/* =========================================================
   Plan Comunal de Emergencia · San Javier de Loncomilla
   ========================================================= */
:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --sky: #1f8fd0;
  --sky-2: #3bb4e5;
  --amber: #e9a100;
  --red: #d62f2f;
  --green: #1f9d6b;
  --violet: #6b4fd8;

  --bg: #f4f6fa;
  --bg-2: #eaeef5;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #dde3ec;
  --line-2: #c9d2df;
  --ink: #0f1c2e;
  --ink-2: #3c4a5e;
  --ink-3: #66748a;
  --brand: #0b2545;
  --accent: #1f8fd0;
  --accent-ink: #0f6aa6;
  --accent-soft: #e3f2fb;
  --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);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --top-h: 64px;
  --sos-h: 38px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Plus Jakarta Sans", var(--font);

  --lv-verde: #1f9d6b;
  --lv-amarilla: #d99a00;
  --lv-roja: #d62f2f;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #081322;
    --bg-2: #0c1b2f;
    --surface: #0f2038;
    --surface-2: #132843;
    --line: #1f3656;
    --line-2: #2a4568;
    --ink: #e8eef7;
    --ink-2: #b6c3d6;
    --ink-3: #8595ac;
    --brand: #e8eef7;
    --accent: #3bb4e5;
    --accent-ink: #7fd0f2;
    --accent-soft: #11344f;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 10px 30px -10px rgba(0, 0, 0, .6);
    --shadow-3: 0 30px 60px -20px rgba(0, 0, 0, .7);
    --lv-amarilla: #f2b31a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #081322;
  --bg-2: #0c1b2f;
  --surface: #0f2038;
  --surface-2: #132843;
  --line: #1f3656;
  --line-2: #2a4568;
  --ink: #e8eef7;
  --ink-2: #b6c3d6;
  --ink-3: #8595ac;
  --brand: #e8eef7;
  --accent: #3bb4e5;
  --accent-ink: #7fd0f2;
  --accent-soft: #11344f;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 10px 30px -10px rgba(0, 0, 0, .6);
  --shadow-3: 0 30px 60px -20px rgba(0, 0, 0, .7);
  --lv-amarilla: #f2b31a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 15.5px/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-ink); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .4em; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sky-2); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 10px 18px;
  font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--sky), #1670b8); color: #fff; box-shadow: 0 6px 18px -6px rgba(31, 143, 208, .6); }
.btn-primary:hover { box-shadow: 0 10px 24px -8px rgba(31, 143, 208, .8); transform: translateY(-1px); }
.btn-soft { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-soft:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-lg { padding: 13px 22px; font-size: 15.5px; }
.btn svg { width: 18px; height: 18px; }
.w100 { width: 100%; }
.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);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.link-btn { background: none; border: 0; color: var(--accent-ink); cursor: pointer; font-weight: 600; padding: 4px; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 30px; height: auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .15)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-family: var(--font-head); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.tabs { position: relative; display: flex; gap: 2px; margin: 0 auto; padding: 4px; background: var(--bg-2); border-radius: 14px; }
.tabs a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px; text-decoration: none; color: var(--ink-2);
  font-weight: 600; font-size: 14px; transition: color .25s;
}
.tabs a svg { width: 18px; height: 18px; }
.tabs a.active { color: var(--ink); }
.tabs a:hover { color: var(--ink); }
.tab-ink {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0;
  background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-1);
  transition: transform .45s var(--ease-spring), width .45s var(--ease-spring);
}
.top-actions { display: flex; gap: 4px; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

/* ---------- Franja emergencia ---------- */
.sos-strip {
  display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; justify-content: center;
  padding: 7px 16px; font-size: 13px; background: var(--navy); color: #dbe6f5;
}
.sos-strip a { color: #fff; text-decoration: none; white-space: nowrap; opacity: .92; }
.sos-strip a:hover { opacity: 1; text-decoration: underline; }
.sos-strip b { color: #ffd166; margin-right: 3px; }
.sos-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 0 rgba(255, 90, 90, .7); animation: pulse 1.8s infinite; }
@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); } }

/* ---------- Vistas y transiciones ---------- */
main { min-height: calc(100vh - var(--top-h) - var(--sos-h)); }
.view { animation: viewIn .55s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
::view-transition-old(root) { animation: vtOut .25s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .45s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(12px); } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 20px 70px; }
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 10px; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 64ch; }
.sec-title { font-size: 26px; margin-top: 48px; }
.sec-sub { color: var(--ink-3); margin: -4px 0 18px; }
.fineprint { color: var(--ink-3); font-size: 13px; margin-top: 18px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, #0b2545 0%, #13315c 55%, #134a7a 100%); color: #fff; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 16s ease-in-out infinite alternate; }
.b1 { width: 420px; height: 420px; background: #1f8fd0; top: -120px; right: -60px; }
.b2 { width: 300px; height: 300px; background: #e9a100; bottom: -140px; left: 30%; opacity: .28; animation-delay: -5s; }
.b3 { width: 260px; height: 260px; background: #d62f2f; top: 40%; left: -80px; opacity: .22; animation-delay: -9s; }
@keyframes float { to { transform: translate(40px, 30px) scale(1.12); } }
.topo { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(255, 255, 255, .07); }
.hero-inner { position: relative; max-width: 1180px; margin: 0 auto; padding: 56px 20px 64px; display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center; }
.hero .eyebrow { color: #9fd8f5; }
.hero h1 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 800; }
.grad { background: linear-gradient(90deg, #7fd0f2, #ffd166 60%, #ff8a73); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: #cfdcee; }
.hero-ask {
  display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; padding: 6px 6px 6px 16px;
  background: rgba(255, 255, 255, .97); border-radius: 999px; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .6);
  transition: box-shadow .3s, transform .3s var(--ease);
}
.hero-ask:focus-within { transform: translateY(-2px); box-shadow: 0 0 0 4px rgba(59, 180, 229, .45), 0 24px 44px -18px rgba(0, 0, 0, .6); }
.hero-ask svg { color: #66748a; }
.hero-ask input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: #0f1c2e; padding: 8px 0; }
.hero-card {
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: 22px; padding: 22px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-3);
}
.dgrd-logo { width: 104px; display: block; margin: 0 auto 16px; padding: 10px 12px; background: #fff; border-radius: 18px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: rgba(255, 255, 255, .07); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-family: var(--font-head); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat small { color: #b9c9df; font-size: 12.5px; line-height: 1.3; display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.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);
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.hero .chip { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #e6eef9; }
.hero .chip:hover { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- Accesos rápidos ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quick {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow-1); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
.quick:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.quick b { font-family: var(--font-head); font-size: 17px; margin-top: 6px; }
.quick small { color: var(--ink-3); font-size: 13.5px; line-height: 1.45; }
.q-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.q-ic svg { width: 22px; height: 22px; }
.q-blue { background: #e3f2fb; color: #0f6aa6; }
.q-amber { background: #fff3d6; color: #9a6a00; }
.q-green { background: #dcf5ea; color: #13754e; }
.q-red { background: #fde4e4; color: #b42323; }
:root[data-theme="dark"] .q-blue { background: #11344f; color: #7fd0f2; }
:root[data-theme="dark"] .q-amber { background: #3a2c07; color: #ffd166; }
:root[data-theme="dark"] .q-green { background: #0e3528; color: #6fdcaf; }
:root[data-theme="dark"] .q-red { background: #3d1515; color: #ff9b9b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .q-blue { background: #11344f; color: #7fd0f2; }
  :root:not([data-theme="light"]) .q-amber { background: #3a2c07; color: #ffd166; }
  :root:not([data-theme="light"]) .q-green { background: #0e3528; color: #6fdcaf; }
  :root:not([data-theme="light"]) .q-red { background: #3d1515; color: #ff9b9b; }
}

/* ---------- Tarjetas de amenaza ---------- */
.threat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
.threat {
  --c: var(--sky);
  position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); cursor: pointer; text-align: left; padding: 0; font: inherit; width: 100%; height: 100%;
  transition: box-shadow .35s var(--ease), transform .35s var(--ease), border-color .3s;
}
.threat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.threat::after { content: ""; position: absolute; right: -50px; bottom: -50px; width: 150px; height: 150px; border-radius: 50%; background: var(--c); opacity: .07; transition: transform .6s var(--ease); }
.threat:hover { box-shadow: var(--shadow-2); transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.threat:hover::after { transform: scale(1.5); }
.threat:hover .t-ic { transform: rotate(-8deg) scale(1.08); }
.threat-head { display: flex; flex-direction: column; gap: 8px; padding: 20px 18px 18px; height: 100%; }
.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); }
.t-ic svg { width: 24px; height: 24px; }
.threat-head b { font-family: var(--font-head); font-size: 17px; }
.threat-head small { color: var(--ink-3); font-size: 13px; }
.t-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.t-count { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.threat-head .more { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--c); }
.threat-head .more svg { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.threat:hover .more svg { transform: translateX(4px); }

/* ---------- Modal de amenaza ---------- */
.tmodal { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 18px; background: rgba(8, 19, 34, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .3s both; }
.tm-card {
  --c: var(--sky);
  width: min(760px, 100%); max-height: min(88vh, 860px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-3); animation: tmIn .55s var(--ease-spring) both;
  border-top: 5px solid var(--c);
}
@keyframes tmIn { from { opacity: 0; transform: translateY(30px) scale(.94); } }
.tm-head { display: flex; align-items: center; gap: 14px; padding: 20px 20px 12px 22px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, transparent), transparent); }
.tm-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; flex: none; background: var(--c); color: #fff; box-shadow: 0 10px 22px -8px var(--c); animation: iconPop .7s var(--ease-spring) .15s both; }
.tm-icon svg { width: 28px; height: 28px; stroke-width: 2; }
@keyframes iconPop { from { transform: scale(.3) rotate(-30deg); opacity: 0; } }
.tm-titles { flex: 1; min-width: 0; }
.tm-titles small { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.tm-titles h2 { font-size: clamp(19px, 2.6vw, 24px); margin: 2px 0 0; }
.tm-close { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .3s var(--ease-spring), background .2s, color .2s; }
.tm-close:hover { background: var(--red); border-color: var(--red); color: #fff; transform: rotate(90deg); }
.tm-lead { padding: 0 22px; color: var(--ink-2); font-size: 14.5px; }
.tm-lead .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tm-more { font-size: 13px; margin: -6px 0 6px; }
.tm-lead p { margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.tm-tabs { position: relative; display: flex; gap: 4px; margin: 4px 22px 0; padding: 4px; background: var(--bg-2); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.tm-tabs button { position: relative; z-index: 1; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; border: 0; background: none; padding: 9px 12px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--ink-3); cursor: pointer; transition: color .25s; }
.tm-tabs button .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--line); color: var(--ink-2); transition: all .3s; }
.tm-tabs button.on { color: var(--ink); }
.tm-tabs button.on .n { background: var(--c); color: #fff; }
.tm-ink { position: absolute; top: 4px; bottom: 4px; left: 0; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-1); transition: transform .45s var(--ease-spring), width .45s var(--ease-spring); }
.tm-progress { position: relative; margin: 12px 22px 0; height: 6px; border-radius: 99px; background: var(--bg-2); }
.tm-progress span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 60%, #ffd166)); transition: width .5s var(--ease); }
.tm-progress small { position: absolute; right: 0; top: 10px; font-size: 12px; color: var(--ink-3); }
.tm-body { flex: 1; overflow: auto; padding: 30px 22px 18px; }
.tm-intro { color: var(--ink-2); font-size: 14.5px; margin: 0 0 12px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.step {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer;
  animation: stepIn .5s var(--ease) both; animation-delay: calc(var(--i) * 45ms); transition: border-color .25s, background .25s, transform .25s var(--ease);
}
@keyframes stepIn { from { opacity: 0; transform: translateX(-14px); } }
.step:hover { border-color: color-mix(in srgb, var(--c) 50%, var(--line)); transform: translateX(3px); }
.s-ic { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.s-ic svg { width: 22px; height: 22px; }
.s-txt { flex: 1; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.s-txt small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1px; }
.step.ban .s-ic { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.step.ban .s-txt small { color: var(--red); }
.s-check { width: 26px; height: 26px; border-radius: 50%; flex: none; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; transition: all .3s var(--ease-spring); }
.s-check svg { width: 15px; height: 15px; stroke-width: 3; }
.step.done { background: color-mix(in srgb, var(--green) 8%, var(--surface)); border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.step.done .s-check { background: var(--green); border-color: var(--green); color: #fff; transform: scale(1.1); }
.step.done .s-txt { color: var(--ink-2); }
.step-sub { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 8px 2px 0; animation: stepIn .5s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.tm-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.tm-foot .sp { flex: 1; }
.btn-call { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); padding: 8px 14px; font-size: 13.5px; }
.btn-call:hover { background: var(--red); color: #fff; }
.tm-foot .btn-ghost, .tm-foot .btn-primary { padding: 8px 14px; font-size: 13.5px; }
.mini-av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; margin-left: -4px; }
.mini-av svg { width: 22px; height: 22px; }

/* ---------- Amari (asistente virtual, identidad amarilla) ---------- */
.amari, .fab-av, .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-face { width: 78%; height: 78%; stroke: none; }
.bot-avatar.amari .amari-face { width: 82%; height: 82%; }
.msg .av.amari .amari-face { width: 30px; height: 30px; }
.amari-name { background: linear-gradient(90deg, #f2a900, #e08a00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wave { animation: wave 2.4s var(--ease) .4s both; }
@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; } }
.fab-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
.fab-av svg { width: 26px; height: 26px; }
@media (max-width: 640px) {
  .tmodal { padding: 0; align-items: end; }
  .tm-card { max-height: 92vh; border-radius: 22px 22px 0 0; animation-name: tmUp; }
  @keyframes tmUp { from { transform: translateY(100%); } }
  .tm-tabs button { flex: none; }
  .tm-foot .sp { display: none; }
  .tm-foot .btn { flex: 1 1 45%; }
  .step { padding: 10px 12px; gap: 10px; }
  .s-ic { width: 36px; height: 36px; }
}

/* ---------- Niveles de alerta ---------- */
.alert-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lv { border-radius: var(--radius); padding: 18px; background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.lv::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--c); opacity: .12; }
.lv h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.lv h3 i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
.lv ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.lv li { margin: 5px 0; }
.lv small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }

/* ---------- Documentos ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: clamp(30px, 4vw, 42px); }
.doc-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 20px; }
.doc-filter button { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); transition: all .25s var(--ease); }
.doc-filter button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
:root[data-theme="dark"] .doc-filter button.on { background: var(--sky); border-color: var(--sky); }
.doc-list { list-style: none; margin: 0; padding: 0; position: relative; }
.doc-list::before { content: ""; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--line), var(--line-2), var(--line)); }
.doc-group-label { margin: 26px 0 10px 64px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.doc-item { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 14px; margin-bottom: 14px; }
.doc-num {
  position: relative; z-index: 1; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 18px; color: #fff; background: var(--c, var(--navy));
  box-shadow: 0 8px 18px -8px var(--c, var(--navy));
}
.doc-card {
  display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1); transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.doc-card:hover { transform: translateX(4px); box-shadow: var(--shadow-2); }
.doc-card h3 { font-size: 17.5px; margin-bottom: 4px; }
.doc-card p { margin: 0; color: var(--ink-3); font-size: 14px; max-width: 70ch; }
.doc-meta { display: flex; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-actions .btn { padding: 8px 14px; font-size: 13.5px; }

/* ---------- Lector ---------- */
.reader { position: fixed; inset: 0; z-index: 80; background: rgba(8, 19, 34, .55); backdrop-filter: blur(4px); display: grid; place-items: stretch; animation: fadeIn .25s both; }
.reader-shell { margin: 18px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-3); display: flex; flex-direction: column; overflow: hidden; animation: popIn .45s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(24px) scale(.985); } }
.reader-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.reader-titles { flex: 1; min-width: 0; }
.reader-titles small { color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.reader-titles h2 { font-size: 18px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-find { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; background: var(--surface-2); color: var(--ink-3); }
.reader-find input { border: 0; background: transparent; outline: 0; font: inherit; color: var(--ink); width: 190px; }
.reader-find span { font-size: 12px; white-space: nowrap; }
.reader-body { flex: 1; display: grid; grid-template-columns: 280px 1fr; min-height: 0; }
.reader-toc { overflow: auto; padding: 16px 10px 40px 16px; border-right: 1px solid var(--line); font-size: 13.5px; }
.reader-toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.reader-toc a:hover, .reader-toc a.on { background: var(--accent-soft); color: var(--accent-ink); }
.reader-toc a.l2 { padding-left: 20px; }
.reader-toc a.l3 { padding-left: 32px; font-size: 12.5px; }
.reader-doc { overflow: auto; padding: 32px clamp(18px, 5vw, 64px) 120px; scroll-behavior: smooth; }
.reader-doc > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.reader-doc h1, .reader-doc h2, .reader-doc h3 { scroll-margin-top: 20px; }
.reader-doc h1 { font-size: 26px; margin-top: 1.4em; }
.reader-doc h2 { font-size: 21px; margin-top: 1.4em; }
.reader-doc h3 { font-size: 17px; margin-top: 1.2em; }
.reader-doc p { margin: .6em auto; color: var(--ink-2); }
.reader-doc p.li { padding-left: 22px; position: relative; }
.reader-doc p.li::before { content: ""; position: absolute; left: 6px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.reader-doc p.note { font-style: italic; color: var(--ink-3); background: var(--surface-2); border-radius: 10px; padding: 10px 14px; }
.reader-doc figure { margin: 18px auto; }
.reader-doc figure img { border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; display: block; margin: 0 auto; max-height: 560px; width: auto; }
.reader-doc .flash { animation: flash 2.2s var(--ease); border-radius: 8px; }
@keyframes flash { 0%, 40% { background: color-mix(in srgb, var(--amber) 30%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--amber) 30%, transparent); } 100% { background: transparent; box-shadow: none; } }
mark { background: #ffe38a; color: #1b1b1b; border-radius: 3px; padding: 0 2px; }
mark.cur { background: #ffb020; }
.tbl-wrap { overflow-x: auto; margin: 14px auto; border: 1px solid var(--line); border-radius: 12px; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { background: var(--surface-2); font-weight: 700; color: var(--ink); position: sticky; top: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td { color: var(--ink-2); }
.tbl tr:hover td { background: var(--surface-2); }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .85); display: grid; place-items: center; padding: 24px; animation: fadeIn .2s both; }
.lightbox img { max-width: 96vw; max-height: 90vh; border-radius: 10px; animation: popIn .35s var(--ease) both; background: #fff; }
.lightbox .icon-btn { position: absolute; top: 14px; right: 14px; color: #fff; background: rgba(255, 255, 255, .12); }

/* ---------- Presentación ---------- */
.deck { position: relative; height: calc(100vh - var(--top-h) - var(--sos-h)); min-height: 560px; display: flex; flex-direction: column; outline: none; background: radial-gradient(1200px 600px at 80% -10%, #16426f 0%, transparent 60%), linear-gradient(160deg, #081a31, #0b2545 60%, #0f2f55); color: #eaf1fb; overflow: hidden; }
.deck:fullscreen { height: 100vh; }
.deck-stage { position: relative; flex: 1; min-height: 0; }
.slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(20px, 4vw, 56px) clamp(20px, 6vw, 96px) 24px; opacity: 0; pointer-events: none; transform: translateX(60px) scale(.98); transition: opacity .6s var(--ease), transform .7s var(--ease); overflow: auto; }
.slide.prev { transform: translateX(-60px) scale(.98); }
.slide.on { opacity: 1; pointer-events: auto; transform: none; }
.slide .anim { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.slide.on .anim { opacity: 1; transform: none; }
.slide.on .anim:nth-child(1) { transition-delay: .08s; } .slide.on .anim:nth-child(2) { transition-delay: .16s; }
.slide.on .anim:nth-child(3) { transition-delay: .24s; } .slide.on .anim:nth-child(4) { transition-delay: .32s; }
.slide.on .anim:nth-child(5) { transition-delay: .4s; } .slide.on .anim:nth-child(6) { transition-delay: .48s; }
.slide-inner { width: 100%; max-width: 1180px; margin: 0 auto; }
.slide .kicker { display: inline-flex; align-items: center; gap: 8px; color: #9fd8f5; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.slide .kicker i { width: 22px; height: 2px; background: #3bb4e5; }
.slide h2 { font-size: clamp(26px, 3.6vw, 44px); font-weight: 800; color: #fff; }
.slide .sub { color: #b9c9df; font-size: clamp(15px, 1.4vw, 18px); max-width: 70ch; }
.slide .src { color: #8ea5c3; font-size: 12.5px; margin-top: 16px; }
.slide .src a { color: #9fd8f5; }
.s-grid { display: grid; gap: 16px; margin-top: 22px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.s-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; padding: 18px; }
.s-card h3 { font-size: 17px; color: #fff; display: flex; align-items: center; gap: 8px; }
.s-card p, .s-card li { color: #c4d3e7; font-size: 14.5px; margin: 4px 0; }
.s-card ul { padding-left: 18px; margin: 6px 0 0; }
.s-big { font-family: var(--font-head); font-size: clamp(30px, 3.8vw, 48px); font-weight: 800; color: #fff; letter-spacing: -.02em; line-height: 1; }
.s-big small { font-size: .42em; font-weight: 700; color: #9fd8f5; margin-left: 4px; }
.s-lbl { color: #b9c9df; font-size: 13.5px; margin-top: 6px; }
.s-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; }
.s-img { border-radius: 16px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .15); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); background: #fff; }
.s-img img { display: block; width: 100%; max-height: 58vh; object-fit: contain; cursor: zoom-in; }
.s-cover { text-align: left; }
.s-cover .logos { display: flex; gap: 18px; align-items: center; margin-bottom: 26px; }
.s-cover .logos img { height: 110px; width: auto; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .4)); }
.s-cover h2 { font-size: clamp(34px, 5.4vw, 68px); line-height: 1.02; }
.s-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15); font-size: 13px; color: #d7e4f5; margin: 4px 6px 0 0; }
.lvl-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.lvl { border-radius: 16px; padding: 16px; background: rgba(255, 255, 255, .06); border-top: 4px solid var(--c); }
.lvl b { color: #fff; font-family: var(--font-head); font-size: 18px; display: block; }
.lvl p { color: #c4d3e7; font-size: 13.5px; margin: 6px 0 0; }
.lvl .who { color: #9fd8f5; font-size: 12.5px; margin-top: 8px; display: block; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; counter-reset: f; }
.flow .s-card { position: relative; }
.flow .s-card::before { counter-increment: f; content: counter(f, decimal); position: absolute; top: -12px; left: 16px; width: 26px; height: 26px; border-radius: 50%; background: #3bb4e5; color: #081a31; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.flow.zero .s-card::before { content: counter(f, decimal); }
.deck-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 16px 14px; }
.deck-bar .icon-btn { color: #cfe0f3; background: rgba(255, 255, 255, .06); }
.deck-bar .icon-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.deck-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 60vw; }
.deck-dots button { width: 9px; height: 9px; border-radius: 99px; border: 0; padding: 0; background: rgba(255, 255, 255, .25); cursor: pointer; transition: width .4s var(--ease), background .3s; }
.deck-dots button.on { width: 26px; background: #3bb4e5; }
.deck-count { color: #9fb3cd; font-size: 13px; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.deck-progress { height: 3px; background: rgba(255, 255, 255, .08); }
.deck-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3bb4e5, #ffd166); transition: width .6s var(--ease); }

/* Gráfico de barras */
.chart { position: relative; margin-top: 10px; }
.chart svg { width: 100%; height: auto; overflow: visible; stroke: none; fill: none; }
.chart svg text { stroke: none; }
.chart .grid line { stroke: rgba(255, 255, 255, .1); stroke-width: 1; }
.chart .axis text { fill: #8ea5c3; font-size: 11px; }
.chart .bar { fill: #ffb547; transition: opacity .2s, transform .8s var(--ease); transform-origin: bottom; transform-box: fill-box; }
.slide:not(.on) .chart .bar { transform: scaleY(0); }
.chart .bar.dim { opacity: .35; }
.chart .lbl { fill: #fff; font-size: 11.5px; font-weight: 700; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart-tip { position: absolute; pointer-events: none; background: #fff; color: #0f1c2e; border-radius: 10px; padding: 8px 11px; font-size: 13px; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .5); opacity: 0; transform: translate(-50%, -110%); transition: opacity .15s; white-space: nowrap; }
.chart-tip b { display: block; font-size: 15px; }
.chart-tip.on { opacity: 1; }
.chart-toggle { background: none; border: 1px solid rgba(255, 255, 255, .2); color: #cfe0f3; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; margin-top: 8px; }
.chart-table { font-size: 12.5px; color: #cfe0f3; width: 100%; border-collapse: collapse; margin-top: 8px; }
.chart-table td, .chart-table th { padding: 4px 8px; border-bottom: 1px solid rgba(255, 255, 255, .1); text-align: right; }
.chart-table td:first-child, .chart-table th:first-child { text-align: left; }

/* ---------- Mapa ---------- */
.view-map { animation: none; }
.map-layout { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - var(--top-h) - var(--sos-h)); min-height: 520px; }
.map-panel { overflow: auto; padding: 20px 18px 40px; border-right: 1px solid var(--line); background: var(--surface); }
.map-panel h1 { font-size: 21px; margin-bottom: 4px; }
.map-panel-head p { color: var(--ink-3); font-size: 13.5px; margin: 0 0 12px; }
.map-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--surface-2); color: var(--ink-3); }
.map-search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); min-width: 0; }
.layer-list { display: grid; gap: 8px; margin: 16px 0; }
.layer { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; transition: all .2s var(--ease); user-select: none; }
.layer:hover { border-color: var(--line-2); }
.layer input { position: absolute; opacity: 0; pointer-events: none; }
.layer .sw { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; transition: filter .2s, opacity .2s; }
.layer .sw svg { width: 16px; height: 16px; stroke-width: 2.2; }
.layer b { font-size: 14px; display: block; line-height: 1.25; }
.layer small { color: var(--ink-3); font-size: 12px; }
.layer .n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-3); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; }
.layer.off { opacity: .55; }
.layer.off .sw { filter: grayscale(1); opacity: .5; }
.locate-result { font-size: 13.5px; margin: 10px 0 0; }
.locate-result .card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--accent-soft); }
.place-list { list-style: none; margin: 16px 0 0; padding: 0; }
.place-list li { border-bottom: 1px solid var(--line); }
.place-list button { width: 100%; text-align: left; background: none; border: 0; padding: 9px 4px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; color: var(--ink); border-radius: 8px; transition: background .2s; }
.place-list button:hover { background: var(--surface-2); }
.place-list i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-top: 6px; flex: none; }
.place-list span { font-size: 13.5px; line-height: 1.35; }
.place-list small { display: block; color: var(--ink-3); font-size: 12px; }
.place-group { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 14px 4px 6px; }
.map-wrap { position: relative; }
#map { position: absolute; inset: 0; background: var(--bg-2); }
:root[data-theme="dark"] #map.osm-base .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9) saturate(.6); }
.map-panel-toggle { display: none; position: absolute; left: 50%; transform: translateX(-50%); bottom: 34px; z-index: 500; box-shadow: var(--shadow-2); }
.pin { --c: var(--sky); width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .5); display: grid; place-items: center; transition: transform .25s var(--ease-spring); }
.pin svg { transform: rotate(45deg); width: 15px; height: 15px; color: #fff; stroke-width: 2.4; }
.pin-wrap:hover .pin, .pin-wrap.hl .pin { transform: rotate(-45deg) scale(1.2); }
.pin-wrap.hl .pin { animation: bounce .9s var(--ease) 2; }
@keyframes bounce { 50% { transform: rotate(-45deg) scale(1.35) translate(4px, -4px); } }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow-2); background: var(--surface); color: var(--ink); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 14px 16px; font: 13.5px/1.5 var(--font); min-width: 220px; }
.pop h4 { margin: 0 0 4px; font: 700 15px/1.3 var(--font-head); }
.pop .lyr { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c); }
.pop dl { margin: 8px 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12.5px; }
.pop dt { color: var(--ink-3); } .pop dd { margin: 0; }
.pop .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pop .acts a, .pop .acts button { font-size: 12.5px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); text-decoration: none; cursor: pointer; }
.pop .acts a.go { background: var(--sky); color: #fff; border-color: var(--sky); }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-3); }
.leaflet-control-layers, .leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line) !important; }
.leaflet-control-layers { border-radius: 12px !important; box-shadow: var(--shadow-2) !important; border: 0 !important; }
.mz-label { background: none; border: 0; box-shadow: none; font: 700 12px var(--font-head); color: #3a2a86; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }

/* ---------- Asistente ---------- */
.view-chat { animation: none; }
.chat-layout { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - var(--top-h) - var(--sos-h)); min-height: 520px; }
.chat-side { overflow: auto; padding: 22px 18px; border-right: 1px solid var(--line); background: var(--surface); }
.chat-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 22px 0 10px; }
.bot-card { display: flex; gap: 12px; align-items: center; }
.bot-card b { font-family: var(--font-head); font-size: 16px; display: block; }
.bot-card small { color: var(--ink-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.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); }
.bot-avatar img { width: 30px; height: auto; filter: brightness(1.1); }
.dot-ok { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.side-note { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 16px; }
.scope { display: flex; flex-direction: column; gap: 4px; }
.scope label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.scope label:hover { background: var(--surface-2); }
.scope input { accent-color: var(--sky); }
.topic-list { display: flex; flex-direction: column; gap: 6px; }
.topic-list button { text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; cursor: pointer; color: var(--ink-2); transition: all .2s var(--ease); }
.topic-list button:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateX(3px); }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.chat-layout > *, .map-layout > * { min-width: 0; }
.chat-log { flex: 1; overflow: auto; padding: 26px clamp(14px, 4vw, 48px) 16px; scroll-behavior: smooth; }
.msg { display: flex; gap: 12px; max-width: 860px; margin: 0 auto 18px; animation: msgIn .45s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } }
.msg .av { width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, #0b2545, #1f8fd0); }
.msg .av img { width: 20px; }
.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; }
.msg.user { flex-direction: row-reverse; }
.msg.user .av { background: var(--amber); color: #3a2a00; font-weight: 800; font-size: 13px; }
.msg.user .bubble { flex: 0 1 auto; background: linear-gradient(135deg, var(--sky), #1670b8); color: #fff; border: 0; border-radius: 18px 4px 18px 18px; }
.bubble p { margin: .35em 0; }
.bubble ul, .bubble ol { margin: .4em 0; padding-left: 20px; }
.bubble li { margin: 3px 0; }
.bubble h4 { margin: .2em 0 .4em; font-family: var(--font-head); font-size: 15.5px; }
.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; }
.bubble .tbl-wrap { margin: 10px 0; }
.bubble .tbl { font-size: 13px; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sources > span { font-size: 12px; color: var(--ink-3); width: 100%; }
.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); }
.src-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.src-btn svg { width: 14px; height: 14px; }
.src-btn i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--sky)); }
.follow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.caret::after { content: "▍"; color: var(--accent); animation: caret 1s steps(1) infinite; margin-left: 1px; }
@keyframes caret { 50% { opacity: 0; } }
.chat-input { padding: 10px clamp(14px, 4vw, 48px) 16px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-input > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.chips-inline { margin-bottom: 10px; }
.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; }
.chat-box:focus-within { border-color: var(--sky); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 18%, transparent); }
.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; }
.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); }
.send:hover { transform: scale(1.06) rotate(-6deg); }
.send svg { width: 18px; height: 18px; }
#chat-mic.rec { color: #fff; background: var(--red); animation: pulse 1.5s infinite; }
.chat-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-3); margin-top: 6px; flex-wrap: wrap; }
.welcome { text-align: center; max-width: 640px; margin: 4vh auto 20px; animation: msgIn .6s var(--ease) both; }
.welcome .bot-avatar { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 14px; }
.welcome .bot-avatar img { width: 44px; }
.welcome h2 { font-size: 26px; }
.welcome p { color: var(--ink-2); }
.welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; text-align: left; }
.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; }
.welcome-grid button:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.welcome-grid small { display: block; color: var(--ink-3); font-size: 12.5px; }
.welcome-grid .t-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.welcome-grid .t-ic svg { width: 18px; height: 18px; }

/* ---------- Pie de página ---------- */
.site-foot { position: relative; background: linear-gradient(170deg, #0b2545 0%, #081a31 100%); color: #b9c9df; margin-top: 40px; }
.foot-wave { position: absolute; top: -59px; left: 0; right: 0; height: 60px; color: #0b2545; pointer-events: none; }
.foot-wave svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }
.foot-inner { max-width: 1180px; margin: 0 auto; padding: 46px 20px 30px; display: grid; grid-template-columns: 1.4fr 1fr 1.3fr 1.3fr; gap: 36px; }
.foot-logos { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.foot-logos > img { width: 64px; height: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.foot-dgrd { background: #fff; border-radius: 14px; padding: 6px 8px; display: grid; place-items: center; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .6); }
.foot-dgrd img { width: 54px; height: auto; }
.foot-brand b { display: block; color: #fff; font-family: var(--font-head); font-size: 17px; }
.foot-brand p { margin: 6px 0 12px; font-size: 13.5px; line-height: 1.55; }
.foot-law { display: inline-block; font-size: 12px; font-weight: 600; color: #9fd8f5; border: 1px solid rgba(159, 216, 245, .3); border-radius: 999px; padding: 3px 11px; }
.foot-col h4 { color: #fff; font-family: var(--font-head); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 4px 0 14px; }
.foot-col a { display: block; color: #b9c9df; text-decoration: none; font-size: 14px; padding: 4px 0; transition: color .2s, transform .25s var(--ease); }
.foot-col a:hover { color: #fff; transform: translateX(4px); }
#foot-docs a { font-size: 13px; padding: 3px 0; }
#foot-docs a span { color: #3bb4e5; font-weight: 700; margin-right: 6px; font-variant-numeric: tabular-nums; }
.foot-contact p { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; font-size: 13.5px; }
.foot-contact p svg { width: 18px; height: 18px; color: #3bb4e5; margin-top: 2px; }
.foot-contact p a { display: inline; padding: 0; color: #fff; }
.foot-contact p a:hover { transform: none; text-decoration: underline; }
.foot-sos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.foot-sos a { text-align: center; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 7px 2px; font-size: 11px; }
.foot-sos a b { display: block; color: #ffd166; font-family: var(--font-head); font-size: 17px; }
.foot-sos a:hover { background: rgba(255, 255, 255, .12); transform: translateY(-2px); }
.foot-bottom { max-width: 1180px; margin: 0 auto; padding: 18px 20px 26px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; font-size: 12.5px; color: #8ea5c3; }
.foot-dev { display: inline-flex; align-items: center; gap: 10px; color: #cfdcee; font-size: 13px; }
.foot-dev b { color: #fff; background: linear-gradient(90deg, #7fd0f2, #3bb4e5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dev-badge { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #1f8fd0, #3bb4e5); color: #fff; box-shadow: 0 6px 14px -6px #3bb4e5; }
.dev-badge svg { width: 16px; height: 16px; stroke-width: 2.2; }
@media (max-width: 960px) { .foot-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .foot-inner { grid-template-columns: 1fr; gap: 26px; padding-top: 34px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 50; display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 18px 13px 15px; border-radius: 999px; text-decoration: none; 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: fabIn .8s var(--ease-spring) .6s both;
}
.fab:hover { transform: translateY(-3px) scale(1.03); }
.fab svg { width: 22px; height: 22px; }
.fab.hide, .fab.off-foot { opacity: 0; transform: translateY(20px) scale(.9); pointer-events: none; }
@keyframes fabIn { from { opacity: 0; transform: translateY(30px) scale(.8); } }

/* ---------- Guía ---------- */
.tour { position: fixed; inset: 0; z-index: 95; background: rgba(8, 19, 34, .6); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 16px; animation: fadeIn .3s both; }
.tour-card { width: min(520px, 100%); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-3); overflow: hidden; animation: popIn .5s var(--ease) both; }
.tour-steps { position: relative; min-height: 290px; }
.tour-step { position: absolute; inset: 0; padding: 28px 28px 10px; opacity: 0; transform: translateX(30px); transition: all .45s var(--ease); pointer-events: none; }
.tour-step.on { opacity: 1; transform: none; pointer-events: auto; }
.tour-step.gone { transform: translateX(-30px); }
.tour-step .t-ic { width: 56px; height: 56px; border-radius: 18px; margin-bottom: 14px; }
.tour-step .t-ic svg { width: 28px; height: 28px; }
.tour-step h3 { font-size: 22px; }
.tour-step p { color: var(--ink-2); margin: 0; }
.tour-nav { display: flex; align-items: center; gap: 10px; padding: 14px 20px 20px; }
.tour-dots { display: flex; gap: 6px; margin-right: auto; }
.tour-dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--line-2); transition: all .3s var(--ease); }
.tour-dots i.on { width: 22px; background: var(--sky); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); opacity: 0; z-index: 99; background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow-2); transition: all .35s var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .tabs a span { display: none; }
  .tabs a { padding: 9px 12px; }
  .quick-grid, .threat-grid { grid-template-columns: repeat(2, 1fr); }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .lvl-row, .flow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  :root { --top-h: 58px; }
  .hero-inner { grid-template-columns: 1fr; padding: 36px 16px 44px; }
  .s-split, .g3 { grid-template-columns: 1fr; }
  .alert-levels { grid-template-columns: 1fr; }
  .reader-body { grid-template-columns: 1fr; }
  .reader-toc { position: absolute; z-index: 5; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); background: var(--surface); box-shadow: var(--shadow-3); transform: translateX(-105%); transition: transform .35s var(--ease); }
  .reader-toc.open { transform: none; }
  .reader-body { position: relative; }
  .reader-find { display: none; }
  .reader-shell { margin: 0; border-radius: 0; }
  .reader-head .btn span { display: none; }
  .map-layout { grid-template-columns: 1fr; }
  .map-panel { position: absolute; z-index: 600; top: 0; left: 0; bottom: 0; width: min(360px, 90vw); transform: translateX(-105%); transition: transform .35s var(--ease); box-shadow: var(--shadow-3); }
  .map-panel.open { transform: none; }
  .map-panel-toggle { display: inline-flex; }
  .view-map .map-layout { position: relative; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-side { display: none; }
  .welcome-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar { padding: 0 10px; gap: 8px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .brand { margin-right: auto; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 13.5px; max-width: 34vw; }
  .tabs { position: fixed; left: 8px; right: 8px; bottom: 8px; margin: 0; justify-content: space-around; z-index: 60; box-shadow: var(--shadow-3); background: var(--surface); border: 1px solid var(--line); padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .tabs a { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 4px; flex: 1; }
  .tabs a span { display: block; }
  .tab-ink { background: var(--accent-soft); box-shadow: none; }
  body { padding-bottom: 78px; }
  .fab { bottom: 88px; right: 14px; padding: 13px; }
  .fab span { display: none; }
  .sos-strip { font-size: 12.5px; gap: 14px; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .sos-strip::-webkit-scrollbar { display: none; }
  .sos-label { white-space: nowrap; }
  .chips-inline { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips-inline .chip { white-space: nowrap; }
  .quick-grid, .threat-grid { grid-template-columns: 1fr; }
  .g2, .g4, .lvl-row, .flow { grid-template-columns: 1fr; }
  .hero-ask { flex-wrap: wrap; border-radius: 18px; padding: 8px 8px 8px 14px; }
  .hero-ask .btn { width: 100%; }
  .stat b { font-size: 22px; }
  .doc-list::before { left: 19px; }
  .doc-item { grid-template-columns: 40px 1fr; gap: 10px; }
  .doc-num { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
  .doc-group-label { margin-left: 50px; }
  .doc-actions { width: 100%; }
  .doc-actions .btn { flex: 1; }
  .deck, .map-layout, .chat-layout { height: calc(100vh - var(--top-h) - var(--sos-h) - 78px); height: calc(100dvh - var(--top-h) - var(--sos-h) - 78px); min-height: 420px; }
  .chat-foot > span { display: none; }
  .slide { justify-content: flex-start; }
  .deck-dots { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .topbar, .sos-strip, .fab, .deck-bar { display: none; }
}

.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-traits { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.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); }
.side-traits { justify-content: flex-start; margin-top: 10px; }
.side-traits span { font-size: 11.5px; padding: 3px 9px; }
.amari-face .ray { stroke: #f2a900; stroke-width: 2.4; stroke-linecap: round; }
.dot-ok { background: #f2b31a; box-shadow: 0 0 0 3px rgba(242, 179, 26, .25); }
/* Logo para fondos oscuros */
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
.brand img.logo-dark { width: 34px; filter: none; }
.s-cover .logos img.dgrd-chip { height: 96px; background: #fff; padding: 8px 10px; border-radius: 18px; }

/* ---------- Lectura en voz alta ---------- */
.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);
}
@keyframes ttsIn { from { opacity: 0; transform: translate(-50%, 30px) scale(.9); } }
.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; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 18px; } }
.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; }
.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); }
.listen-btn svg { width: 16px; height: 16px; }
.listen-btn:hover { background: #ffd23f; color: #0b2545; }
.tts-trigger.speaking, .listen-btn.speaking { background: #ffd23f !important; color: #0b2545 !important; border-color: #f2b31a !important; animation: speakPulse 1.6s infinite; }
@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); } }
.listen-btn.speaking span::after { content: " · detener"; }
.tm-listen { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; flex: none; transition: all .2s; }
.tm-listen:hover { border-color: #f2b31a; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch svg { width: 15px; height: 15px; }
.sw-track { width: 34px; height: 20px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .25s; flex: none; }
.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); }
.switch input:checked + .sw-track { background: #f2b31a; }
.switch input:checked + .sw-track .sw-knob { transform: translateX(14px); }
.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; }
  .tm-listen span { display: none; }
  .tm-listen { padding: 0 12px; }
  .chat-foot span.sw-track + svg { display: none; }
}
body:has(#tmodal:not([hidden])) .tts-bar { top: 14px; bottom: auto; }
@media (max-width: 640px) { body:has(#tmodal:not([hidden])) .tts-bar { top: 8px; } }

/* Voz: estado, menú y consentimiento */
.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; }
body:has(#tmodal:not([hidden])) .tts-menu { bottom: auto; top: calc(100% + 10px); }
.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; }
.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); }
.mi-av svg { width: 28px; height: 28px; stroke: none; }
.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; } }
.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; }
