/* ==========================================================================
   Amari · asistente virtual del Plan Comunal de Emergencia en Panel DGRD
   Estilos acotados al widget (#amari-root) y al reproductor de voz (.tts-*).
   Los colores se toman de las variables --sig-* de la plataforma.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  --surface: var(--sig-surface, #fff);
  --surface-2: var(--sig-surface-alt, #f7f9fc);
  --bg: var(--sig-background, #f4f6fa);
  --bg-2: var(--sig-surface-alt, #eaeef5);
  --line: var(--sig-border, #dde3ec);
  --line-2: var(--sig-border, #c9d2df);
  --ink: var(--sig-text, #0f1c2e);
  --ink-2: var(--sig-text, #3c4a5e);
  --ink-3: var(--sig-text-muted, #66748a);
  --accent: var(--sig-action, #1f8fd0);
  --accent-ink: var(--sig-action, #0f6aa6);
  --accent-soft: var(--sig-action-soft, #e3f2fb);
  --sky: #1f8fd0; --sky-2: #3bb4e5; --navy: #0b2545; --amber: #e9a100; --red: #d62f2f; --green: #1f9d6b;
  --radius: 16px;
  --shadow-1: 0 1px 2px rgba(15, 28, 46, .06), 0 2px 8px rgba(15, 28, 46, .05);
  --shadow-2: 0 10px 30px -10px rgba(15, 28, 46, .25);
  --shadow-3: 0 30px 60px -20px rgba(11, 37, 69, .35);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}

#amari-root svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#amari-root .amari-face, .tts-bar .mi-av svg, .tts-consent-ic svg { stroke: none; }
#amari-root button { font: inherit; color: inherit; }
#amari-root [hidden] { display: none !important; }

/* Botón flotante */
#amari-root .amari-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 1050; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 10px; border: 0; border-radius: 999px; cursor: pointer; color: #fff; font-weight: 700; font-size: 14.5px;
  background: linear-gradient(135deg, #0b2545, #1f8fd0); box-shadow: 0 16px 30px -10px rgba(11, 37, 69, .7);
  transition: transform .35s var(--ease-spring), opacity .3s; animation: amariFabIn .8s var(--ease-spring) .6s both;
}
#amari-root .amari-fab:hover { transform: translateY(-3px) scale(1.03); }
#amari-root .amari-fab .fab-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
#amari-root .amari-fab .fab-av svg { width: 30px; height: 30px; }
#amari-root.open .amari-fab { opacity: 0; pointer-events: none; transform: scale(.8); }
@keyframes amariFabIn { from { opacity: 0; transform: translateY(30px) scale(.8); } }

/* Panel lateral */
#amari-root .amari-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1060; width: min(460px, 100vw); display: flex; flex-direction: column;
  background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow-3);
  transform: translateX(105%); transition: transform .45s var(--ease); font-family: "Inter", system-ui, sans-serif; font-size: 15px; line-height: 1.55; color: var(--ink);
}
#amari-root.open .amari-panel { transform: none; }
#amari-root .amari-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; background: linear-gradient(135deg, #0b2545, #13315c); color: #fff; }
#amari-root .amari-head .bot-avatar { width: 44px; height: 44px; border-radius: 14px; }
#amari-root .amari-head b { font-family: var(--font-head); font-size: 17px; display: block; }
#amari-root .amari-head small { color: #cfdcee; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
#amari-root .amari-head .sp { flex: 1; }
#amari-root .amari-head .icon-btn { color: #fff; background: rgba(255,255,255,.08); }
#amari-root .amari-head .icon-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
#amari-root .amari-tools { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); align-items: center; flex-wrap: wrap; }
#amari-root .amari-tools select { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--surface-2); color: var(--ink); font-size: 13px; }
#amari-root .amari-tools a { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
#amari-root .amari-panel .chat-log { flex: 1; overflow: auto; padding: 18px 14px 10px; scroll-behavior: smooth; }
#amari-root .amari-panel .chat-input { padding: 10px 14px 14px; border-top: 1px solid var(--line); background: var(--surface); }
#amari-root .amari-panel .msg { max-width: none; }
#amari-root .amari-panel .welcome { margin-top: 8px; }
#amari-root .amari-panel .welcome h2 { font-size: 21px; }
#amari-root .amari-panel .welcome-grid { grid-template-columns: 1fr; }
#amari-root .amari-panel .chips-inline { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
#amari-root .amari-panel .chips-inline .chip { white-space: nowrap; }
#amari-root .amari-panel .chat-foot span.note { display: none; }
#amari-root .amari-scrim { position: fixed; inset: 0; z-index: 1055; background: rgba(8, 19, 34, .35); opacity: 0; pointer-events: none; transition: opacity .3s; }
#amari-root.open .amari-scrim { opacity: 1; pointer-events: auto; }
#amari-root .amari-panel h2, #amari-root .amari-panel h4 { font-family: var(--font-head); margin: 0 0 .4em; line-height: 1.2; }
#amari-root .amari-hidden { display: none; }
body.amari-open .tts-bar { left: auto; right: 16px; transform: none; bottom: 150px; z-index: 1070; }
.tts-bar, .tts-consent { font-family: "Inter", system-ui, sans-serif; }
.tts-consent { z-index: 1100 !important; }
.tts-bar { z-index: 1070 !important; }
.tts-on { background: color-mix(in srgb, #ffd23f 26%, transparent) !important; box-shadow: 0 0 0 4px color-mix(in srgb, #ffd23f 26%, transparent); border-radius: 8px; }
.tts-bar svg, .tts-consent svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) {
  #amari-root .amari-fab { right: 14px; bottom: 14px; padding: 8px; }
  #amari-root .amari-fab span.lbl { display: none; }
  body.amari-open .tts-bar { right: 8px; left: 8px; bottom: 140px; }
}
@media (prefers-reduced-motion: reduce) { #amari-root *, .tts-bar { animation: none !important; transition: none !important; } }

/* ---- Reglas del sitio del Plan (chat, Amari, voz), acotadas al widget ---- */
#amari-root .icon-btn {display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2);
  transition: background .2s, color .2s, transform .2s var(--ease);}
#amari-root .icon-btn:hover {background: var(--surface-2); color: var(--ink);}
#amari-root .icon-btn:active {transform: scale(.92);}
#amari-root .link-btn {background: none; border: 0; color: var(--accent-ink); cursor: pointer; font-weight: 600; padding: 4px;}
#amari-root .chips {display: flex; flex-wrap: wrap; gap: 8px;}
#amari-root .chip {border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px;
  padding: 6px 13px; font-size: 13.5px; cursor: pointer; transition: all .2s var(--ease);}
#amari-root .chip:hover {border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px);}
#amari-root .hero .chip {background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #e6eef9;}
#amari-root .hero .chip:hover {background: rgba(255, 255, 255, .2); color: #fff;}
#amari-root .threat:hover .t-ic {transform: rotate(-8deg) scale(1.08);}
#amari-root .t-ic {width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); transition: transform .4s var(--ease-spring);}
#amari-root .t-ic svg {width: 24px; height: 24px;}
#amari-root .amari, #amari-root .fab-av, #amari-root .mini-av {background: radial-gradient(circle at 30% 25%, #fff3b0 0%, #ffd23f 45%, #f2a900 100%) !important; box-shadow: 0 8px 20px -8px rgba(242, 169, 0, .7);}
#amari-root .amari-face {width: 78%; height: 78%; stroke: none;}
#amari-root .bot-avatar.amari .amari-face {width: 82%; height: 82%;}
#amari-root .msg .av.amari .amari-face {width: 30px; height: 30px;}
#amari-root .amari-name {background: linear-gradient(90deg, #f2a900, #e08a00); -webkit-background-clip: text; background-clip: text; color: transparent;}
#amari-root .wave {animation: wave 2.4s var(--ease) .4s both;}
#amari-root mark {background: #ffe38a; color: #1b1b1b; border-radius: 3px; padding: 0 2px;}
#amari-root mark.cur {background: #ffb020;}
#amari-root .tbl-wrap {overflow-x: auto; margin: 14px auto; border: 1px solid var(--line); border-radius: 12px;}
#amari-root table.tbl {border-collapse: collapse; width: 100%; font-size: 13.5px;}
#amari-root .tbl th, #amari-root .tbl td {padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top;}
#amari-root .tbl th {background: var(--surface-2); font-weight: 700; color: var(--ink); position: sticky; top: 0;}
#amari-root .tbl tr:last-child td {border-bottom: 0;}
#amari-root .tbl td {color: var(--ink-2);}
#amari-root .tbl tr:hover td {background: var(--surface-2);}
#amari-root .lightbox .icon-btn {position: absolute; top: 14px; right: 14px; color: #fff; background: rgba(255, 255, 255, .12);}
#amari-root .deck-bar .icon-btn {color: #cfe0f3; background: rgba(255, 255, 255, .06);}
#amari-root .deck-bar .icon-btn:hover {background: rgba(255, 255, 255, .14); color: #fff;}
#amari-root .bot-avatar {width: 48px; height: 48px; border-radius: 16px; background: linear-gradient(135deg, #0b2545, #1f8fd0); display: grid; place-items: center; flex: none; box-shadow: var(--shadow-2);}
#amari-root .bot-avatar img {width: 30px; height: auto; filter: brightness(1.1);}
#amari-root .dot-ok {width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);}
#amari-root .msg {display: flex; gap: 12px; max-width: 860px; margin: 0 auto 18px; animation: msgIn .45s var(--ease) both;}
#amari-root .msg .av {width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, #0b2545, #1f8fd0);}
#amari-root .msg .av img {width: 20px;}
#amari-root .msg .bubble {background: var(--surface); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; padding: 14px 16px; box-shadow: var(--shadow-1); min-width: 0; flex: 1;}
#amari-root .msg.user {flex-direction: row-reverse;}
#amari-root .msg.user .av {background: var(--amber); color: #3a2a00; font-weight: 800; font-size: 13px;}
#amari-root .msg.user .bubble {flex: 0 1 auto; background: linear-gradient(135deg, var(--sky), #1670b8); color: #fff; border: 0; border-radius: 18px 4px 18px 18px;}
#amari-root .bubble p {margin: .35em 0;}
#amari-root .bubble ul, #amari-root .bubble ol {margin: .4em 0; padding-left: 20px;}
#amari-root .bubble li {margin: 3px 0;}
#amari-root .bubble h4 {margin: .2em 0 .4em; font-family: var(--font-head); font-size: 15.5px;}
#amari-root .bubble .answer-from {font-size: 12px; font-weight: 700; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; display: flex; align-items: center; gap: 6px;}
#amari-root .bubble .tbl-wrap {margin: 10px 0;}
#amari-root .bubble .tbl {font-size: 13px;}
#amari-root .sources {display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);}
#amari-root .sources > span {font-size: 12px; color: var(--ink-3); width: 100%;}
#amari-root .src-btn {display: inline-flex; align-items: center; gap: 6px; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); text-decoration: none; transition: all .2s var(--ease);}
#amari-root .src-btn:hover {border-color: var(--accent); color: var(--accent-ink);}
#amari-root .src-btn svg {width: 14px; height: 14px;}
#amari-root .src-btn i {width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--sky));}
#amari-root .follow {display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;}
#amari-root .typing {display: inline-flex; gap: 4px; padding: 6px 2px;}
#amari-root .typing i {width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite both;}
#amari-root .typing i:nth-child(2) {animation-delay: .15s;}
#amari-root .typing i:nth-child(3) {animation-delay: .3s;}
#amari-root .caret::after {content: "▍"; color: var(--accent); animation: caret 1s steps(1) infinite; margin-left: 1px;}
#amari-root .chat-input {padding: 10px clamp(14px, 4vw, 48px) 16px; border-top: 1px solid var(--line); background: var(--surface);}
#amari-root .chat-input > * {max-width: 860px; margin-left: auto; margin-right: auto;}
#amari-root .chips-inline {margin-bottom: 10px;}
#amari-root .chat-box {display: flex; align-items: flex-end; gap: 6px; border: 1.5px solid var(--line); border-radius: 18px; padding: 6px 6px 6px 16px; background: var(--surface-2); transition: border-color .2s, box-shadow .2s;}
#amari-root .chat-box:focus-within {border-color: var(--sky); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 18%, transparent);}
#amari-root .chat-box textarea {flex: 1; resize: none; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15.5px; color: var(--ink); padding: 8px 0; max-height: 140px;}
#amari-root .send {width: 42px; height: 42px; border-radius: 13px; border: 0; background: linear-gradient(135deg, var(--sky), #1670b8); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .2s var(--ease-spring);}
#amari-root .send:hover {transform: scale(1.06) rotate(-6deg);}
#amari-root .send svg {width: 18px; height: 18px;}
#amari-root #chat-mic.rec {color: #fff; background: var(--red); animation: pulse 1.5s infinite;}
#amari-root .chat-foot {display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-3); margin-top: 6px; flex-wrap: wrap;}
#amari-root .welcome {text-align: center; max-width: 640px; margin: 4vh auto 20px; animation: msgIn .6s var(--ease) both;}
#amari-root .welcome .bot-avatar {width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 14px;}
#amari-root .welcome .bot-avatar img {width: 44px;}
#amari-root .welcome h2 {font-size: 26px;}
#amari-root .welcome p {color: var(--ink-2);}
#amari-root .welcome-grid {display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; text-align: left;}
#amari-root .welcome-grid button {text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; cursor: pointer; font-size: 14px; color: var(--ink); transition: all .25s var(--ease); display: flex; gap: 10px; align-items: flex-start;}
#amari-root .welcome-grid button:hover {border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-2);}
#amari-root .welcome-grid small {display: block; color: var(--ink-3); font-size: 12.5px;}
#amari-root .welcome-grid .t-ic {width: 34px; height: 34px; border-radius: 10px; flex: none;}
#amari-root .welcome-grid .t-ic svg {width: 18px; height: 18px;}
#amari-root .tour-step .t-ic {width: 56px; height: 56px; border-radius: 18px; margin-bottom: 14px;}
#amari-root .tour-step .t-ic svg {width: 28px; height: 28px;}
@media (max-width: 860px) {
  #amari-root .welcome-grid {grid-template-columns: 1fr;}
}
@media (max-width: 640px) {
  #amari-root .chips-inline {flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;}
  #amari-root .chips-inline .chip {white-space: nowrap;}
  #amari-root .chat-foot > span {display: none;}
}
#amari-root .amari-tag {margin: 14px auto 0; max-width: 520px; font-style: italic; color: var(--ink-2); padding: 10px 16px; border-left: 4px solid #f2b31a; background: color-mix(in srgb, #ffd23f 12%, transparent); border-radius: 0 12px 12px 0; text-align: left;}
#amari-root .amari-traits {display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px;}
#amari-root .amari-traits span {font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: color-mix(in srgb, #ffd23f 16%, var(--surface)); border: 1px solid color-mix(in srgb, #f2b31a 40%, transparent); color: var(--ink);}
#amari-root .amari-face .ray {stroke: #f2a900; stroke-width: 2.4; stroke-linecap: round;}
#amari-root .dot-ok {background: #f2b31a; box-shadow: 0 0 0 3px rgba(242, 179, 26, .25);}
.tts-on {background: color-mix(in srgb, #ffd23f 26%, transparent) !important; box-shadow: 0 0 0 4px color-mix(in srgb, #ffd23f 26%, transparent); border-radius: 8px; transition: background .3s, box-shadow .3s;}
tr.tts-on td {background: color-mix(in srgb, #ffd23f 22%, transparent);}
.step.tts-on {border-color: #f2b31a !important; transform: translateX(4px);}
.slide .tts-on {box-shadow: 0 0 0 3px #ffd23f; background: rgba(255, 210, 63, .12) !important;}
.tts-bar {position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 97; display: flex; align-items: center; gap: 6px;
  padding: 8px 10px 8px 14px; border-radius: 999px; background: #0b2545; color: #fff; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6);
  border: 1px solid rgba(255, 210, 63, .35); animation: ttsIn .45s var(--ease-spring) both; max-width: calc(100vw - 24px);}
.tts-eq {display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; width: 22px;}
.tts-eq i {width: 3px; background: #ffd23f; border-radius: 2px; animation: eq 1s ease-in-out infinite;}
.tts-eq i:nth-child(2) {animation-delay: .2s;}
.tts-eq i:nth-child(3) {animation-delay: .4s;}
.tts-eq i:nth-child(4) {animation-delay: .1s;}
.tts-bar.paused .tts-eq i {animation-play-state: paused;}
.tts-info {display: flex; flex-direction: column; line-height: 1.15; min-width: 0; margin-right: 4px;}
.tts-info small {font-size: 10.5px; color: #ffd23f; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;}
.tts-info b {font-size: 13px; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.tts-prog {font-size: 12px; color: #9fb3cd; font-variant-numeric: tabular-nums; margin: 0 4px;}
.tts-btn {width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .2s, transform .2s var(--ease-spring); font-weight: 700; font-size: 12px;}
.tts-btn:hover {background: rgba(255, 255, 255, .18); transform: scale(1.06);}
.tts-btn svg {width: 17px; height: 17px;}
.tts-main {background: #ffd23f; color: #0b2545; width: 40px; height: 40px;}
.tts-main:hover {background: #ffe27a;}
.tts-main .i-play {display: none;}
.tts-bar.paused .tts-main .i-play {display: block;}
.tts-bar.paused .tts-main .i-pause {display: none;}
.tts-main svg {stroke-width: 2.6;}
.tts-rate {width: auto; padding: 0 10px; border-radius: 999px;}
body.tts-playing .fab {opacity: 0; pointer-events: none;}
#amari-root .listen-btn {display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; border: 1px solid color-mix(in srgb, #f2b31a 45%, var(--line)); background: color-mix(in srgb, #ffd23f 14%, var(--surface)); color: var(--ink); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s var(--ease);}
#amari-root .listen-btn svg {width: 16px; height: 16px;}
#amari-root .listen-btn:hover {background: #ffd23f; color: #0b2545;}
.tts-trigger.speaking, #amari-root .listen-btn.speaking {background: #ffd23f !important; color: #0b2545 !important; border-color: #f2b31a !important; animation: speakPulse 1.6s infinite;}
#amari-root .listen-btn.speaking span::after {content: " · detener";}
#amari-root .switch {display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); user-select: none;}
#amari-root .switch input {position: absolute; opacity: 0; pointer-events: none;}
#amari-root .switch svg {width: 15px; height: 15px;}
#amari-root .sw-track {width: 34px; height: 20px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .25s; flex: none;}
#amari-root .sw-knob {position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .3s var(--ease-spring);}
#amari-root .switch input:checked + .sw-track {background: #f2b31a;}
#amari-root .switch input:checked + .sw-track .sw-knob {transform: translateX(14px);}
#amari-root .switch input:focus-visible + .sw-track {outline: 3px solid var(--sky-2); outline-offset: 2px;}
@media (max-width: 640px) {
  .tts-bar {bottom: 86px; gap: 4px; padding: 6px 8px 6px 12px;}
  .tts-info b {max-width: 90px;}
  .tts-prog, .tts-btn[data-a="prev"] {display: none;}
  #amari-root .chat-foot span.sw-track + svg {display: none;}
}
.tts-status {font-style: normal; font-size: 11.5px; color: #ffd23f; white-space: nowrap;}
.tts-bar.loading .tts-eq i {animation-duration: .5s; opacity: .6;}
.tts-bar.loading .tts-title {display: none;}
.tts-menu {position: absolute; right: 0; bottom: calc(100% + 10px); width: min(340px, calc(100vw - 24px)); max-height: 60vh; overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-3); padding: 8px; animation: popIn .3s var(--ease) both;}
.tts-menu-h {margin: 6px 8px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);}
.tts-menu button {width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 1px solid transparent; border-radius: 12px; padding: 8px 10px; cursor: pointer; color: var(--ink); font-size: 13.5px;}
.tts-menu button:hover {background: var(--surface-2);}
.tts-menu button.on {background: color-mix(in srgb, #ffd23f 18%, var(--surface)); border-color: #f2b31a;}
.tts-menu button b {display: block; font-weight: 600;}
.tts-menu button small {display: block; color: var(--ink-3); font-size: 12px; line-height: 1.35;}
#amari-root .mi-av {width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #fff3b0, #ffd23f 45%, #f2a900);}
#amari-root .mi-av svg {width: 28px; height: 28px; stroke: none;}
#amari-root .mi-flag {width: 32px; text-align: center; font-size: 20px; flex: none;}
.tts-consent {position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(8, 19, 34, .6); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fadeIn .25s both;}
.tts-consent-card {width: min(440px, 100%); background: var(--surface); border-radius: 22px; padding: 26px 24px 20px; text-align: center; box-shadow: var(--shadow-3); border-top: 5px solid #f2b31a; animation: tmIn .5s var(--ease-spring) both;}
.tts-consent-ic {width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: radial-gradient(circle at 30% 25%, #fff3b0, #ffd23f 45%, #f2a900); box-shadow: 0 10px 24px -10px rgba(242, 169, 0, .8);}
.tts-consent-ic svg {width: 54px; height: 54px; stroke: none;}
.tts-consent-card h3 {font-size: 20px;}
.tts-consent-card p {color: var(--ink-2); font-size: 14.5px; margin: 6px 0;}
.tts-consent-card p.small {font-size: 13px; color: var(--ink-3);}
.tts-consent-acts {display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px;}
@media (max-width: 640px) {
  .tts-btn[data-a="voice"] {display: grid;}
}
#amari-root .mi-av:not(:has(svg)) {background: color-mix(in srgb, #ffd23f 25%, var(--surface)); font-size: 20px;}
.tts-menu-note {margin: 8px 8px 4px; font-size: 12px; color: var(--ink-3); line-height: 1.4; border-top: 1px dashed var(--line); padding-top: 8px;}
@keyframes pulse{ 70% { box-shadow: 0 0 0 9px rgba(255, 90, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0); } }
@keyframes tmIn{ from { opacity: 0; transform: translateY(30px) scale(.94); } }
@keyframes wave{ 0% { transform: scale(.5) rotate(-20deg); opacity: 0; } 30% { transform: scale(1.08) rotate(8deg); opacity: 1; } 45% { transform: rotate(-6deg); } 60% { transform: rotate(5deg); } 75% { transform: rotate(-3deg); } 100% { transform: none; } }
@keyframes fadeIn{ from { opacity: 0; } }
@keyframes popIn{ from { opacity: 0; transform: translateY(24px) scale(.985); } }
@keyframes msgIn{ from { opacity: 0; transform: translateY(10px); } }
@keyframes blink{ 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes caret{ 50% { opacity: 0; } }
@keyframes ttsIn{ from { opacity: 0; transform: translate(-50%, 30px) scale(.9); } }
@keyframes eq{ 0%, 100% { height: 4px; } 50% { height: 18px; } }
@keyframes speakPulse{ 0% { box-shadow: 0 0 0 0 rgba(255, 210, 63, .6); } 70% { box-shadow: 0 0 0 10px rgba(255, 210, 63, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 210, 63, 0); } }