/* AEOTEE message surface v1: final layout owner after theme-system.css.
   The gesture controller alone owns transforms; this sheet never changes auth or message content. */
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages{
  --ae-message-gutter:36px;
  --ae-message-edge:color-mix(in srgb,var(--ui-line) 84%,transparent);
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  gap:2px!important;padding-inline:clamp(10px,2.5vw,20px)!important;
  overflow-x:hidden!important;overscroll-behavior-x:none!important;scroll-behavior:auto!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble:not(.media-only){
  position:relative!important;display:flex!important;flex-direction:column!important;
  flex:0 0 auto!important;align-items:stretch!important;
  width:max-content!important;max-width:min(84%,calc(100% - var(--ae-message-gutter) - var(--ae-message-gutter)),530px)!important;
  min-width:0!important;min-height:0!important;
  box-sizing:border-box!important;margin-block:3px!important;
  padding:10px 12px 8px!important;border:1px solid var(--ae-message-edge)!important;
  border-radius:18px 18px 18px 6px!important;
  background:var(--ui-panel)!important;color:var(--ui-text)!important;
  box-shadow:0 2px 10px #00000012!important;
  text-align:start!important;overflow:visible!important;touch-action:pan-y!important;
  -webkit-tap-highlight-color:transparent;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.incoming{
  align-self:flex-start!important;
  margin-inline-start:var(--ae-message-gutter)!important;margin-inline-end:auto!important;
  background:var(--ui-panel)!important;color:var(--ui-text)!important;
  border-radius:18px 18px 18px 6px!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.outgoing{
  align-self:flex-end!important;
  margin-inline-start:auto!important;margin-inline-end:var(--ae-message-gutter)!important;
  background:var(--ui-out)!important;color:var(--ui-out-text)!important;
  border-color:color-mix(in srgb,var(--ui-out) 65%,var(--ui-line) 35%)!important;
  border-radius:18px 18px 6px 18px!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .bubble-body{
  display:block!important;max-width:100%!important;min-width:0!important;
  margin:0!important;padding:0!important;white-space:pre-wrap!important;
  font:500 14px/1.48 Arial,Roboto,"Noto Sans",sans-serif!important;
  letter-spacing:0!important;color:inherit!important;text-align:start!important;
  overflow-wrap:anywhere!important;word-break:normal!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .bubble-meta,
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .bubble-meta span{
  font:500 10.5px/1.25 Arial,Roboto,"Noto Sans",sans-serif!important;
  color:var(--ui-muted)!important;letter-spacing:0!important;
  white-space:nowrap!important;opacity:.95!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .bubble-meta{
  display:flex!important;align-self:flex-end!important;align-items:center!important;
  justify-content:flex-end!important;flex-wrap:nowrap!important;gap:6px!important;
  min-height:13px!important;min-width:0!important;
  margin:5px 0 0!important;padding:0!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .bubble-meta span{
  display:inline!important;margin:0!important;padding:0!important;
  text-align:end!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.outgoing .bubble-meta,
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.outgoing .bubble-meta span{
  color:var(--ui-out-text)!important;opacity:.80!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .message-protection{
  display:block;text-align:start!important;
  color:var(--ui-muted)!important;margin:0 0 4px!important;padding:0!important;
  font:600 10.5px/1.3 Arial,Roboto,"Noto Sans",sans-serif!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble:is([data-content-protection="e2ee"],[data-content-protection="e2ee-v2"]) .message-protection{display:none!important;}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .quoted{
  max-width:100%!important;min-width:0!important;
  margin:0 0 7px!important;padding:6px 9px!important;
  border-inline-start:2px solid var(--ui-accent)!important;
  border-radius:0 8px 8px 0!important;
  background:color-mix(in srgb,var(--ui-raised) 68%,transparent)!important;
  font:500 11.5px/1.4 Arial,Roboto,"Noto Sans",sans-serif!important;
  overflow-wrap:anywhere!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble[data-grouped="true"]{margin-top:1px!important;}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble[data-emoji-only="true"] .bubble-body{
  font-size:30px!important;line-height:1.25!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble :is(img,video,audio){max-width:100%!important;}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.media-only{
  width:max-content!important;max-width:min(85%,520px)!important;
  padding:0!important;border:0!important;background:transparent!important;
  box-shadow:none!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble:is(
 [data-content-protection="unavailable"],[data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],[data-content-protection="history-unavailable"],
 [data-content-protection="unsupported"]){
  max-width:min(86%,calc(100% - var(--ae-message-gutter) - var(--ae-message-gutter)),370px)!important;
  margin-block:3px!important;padding:10px 12px 8px!important;
  border:1px solid var(--ae-message-edge)!important;border-radius:17px!important;
  background:color-mix(in srgb,var(--ui-panel) 94%,var(--ui-raised) 6%)!important;
  color:var(--ui-text)!important;box-shadow:none!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.incoming:is(
 [data-content-protection="unavailable"],[data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],[data-content-protection="history-unavailable"],
 [data-content-protection="unsupported"]){
  margin-inline-start:var(--ae-message-gutter)!important;margin-inline-end:auto!important;
  border-inline-start:2px solid var(--ui-accent)!important;
  border-radius:17px 17px 17px 6px!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.outgoing:is(
 [data-content-protection="unavailable"],[data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],[data-content-protection="history-unavailable"],
 [data-content-protection="unsupported"]){
  margin-inline-start:auto!important;margin-inline-end:var(--ae-message-gutter)!important;
  border-inline-end:2px solid var(--ui-accent)!important;
  border-radius:17px 17px 6px 17px!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble:is(
 [data-content-protection="unavailable"],[data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],[data-content-protection="history-unavailable"],
 [data-content-protection="unsupported"]) .bubble-body{
  color:var(--ui-text)!important;
  font:500 13px/1.46 Arial,Roboto,"Noto Sans",sans-serif!important;
  white-space:normal!important;overflow-wrap:anywhere!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble:is(
 [data-content-protection="unavailable"],[data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],[data-content-protection="history-unavailable"],
 [data-content-protection="unsupported"]) .bubble-body::before{content:none!important;display:none!important;}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble:is(
 [data-content-protection="unavailable"],[data-content-protection="recovery-required"],
 [data-content-protection="identity-mismatch"],[data-content-protection="history-unavailable"],
 [data-content-protection="unsupported"]) :is(.bubble-meta,.bubble-meta span){
  color:var(--ui-muted)!important;opacity:1!important;
  font:500 10px/1.3 Arial,Roboto,"Noto Sans",sans-serif!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .message-decrypt-retry{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  align-self:flex-start!important;width:auto!important;max-width:100%!important;
  min-height:40px!important;margin:7px 0 0!important;padding:7px 12px!important;
  background:var(--ui-raised)!important;color:var(--ui-text)!important;
  border:1px solid var(--ui-line)!important;border-radius:11px!important;
  box-shadow:none!important;cursor:pointer!important;
  font:600 12px/1.2 Arial,Roboto,"Noto Sans",sans-serif!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .message-decrypt-retry:focus-visible{
  outline:2px solid var(--ui-accent)!important;outline-offset:2px!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .attachment-preview.aeotee-media-suppressed{display:none!important;}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.swiping{
  box-shadow:none!important;transition:none!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.swiping.swipe-ready{
  border-color:var(--ui-accent)!important;outline:none!important;filter:none!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.swiping.swipe-ready[data-swipe-direction="right"]{
  box-shadow:inset 2px 0 0 var(--ui-accent)!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.swiping.swipe-ready[data-swipe-direction="left"]{
  box-shadow:inset -2px 0 0 var(--ui-accent)!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble:has(:focus-visible){
  outline:2px solid var(--ui-accent)!important;outline-offset:2px!important;
}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble.swiping:has(:focus-visible){outline:none!important;}
html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.day,html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.date-divider{
  margin:9px auto 12px!important;padding:5px 11px!important;
  background:var(--ui-raised)!important;border:1px solid var(--ui-line)!important;
  border-radius:999px!important;color:var(--ui-muted)!important;
  font:600 10px/1.3 Arial,Roboto,"Noto Sans",sans-serif!important;
  box-shadow:none!important;
}
@media(max-width:760px){
 html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages{--ae-message-gutter:34px;padding-inline:10px!important;}
 html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble:not(.media-only){max-width:min(86%,calc(100% - var(--ae-message-gutter) - var(--ae-message-gutter)),460px)!important;}
}
@media(max-width:380px){
 html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages{--ae-message-gutter:30px;padding-inline:8px!important;}
 html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble:not(.media-only){padding:9px 11px 7px!important;}
 html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble .bubble-body{font-size:13.5px!important;}
}
@media(prefers-reduced-motion:reduce){
 html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble{transition:none!important;animation:none!important;}
}
@media(forced-colors:active){
 html[data-aeotee-theme] body :is(.app.premium-ready,.app.premium-ready.aeotee-neon-chat.aeotee-view-thread) #messages>.bubble{border:1px solid CanvasText!important;box-shadow:none!important;}
}

/* Gesture menus live in the viewport, beside messages when space allows. */
html[data-aeotee-theme] body .connect-gesture-menu{
  background:var(--ui-panel)!important;color:var(--ui-text)!important;
  border:1px solid var(--ui-line)!important;
  border-radius:14px!important;box-shadow:0 12px 32px #00000030!important;
  overscroll-behavior:contain;
}
html[data-aeotee-theme] body .connect-gesture-menu button{
  color:var(--ui-text)!important;
  font-family:Arial,Roboto,"Noto Sans",sans-serif!important;
}
html[data-aeotee-theme] body .connect-gesture-menu button:focus-visible{
  outline:2px solid var(--ui-accent)!important;outline-offset:-2px!important;
}
html[data-aeotee-theme] body .connect-gesture-menu button.danger{
  color:var(--ui-danger)!important;
}
html[data-aeotee-theme] body .connect-gesture-menu button:hover:not(:disabled){
  background:var(--ui-raised)!important;
}

/* Ephemeral local-only feedback for failed gesture actions; never implies a failed write succeeded. */
html[data-aeotee-theme] body .aeotee-gesture-notice{
 position:fixed;z-index:100001;inset-inline:clamp(12px,4vw,32px);
 bottom:calc(84px + env(safe-area-inset-bottom));
 width:max-content;max-width:calc(100vw - 24px);margin-inline:auto;
 padding:10px 14px;border-radius:12px;border:1px solid var(--ui-line);
 background:var(--ui-panel);color:var(--ui-text);
 box-shadow:0 10px 28px #00000036;
 font:600 12px/1.4 Arial,Roboto,"Noto Sans",sans-serif;
 pointer-events:none;overflow-wrap:anywhere;
}

/* Motion 2.0+ | Composer context morphs without resizing the keyboard or chat.
   The finalized theme's palette stays authoritative; no text or media animation. */
html[data-aeotee-theme] body .app.premium-ready .chat .composer .aeotee-compose-field{
 transition:border-radius 240ms cubic-bezier(.18,.82,.24,1),
            border-color 190ms ease,box-shadow 220ms cubic-bezier(.18,.82,.24,1)!important;
}
html[data-aeotee-theme] body .app.premium-ready .chat .composer:focus-within .aeotee-compose-field{
 border-radius:18px!important;border-color:var(--ui-accent)!important;
 box-shadow:0 0 0 1px var(--ui-accent),inset 0 1px 0 #ffffff12!important;
}
html[data-aeotee-theme] body .app.premium-ready .chat .composer:has(#attachBtn[aria-expanded="true"]) .aeotee-compose-field{
 border-radius:16px!important;border-color:var(--ui-accent)!important;
}
html[data-aeotee-theme] body .app.premium-ready .chat .composer #sendBtn.send:not(:disabled){
 transition-property:transform,opacity,background-color,border-color,border-radius!important;
 transition-duration:140ms,150ms,190ms,190ms,230ms!important;
 transition-timing-function:cubic-bezier(.18,.82,.24,1)!important;
}
html[data-aeotee-theme] body .app.premium-ready .chat .composer:focus-within #sendBtn.send:not(:disabled){
 border-radius:41%!important;
}
@media(prefers-reduced-motion:reduce){
 html[data-aeotee-theme] body .app.premium-ready .chat .composer .aeotee-compose-field,
 html[data-aeotee-theme] body .app.premium-ready .chat .composer #sendBtn.send{transition:none!important;}
}
html.premium-motion-off[data-aeotee-theme] body .app.premium-ready .chat .composer .aeotee-compose-field,
html.premium-motion-off[data-aeotee-theme] body .app.premium-ready .chat .composer #sendBtn.send{transition:none!important}
html.premium-motion-lite[data-aeotee-theme] body .app.premium-ready .chat .composer .aeotee-compose-field{transition-duration:110ms,110ms,110ms!important;}

/* AEOTEE Motion DNA | voice-capture context, presentation only.
   The recorder owns its Web Audio lifecycle; these effects never start,
   restart, pause or consume a recording. No composer geometry is changed. */
html[data-aeotee-theme]{
 --ae-motion-dna-curve:cubic-bezier(.18,.84,.24,1);
 --ae-motion-dna-short:170ms;
}
html[data-aeotee-theme] body .app.premium-ready .chat .composer:has(> #aeoteeVoiceWaveform) .aeotee-compose-field{
 border-radius:15px!important;border-color:var(--ui-accent)!important;
 box-shadow:0 0 0 1px var(--ui-accent),inset 0 1px 0 #ffffff12!important;
}
html[data-aeotee-theme] body .app.premium-ready .chat .composer:has(> #aeoteeVoiceWaveform) #micBtn:not(:disabled){
 transform:scale(1.045)!important;color:var(--ui-accent-ink)!important;
 border-color:var(--ui-accent)!important;
 transition:transform var(--ae-motion-dna-short) var(--ae-motion-dna-curve),
            border-color var(--ae-motion-dna-short) ease!important;
}
html[data-aeotee-theme] body .app.premium-ready .chat .composer>#aeoteeVoiceWaveform{
 flex:0 0 auto;
 animation:aeotee-voice-context-appear 185ms var(--ae-motion-dna-curve) both;
}
@keyframes aeotee-voice-context-appear{
 from{opacity:.15;scale:.94}
 to{opacity:1;scale:1}
}
html.premium-motion-lite[data-aeotee-theme] body .app.premium-ready .chat .composer>#aeoteeVoiceWaveform{
 animation-duration:110ms!important;
}
@media(prefers-reduced-motion:reduce){
 html[data-aeotee-theme] body .app.premium-ready .chat .composer>#aeoteeVoiceWaveform{
  animation:none!important;
 }
 html[data-aeotee-theme] body .app.premium-ready .chat .composer:has(> #aeoteeVoiceWaveform) #micBtn{
  transition:none!important;transform:none!important;
 }
}
html.premium-motion-off[data-aeotee-theme] body .app.premium-ready .chat .composer>#aeoteeVoiceWaveform{
 animation:none!important;
}
html.premium-motion-off[data-aeotee-theme] body .app.premium-ready .chat .composer:has(> #aeoteeVoiceWaveform) #micBtn{
 transition:none!important;transform:none!important;
}
