/* Every enhancement is gated. Off restores the previous styles verbatim. */
.interaction-polish-controls { margin-bottom: 18px; }
.interaction-polish-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.interaction-polish-heading h2 { margin: 0; font-size: 18px; }
.interaction-polish-heading span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.interaction-polish-controls p { color: var(--muted); line-height: 1.65; font-size: 14px; margin: 12px 0 16px; }
.interaction-polish-controls [data-interaction-polish-toggle] {
  min-height: 46px; width: 100%; border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 16px; color: var(--text); background: var(--surface-muted); font: inherit; cursor: pointer;
}
.interaction-polish-controls small { display: block; color: var(--muted); line-height: 1.6; font-size: 12px; margin-top: 10px; }
.interaction-polish-controls button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

html[data-aevi-interaction-polish="on"] #bottomNav { position: relative; isolation: isolate; }
html[data-aevi-interaction-polish="on"] #bottomNav[data-interaction-nav="ready"]::before {
  content: ""; position: absolute; pointer-events: none; z-index: -1; top: 0; left: 0;
  width: var(--interaction-nav-width); height: var(--interaction-nav-height); border-radius: var(--radius);
  background: var(--surface-muted); transform: translate3d(var(--interaction-nav-x), var(--interaction-nav-y), 0);
  transition: transform 300ms cubic-bezier(.22,.85,.26,1), width 240ms ease, height 240ms ease;
}
html[data-aevi-interaction-polish="on"] #bottomNav[data-interaction-nav-initial]::before { transition: none; }
html[data-aevi-interaction-polish="on"] #bottomNav[data-interaction-nav="ready"] .bottom-nav-item.active { background: transparent; }

html[data-aevi-interaction-polish="on"] :is(.icon-button,.bottom-nav-item,.section-tab,.settings-menu-item,.dark-button,.mini-edit-button,.voice-call-round,.voice-call-mic,#sendButton,[data-interaction-polish-toggle]) {
  transition: scale 160ms cubic-bezier(.2,.8,.25,1.2), background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
html[data-aevi-interaction-polish="on"] :is(.icon-button,.bottom-nav-item,.section-tab,.settings-menu-item,.dark-button,.mini-edit-button,.voice-call-round,.voice-call-mic,#sendButton,[data-interaction-polish-toggle]):active:not(:disabled) { scale: .97; }
html[data-aevi-interaction-polish="on"] .section-tab { min-height: 44px; }

/* Timings stay within the existing dismiss/unmount deadlines. */
html[data-aevi-interaction-polish="on"] .modal-layer > .modal-card {
  animation-name: interaction-card-in;
  animation-timing-function: cubic-bezier(.2,.85,.25,1.04);
}
html[data-aevi-interaction-polish="on"] .modal-layer.motion-closing > .modal-card { animation-timing-function: ease-in; }
html[data-aevi-interaction-polish="on"] .chat-drawer:not(.motion-closing) { animation-timing-function: cubic-bezier(.2,.85,.25,1.02); }
html[data-aevi-interaction-polish="on"] .voice-call-layer:not(.motion-closing) { animation-timing-function: cubic-bezier(.2,.85,.25,1); }
@keyframes interaction-card-in { from { opacity: .3; transform: translateY(8px) scale(.975); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Existing history and streamed re-renders remain still. New tails use WAAPI. */
html[data-aevi-interaction-polish="on"] #messages > .message-row { animation: none; }

html[data-aevi-interaction-polish="on"] .voice-call-stage::before {
  content: ""; pointer-events: none; position: absolute; width: min(76vw, 540px); aspect-ratio: 1;
  border-radius: 50%; background: radial-gradient(ellipse, rgba(132,149,168,.14), rgba(166,156,178,.07) 38%, transparent 68%);
  opacity: .65; animation: interaction-call-breathe 6s ease-in-out infinite;
}
html[data-aevi-interaction-polish="on"] .voice-call-layer[data-mode="subtitle"] .voice-call-stage::before { opacity: .25; }
html[data-aevi-interaction-polish="on"] .voice-call-layer.hidden .voice-call-stage::before,
html[data-aevi-polish-paused] .voice-call-stage::before { animation-play-state: paused; }
@keyframes interaction-call-breathe { 0%,100% { transform: scale(.93); } 50% { transform: scale(1.04); } }

@media (prefers-color-scheme: dark) {
  html[data-aevi-interaction-polish="on"] .voice-call-stage::before { background: radial-gradient(ellipse, rgba(170,190,210,.10), rgba(170,157,189,.05) 38%, transparent 68%); }
}
@media (prefers-reduced-motion: reduce) {
  html[data-aevi-interaction-polish="on"] #bottomNav::before { transition: none; }
  html[data-aevi-interaction-polish="on"] :is(.icon-button,.bottom-nav-item,.section-tab,.settings-menu-item,.dark-button,.mini-edit-button,.voice-call-round,.voice-call-mic,#sendButton,[data-interaction-polish-toggle]) { transition: none; scale: none; }
  html[data-aevi-interaction-polish="on"] .voice-call-stage::before { animation: none; }
  html[data-aevi-interaction-polish="on"] .modal-layer > .modal-card { animation: none; }
}
