/* Fuentes (subconjuntos latinos, licencia SIL OFL: ver fonts/OFL-*.txt) */
@font-face { font-family: "Orbitron"; src: url("fonts/orbitron-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("fonts/rajdhani-600-latin.woff2") format("woff2"); font-weight: 600; font-display: swap; }
/* ===== Antares Web · estilo "Jarvis" ===== */
:root {
  --bg: #070c1c;
  --bg-2: #0b1530;
  --panel: #0a1224;          /* fondo opaco de paneles */
  --panel-2: #0f1a33;
  --line: rgba(255, 179, 71, 0.32);
  --line-soft: rgba(79, 240, 255, 0.14);
  --cyan: #4ff0ff;
  --cyan-2: #aee8ff;
  --cyan-ink: #03131c;       /* texto sobre botón cian */
  --text: #e8f4ff;
  --muted: #9fb4c8;
  --dim: #7f93a8;
  --amber: #ffc457;
  --red: #ff5a6e;
  --accent: #ffb347;         /* v1.14: rojo de acento */
  --accent-2: #ffc98a;
  --ok: #7dff9b;
  --glow: 0 0 12px rgba(79, 240, 255, 0.45);
  --app-h: 100dvh;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font-ui: "Rajdhani", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-hud: "Orbitron", "Rajdhani", ui-monospace, monospace;
  --font-read: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
@supports not (height: 100dvh) { :root { --app-h: 100vh; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overscroll-behavior: none; }
body { font-family: var(--font-ui); font-size: 17px; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--cyan-2); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.app {
  position: fixed; inset: 0 0 auto 0; height: var(--app-h);
  max-width: 440px; margin: 0 auto;
  display: flex; flex-direction: column;
  background:
    radial-gradient(520px 380px at 50% 34%, rgba(79, 240, 255, 0.10), transparent 70%),
    linear-gradient(rgba(79, 240, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(79, 240, 255, 0.035) 1px, transparent 1px) 0 0 / 28px 100%,
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
}
.app::after { /* líneas de escaneo muy sutiles */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px);
}

/* ---------- Barra superior ---------- */
.topbar {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-t) + 8px) 8px 8px 16px;
}
.brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 50%; flex: none; position: relative;
  border: 2px solid var(--cyan); box-shadow: var(--glow), inset 0 0 10px rgba(79, 240, 255,.5);
}
.logo-mark::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: radial-gradient(circle, #fff 0 30%, var(--cyan) 70%); box-shadow: 0 0 10px var(--cyan); }
.brand h1 { margin: 0; font-family: var(--font-hud); font-weight: 700; font-size: 18px; letter-spacing: 4px; color: var(--text); text-shadow: 0 0 10px rgba(79, 240, 255,.55); }
.brand p { margin: 1px 0 0; font-size: 14px; color: var(--muted); letter-spacing: .5px; }
.icon-btn {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border-radius: 14px; border: 1px solid var(--line-soft); background: rgba(79, 240, 255, 0.05);
  color: var(--cyan-2); cursor: pointer; text-decoration: none;
}
.icon-btn:active { background: rgba(79, 240, 255, 0.16); }
.icon-btn svg { width: 24px; height: 24px; }

/* ---------- Panel HUD ---------- */
.hud {
  flex: none; margin: 2px 12px 0; display: grid; grid-template-columns: 1.2fr 1fr 1.05fr;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; position: relative;
  box-shadow: inset 0 0 24px rgba(79, 240, 255, 0.06);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.hud > div { padding: 9px 10px 10px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hud > div + div { border-left: 1px solid var(--line-soft); }
.hud-label { font-family: var(--font-hud); font-size: 11px; font-weight: 600; letter-spacing: 1.6px; color: var(--muted); }
.hud-big { font-family: var(--font-hud); font-size: 24px; font-weight: 600; color: var(--text); text-shadow: 0 0 10px rgba(79, 240, 255,.6); line-height: 1.15; font-variant-numeric: tabular-nums; }
.hud-val { font-family: var(--font-hud); font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.6; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.hud-sub { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); flex: none; }
.warn .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.warn .hud-val { color: var(--amber); }
.tag { font-size: 11.5px; letter-spacing: .5px; color: var(--amber); border: 1px solid rgba(255,196,87,.45); border-radius: 6px; padding: 0 5px; margin-left: 2px; font-family: var(--font-ui); }

/* ---------- Escenario central ---------- */
.stage { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.stage-center { flex: 1; min-height: 0; width: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 8px; padding: 8px 20px; }
.reactor-wrap { position: relative; width: 210px; height: 210px; flex: none; transition: width .4s, height .4s; }
.reactor { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 0 10px rgba(79, 240, 255,.55)); }
.reactor .spin { transform-box: fill-box; transform-origin: center; animation: spin var(--spd-1, 40s) linear infinite; }
.reactor .spin-rev { transform-box: fill-box; transform-origin: center; animation: spin var(--spd-2, 28s) linear infinite reverse; }
.reactor .coil { transform-box: fill-box; transform-origin: center; animation: spin var(--spd-3, 60s) linear infinite; }
.reactor .core { transform-box: fill-box; transform-origin: center; animation: pulse var(--pulse, 3.2s) ease-in-out infinite; }
.reactor .halo { transform-box: fill-box; transform-origin: center; animation: halo var(--pulse, 3.2s) ease-in-out infinite; }
.ripple { position: absolute; inset: 18%; border-radius: 50%; border: 2px solid var(--cyan); opacity: 0; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(.92); opacity: .85; } 50% { transform: scale(1.04); opacity: 1; } }
@keyframes halo { 0%,100% { opacity: .35; transform: scale(.95); } 50% { opacity: .8; transform: scale(1.06); } }
@keyframes ripple { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.75); opacity: 0; } }

.state-label { margin: 2px 0 0; font-family: var(--font-hud); font-size: 13px; font-weight: 600; letter-spacing: 3px; color: var(--cyan-2); text-shadow: 0 0 8px rgba(79, 240, 255,.6); }
.wave { height: 28px; display: flex; align-items: center; gap: 3px; }
.wave i { width: 3px; height: 100%; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); transform: scaleY(.15); animation: bar 1s ease-in-out infinite; }
@keyframes bar { 0%,100% { transform: scaleY(.15); } 50% { transform: scaleY(var(--h, .8)); } }
.greeting { margin: 4px 0 0; text-align: center; font-family: var(--font-read); font-size: 19px; line-height: 1.4; color: var(--text); max-width: 320px; }
.greeting strong { color: var(--cyan-2); font-weight: 600; }
.interim { margin: 2px 0 0; text-align: center; font-family: var(--font-read); font-size: 18px; line-height: 1.4; color: var(--text); max-width: 330px; }
.interim .q { color: var(--cyan-2); }
.caret { display: inline-block; width: 2px; height: 1.05em; vertical-align: -2px; background: var(--cyan); margin-left: 2px; box-shadow: 0 0 6px var(--cyan); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.hint-line { margin: 0; font-size: 15px; color: var(--muted); text-align: center; }

/* ---------- Tarjeta de primer uso ---------- */
.setup-card {
  width: 100%; max-width: 360px; margin-top: 6px; padding: 16px 16px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(79, 240, 255,.05), 0 10px 40px rgba(0, 0, 0, .5), inset 0 0 30px rgba(79, 240, 255,.05);
}
.setup-card h2 { margin: 0 0 6px; font-family: var(--font-hud); font-size: 16px; letter-spacing: 1px; color: var(--cyan-2); display: flex; align-items: center; gap: 8px; }
.setup-card p { margin: 0 0 10px; font-family: var(--font-read); font-size: 15.5px; line-height: 1.45; color: var(--text); }
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; font-family: var(--font-read); font-size: 15px; line-height: 1.4; color: var(--muted); }
.steps li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--cyan); color: var(--cyan-2); font-family: var(--font-hud); font-size: 11px; display: grid; place-items: center; margin-top: 1px; }
.steps b { color: var(--text); font-weight: 600; }

/* ---------- Botones ---------- */
.btn {
  white-space: nowrap;
  min-height: 48px; padding: 0 18px; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-size: 17px; font-weight: 600; letter-spacing: .4px; text-decoration: none;
  border: 1px solid var(--line); background: rgba(79, 240, 255, 0.06); color: var(--text);
}
.btn:active { background: rgba(79, 240, 255, 0.18); }
.btn.primary { background: var(--cyan); color: var(--cyan-ink); border-color: var(--cyan); box-shadow: 0 0 18px rgba(79, 240, 255,.4); }
.btn.danger { border-color: rgba(255,138,138,.5); color: var(--red); background: rgba(255,138,138,.06); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; }

/* ---------- Chat ---------- */
/* v1.11: el desvanecido superior solo aparece al desplazarse y es corto (antes 44 px fijos tapaban la primera línea) */
.chat { width: 100%; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.chat::before { content: ""; flex: 1; }
.chat.faded { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px); mask-image: linear-gradient(to bottom, transparent 0, #000 18px); }
.msg { display: flex; flex-direction: column; max-width: 86%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.bot { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 10px 14px; border-radius: 16px; font-family: var(--font-read); font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.msg.user .bubble { background: #1f3d5c; border: 1px solid rgba(79, 240, 255, 0.45); color: #f2fcff; border-bottom-right-radius: 4px; }
.msg.bot .bubble { background: var(--panel-2); border: 1px solid var(--line-soft); color: var(--text); border-bottom-left-radius: 4px; position: relative; }
.msg.bot .bubble::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); border-radius: 2px; }
.meta { margin: 4px 4px 0; font-family: var(--font-hud); font-size: 12px; letter-spacing: .6px; color: var(--dim); }
.memory-note {
  align-self: center; display: flex; align-items: center; gap: 8px; max-width: 96%;
  padding: 2px 2px 2px 12px; border-radius: 12px; font-size: 15px; color: var(--text);
  background: rgba(125, 255, 155, 0.07); border: 1px solid rgba(125, 255, 155, 0.28);
}
.memory-note svg { width: 18px; height: 18px; color: var(--ok); flex: none; }
.memory-note .txt { flex: 1; line-height: 1.3; }
.memory-note .txt b { color: var(--ok); font-weight: 600; }
.link-btn { min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--cyan-2); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.photo {
  width: 150px; height: 108px; border-radius: 12px; margin-bottom: 6px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #2f6d7a, #161e2f 70%); border: 1px solid rgba(79, 240, 255,.35);
}
.photo svg { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; color: #6fc3d4; opacity: .9; }
.photo .badge { position: absolute; left: 6px; bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: .5px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.72); color: #fff; }
.msg.user .bubble.has-photo { padding: 6px 6px 10px; }
.msg.user .bubble.has-photo .t { padding: 0 6px; }

.error-card { align-self: stretch; padding: 12px 14px; border-radius: 14px; background: #1f1708; border: 1px solid rgba(255, 196, 87, .5); }
.error-card h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: 18px; color: var(--amber); }
.error-card h3 svg { width: 20px; height: 20px; }
.error-card p { margin: 0 0 10px; font-family: var(--font-read); font-size: 15.5px; line-height: 1.45; color: #fff3dc; }
.error-card .btn { min-height: 44px; font-size: 16px; }
.error-card .btn.retry { border-color: rgba(255,196,87,.6); color: var(--amber); background: rgba(255,196,87,.08); }

/* ---------- Base: micrófono + entrada ---------- */
.dock { flex: none; padding: 6px 12px calc(var(--safe-b) + 10px); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mic-zone { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mic-big {
  width: 76px; height: 76px; border-radius: 50%; cursor: pointer; position: relative;
  display: grid; place-items: center; color: var(--cyan-2);
  background: radial-gradient(circle, #10182b, #080d17 70%);
  border: 2px solid var(--cyan); box-shadow: 0 0 22px rgba(79, 240, 255,.45), inset 0 0 16px rgba(79, 240, 255,.25);
}
.mic-big::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 1px dashed rgba(79, 240, 255,.45); animation: spin 24s linear infinite; }
.mic-big svg { width: 32px; height: 32px; }
.mic-big .ico-stop { display: none; }
.mic-hint { font-size: 15px; color: var(--muted); letter-spacing: .3px; min-height: 20px; }
.composer { width: 100%; display: flex; align-items: flex-end; gap: 8px; }
.pill { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px; padding: 3px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.pill:focus-within { border-color: var(--cyan); box-shadow: var(--glow); }
.pill textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent;
  font-family: var(--font-read); font-size: 16px; line-height: 22px; padding: 11px 4px; max-height: 120px; color: var(--text);
}
.pill textarea::placeholder { color: var(--dim); }
.pill .icon-btn { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); }
.send { width: 50px; height: 50px; flex: none; border-radius: 14px; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--cyan); color: var(--cyan-ink); box-shadow: 0 0 16px rgba(79, 240, 255,.45); }
.send svg { width: 24px; height: 24px; }
.send:disabled, .mic-big:disabled { cursor: not-allowed; }

/* ---------- Estados ---------- */
[data-estado] .only { display: none !important; }
[data-estado="reposo"] .only.reposo,
[data-estado="escuchando"] .only.escuchando,
[data-estado="hablando"] .only.hablando,
[data-estado="sinkey"] .only.sinkey,
[data-estado="error"] .only.error { display: revert !important; }
[data-estado="reposo"] .only.reposo.flex, [data-estado="escuchando"] .only.escuchando.flex,
[data-estado="hablando"] .only.hablando.flex, [data-estado="error"] .only.error.flex,
[data-estado="sinkey"] .only.sinkey.flex { display: flex !important; }

[data-estado="escuchando"] .reactor-wrap { --spd-1: 14s; --spd-2: 9s; --spd-3: 18s; --pulse: .9s; }
[data-estado="escuchando"] .ripple { animation: ripple 2.1s ease-out infinite; }
[data-estado="escuchando"] .ripple.r2 { animation-delay: .7s; }
[data-estado="escuchando"] .ripple.r3 { animation-delay: 1.4s; }
[data-estado="escuchando"] .mic-big { background: var(--cyan); color: var(--cyan-ink); box-shadow: 0 0 0 6px rgba(79, 240, 255,.18), 0 0 36px rgba(79, 240, 255,.8); }
[data-estado="escuchando"] .mic-hint { color: var(--cyan-2); }

[data-estado="hablando"] .reactor-wrap, [data-estado="error"] .reactor-wrap { width: 92px; height: 92px; --spd-1: 6s; --spd-2: 4s; --spd-3: 9s; --pulse: .6s; }
[data-estado="error"] .reactor-wrap { --spd-1: 40s; --spd-2: 28s; --spd-3: 60s; --pulse: 3.2s; }
[data-estado="hablando"] .stage-center, [data-estado="error"] .stage-center { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 6px 18px 2px; }
[data-estado="hablando"] .mic-big { border-color: var(--red); color: var(--red); box-shadow: 0 0 22px rgba(255,138,138,.35), inset 0 0 16px rgba(255,138,138,.2); background: radial-gradient(circle, #2a1015, #12080a 70%); }
[data-estado="hablando"] .mic-big::before { border-color: rgba(255,138,138,.45); }
[data-estado="hablando"] .mic-big .ico-mic { display: none; }
[data-estado="hablando"] .mic-big .ico-stop { display: block; }
[data-estado="hablando"] .mic-hint { color: var(--red); font-weight: 600; }

[data-estado="sinkey"] .app .reactor-wrap { width: 96px; height: 96px; opacity: .55; filter: saturate(.35); --spd-1: 0s; --pulse: 5s; }
[data-estado="sinkey"] .app .reactor .spin, [data-estado="sinkey"] .app .reactor .spin-rev, [data-estado="sinkey"] .app .reactor .coil { animation: none; }
[data-estado="sinkey"] .mic-zone { display: none; }
[data-estado="sinkey"] .dock { padding-top: 10px; }
.setup-card .more { display: block; margin-top: 12px; text-align: center; font-family: var(--font-read); font-size: 15px; color: var(--muted); }
.setup-card .more a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
[data-estado="sinkey"] .mic-big::before { animation: none; }
[data-estado="sinkey"] .send { background: #1a3150; color: var(--muted); box-shadow: none; }

.side-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.side-info .state-label { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; }
}

/* ---------- Configuración ---------- */
.topbar h1.page-title { flex: 1; margin: 0; font-family: var(--font-hud); font-size: 17px; font-weight: 700; letter-spacing: 3px; color: var(--text); text-shadow: 0 0 10px rgba(79, 240, 255,.5); }
.settings-scroll > * { flex-shrink: 0; }
.settings-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px;
  box-shadow: inset 0 0 24px rgba(79, 240, 255, 0.05);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.panel h2 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-family: var(--font-hud); font-size: 12px; font-weight: 600; letter-spacing: 2px; color: var(--cyan-2); }
.panel h2::before { content: ""; width: 6px; height: 6px; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); transform: rotate(45deg); }
.field-label { display: block; margin: 10px 0 6px; font-size: 16px; color: var(--text); }
.hint { margin: 6px 0 0; font-family: var(--font-read); font-size: 14px; line-height: 1.4; color: var(--muted); }
.field {
  width: 100%; min-height: 48px; padding: 12px; border-radius: 12px; outline: none;
  font-family: var(--font-read); font-size: 16px; color: var(--text);
  background: #060b19; border: 1px solid rgba(79, 240, 255, 0.35);
}
.field::placeholder { color: var(--dim); }
.field:focus { border-color: var(--cyan); box-shadow: var(--glow); }
textarea.field { min-height: 92px; resize: vertical; line-height: 1.4; }
select.field { appearance: none; -webkit-appearance: none; padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, var(--cyan-2) 50%), linear-gradient(135deg, var(--cyan-2) 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
.key-field { position: relative; }
.key-field .field { padding-right: 52px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 1px; }
.key-field .icon-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: transparent; }
.status-box { margin-top: 10px; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 12px; font-size: 15.5px; background: rgba(125, 255, 155,.07); border: 1px solid rgba(125, 255, 155,.3); color: var(--text); }
.status-box svg { width: 18px; height: 18px; color: var(--ok); flex: none; }
.status-box.pending { background: rgba(255,196,87,.07); border-color: rgba(255,196,87,.4); }
.status-box.pending svg { color: var(--amber); }
.status-box .tag { margin-left: auto; }
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; cursor: pointer; }
.switch-row + .switch-row, .panel .switch-row.sep { border-top: 1px solid var(--line-soft); }
.switch-row .txt { flex: 1; font-size: 17px; line-height: 1.25; }
.switch-row .txt small { display: block; margin-top: 2px; font-family: var(--font-read); font-size: 13.5px; color: var(--muted); }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 52px; height: 32px; margin: 0; border-radius: 16px; cursor: pointer;
  background: #12203a; border: 1px solid rgba(159, 180, 200, 0.55); transition: background .2s, border-color .2s; }
.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch:checked { background: rgba(79, 240, 255, 0.25); border-color: var(--cyan); box-shadow: var(--glow); }
.switch:checked::before { transform: translateX(20px); background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.facts { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.facts li { display: flex; align-items: center; gap: 6px; padding: 2px 2px 2px 12px; min-height: 48px; border-radius: 12px; background: #0f1a33; border: 1px solid var(--line-soft); font-family: var(--font-read); font-size: 15.5px; }
.facts li span { flex: 1; }
.facts li .icon-btn { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.meter { margin-top: 12px; }
.meter .row { display: flex; justify-content: space-between; font-size: 15px; color: var(--muted); }
.meter .row b { color: var(--text); font-weight: 600; }
.meter .bar { margin-top: 6px; height: 8px; border-radius: 4px; background: #12203a; overflow: hidden; border: 1px solid var(--line-soft); }
.meter .bar i { display: block; height: 100%; width: 8%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.danger-zone { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.foot { margin: 4px 0 8px; text-align: center; font-family: var(--font-read); font-size: 13.5px; color: var(--muted); }
.save-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px calc(var(--safe-b) + 10px); background: rgba(3, 8, 13, 0.94); border-top: 1px solid var(--line); }
.save-bar .unsaved { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 15.5px; color: var(--amber); }
.save-bar .unsaved .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.save-bar .btn { min-width: 150px; min-height: 50px; }

.stop-pill { min-height: 52px; min-width: 240px; padding: 0 22px; margin: 4px 0 2px; border-radius: 26px; cursor: pointer;
  align-items: center; justify-content: center; gap: 10px; font-family: var(--font-ui); font-size: 18px; font-weight: 600; letter-spacing: .5px;
  color: var(--red); background: rgba(255, 138, 138, 0.08); border: 1.5px solid var(--red); box-shadow: 0 0 18px rgba(255, 138, 138, .3); }
.stop-pill svg { width: 20px; height: 20px; animation: pulse 1.2s ease-in-out infinite; }
[data-estado="hablando"] .mic-zone { display: none; }


/* ===================== App real (v1.4) ===================== */
body[data-estado] .only[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; z-index: 1; }
.topbar .icon-btn + .icon-btn { margin-left: -4px; }
#toggle-chat[aria-pressed="true"] { background: rgba(79, 240, 255, 0.18); border-color: var(--line); }

/* HUD: si no hay clima, dos columnas */
.hud.no-weather { grid-template-columns: 1.2fr 1fr; }
.hud.no-weather > #conn-cell { border-left: 1px solid var(--line-soft); }
.hud-val .unit { font-size: 12px; color: var(--muted); }
#conn-cell.off .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
#conn-cell.off .hud-val { color: var(--red); }

/* Diseño compacto: reactor pequeño + conversación */
.chat { display: none; }
body.compact .chat { display: flex; }
body.compact .stage-center { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 6px 18px 2px; overflow: visible; }
body.compact .reactor-wrap { width: 92px; height: 92px; }
body.compact[data-estado] .home-only.only { display: none !important; }
body.compact[data-estado="reposo"] .reactor-wrap { --spd-1: 40s; --spd-2: 28s; --spd-3: 60s; --pulse: 3.2s; }
body.compact[data-estado="reposo"] .mic-big { width: 60px; height: 60px; }
body.compact[data-estado="reposo"] .mic-big svg { width: 26px; height: 26px; }
body.compact[data-estado="reposo"] .mic-hint { display: none; }
[data-estado="escuchando"] .chat { display: none !important; }
[data-estado="escuchando"] .stage-center { flex: 1 !important; flex-direction: column !important; justify-content: safe center !important; }
[data-estado="escuchando"] .reactor-wrap { width: 210px !important; height: 210px !important; }
.side-hint { text-align: left; }
.state-label.warn { color: var(--amber); text-shadow: none; }
.greeting strong { font-weight: 600; }
.interim .q:empty::before { content: "Escuchando…"; color: var(--muted); }
#open-chat { margin-top: 4px; }

/* Burbujas */
.msg.bot .bubble.streaming::after { content: ""; display: inline-block; width: 2px; height: 1.05em; vertical-align: -2px; background: var(--cyan); margin-left: 2px; box-shadow: 0 0 6px var(--cyan); animation: caret 1s steps(1) infinite; }
.msg .bubble a { color: var(--cyan-2); }
.sources { margin: 6px 2px 0; display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.sources a { display: inline-flex; align-items: center; min-height: 32px; padding: 2px 10px; border-radius: 10px; font-size: 14px; color: var(--cyan-2); text-decoration: none;
  background: rgba(79, 240, 255, 0.06); border: 1px solid var(--line-soft); max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-read); }
.msg.user .bubble.has-media { padding: 6px 6px 10px; }
.msg.user .bubble.has-media.media-only { padding: 6px; }
.msg.user .bubble.has-media .t { padding: 0 6px; display: block; }
.bubble-media { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-bottom: 6px; max-width: 240px; }
.bubble-media.single { grid-template-columns: 1fr; }
.media-only .bubble-media { margin-bottom: 0; }
.media-item { position: relative; border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, 0.3); min-height: 60px; border: 1px solid rgba(79, 240, 255,.35); }
.media-item img, .media-item video { width: 100%; display: block; max-height: 260px; object-fit: cover; }
.bubble-media:not(.single) .media-item img, .bubble-media:not(.single) .media-item video { height: 110px; }
.media-item .ph { display: grid; place-items: center; height: 70px; font-size: 14px; color: var(--muted); }
.badge { position: absolute; left: 6px; bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: .5px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.72); color: #fff; }
.memory-note.undone { background: rgba(159, 180, 200, 0.06); border-color: var(--line-soft); }
.memory-note.warn { background: #1f1708; border-color: rgba(255, 196, 87, .5); }
.memory-note.warn svg { color: var(--amber); }
.error-card .btn:disabled { opacity: .75; cursor: not-allowed; }
.confirm-card { align-self: stretch; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); font-family: var(--font-read); font-size: 15.5px; }
.confirm-card p { margin: 0 0 10px; line-height: 1.45; }

/* Adjuntos */
.attachments { width: 100%; display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; }
.att { position: relative; flex: none; width: 68px; height: 68px; border-radius: 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att.loading::after { content: "…"; font-size: 20px; color: var(--cyan-2); }
.att .rm { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; padding: 0; background: transparent; cursor: pointer; display: grid; place-items: start end; }
.att .rm span { display: grid; place-items: center; width: 24px; height: 24px; margin: 3px; border-radius: 50%; background: rgba(0,0,0,.75); color: #fff; font-size: 16px; line-height: 1; }
.att .badge { left: 3px; bottom: 3px; font-size: 11px; }
.attach-menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 20; min-width: 230px; padding: 6px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.6), var(--glow); }
.attach-menu button { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 17px; font-weight: 600; text-align: left; cursor: pointer; }
.attach-menu button:active, .attach-menu button:focus-visible { background: rgba(79, 240, 255,.12); }
.attach-menu svg { width: 22px; height: 22px; color: var(--cyan-2); flex: none; }
.composer { position: relative; }
#attach-btn[aria-expanded="true"] { color: var(--cyan-2); }
.send:disabled { background: #1a3150; color: var(--muted); box-shadow: none; }
.mic-big:disabled { opacity: .5; }

/* Configuración */
.status-box .ico-warn { display: none; }
.status-box.pending .ico-ok, .status-box.err .ico-ok { display: none; }
.status-box.pending .ico-warn, .status-box.err .ico-warn { display: block; }
.status-box.err { background: rgba(255,138,138,.07); border-color: rgba(255,138,138,.45); }
.status-box.err svg { color: var(--red); }
.status-box .link-btn { margin-left: auto; }
.status-box #conn-status-text { flex: 1; }
.facts li .icon-btn { min-width: 44px; }
.facts:empty { display: none; }
.meter .bar i { width: 0; transition: width .3s; }
.meter.high .bar i { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.save-bar .saved-msg { flex: 1; font-size: 15.5px; color: var(--ok); }
.save-bar .saved-msg.err { color: var(--red); }
.save-bar .saved-msg:empty { display: none; }
.save-bar .unsaved:not([hidden]) ~ .saved-msg { display: none; }
.save-bar .btn:disabled { opacity: .55; box-shadow: none; cursor: default; }
.ajustes .settings-scroll { scroll-padding-top: 12px; }

/* Diálogo */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgba(0, 4, 8, 0.78); }
.modal-card { width: 100%; max-width: 420px; max-height: 82%; display: flex; flex-direction: column; gap: 10px; padding: 16px; outline: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.6), var(--glow);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); }
.modal-card h2 { margin: 0; font-family: var(--font-hud); font-size: 14px; letter-spacing: 2px; color: var(--cyan-2); }
.modal-body { margin: 0; flex: 1; min-height: 60px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.45; color: var(--text);
  background: #060b19; border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px; }

/* Aviso de actualización */
.toast { position: fixed; z-index: 55; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 10px); width: calc(100% - 24px); max-width: 416px;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; font-size: 16.5px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--cyan); box-shadow: 0 10px 30px rgba(0,0,0,.6), var(--glow); }
.toast span { flex: 1; }
.toast .btn { min-height: 44px; }
.toast .icon-btn { width: 44px; height: 44px; font-size: 22px; }
/* Teclado abierto: se esconden HUD y micrófono para dejar lugar a la conversación */
body.kb-open .hud, body.kb-open .mic-zone { display: none !important; }
body.kb-open .reactor-wrap { width: 72px !important; height: 72px !important; }
body.kb-open .stage-center { flex: none !important; flex-direction: row !important; justify-content: flex-start !important; padding: 4px 18px 0 !important; }
body.kb-open .chat { display: flex; }
body.kb-open[data-estado] .home-only.only, body.kb-open .setup-card .steps { display: none !important; }
.save-bar .btn { margin-left: auto; }
.state-label { white-space: nowrap; }

/* ---------- Pantalla de bloqueo (v1.5) ---------- */
body.booting #app { visibility: hidden; }
.lock-screen {
  position: fixed; inset: 0 0 auto 0; height: var(--app-h); max-width: 440px; margin: 0 auto; z-index: 40;
  display: flex; flex-direction: column;
  background:
    radial-gradient(520px 380px at 50% 30%, rgba(79, 240, 255, 0.10), transparent 70%),
    linear-gradient(rgba(79, 240, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(79, 240, 255, 0.035) 1px, transparent 1px) 0 0 / 28px 100%,
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
}
.lock { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center;
  padding: calc(var(--safe-t) + 18px) 20px calc(var(--safe-b) + 14px); gap: 0; }
.lock-screen .reactor-wrap { position: relative; flex: none; width: 108px !important; height: 108px !important; --spd-1: 60s; --spd-2: 40s; --spd-3: 90s; --pulse: 4s; }
.lock-badge { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.lock-badge svg { width: 30px; height: 30px; color: #06112a; filter: drop-shadow(0 0 2px #fff); }
.lock h1 { margin: 14px 0 4px; font-family: var(--font-hud); font-size: 19px; font-weight: 700; letter-spacing: 3px; text-align: center; color: var(--text); text-shadow: 0 0 10px rgba(79, 240, 255,.55); outline: none; }
.lock .sub { margin: 0; font-family: var(--font-read); font-size: 17px; color: var(--muted); text-align: center; }
.pin-dots { display: flex; gap: 16px; margin: 20px 0 6px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--cyan); transition: background .15s, box-shadow .15s; }
.pin-dots i.on { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.lock-msg { min-height: 26px; margin: 4px 0 10px; font-size: 17px; font-weight: 600; text-align: center; color: var(--muted); }
[data-lock="error"] .pin-dots i { border-color: var(--red); }
[data-lock="error"] .pin-dots i.on { background: var(--red); box-shadow: 0 0 10px var(--red); }
[data-lock="error"] .pin-dots { animation: shake .4s ease-in-out; }
[data-lock="error"] .lock-msg { color: var(--red); }
[data-lock="espera"] .lock-msg { color: var(--amber); }
[data-lock="espera"] .pin-dots i { border-color: rgba(159, 180, 200,.45); }
[data-lock="espera"] .reactor-wrap { filter: saturate(.3); opacity: .6; }
[data-lock="ok"] .lock-msg { color: var(--ok); }
[data-lock="trabajando"] .pin-dots i { animation: pulse 1s ease-in-out infinite; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px 30px; justify-content: center; }
.key {
  width: 76px; height: 76px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; align-content: center;
  font-family: var(--font-ui); font-size: 34px; font-weight: 600; line-height: 1; color: var(--text);
  background: radial-gradient(circle at 50% 35%, #131b2e, #0a101d 70%); border: 1px solid rgba(79, 240, 255, 0.38);
  box-shadow: inset 0 0 14px rgba(79, 240, 255,.10); transition: background .1s, box-shadow .1s;
}
.key small { font-family: var(--font-ui); font-size: 11px; letter-spacing: 2px; color: var(--muted); margin-top: 1px; }
.key:active { background: rgba(79, 240, 255, 0.28); box-shadow: 0 0 18px rgba(79, 240, 255,.6); }
.key.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--cyan-2); }
.key.ghost svg { width: 30px; height: 30px; }
.key.ghost.off { visibility: hidden; }
.key:disabled { cursor: not-allowed; color: var(--dim); border: 1px dashed rgba(134,174,189,.35); background: transparent; box-shadow: none; }
.key:disabled small { color: var(--dim); }
.key.ghost:disabled { background: transparent; border-color: transparent; }
.bio-btn { margin-top: 16px; min-width: 260px; }
.bio-note { margin: 6px 0 0; max-width: 320px; font-family: var(--font-read); font-size: 13.5px; color: var(--muted); text-align: center; }
.lock-links { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.countdown { font-variant-numeric: tabular-nums; }
/* v1.9.1: frase segura y paso «Confirmar con Face ID / huella» */
.phrase-form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; margin: 20px 0 6px; }
.phrase-row { position: relative; }
.phrase-row .field { width: 100%; min-height: 52px; padding-right: 52px; font-size: 18px; color: var(--text); -webkit-text-fill-color: var(--text); }
.phrase-row .icon-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; background: transparent; color: var(--muted); }
.phrase-row .icon-btn svg { width: 24px; height: 24px; }
.phrase-row .icon-btn[aria-pressed="true"] { color: var(--cyan); }
.phrase-form .btn { min-height: 48px; }
[data-lock="error"] .phrase-row { animation: shake .4s ease-in-out; }
[data-lock="error"] .phrase-row .field { border-color: var(--red); }
[data-lock="factor"] .keypad, [data-lock="factor"] .pin-dots, [data-lock="factor"] .phrase-form { display: none !important; }
[data-lock="factor"] .bio-btn { margin-top: 26px; }
@media (max-height: 700px) {
  .lock-screen .reactor-wrap { width: 72px !important; height: 72px !important; }
  .keypad { grid-template-columns: repeat(3, 68px); gap: 10px 26px; }
  .key { width: 68px; height: 68px; font-size: 30px; }
}

/* Seguridad en Configuración */
.sec-status { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; margin-top: 4px; border-radius: 12px; background: rgba(255,196,87,.06); border: 1px solid rgba(255,196,87,.35); }
.sec-status.on { background: rgba(125, 255, 155,.07); border-color: rgba(125, 255, 155,.3); }
.sec-status svg { width: 22px; height: 22px; color: var(--amber); flex: none; }
.sec-status.on svg { color: var(--ok); }
.sec-status .ico-on, .sec-status.on .ico-off { display: none; }
.sec-status.on .ico-on { display: block; }
.sec-status .t { flex: 1; font-size: 16.5px; line-height: 1.25; }
.sec-status .t small { display: block; font-family: var(--font-read); font-size: 13.5px; color: var(--muted); }
.sec-status .tag { font-size: 11.5px; letter-spacing: .5px; color: var(--amber); border: 1px solid rgba(255,196,87,.45); border-radius: 6px; padding: 0 5px; font-family: var(--font-ui); }

/* ===================== Paneles v1.6 ===================== */
.quickbar { display: flex; gap: 8px; margin: 8px 12px 0; }
.quickbar button {
  flex: 1; min-height: 44px; padding: 6px 8px; border-radius: 12px; cursor: pointer;
  font-family: var(--font-ui); font-size: 15px; font-weight: 600; color: var(--cyan-2);
  background: rgba(79, 240, 255,.06); border: 1px solid var(--line-soft);
}
.quickbar button:active { background: rgba(79, 240, 255,.18); }
.panel-tabs { flex: none; display: flex; gap: 6px; padding: 2px 2px 0; }
.panel-tab {
  flex: 1; min-height: 44px; border-radius: 12px; cursor: pointer;
  font-family: var(--font-ui); font-size: 16px; font-weight: 600; color: var(--muted);
  background: transparent; border: 1px solid var(--line-soft);
}
.panel-tab.on { color: var(--cyan-ink); background: var(--cyan); border-color: var(--cyan); }
.panel-body { display: flex; flex-direction: column; gap: 12px; }
.add-form { display: flex; flex-direction: column; gap: 8px; }
.form-row { display: flex; gap: 8px; }
.form-row .field { flex: 1; min-width: 0; }
.perm-box, .suggest-box, .digest-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.perm-box p, .suggest-box p { margin: 0 0 10px; font-family: var(--font-read); font-size: 15.5px; line-height: 1.4; color: var(--text); }
.panel-note { margin: 0; }
.empty-note { margin: 4px 0; font-family: var(--font-read); font-size: 15.5px; color: var(--muted); text-align: center; }
.store-h { margin: 4px 0 0; font-family: var(--font-hud); font-size: 12px; letter-spacing: 1.5px; color: var(--cyan-2); }
.item-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item-row {
  display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px;
}
.item-row.done .item-main strong { text-decoration: line-through; color: var(--muted); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-main strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.item-main small, .news-list small { font-family: var(--font-read); font-size: 13.5px; color: var(--muted); }
.item-actions { display: flex; gap: 4px; flex: none; }
.mini-btn {
  min-height: 44px; padding: 0 10px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--text);
  background: rgba(79, 240, 255,.06); border: 1px solid var(--line-soft);
}
.mini-btn.danger { color: var(--red); border-color: rgba(255,138,138,.45); }
.check-btn {
  width: 44px; height: 44px; flex: none; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1.5px solid var(--cyan); position: relative;
}
.check-btn[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 14px; top: 8px; width: 10px; height: 18px;
  border: solid var(--cyan); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.digest-card h3 { margin: 10px 0 2px; font-family: var(--font-hud); font-size: 12px; letter-spacing: 1.5px; color: var(--cyan-2); }
.digest-card h3:first-of-type { margin-top: 8px; }
.digest-card p { margin: 0; font-family: var(--font-read); font-size: 15.5px; line-height: 1.45; }
.news-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.news-list li { display: flex; flex-direction: column; }
.news-list a { color: var(--cyan-2); font-size: 15.5px; line-height: 1.35; }
.bubble a { color: var(--cyan-2); }
.pdf-chip {
  display: flex; align-items: flex-end; justify-content: flex-start; width: 100%; height: 100%; min-height: 60px;
  padding: 22px 6px 6px; box-sizing: border-box; font-family: var(--font-read); font-size: 11.5px; line-height: 1.2;
  color: var(--text); overflow: hidden; overflow-wrap: anywhere;
  background: linear-gradient(180deg, rgba(255,138,138,.18), transparent 60%);
}
.pdf-chip::before { content: "PDF"; position: absolute; top: 5px; left: 6px; font-family: var(--font-hud); font-size: 10px; letter-spacing: 1px; color: var(--red); }
.bubble-media .media-item .pdf-chip { min-width: 150px; min-height: 64px; font-size: 14px; padding-top: 24px; position: relative; }
.bubble-media .media-item .pdf-chip::before { top: 6px; }
.bubble { white-space: pre-line; }
.add-form.editing { padding: 10px; border: 1px solid var(--cyan); border-radius: 14px; box-shadow: var(--glow); }

/* ===================== Herramientas de trabajo v1.7 ===================== */
.quickbar { flex-direction: column; gap: 6px; }
.quickbar .qrow { display: flex; gap: 6px; }
.quickbar .qrow.work button { font-size: 14px; color: var(--amber); border-color: rgba(255,196,87,.28); background: rgba(255,196,87,.05); }
.panel-groups { flex: none; display: flex; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.panel-groups .seg { flex: 1; min-height: 44px; border: 0; cursor: pointer; background: transparent; color: var(--muted);
  font-family: var(--font-hud); font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.panel-groups .seg.on { background: rgba(79, 240, 255,.16); color: var(--cyan-2); box-shadow: inset 0 -2px 0 var(--cyan); }
.panel-groups .seg[data-group="trabajo"].on { background: rgba(255,196,87,.12); color: var(--amber); box-shadow: inset 0 -2px 0 var(--amber); }
.panel-tabs.four .panel-tab { font-size: 15px; padding: 0 4px; }
.wp-status { margin: 0; min-height: 1.2em; font-family: var(--font-read); font-size: 14.5px; color: var(--ok); }
.wp-status:empty { display: none; }
.warn-box { border-color: rgba(255,196,87,.5); }
.warn-box p { color: var(--amber); margin: 0; }
.btn-row.wrap { flex-wrap: wrap; }
.btn-row.wrap > .btn { flex: 1 1 140px; }
.kpis { display: flex; gap: 8px; }
.kpis > div { flex: 1; display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(79, 240, 255,.04); }
.kpis b { font-family: var(--font-hud); font-size: 17px; color: var(--text); text-shadow: 0 0 8px rgba(79, 240, 255,.5); }
.route-list { margin: 4px 0 0; padding-left: 26px; display: flex; flex-direction: column; gap: 6px; font-family: var(--font-read); font-size: 15.5px; }
.route-list li::marker { color: var(--cyan-2); font-family: var(--font-hud); font-size: 13px; }
.route-list small { display: block; color: var(--muted); font-size: 13px; }
.route-card details { margin-top: 8px; }
.route-card summary, .sub-form summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--cyan-2); font-size: 16px; }
.legs { margin: 4px 0; padding-left: 18px; font-family: var(--font-read); font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.sub-form { border: 1px dashed var(--line-soft); border-radius: 12px; padding: 0 12px 10px; }
.form-row.three .field { min-width: 0; }
.chip { flex: none; min-width: 64px; text-align: center; padding: 4px 8px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid; }
.chip.cabe { color: var(--ok); border-color: rgba(125, 255, 155,.45); }
.chip.parcial { color: var(--amber); border-color: rgba(255,196,87,.5); }
.chip.no { color: var(--red); border-color: rgba(255,138,138,.5); }
.meter .bar i.over { background: var(--red); box-shadow: 0 0 8px var(--red); }
.mini-btn.status-planificada { color: var(--muted); }
.mini-btn.status-en-curso { color: var(--amber); border-color: rgba(255,196,87,.5); }
.mini-btn.status-cerrada { color: var(--ok); border-color: rgba(125, 255, 155,.45); }
.log-row .item-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 190px; }
.mail-partial { white-space: pre-line; font-family: var(--font-read); font-size: 15px; color: var(--muted); }
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-actions .mini-btn { color: var(--cyan-2); }
#ml-body { min-height: 220px; line-height: 1.45; }

/* ===================== v1.8: modos, ocio, robótica ===================== */
/* Botones de modo bajo el HUD */
.mode-row { display: flex; gap: 8px; margin: 8px 12px 0; flex: none; }
.mode-btn {
  flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 10px;
  border-radius: 12px; cursor: pointer; font-family: var(--font-ui); font-size: 15px; font-weight: 600;
  color: var(--muted); background: rgba(79, 240, 255,.03); border: 1px solid var(--line-soft); min-width: 0;
}
.mode-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-btn svg { width: 22px; height: 22px; flex: none; }
.mode-btn[aria-pressed="true"] { color: var(--cyan-2); border-color: var(--line); background: rgba(79, 240, 255,.1); }
#drive-btn[aria-pressed="true"] { color: var(--amber); border-color: rgba(255,196,87,.55); background: rgba(255,196,87,.1); }
.wake-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1.5px solid currentColor; }
#wake-btn[data-state="listening"] .wake-dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 10px var(--ok); animation: wakePulse 1.6s ease-in-out infinite; }
#wake-btn[data-state="listening"] { color: var(--ok); border-color: rgba(125, 255, 155,.5); background: rgba(125, 255, 155,.08); }
#wake-btn[data-state="command"] { color: var(--cyan-ink); background: var(--cyan); border-color: var(--cyan); }
#wake-btn[data-state="command"] .wake-dot { background: var(--cyan-ink); border-color: var(--cyan-ink); animation: wakePulse .7s ease-in-out infinite; }
#wake-btn[data-state="paused"] .wake-dot, #wake-btn[data-state="idle"] .wake-dot { background: var(--amber); border-color: var(--amber); }
#wake-btn[data-state="idle"] { color: var(--amber); border-color: rgba(255,196,87,.5); }
@keyframes wakePulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { #wake-btn .wake-dot { animation: none !important; } }
body.kb-open .mode-row { display: none; }

.quickbar .qrow.ocio button { font-size: 14px; color: var(--ok); border-color: rgba(125, 255, 155,.26); background: rgba(125, 255, 155,.05); }

/* Chip del modo tutor */
.tutor-chip { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 12px;
  border: 1px solid rgba(125, 255, 155,.45); background: rgba(125, 255, 155,.07); font-family: var(--font-read); font-size: 14px; color: var(--text); }
.tutor-chip span { flex: 1; min-width: 0; }
.tutor-chip b { color: var(--ok); }
.tutor-chip[hidden] { display: none; }
body.tutor .pill { border-color: rgba(125, 255, 155,.5); }

/* Modo conducción: botones grandes y lo mínimo en pantalla */
body.driving[data-estado] .quickbar.only, body.driving #weather-cell, body.driving .hud-sub, body.driving #attach-btn,
body.driving[data-estado] .greeting.only, body.driving[data-estado] #open-chat.only { display: none !important; }
body.driving .mode-btn { min-height: 60px; font-size: 18px; }
body.driving .mic-big { width: 116px; height: 116px; }
body.driving .mic-big svg { width: 46px; height: 46px; }
body.driving.compact[data-estado="reposo"] .mic-big { width: 96px; height: 96px; }
body.driving.compact[data-estado="reposo"] .mic-big svg { width: 40px; height: 40px; }
body.driving .mic-hint { font-size: 18px; display: block !important; }
body.driving .stop-pill { min-height: 60px; font-size: 19px; padding: 0 26px; }
body.driving .send { width: 56px; height: 56px; }
body.driving .bubble { font-size: 20px; line-height: 1.45; }
body.driving .state-label { font-size: 18px; }
body.driving .hud-big { font-size: 28px; }

/* Tamaño de letra */
html[data-fs="2"] .bubble { font-size: 18.5px; }
html[data-fs="3"] .bubble { font-size: 21px; }
html[data-fs="2"] .field, html[data-fs="2"] #msg-input { font-size: 18px; }
html[data-fs="3"] .field, html[data-fs="3"] #msg-input { font-size: 20px; }
html[data-fs="2"] .btn, html[data-fs="2"] .panel-tab, html[data-fs="2"] .quickbar button, html[data-fs="2"] .mode-btn, html[data-fs="2"] .opt, html[data-fs="2"] .pick { font-size: 17.5px; }
html[data-fs="3"] .btn, html[data-fs="3"] .panel-tab, html[data-fs="3"] .quickbar button, html[data-fs="3"] .mode-btn, html[data-fs="3"] .opt, html[data-fs="3"] .pick { font-size: 19.5px; }
html[data-fs="2"] .hint, html[data-fs="2"] .item-main small, html[data-fs="2"] .switch-row small, html[data-fs="2"] .rb-step small { font-size: 16px; }
html[data-fs="3"] .hint, html[data-fs="3"] .item-main small, html[data-fs="3"] .switch-row small, html[data-fs="3"] .rb-step small { font-size: 18px; }
html[data-fs="2"] .item-main strong, html[data-fs="2"] .switch-row .txt, html[data-fs="2"] .rb-step b, html[data-fs="2"] .tv-q, html[data-fs="2"] .greeting { font-size: 19px; }
html[data-fs="3"] .item-main strong, html[data-fs="3"] .switch-row .txt, html[data-fs="3"] .rb-step b, html[data-fs="3"] .tv-q, html[data-fs="3"] .greeting { font-size: 22px; }
html[data-fs="2"] .msg-actions .mini-btn, html[data-fs="2"] .sources a, html[data-fs="2"] .meta { font-size: 16px; }
html[data-fs="3"] .msg-actions .mini-btn, html[data-fs="3"] .sources a, html[data-fs="3"] .meta { font-size: 18px; }

/* Grupos de paneles con 3 segmentos */
.panel-groups .seg { letter-spacing: 1px; padding: 0 4px; }
.panel-groups .seg[data-group="ocio"].on { background: rgba(125, 255, 155,.1); color: var(--ok); box-shadow: inset 0 -2px 0 var(--ok); }
.panel-tabs.ocio .panel-tab { font-size: 15px; padding: 0 4px; }

/* Botones de elección (dificultad, tema) */
.picks, .seg-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { min-height: 44px; padding: 0 14px; border-radius: 22px; cursor: pointer; font-family: var(--font-ui); font-size: 15px; font-weight: 600;
  color: var(--muted); background: transparent; border: 1px solid var(--line-soft); }
.pick.on { color: var(--cyan-ink); background: var(--cyan); border-color: var(--cyan); }

/* Damas internacionales */
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cc-score { margin: 0; font-family: var(--font-hud); font-size: 13px; letter-spacing: 1px; color: var(--muted); }
.cc-status { margin: 0; min-height: 1.4em; font-family: var(--font-read); font-size: 16px; color: var(--text); }
.cc-status.done { color: var(--ok); font-weight: 600; }
.cc-wrap { display: flex; justify-content: center; }
.dr-turn { display: flex; gap: 8px; flex-wrap: wrap; }
.turn-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 16px; border: 1px solid var(--line-soft); font-family: var(--font-read); font-size: 14px; color: var(--muted); }
.turn-chip i { width: 12px; height: 12px; border-radius: 50%; }
.turn-chip.p1 i { background: radial-gradient(circle at 35% 35%, #fff2b0, #e2ad2b 60%, #9a6c0e); }
.turn-chip.p2 i { background: radial-gradient(circle at 35% 35%, #b07a4d, #6b3b1c 60%, #3d1e0b); }
.turn-chip.on { color: var(--text); border-color: var(--cyan); box-shadow: var(--glow); }
.dr-board { width: 100%; max-width: 460px; height: auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.55); }
.dr-board .frame { fill: #8a5a2e; }
.dr-board .sq.lt { fill: #f1d9a8; }
.dr-board .sq.dk { fill: #b5824f; }
.dr-board .sq.last { fill: #9c6c3c; }
.dr-board .sq.dest { fill: #528e9a; }
.dr-board .d-dot { fill: rgba(255,255,255,.85); pointer-events: none; }
.dr-board .d-path { fill: none; stroke-width: .07; stroke-dasharray: .2 .12; opacity: .85; pointer-events: none; }
.dr-board .d-path.p1 { stroke: #ffe27a; } .dr-board .d-path.p2 { stroke: #4a250e; }
.dr-board .pc { cursor: pointer; }
.dr-board .pc .rim { stroke: rgba(0,0,0,.45); stroke-width: .03; }
.dr-board .pc.p1 .rim { fill: #b9850f; } .dr-board .pc.p1 .top { fill: #f2c335; } .dr-board .pc.p1 .ring { fill: none; stroke: #c99613; stroke-width: .035; }
.dr-board .pc.p2 .rim { fill: #3f1f0b; } .dr-board .pc.p2 .top { fill: #7a4321; } .dr-board .pc.p2 .ring { fill: none; stroke: #5a2e12; stroke-width: .035; }
.dr-board .pc .crown { fill: #fff6d0; stroke: #6b4a00; stroke-width: .02; }
.dr-board .pc.p2 .crown { fill: #f2c335; stroke: #3f1f0b; }
.dr-board .pc.can .rim { stroke: #fff; stroke-width: .05; }
.dr-board .pc.sel .rim { stroke: #4ff0ff; stroke-width: .08; filter: drop-shadow(0 0 .08px #4ff0ff); }
.dr-board .pc.moving { animation: dr-move .35s ease-out; }
.dr-board .pc.ghost { pointer-events: none; animation: dr-gone .5s ease-in forwards; }
@keyframes dr-move { from { transform: translate(var(--dx), var(--dy)); } to { transform: none; } }
@keyframes dr-gone { from { opacity: 1; } to { opacity: 0; transform: scale(.6); transform-origin: center; transform-box: fill-box; } }
@media (prefers-reduced-motion: reduce) { .dr-board .pc.moving, .dr-board .pc.ghost { animation: none; } .dr-board .pc.ghost { opacity: 0; } }
.cc-legend { margin: 0; font-family: var(--font-read); font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.cc-legend .dot { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 0; vertical-align: -1px; box-shadow: none; }
.cc-legend .dot.p1 { background: var(--cyan); }
.cc-legend .dot.p2 { background: var(--amber); }
.howto { border: 1px solid var(--line-soft); border-radius: 12px; padding: 0 12px; }
.howto summary, .rb-level summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--cyan-2); list-style: none; }
.howto summary::-webkit-details-marker, .rb-level summary::-webkit-details-marker { display: none; }
.howto p { margin: 0 0 10px; font-family: var(--font-read); font-size: 14.5px; line-height: 1.45; color: var(--text); }

/* Trivia */
.kpis b small { font-size: 12px; color: var(--muted); font-weight: 500; }
.trivia-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); }
.tv-topic { margin: 0; font-family: var(--font-hud); font-size: 11px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.tv-q { margin: 0; font-family: var(--font-read); font-size: 17.5px; line-height: 1.4; color: var(--text); font-weight: 600; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; text-align: left; border-radius: 12px; cursor: pointer;
  font-family: var(--font-read); font-size: 16px; color: var(--text); background: rgba(79, 240, 255,.04); border: 1px solid var(--line-soft); }
.opt b { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font-family: var(--font-hud); font-size: 12px; color: var(--cyan-2); }
.opt.right { border-color: var(--ok); background: rgba(125, 255, 155,.12); }
.opt.right b { background: var(--ok); color: #040d20; border-color: var(--ok); }
.opt.wrong { border-color: var(--red); background: rgba(255,138,138,.1); }
.opt.wrong b { background: var(--red); color: #2a0000; border-color: var(--red); }
.opt.dim { opacity: .6; }
.opt[aria-disabled="true"] { cursor: default; }
.tv-result p { margin: 0 0 6px; font-family: var(--font-read); font-size: 15px; line-height: 1.45; color: var(--text); }
.tv-result.ok strong { color: var(--ok); }
.tv-result.ko strong { color: var(--amber); }

/* Robótica */
.rb-hero { padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(125, 255, 155,.35); background: rgba(125, 255, 155,.05); }
.rb-dream { margin: 0 0 8px; font-family: var(--font-hud); font-size: 13px; letter-spacing: 1.2px; color: var(--ok); text-transform: uppercase; }
.rb-hero .bar i { display: block; height: 100%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.rb-level { border: 1px solid var(--line-soft); border-radius: 12px; padding: 0 12px; background: rgba(79, 240, 255,.02); }
.rb-level summary { gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.rb-level summary strong { flex: 1 1 60%; color: var(--text); font-size: 16.5px; }
.rb-level summary small { font-family: var(--font-read); font-size: 13px; color: var(--muted); font-weight: 400; }
.rb-lv { font-family: var(--font-hud); font-size: 11px; letter-spacing: 1.4px; color: var(--ok); }
.rb-steps { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rb-step { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 8px 0; cursor: pointer; border-top: 1px solid var(--line-soft); }
.rb-step input { flex: none; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--ok); }
.rb-step span { display: flex; flex-direction: column; gap: 2px; }
.rb-step b { font-size: 16px; color: var(--text); }
.rb-step small { font-family: var(--font-read); font-size: 14px; line-height: 1.4; color: var(--muted); }
.rb-step input:checked + span b { color: var(--ok); }
.rb-projects h4 { margin: 8px 0 4px; font-family: var(--font-hud); font-size: 12px; letter-spacing: 1.3px; color: var(--cyan-2); }
.rb-projects ul { margin: 0; padding-left: 20px; font-family: var(--font-read); font-size: 15px; line-height: 1.5; color: var(--text); }
.tutor-chip .mini-btn { min-height: 44px; min-width: 64px; }

/* ---------- v1.8.1: fotos y videos ---------- */
.msg.bot .bubble.streaming.pending { color: var(--muted, #7f93a8); font-style: italic; display: inline-flex; align-items: center; gap: 10px; }
.msg.bot .bubble.streaming.pending::after { content: ""; order: -1; width: 14px; height: 14px; flex: none; margin: 0; vertical-align: 0; background: none; border-radius: 50%; border: 2px solid var(--cyan); border-right-color: transparent; animation: spin181 0.9s linear infinite; box-shadow: 0 0 8px var(--cyan); }
@keyframes spin181 { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .msg.bot .bubble.streaming.pending::after { animation: none; } }
.att .pdf-chip { font-size: 12px; }
.pdf-chip.img-chip { background: linear-gradient(180deg, rgba(79, 240, 255,.16), transparent 60%); }
.pdf-chip.img-chip::before { content: attr(data-label); color: var(--cyan); }

/* ===================== v1.9.0: pestañas, HUD compacto y modo escritura ===================== */
/* HUD en una sola línea: hora · clima · conexión · modos (iconos) */
.hud.slim { display: flex; align-items: center; margin: 0 12px; padding: 2px 4px 2px 6px; min-height: 52px; grid-template-columns: none; }
.hud.slim > div { padding: 3px 8px; justify-content: center; gap: 0; }
.hud.slim .hud-time { flex: none; }
.hud.slim .hud-big { font-size: 20px; line-height: 1.15; }
.hud.slim .hud-val { font-size: 14px; line-height: 1.35; }
.hud.slim .hud-sub { font-size: 12.5px; line-height: 1.3; }
.hud.slim #weather-cell { flex: none; }
.hud.slim #weather-desc { max-width: 76px; }
.hud.slim #conn-cell { flex: 1; min-width: 0; }
.hud.slim.no-weather > #conn-cell { border-left: 1px solid var(--line-soft); }
.hud.slim .mode-row { flex: none; margin: 0; padding: 0 0 0 6px; gap: 4px; flex-direction: row; }
.hud.slim .mode-btn { flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; position: relative; border-radius: 12px; }
.hud.slim .mode-btn .mode-txt { display: none; }
.hud.slim .wake-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; }
.wake-status { flex: none; margin: 4px 16px 0; font-size: 14px; font-weight: 600; color: var(--ok); text-align: center; letter-spacing: .3px; }
.wake-status:empty { display: none; }
body[data-wake="paused"] .wake-status, body[data-wake="idle"] .wake-status { color: var(--amber); }

/* Barra de pestañas inferior */
.tabbar {
  flex: none; display: flex; gap: 4px; padding: 5px 8px calc(var(--safe-b) + 5px); position: relative; z-index: 2;
  border-top: 1px solid var(--line-soft); background: linear-gradient(180deg, rgba(6, 20, 28, .94), rgba(2, 9, 13, .98));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .35);
}
.tab {
  flex: 1; min-width: 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; position: relative;
  font-family: var(--font-ui); font-size: 13px; font-weight: 600; letter-spacing: .3px;
}
.tab svg { width: 24px; height: 24px; flex: none; }
.tab:active { background: rgba(79, 240, 255, .12); }
.tab[aria-current="page"] { color: var(--cyan-2); background: rgba(79, 240, 255, .09); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: -6px; left: 26%; right: 26%; height: 2px; border-radius: 2px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.tab[data-section="trabajo"][aria-current="page"] { color: var(--amber); background: rgba(255, 196, 87, .08); }
.tab[data-section="ocio"][aria-current="page"] { color: var(--ok); background: rgba(125, 255, 155, .07); }
#settings-view:not([hidden]) ~ .tabbar, body.typing .tabbar, body.kb-open .tabbar, body.driving .tabbar { display: none; }
/* la barra de pestañas ya respeta el área segura inferior */
.dock { padding-bottom: 8px; }
body.driving .dock { padding-bottom: calc(var(--safe-b) + 10px); }
#panel-view .settings-scroll { padding-bottom: 20px; }

/* Portada de cada pestaña: tarjetas grandes */
.landing-intro { margin: 2px 2px 0; font-family: var(--font-read); font-size: 15.5px; color: var(--muted); }
.group-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.group-card {
  width: 100%; min-height: 76px; display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 16px; text-align: left; cursor: pointer;
  border-radius: 16px; border: 1px solid var(--line); background: var(--panel); color: var(--text); box-shadow: inset 0 0 22px rgba(79, 240, 255, .05);
}
.group-card:active { background: rgba(79, 240, 255, .12); }
.group-card > svg:first-child { width: 30px; height: 30px; flex: none; color: var(--cyan-2); filter: drop-shadow(0 0 6px rgba(79, 240, 255, .45)); }
.gc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gc-text strong { font-family: var(--font-ui); font-size: 18px; font-weight: 600; }
.gc-text small { font-family: var(--font-read); font-size: 14.5px; color: var(--muted); }
.gc-count { flex: none; font-size: 13px; font-weight: 700; color: var(--cyan-ink); background: var(--cyan-2); border-radius: 10px; padding: 2px 8px; }
.gc-go { width: 20px; height: 20px; flex: none; color: var(--dim); }
.group-cards.trabajo .group-card { border-color: rgba(255, 196, 87, .38); background: rgba(255, 196, 87, .04); }
.group-cards.trabajo .group-card > svg:first-child { color: var(--amber); filter: drop-shadow(0 0 6px rgba(255, 196, 87, .4)); }
.group-cards.ocio .group-card { border-color: rgba(125, 255, 155, .32); background: rgba(125, 255, 155, .035); }
.group-cards.ocio .group-card > svg:first-child { color: var(--ok); filter: drop-shadow(0 0 6px rgba(125, 255, 155, .4)); }
#panel-view[data-tab-group="trabajo"] .page-title { color: var(--amber); }
#panel-view[data-tab-group="ocio"] .page-title { color: var(--ok); }
html[data-fs="2"] .gc-text strong, html[data-fs="2"] .tab { font-size: 19px; }
html[data-fs="3"] .gc-text strong { font-size: 21px; }
html[data-fs="2"] .tab, html[data-fs="3"] .tab { font-size: 14.5px; }

/* Campo de texto: siempre visible (color, cursor) y crece hasta 5 líneas */
.pill textarea { -webkit-appearance: none; appearance: none; min-height: 44px; line-height: 1.375; text-indent: 0; transform: none; filter: none; mix-blend-mode: normal; text-shadow: none; visibility: visible; }
html[data-fs="2"] .pill textarea { min-height: 47px; }
html[data-fs="3"] .pill textarea { min-height: 50px; }
.pill textarea { max-height: 132px; overflow-y: hidden; color: var(--text); -webkit-text-fill-color: var(--text); caret-color: var(--cyan-2); opacity: 1; -webkit-user-select: text; user-select: text; }
.pill textarea::placeholder { color: var(--dim); -webkit-text-fill-color: var(--dim); opacity: 1; }
.pill textarea:disabled { -webkit-text-fill-color: var(--dim); opacity: 1; }

/* Modo escritura (campo enfocado o teclado abierto): fuera reactor, HUD, micrófono y pestañas; la conversación crece
   y la barra de entrada queda pegada justo encima del teclado (la app mide el área visible con visualViewport). */
body.typing .hud, body.typing .wake-status, body.typing:not(.driving) .mic-zone, body.typing .mode-row,
body.kb-open .wake-status { display: none !important; }
body.typing .topbar { padding-top: calc(var(--safe-t) + 4px); padding-bottom: 4px; }
body.typing #chat-view .stage-center, body.kb-open #chat-view .stage-center { display: none !important; }
body.typing .chat, body.kb-open .chat { display: flex !important; }
body.typing[data-estado] .home-only.only { display: none !important; }
body.typing .dock, body.kb-open .dock { padding: 6px 10px 6px; gap: 6px; }
body.typing .chat.faded { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px); mask-image: linear-gradient(to bottom, transparent 0, #000 12px); }
/* conducción: los modos muestran su texto y son grandes */
body.driving .hud.slim { flex-wrap: wrap; }
body.driving .hud.slim .mode-row { flex: 1 0 100%; border-left: 0; border-top: 1px solid var(--line-soft); padding: 6px 2px 4px; gap: 8px; }
body.driving .hud.slim .mode-btn { flex: 1; width: auto; height: auto; min-height: 60px; gap: 8px; padding: 4px 10px; }
body.driving .hud.slim .mode-btn .mode-txt { display: inline; }
body.driving .hud.slim .wake-dot { position: static; }
body.driving #wake-label { position: static !important; width: auto; height: auto; margin: 0; clip: auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body.driving .wake-status { display: none; }

/* v1.9.1: enlaces de texto con área táctil de 44px */
.hint a, a.link-44 { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; color: var(--cyan-2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.setup-card .more { min-height: 44px; display: flex; align-items: center; justify-content: center; }
/* Seguridad: tipo de protección */
.sec-type { border: 0; margin: 10px 0 0; padding: 0; }
.sec-type legend { padding: 0; margin-bottom: 4px; font-family: var(--font-read); font-size: 15px; color: var(--muted); }
.opt-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 0; cursor: pointer; }
.opt-row input { width: 22px; height: 22px; flex: none; accent-color: var(--cyan); }
.opt-row .txt { display: flex; flex-direction: column; }
.opt-row small { font-family: var(--font-read); font-size: 13.5px; color: var(--muted); }
html[data-fs="2"] .opt-row small { font-size: 16px; }
html[data-fs="3"] .opt-row small { font-size: 18px; }

/* ===== v1.10.0: reacciones con emoji y stickers ===== */
.msg { position: relative; }
.msg > .bubble[tabindex] { cursor: pointer; }
.msg > .bubble[tabindex]:focus-visible { outline: 2px solid var(--cyan-2); outline-offset: 2px; }
.reactions { position: relative; z-index: 1; display: flex; margin: -14px 0 -8px; }
.msg.user .reactions { justify-content: flex-end; padding-right: 4px; }
.msg.bot .reactions { padding-left: 4px; }
.react-pill { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 0; border: 0; background: transparent; color: inherit; }
button.react-pill { cursor: pointer; }
.react-pill i { font-style: normal; font-size: 17px; line-height: 1; padding: 4px 7px; border-radius: 999px; background: #0c1427; border: 1px solid rgba(79, 240, 255, .6); box-shadow: 0 0 8px rgba(79, 240, 255, .35); }
.react-pill.mine i { border-color: var(--cyan-2); background: #1f3d5c; }
.react-pill:focus-visible { outline: none; }
.react-pill:focus-visible i { outline: 2px solid var(--cyan-2); outline-offset: 2px; }
.react-pill.pop i { animation: react-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes react-pop { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(1); } }
.react-bar { position: absolute; top: calc(100% - 4px); z-index: 15; display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; max-width: calc(100vw - 24px); width: max-content;
  border-radius: 26px; background: rgba(6, 20, 28, .97); border: 1px solid var(--cyan); box-shadow: 0 8px 24px rgba(0,0,0,.6), 0 0 16px rgba(79, 240, 255, .35); }
.msg.user .react-bar { right: 0; }
.msg.bot .react-bar { left: 0; }
.react-bar button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.react-bar button:active, .react-bar button:focus-visible { background: rgba(79, 240, 255, .16); outline: none; }
.react-bar button[aria-pressed="true"] { background: rgba(79, 240, 255, .22); box-shadow: inset 0 0 0 1.5px var(--cyan); }
.react-bar .rb-clear { width: auto; padding: 0 14px; border-radius: 22px; font-family: var(--font-ui); font-size: 15px; font-weight: 700; color: var(--text); }
.sticker { width: 128px; height: 128px; filter: drop-shadow(0 0 8px rgba(79, 240, 255, .45)); animation: sticker-in .35s ease-out; }
.sticker svg { display: block; width: 100%; height: 100%; }
.sticker.after-text { margin-top: 6px; width: 112px; height: 112px; }
.stk-txt { font-family: var(--font-hud), var(--font-ui), sans-serif; }
.msg .bubble.sticker-only { padding: 0; background: transparent !important; border: 0 !important; box-shadow: none; }
.msg.bot .bubble.sticker-only::before { display: none; }
@keyframes sticker-in { from { transform: scale(.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.sticker-menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px;
  width: min(360px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.6), var(--glow); }
.sticker-menu button { aspect-ratio: 1; min-height: 64px; padding: 4px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.sticker-menu button:active, .sticker-menu button:focus-visible { background: rgba(79, 240, 255, .14); outline: 2px solid var(--cyan-2); outline-offset: -2px; }
.sticker-menu svg { display: block; width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .sticker, .react-pill.pop i { animation: none; } }

/* ---------- v1.11.0: Herramientas (Fotos, Código, Excel) ---------- */
/* barra con 5 pestañas: texto un poco más chico para que "Herramientas" quepa en 360 px */
.tabbar .tab { padding: 0 2px; }
.tabbar .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; letter-spacing: 0; }
@media (max-width: 374px) { .tabbar .tab span { font-size: 11px; letter-spacing: 0; } .tabbar { gap: 2px; padding-left: 4px; padding-right: 4px; } }
.tab[data-section="herramientas"][aria-current="page"] { color: #c9a6ff; background: rgba(170, 120, 255, .09); }

.tl-stage { position: relative; display: flex; justify-content: center; align-items: center; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 14px; background: repeating-conic-gradient(#0f1a33 0 25%, #0b0f1a 0 50%) 0 0 / 22px 22px; min-height: 160px; }
.tl-stage canvas { display: block; max-width: 100%; max-height: 54vh; width: auto; height: auto; transition: transform .12s; }
.tl-stage.draw canvas { touch-action: none; cursor: crosshair; }
.tl-modes { justify-content: center; }
.tl-tools { display: flex; flex-direction: column; gap: 10px; }
.tl-slider { display: flex; flex-direction: column; gap: 2px; font-family: var(--font-ui); font-size: 15px; color: var(--text); }
.tl-slider span { display: flex; justify-content: space-between; }
.tl-slider b { font-family: var(--font-hud); color: var(--cyan-2); font-weight: 600; }
.tl-slider input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--cyan); }
.tl-color { align-items: center; flex-wrap: wrap; }
.tl-swatch { display: inline-flex; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.tl-swatch input { width: 64px; height: 64px; margin: -8px; border: 0; padding: 0; background: none; cursor: pointer; }
.tl-chip { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; flex: none; }
.tl-color .btn { flex: 1 1 120px; }
.tl-actions .btn { flex: 1 1 120px; }
.tl-h { margin: 0 0 6px; font-family: var(--font-ui); font-size: 16px; color: var(--cyan-2); letter-spacing: .5px; }
.tl-h small { color: var(--muted); font-size: 12px; font-weight: 500; }
.tl-result { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(79, 240, 255,.04); }
.ba { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ba .ba-after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.ba .ba-line { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.ba-l, .ba-r { position: absolute; top: 8px; padding: 2px 8px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font: 600 12px var(--font-ui); }
.ba-l { left: 8px; } .ba-r { right: 8px; }
.tl-ai-err p + p { margin-top: 6px; color: var(--text); }
.tl-ai-err .btn-row { margin-top: 10px; }
.code-field { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.45; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 2; min-height: 200px; }
.tl-out { border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px; }
.tl-out.ko { border-color: rgba(255,138,138,.45); }
.tl-console { margin: 0; padding: 10px; border-radius: 10px; background: #050914; color: #d6e6ff; font: 13.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow: auto; }
.tl-console.ko, .tl-console .lg-error { color: var(--red); }
.tl-console .lg-warn { color: var(--amber); } .tl-console .lg-ret { color: var(--ok); } .tl-console .lg-dim { color: var(--muted); }
.tl-file { font-family: var(--font-ui); font-size: 16px; color: var(--text); overflow-wrap: anywhere; }
.tl-table-wrap { overflow: auto; max-height: 46vh; border: 1px solid var(--line-soft); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.tl-table { border-collapse: collapse; width: max-content; min-width: 100%; font: 14px/1.3 var(--font-read); color: var(--text); }
.tl-table th, .tl-table td { padding: 8px 10px; border-bottom: 1px solid rgba(79, 240, 255,.1); text-align: left; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.tl-table thead th { position: sticky; top: 0; background: var(--panel-2); color: var(--cyan-2); font-family: var(--font-ui); font-weight: 600; z-index: 1; }
.tl-table .cl { display: block; font-size: 10.5px; color: var(--muted); }
.tl-table .rn { color: var(--muted); font-family: var(--font-hud); font-size: 12px; position: sticky; left: 0; background: var(--panel); }
.tl-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.tl-table tr.tot th, .tl-table tr.tot td { font-weight: 700; color: var(--ok); border-top: 1px solid var(--line); }
.tl-answer { display: flex; flex-direction: column; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(79, 240, 255,.04); }
.tl-answer-text { margin: 0; font: 16px/1.45 var(--font-read); color: var(--text); white-space: pre-wrap; }
.tl-res h4 { margin: 0 0 6px; font: 600 15px var(--font-ui); color: var(--cyan-2); }
.tl-res h4 small { color: var(--muted); }
.tl-big { margin: 0; font: 600 26px var(--font-hud); color: var(--text); text-shadow: 0 0 8px rgba(79, 240, 255,.5); }
.tl-formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tl-formula code { flex: 1 1 200px; padding: 10px; border-radius: 10px; background: #050914; color: var(--ok); font: 14px ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
.tl-formula .hint { flex: 1 0 100%; margin: 0; }
.tl-log { margin: 0; padding-left: 20px; font: 15px/1.4 var(--font-read); color: var(--ok); }
.tl-quick { border: 1px solid var(--line-soft); border-radius: 12px; padding: 0 10px 10px; }
.tl-quick summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font: 600 15px var(--font-ui); color: var(--cyan-2); }
.tl-quick .btn { margin-top: 8px; width: 100%; }
.tl-quick .btn-row .btn { width: auto; }

/* bloques de código en el chat */
.msg.wide { max-width: 96%; }
.bubble.has-code { width: 100%; }
.bubble .t-seg { display: block; white-space: pre-wrap; }
.bubble .t-seg + .code-block, .bubble .code-block + .t-seg { margin-top: 8px; }
.code-block { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #050914; margin: 4px 0; }
.code-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; background: rgba(79, 240, 255,.07); border-bottom: 1px solid var(--line-soft); }
.code-lang { flex: 1 1 auto; font: 600 12.5px var(--font-ui); color: var(--muted); letter-spacing: .4px; }
.code-head .mini-btn { min-height: 44px; font-size: 13px; padding: 0 9px; }
.code-head .mini-btn.run { color: var(--ok); border-color: rgba(125, 255, 155,.45); }
.code-pre { margin: 0; padding: 10px 12px; max-height: 60vh; overflow: auto; font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #d6e6ff; white-space: pre; tab-size: 2; overflow-wrap: normal; -webkit-overflow-scrolling: touch; }
.code-extra:empty { display: none; }
.code-extra { border-top: 1px solid var(--line-soft); }
.code-extra .tl-console { border-radius: 0; }
.diff-sum { margin: 0; padding: 6px 10px; font: 13px var(--font-ui); color: var(--muted); }
.code-diff { max-height: 50vh; overflow: auto; font: 13px/1.45 ui-monospace, Menlo, monospace; white-space: pre; }
.code-diff > div { padding: 0 10px 0 6px; }
.df-add { background: rgba(125, 255, 155,.12); color: #b9f3ff; }
.df-del { background: rgba(255,138,138,.12); color: #ffc9c9; text-decoration: line-through; text-decoration-color: rgba(255,138,138,.5); }
.df-ctx { color: #87b8c2; }
.df-gap { color: var(--muted); text-align: center; }
.df-sign { display: inline-block; width: 1.4em; user-select: none; }
.hl-kw { color: #ff9ad5; } .hl-str { color: #9ce2f0; } .hl-num { color: #ffc457; } .hl-com { color: #6b949c; font-style: italic; }
.hl-fn { color: #7fdcff; } .hl-attr { color: #ffd18a; }
.pdf-chip.code-chip { color: var(--ok); }
.msg.bot .bubble.has-media .bubble-media + * { margin-top: 8px; }

/* v1.13: cerebro 3D en red (reemplaza el reactor) */
.reactor-wrap canvas.brain { position: absolute; inset: -14%; width: 128%; height: 128%; display: block; pointer-events: none; }
@media (min-height: 701px) { .lock-screen .reactor-wrap { width: 132px !important; height: 132px !important; } }
.lock-screen .lock-badge { inset: auto; right: -6px; bottom: -6px; width: 38px; height: 38px; border-radius: 50%; background: #0a1224; border: 1px solid rgba(79, 240, 255,.55); box-shadow: 0 0 10px rgba(79, 240, 255,.45); }
.lock-screen .lock-badge svg { width: 20px; height: 20px; color: var(--cyan); filter: none; }

/* ===== v1.14: tema verde y rojo (variante B) ===== */
body { background-color: var(--bg); }
.brand h1 { background: linear-gradient(90deg, #4ff0ff, #ffb347); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 6px rgba(79, 240, 255,.35)); }
.logo-mark::after { background: radial-gradient(circle, #fff 0 30%, var(--accent) 70%); box-shadow: 0 0 10px var(--accent); }
.btn.primary { background: linear-gradient(90deg, #4ff0ff, #19c4e6 45%, #ffb347); color: #08101f; border-color: transparent; box-shadow: 0 0 16px rgba(79, 240, 255,.3), 0 0 16px rgba(255, 179, 71,.25); }
.mic-big { border-color: var(--accent) !important; color: var(--accent-2) !important; box-shadow: 0 0 0 4px rgba(255, 179, 71,.12), 0 0 20px rgba(255, 179, 71,.5), inset 0 0 14px rgba(79, 240, 255,.15) !important; }
.mic-big::before { border-color: rgba(255, 179, 71,.55); }
.tab[aria-current="page"] { color: var(--accent-2); background: rgba(255, 179, 71,.10); }
.dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.pick.on { background: linear-gradient(90deg, #4ff0ff, #ffb347); color: #08101f; border-color: transparent; }

.lock-screen .lock-badge { border-color: rgba(255, 179, 71,.6); box-shadow: 0 0 10px rgba(255, 179, 71,.45); }
.lock-screen .lock-badge svg { color: var(--accent-2); }
.dr-board .pc.sel .rim { stroke: var(--accent); filter: drop-shadow(0 0 .08px var(--accent)); }

/* v1.15: modo de respuesta y botón Callar */
.reply-mode-btn svg { display: none; }
.reply-mode-btn[data-mode="voz"] .rm-voz, .reply-mode-btn[data-mode="texto"] .rm-texto, .reply-mode-btn[data-mode="mic"] .rm-mic { display: block; }
.reply-mode-btn[data-mode="voz"] { color: var(--accent-2); border-color: rgba(255, 179, 71,.55); }
.reply-mode-btn[data-mode="texto"] { color: var(--muted); }
.stop-voice { display: flex; align-items: center; gap: 8px; margin: 0 auto 8px; min-height: 40px; padding: 0 16px; border-radius: 20px; cursor: pointer;
  font-family: var(--font-hud); font-size: 12px; letter-spacing: 1.5px; color: #fff; background: rgba(255, 179, 71,.18); border: 1px solid var(--accent); box-shadow: 0 0 14px rgba(255, 179, 71,.45); }
.stop-voice[hidden] { display: none; }
.stop-voice i { width: 10px; height: 10px; background: var(--accent); border-radius: 2px; }
input.range { width: 100%; min-height: 40px; accent-color: var(--cyan); }

/* v1.16: modo conversación */
.conv-start { margin-top: 2px; font-size: 14px; color: var(--cyan-2); background: none; border: 0; cursor: pointer; min-height: 36px; }
.conv-start small { color: var(--muted); font-size: 12px; }
body.conv-on .conv-start { display: none; }
.conv-pill { display: flex; align-items: center; gap: 8px; margin: 0 auto 8px; width: max-content; max-width: 92%; padding: 4px 4px 4px 12px; border-radius: 20px;
  font-family: var(--font-hud); font-size: 11px; letter-spacing: 1.4px; color: var(--text); background: rgba(79, 240, 255,.10); border: 1px solid rgba(79, 240, 255,.45); box-shadow: 0 0 12px rgba(79, 240, 255,.25); }
.conv-pill[hidden] { display: none; }
.conv-pill .conv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: blink 1.4s infinite; }
.conv-pill button { min-height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--accent); background: rgba(255, 179, 71,.18); color: #fff; font-family: var(--font-ui); font-size: 14px; cursor: pointer; }
@keyframes blink { 50% { opacity: .3; } }
body.conv-on #stage .reactor-wrap { cursor: pointer; }

/* v1.17.1: micrófono más pequeño y transcripción siempre visible encima */
.mic-big { width: 84px; height: 84px; }
[data-estado="escuchando"] .reactor-wrap { width: min(210px, 26vh) !important; height: min(210px, 26vh) !important; }
[data-estado="escuchando"] .stage-center { gap: 4px; padding-top: 4px; padding-bottom: 4px; }
.interim { max-width: 340px; width: 100%; max-height: calc(1.4em * 3 + 16px); overflow-y: auto; padding: 6px 12px; border-radius: 12px; flex: none;
  background: rgba(10, 18, 36,.75); border: 1px solid var(--line-soft); -webkit-overflow-scrolling: touch; }
@media (max-height: 760px) {
  .mic-big { width: 70px; height: 70px; }
  .mic-big svg { width: 28px; height: 28px; }
  [data-estado="escuchando"] .reactor-wrap { width: min(150px, 22vh) !important; height: min(150px, 22vh) !important; }
  [data-estado="escuchando"] .hint-line.only.escuchando { display: none !important; }
  .interim { font-size: 16.5px; }
}

/* v1.18: cerebro local */
.lb-card { margin-top: 10px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(10, 18, 36,.55); }
.lb-state { margin: 0 0 8px; font-family: var(--font-read); font-size: 16px; color: var(--text, #e8f4ff); }
.lb-state.ok { color: var(--cyan-2); } .lb-state.err { color: #ff8a8a; }
.lb-bar { height: 12px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; border: 1px solid var(--line-soft); }
.lb-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--cyan-2)); box-shadow: 0 0 10px var(--cyan); transition: width .3s; }
.lb-prog { margin: 6px 0 0; font-family: var(--font-read); font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lb-actions .btn { min-height: 44px; }
.lb-limits { margin-top: 8px; font-family: var(--font-read); font-size: 14px; color: var(--muted); }
.lb-limits summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--cyan-2); }
.lb-limits ul { margin: 0; padding-left: 18px; line-height: 1.45; }
.msg .meta.local::before { content: "◆ "; color: var(--cyan); }
#status-line.local { color: var(--cyan-2); }

/* ---------- v1.19: centro de mando, avatar y Visión ---------- */
.stage { isolation: isolate; }
.hud-layer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
body.compact .hud-layer, body.kb-open .hud-layer { opacity: .45; }
/* v1.19.4: el avatar vive DENTRO del cerebro (centrado), tamaño fijo en px: sin desbordes en iPhone */
#stage .avatar-home { display: none; position: absolute; left: 50%; top: 50%; width: 66%; height: 66%; transform: translate(-50%, -50%); z-index: 2; pointer-events: none; }
[data-presencia="ambos"] #stage .avatar-home { display: block; }
[data-presencia="avatar"] #stage .avatar-home { display: block; width: 100%; height: 100%; }
[data-presencia="avatar"] #stage .reactor-wrap > :not(.avatar-home) { visibility: hidden; }
.vision-btn { position: absolute; top: 6px; right: 12px; z-index: 3; min-height: 34px; padding: 0 12px; font-family: var(--font-hud, monospace); font-size: 10px; letter-spacing: 1.2px; color: #ffb347; background: rgba(3, 6, 14,.75); border: 1px solid rgba(255, 179, 71,.5); border-radius: 10px; }
/* v1.19.2: avatar del bloqueo: redondo, nítido, brillo suave fijo (sin animaciones que lo recorten) */
.lock-screen .reactor-wrap { width: 132px !important; height: 132px !important; }
.lock-screen .reactor-wrap .reactor, .lock-screen .reactor-wrap .ripple, .lock-screen .reactor-wrap canvas.brain { display: none !important; }
.avatar-lock { position: absolute; inset: 0; z-index: 1; border-radius: 50%; overflow: hidden; aspect-ratio: 1 / 1; clip-path: circle(50%); -webkit-clip-path: circle(50%); box-shadow: 0 0 0 2px rgba(79, 240, 255,.55), 0 0 18px rgba(79, 240, 255,.28) !important; }
.lock-screen .lock-badge { z-index: 2; right: 2px !important; bottom: 2px !important; }
.avatar-lock-ring { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(79, 240, 255,.6); box-shadow: 0 0 16px rgba(79, 240, 255,.3); pointer-events: none; z-index: 1; }
.lock-ver { position: absolute; left: 0; right: 0; bottom: calc(6px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 11px; letter-spacing: 1px; color: rgba(159, 203, 212,.8); pointer-events: none; }
.home-ver { align-self: center; margin: 0; padding: 2px 8px; min-height: 24px; background: none; border: 0; font-size: 10.5px; letter-spacing: .5px; color: rgba(185, 214, 220,.7); text-decoration: underline dotted; }
body.compact .home-ver, body.kb-open .home-ver { display: none; }
@media (max-height: 720px) { body:not(.compact):not(.kb-open) #stage .reactor-wrap { width: 150px; height: 150px; } .stage-center { gap: 4px; padding-top: 18px; } }
/* v1.20: ella es el centro: el cerebro (sin rótulos) queda como halo alrededor */
[data-presencia="ambos"] #stage .reactor-wrap { width: 250px; height: 250px; }
[data-presencia="ambos"] #stage .reactor-wrap .reactor { opacity: .35; }
@media (max-height: 720px) { [data-presencia="ambos"] #stage .reactor-wrap { width: 150px; height: 150px; } .home-ver { min-height: 18px; padding: 0 6px; font-size: 9.5px; } }
#stage .avatar-home.av-blocked { pointer-events: auto; }
body.kb-open .vision-btn, body.typing .vision-btn { display: none; }
/* v1.21: avatar 3D en el lugar del cerebro */
#stage .reactor-wrap .av3d { position: absolute; inset: -14%; z-index: 2; pointer-events: none; }
#stage .reactor-wrap .av3d canvas { display: block; }
[data-presencia="avatar3d"] #stage .reactor-wrap > :not(.av3d) { visibility: hidden; }

/* v1.22: OJO (prueba) */
.ojo-btn { right: 108px; color: #4ff0ff; border-color: rgba(79, 240, 255,.5); }
.ojo-view { position: fixed; inset: 0; z-index: 950; background: #010309; }
.ojo-view iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ojo-bar { position: absolute; z-index: 2; top: calc(env(safe-area-inset-top) + 12px); right: 14px; display: flex; gap: 8px; }
.ojo-view[data-modo="cr"] .ojo-bar { display: none; } /* en Costa Rica la propia página trae MUNDO y CERRAR */
.ojo-cerrar, .ojo-cr-btn { min-height: 36px; padding: 0 14px; font: 600 12px var(--font-hud, monospace); letter-spacing: 1px; color: #fff; background: rgba(255, 179, 71,.88); border: 1px solid #ff8a9b; border-radius: 10px; cursor: pointer; }
.ojo-cr-btn { background: rgba(3, 9, 24,.88); border-color: rgba(79, 240, 255,.6); color: #4ff0ff; }
/* v1.24: resumen de Ojo CR en Inicio */
.cr-sismo { display: flex; align-items: center; gap: 8px; width: min(440px, 92%); margin: 6px auto 0; padding: 9px 12px; border: 1px solid #ff8a9b; border-radius: 12px; background: rgba(255, 179, 71,.2); color: #fff; font: 600 13px var(--font-ui, sans-serif); text-align: left; cursor: pointer; }
.cr-sismo b { color: #ff8a9b; font-family: var(--font-hud, monospace); letter-spacing: .5px; }
.cr-sismo .x { margin-left: auto; padding: 2px 6px; opacity: .8; }
.cr-card { display: block; width: min(440px, 92%); margin: 8px auto 0; padding: 9px 12px; border: 1px solid rgba(79, 240, 255,.35); border-radius: 12px; background: rgba(3, 9, 24,.6); color: #dfe8ff; text-align: left; cursor: pointer; font: 500 13px var(--font-ui, sans-serif); }
.cr-card .h { white-space: nowrap; display: flex; gap: 8px; align-items: baseline; font: 600 11px var(--font-hud, monospace); letter-spacing: 1.2px; color: #4ff0ff; }
.cr-card .h i { font-style: normal; margin-left: auto; color: #8fa6bc; letter-spacing: .3px; font-size: 10px; }
.cr-card .n { color: #ff5a73; } .cr-card.ok .n { color: #4ff0ff; }
.cr-card p { margin: 3px 0 0; line-height: 1.3; }
.cr-card p.d { color: #8fa6bc; font-size: 12px; }
.cr-home { width: 100%; flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 14px 6px; }
.cr-home:empty { display: none; }
body.compact .cr-home, body.typing .cr-home, body.kb-open .cr-home, body.driving .cr-home, body:not(.desk)[data-estado]:not([data-estado="reposo"]) .cr-home { display: none; }
/* teléfono: una sola línea cada uno, para no empujar el micrófono */
body:not(.desk) .cr-sismo, body:not(.desk) .cr-card { width: min(440px, 100%); margin: 0; padding: 7px 11px; font-size: 12.5px; }
body:not(.desk) .cr-sismo small, body:not(.desk) .cr-card .h i .l, body:not(.desk) .cr-card p.d { display: none; }
body:not(.desk) .cr-card { display: flex; align-items: baseline; gap: 8px; }
body:not(.desk) .cr-card p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:not(.desk) .cr-card::after { content: "›"; margin-left: auto; color: #4ff0ff; }
body.desk .cr-home { grid-column: 1; grid-row: 5; padding: 6px 16px 0; }
body.desk .cr-home .cr-sismo, body.desk .cr-home .cr-card { width: 100%; margin: 0; }
body.desk #desk-cards { grid-row: 6; }
@media (max-height: 900px) {
body.desk .cr-sismo, body.desk .cr-card { width: 100%; margin: 0; padding: 7px 11px; font-size: 12.5px; }
body.desk .cr-sismo small, body.desk .cr-card .h i .l { display: none; }
body.desk .cr-card { display: flex; align-items: baseline; gap: 8px; }
body.desk .cr-card p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.desk .cr-card::after { content: "›"; margin-left: auto; color: #4ff0ff; }
body.desk .cr-card .h { white-space: nowrap; flex: none; }
body.desk .cr-card p:not(.d) { flex: none; } body.desk .cr-card p.d { min-width: 0; }
body.desk .cr-sismo > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.desk .cr-sismo br { display: none; }
body.desk .cr-sismo { padding: 7px 11px; }
body.desk:has(.cr-card) .reactor-wrap { width: min(320px, 24vh) !important; height: min(320px, 24vh) !important; }
}

body.kb-open .ojo-btn, body.typing .ojo-btn { display: none; }

/* ======================================================================
   v1.23: diseño de computadora. TODO va bajo body.desk (lo pone js/desktop.js
   solo en pantallas >= 1024 px). El teléfono no usa ninguna de estas reglas.
   ====================================================================== */
.desk-only { display: none; }
body.desk .app { max-width: none; inset: 0; height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
body.desk .app > .view { grid-column: 2; grid-row: 1; min-width: 0; }
/* barra lateral = la misma barra de pestañas, de pie */
body.desk .tabbar { grid-column: 1; grid-row: 1; display: flex !important; flex-direction: column; gap: 4px; padding: 16px 12px; border-top: 0; border-right: 1px solid var(--line); box-shadow: none; background: linear-gradient(180deg, rgba(10, 18, 36,.97), rgba(3, 6, 12,.97)); overflow-y: auto; }
body.desk .tabbar .desk-only { display: flex; }
body.desk .desk-brand { align-items: center; gap: 12px; padding: 4px 8px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
body.desk .desk-brand b { display: block; font-family: var(--font-hud); font-size: 17px; letter-spacing: 4px; color: var(--cyan); }
body.desk .desk-brand small { color: var(--muted); font-size: 13px; }
body.desk .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; font-size: 16.5px; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s; }
body.desk .tab svg { width: 20px; height: 20px; }
body.desk .tab:hover { background: rgba(79, 240, 255,.06); border-color: var(--line-soft); color: var(--text); }
body.desk .tab[aria-current="page"] { background: linear-gradient(90deg, rgba(255, 179, 71,.16), rgba(255, 179, 71,.02)); border-color: var(--line); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
body.desk .tab[aria-current="page"]::before { display: none; }
body.desk .tab .desk-kbd { margin-left: auto; font: 10px var(--font-read); color: var(--dim); border: 1px solid var(--line-soft); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
body.desk .desk-extra { flex: 1; flex-direction: column; gap: 4px; min-height: 0; }
body.desk .desk-sec { margin: 14px 10px 4px; font-family: var(--font-hud); font-size: 9.5px; letter-spacing: 2.5px; color: var(--dim); }
body.desk .desk-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
body.desk .desk-ver { background: none; border: 0; text-align: left; padding: 4px 12px; font-size: 12px; color: var(--dim); text-decoration: underline dotted; cursor: pointer; }
body.desk .desk-ver:hover { color: var(--text); }
/* la barra no se esconde en escritorio */
body.desk #settings-view:not([hidden]) ~ .tabbar, body.desk.typing .tabbar, body.desk.kb-open .tabbar { display: flex !important; }
body.desk.driving .tabbar { display: none !important; }
body.desk.driving .app { grid-template-columns: 0 minmax(0, 1fr); }

/* Inicio: cerebro a la izquierda, conversación grande a la derecha */
body.desk #chat-view { display: grid; grid-template-columns: minmax(340px, 37%) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; column-gap: 18px; padding: 0 20px 16px; }
body.desk #chat-view > .topbar { grid-column: 1 / -1; grid-row: 1; padding: 12px 4px 8px; }
body.desk #chat-view > .topbar .brand { visibility: hidden; }
body.desk #toggle-chat { display: none; }
body.desk #hud { grid-column: 1 / -1; grid-row: 2; margin: 0 0 14px; }
body.desk #chat-view > .wake-status { grid-column: 2; grid-row: 2; justify-self: center; align-self: end; margin: 0 0 -6px; z-index: 2; }
body.desk #stage, body.desk #chat-view .dock { display: contents; }
/* marcos de los dos paneles */
body.desk #chat-view::before, body.desk #chat-view::after { content: ""; grid-row: 3 / 7; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(170deg, rgba(9, 17, 36,.88), rgba(4, 7, 16,.9)); pointer-events: none; z-index: 0; }
body.desk #chat-view::before { grid-column: 1; }
body.desk #chat-view::after { grid-column: 2; }
body.desk #chat-view > :not(.sr-only):not(.hud-layer), body.desk #stage > :not(.sr-only):not(.hud-layer), body.desk #chat-view .dock > :not(.sr-only) { position: relative; z-index: 1; }
body.desk #stage > .hud-layer { position: absolute; inset: 0; z-index: 0; opacity: .5; }
body.desk .stage-center { grid-column: 1; grid-row: 3; padding: 52px 18px 6px; overflow-y: auto; justify-content: safe center; }
body.desk .reactor-wrap { width: min(320px, 31vh) !important; height: min(320px, 31vh) !important; }
body.desk .vision-btn { grid-column: 1; grid-row: 3; position: relative; top: auto; right: auto; left: auto; align-self: start; justify-self: end; margin: 14px 14px 0 0; z-index: 3; }
body.desk .ojo-btn { margin-right: 112px; }
body.desk.kb-open .vision-btn, body.desk.typing .vision-btn { display: inline-flex; }
body.desk #messages { grid-column: 2; grid-row: 3; display: flex !important; padding: 18px 22px 10px; font-size: 16px; }
body.desk[data-estado="escuchando"] #messages { display: flex !important; }
body.desk #messages .msg { max-width: 78%; }
body.desk #messages .msg .bubble { max-width: 100%; }
body.desk .mic-zone { grid-column: 1; grid-row: 4; padding: 4px 0 6px; }
body.desk #conv-pill, body.desk #stop-voice { grid-column: 1; grid-row: 4; justify-self: center; align-self: center; }
body.desk .stop-pill { grid-column: 2; grid-row: 4; justify-self: center; margin: 4px 0; }
body.desk #attachments, body.desk #tutor-chip { grid-column: 2; grid-row: 4; margin: 0 16px; }
body.desk .desk-cards { grid-column: 1; grid-row: 5 / 7; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 16px 16px; align-self: end; }
body.desk .desk-card { text-align: left; border: 1px solid var(--line-soft); border-radius: 12px; padding: 9px 12px; background: rgba(3, 6, 14,.6); color: var(--text); cursor: pointer; font-family: var(--font-ui); transition: border-color .15s, transform .15s; min-width: 0; }
body.desk .desk-card:hover { border-color: var(--cyan); transform: translateY(-1px); }
body.desk .desk-card.off { grid-column: 1 / -1; cursor: default; }
body.desk .desk-card .hud-l { display: block; font-family: var(--font-hud); font-size: 9px; letter-spacing: 1.6px; color: var(--dim); }
body.desk .desk-card b { display: block; font-size: 21px; line-height: 1.2; color: #fff; }
body.desk .desk-card small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.desk #composer { grid-column: 2; grid-row: 5; width: auto; margin: 0 16px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
body.desk #msg-input { max-height: 180px; }
body.desk .desk-kbh { grid-column: 2; grid-row: 6; display: block; margin: 6px 18px 12px; font-size: 12.5px; color: var(--dim); }
body.desk .desk-kbh kbd { font: 11px var(--font-read); border: 1px solid var(--line-soft); border-radius: 4px; padding: 1px 5px; color: var(--muted); }
body.desk .icon-btn:hover, body.desk .mode-btn:hover { border-color: var(--cyan); }
body.desk .mic-big:hover { filter: brightness(1.12); }
/* sin modo "escritura" de teléfono */
body.desk.kb-open .stage-center, body.desk.typing .stage-center { display: flex; }
/* paneles y ajustes: contenido más ancho, tarjetas en cuadrícula */
body.desk #panel-view .settings-scroll, body.desk #settings-view .settings-scroll { padding: 8px 28px 28px; }
body.desk #panel-view .settings-scroll > *, body.desk #settings-view .settings-scroll > * { width: 100%; max-width: 1100px; margin-left: auto; margin-right: auto; }
body.desk .group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
body.desk .group-card { min-height: 110px; transition: border-color .15s, transform .15s, box-shadow .15s; }
body.desk .group-card:hover { border-color: var(--cyan); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(79, 240, 255,.08); }
body.desk #settings-view .settings-scroll > .panel { max-width: 860px; }
body.desk #settings-view .save-bar { max-width: 860px; margin: 0 auto; width: 100%; }
body.desk .panel-view .topbar, body.desk #settings-view .topbar { padding: 14px 28px 10px; }
@media (max-height: 820px) {
  body.desk .reactor-wrap { width: min(250px, 30vh) !important; height: min(250px, 30vh) !important; }
  body.desk .stage-center { padding-top: 48px; gap: 4px; }
  body.desk #hud { margin-bottom: 10px; }
  body.desk .desk-card { padding: 7px 11px; } body.desk .desk-card b { font-size: 18px; }
  body.desk .desk-kbh { margin-bottom: 8px; }
}
body.desk[data-estado="sinkey"] .desk-cards { display: none; } /* deja espacio a «Configure su API key» */
/* v1.23.1: bloqueo a pantalla completa en computadora (el teléfono no cambia) */
.lock-kbh { display: none; }
.lock-screen, .modal { isolation: isolate; }
body.desk .lock-screen {
  inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; margin: 0; z-index: 2000;
  display: grid; place-items: center; padding: 24px; overflow: auto;
  background:
    radial-gradient(900px 600px at 50% 42%, rgba(79, 240, 255, 0.10), transparent 70%),
    radial-gradient(700px 500px at 85% 100%, rgba(255, 179, 71, 0.06), transparent 70%),
    linear-gradient(rgba(79, 240, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, rgba(79, 240, 255, 0.035) 1px, transparent 1px) 0 0 / 32px 100%,
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
}
body.desk .lock-screen .lock {
  flex: none; width: min(480px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto;
  padding: 30px 36px 18px; border: 1px solid var(--line); border-radius: 24px;
  background: linear-gradient(170deg, rgba(9, 17, 36, 0.94), rgba(4, 7, 16, 0.96));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 70px rgba(79, 240, 255, 0.08), inset 0 1px 0 rgba(79, 240, 255, 0.10);
}
body.desk .lock-screen .reactor-wrap { width: 140px !important; height: 140px !important; }
body.desk .lock-screen .lock h1 { font-size: 22px; letter-spacing: 4px; }
body.desk .lock-screen .keypad { gap: 12px 34px; }
body.desk .lock-screen .key:hover:not(:disabled) { border-color: var(--cyan); box-shadow: inset 0 0 18px rgba(79, 240, 255, .22), 0 0 12px rgba(79, 240, 255, .25); }
body.desk .lock-screen .key.ghost:hover:not(:disabled) { border-color: transparent; box-shadow: none; color: var(--cyan); }
body.desk .lock-screen .keypad:not([hidden]) ~ .lock-kbh { display: block; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
body.desk .lock-screen[data-lock="factor"] .lock-kbh { display: none !important; }
body.desk .lock-kbh kbd { font-family: var(--font-hud); font-size: 11px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--cyan-2); background: rgba(79, 240, 255, .05); }
body.desk .lock-ver { position: fixed; bottom: 12px; }
@media (max-height: 820px) {
  body.desk .lock-screen .lock { padding: 20px 32px 12px; }
  body.desk .lock-screen .reactor-wrap { width: 96px !important; height: 96px !important; }
  body.desk .lock-screen .lock h1 { margin-top: 10px; font-size: 20px; }
  body.desk .lock-screen .pin-dots { margin: 14px 0 4px; }
  body.desk .lock-screen .lock-msg { margin: 2px 0 6px; }
  body.desk .lock-screen .keypad { grid-template-columns: repeat(3, 64px); gap: 9px 34px; }
  body.desk .lock-screen .key { width: 64px; height: 64px; font-size: 28px; }
  body.desk .lock-screen .lock-kbh { margin-top: 8px; }
}
body.desk .dr-board { max-width: min(560px, calc(100vh - 330px)); min-width: 300px; } /* el tablero y sus botones caben sin desplazar */
/* v1.23.2: esqueleto mientras se reúne el Resumen del día */
.digest-skel .skel-note { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; font-family: var(--font-read); font-size: 15px; color: var(--muted); }
.skel-spin { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid rgba(79, 240, 255, .22); border-top-color: var(--cyan); animation: skel-rot .8s linear infinite; }
.digest-card.skel .sk { display: block; height: 14px; margin: 8px 0 4px; border-radius: 7px;
  background: linear-gradient(90deg, rgba(79, 240, 255,.06) 0%, rgba(79, 240, 255,.16) 45%, rgba(79, 240, 255,.06) 90%) 0 0 / 300% 100%; animation: skel-sh 1.4s ease-in-out infinite; }
.digest-card.skel .sk.sm { height: 10px; margin-top: 2px; opacity: .7; }
@keyframes skel-sh { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes skel-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .digest-card.skel .sk, .skel-spin { animation: none; } }
/* v1.23.2: en Ajustes solo se resalta «Ajustes» en la barra lateral */
body.desk .tab.desk-tab[aria-current="page"] { background: linear-gradient(90deg, rgba(255, 179, 71,.16), rgba(255, 179, 71,.02)); border-color: var(--line); color: #fff; }
.cr-sismo[hidden] { display: none; }
/* v1.24.1: «COSTA RICA» del globo lejos de «Cerrar» (arriba al centro; en pantallas angostas, abajo a la derecha) */
.ojo-cr-btn { position: absolute; z-index: 2; top: calc(env(safe-area-inset-top) + 12px); left: 50%; transform: translateX(-50%); touch-action: manipulation; }
.ojo-view[data-modo="cr"] .ojo-cr-btn { display: none; }
@media (max-width: 760px) { .ojo-cr-btn { top: auto; left: auto; transform: none; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 76px); min-height: 42px; box-shadow: 0 6px 20px rgba(0,0,0,.6); } }
.cr-nosis { margin: 0; font: 500 11px var(--font-ui, sans-serif); color: #8fa6bc; opacity: .8; text-align: center; }
.cr-nosis[hidden] { display: none; }

/* v1.25: Mi compu y cerebro doble */
.pc-btn { right: 186px; color: #9fdce8; border-color: rgba(79, 240, 255,.4); display: inline-flex; align-items: center; gap: 6px; }
.pc-btn[hidden] { display: none; }
body.kb-open .pc-btn, body.typing .pc-btn { display: none; }
body.desk .pc-btn { margin-right: 200px; }
body.desk.kb-open .pc-btn, body.desk.typing .pc-btn { display: inline-flex; }
.pc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #555; flex: none; }
.pc-dot[data-st="on"] { background: #4ff0ff; box-shadow: 0 0 8px #4ff0ff; }
.pc-dot[data-st="off"] { background: #ffb347; box-shadow: 0 0 8px #ffb347; }
.desk-tab .pc-dot { margin-left: auto; }
.pc-alerta { border-color: #ffb347 !important; color: #ff8a9b !important; animation: pcAl 1.6s ease-in-out infinite; }
@keyframes pcAl { 50% { box-shadow: 0 0 14px rgba(255, 179, 71,.7); } }
#pc-test .pc-dot { margin-right: 6px; }
.micompu-view { background: #02060e; }
@media (max-width: 380px) { .pc-btn { right: 172px; padding: 0 9px; } }

/* v1.25.1 · emparejar con QR */
#pc-toast{position:fixed;left:50%;top:calc(env(safe-area-inset-top,0px) + 16px);transform:translateX(-50%);z-index:9999;max-width:min(92vw,520px);padding:12px 18px;border-radius:14px;font-weight:600;text-align:center;background:#060b18;backdrop-filter:blur(6px)}
#pc-toast.ok{color:#4ff0ff;border:1px solid #4ff0ff;box-shadow:0 0 24px #2bff9a55}
#pc-toast.mal{color:#ff5c7a;border:1px solid #ff3b5c;box-shadow:0 0 24px #ff3b5c55}
.pc-aviso{color:#ff5c7a;font-size:.9em;margin:6px 0 0}

/* v1.25.2 · botones de la compu sin desbordar en teléfono */
#pc-cerebro .btn-row{display:flex;flex-wrap:wrap;gap:8px}
#pc-cerebro .btn-row .btn{flex:1 1 auto;min-width:0;white-space:normal}

/* v1.26 · Panel de inteligencias */
.intel-view { background: #050914; }
.aprende-view { background: #050914; } /* v1.29: Aprende a programar */
.group-card.intel-card { border-color: #2bff9a88; box-shadow: 0 0 18px #2bff9a33; }

/* ---------- v1.27: bloqueo con cerebro animado; sin zoom de doble toque; tamaño fijo a la pantalla ---------- */
.lock-screen { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
.lock-screen .key, .lock-screen .btn, .lock-screen button { touch-action: manipulation; }
/* con código de números, el bloqueo ocupa la pantalla completa y NO usa --app-h (que cambia con el zoom/teclado);
   con frase segura sí sigue al teclado */
.lock-screen:not([data-entry="frase"]) { inset: 0; height: 100%; height: 100dvh; }
.lock-screen .phrase-row .field { font-size: 18px; } /* ≥16 px: iOS no hace zoom al enfocar */
.lock-orbe { position: relative; flex: none; width: 148px; height: 148px; contain: layout; }
.lock-orbe canvas { position: absolute; inset: -10%; width: 120%; height: 120%; display: block; pointer-events: none; }
.lock-anillo { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; will-change: transform; }
.lock-anillo.a1 { inset: -6px; border: 1.5px dashed rgba(79, 240, 255,.38); box-shadow: 0 0 18px rgba(79, 240, 255,.2), inset 0 0 18px rgba(79, 240, 255,.1); animation: lockGira 26s linear infinite; }
.lock-anillo.a2 { inset: -14px; border: 1px solid transparent; border-top-color: rgba(255, 179, 71,.7); border-bottom-color: rgba(255, 179, 71,.35); animation: lockGira 9s linear infinite reverse; }
@keyframes lockGira { to { transform: rotate(1turn); } }
.lock-candado { position: absolute; right: -2px; bottom: -2px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #0a0306; border: 1px solid rgba(255, 179, 71,.65); box-shadow: 0 0 12px rgba(255, 179, 71,.45); transition: border-color .3s, box-shadow .3s; }
.lock-candado svg { width: 20px; height: 20px; color: #ff4d66; transition: color .3s; }
[data-lock="ok"] .lock-candado { border-color: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
[data-lock="ok"] .lock-candado svg { color: var(--cyan); }
[data-lock="espera"] .lock-orbe { filter: saturate(.3); opacity: .6; }
.lock-screen .pin-dots i { transform: scale(1); transition: background-color .12s, box-shadow .12s, transform .12s; }
.lock-screen .pin-dots i.on { transform: scale(1.12); }
.lock-screen .key:active { transform: scale(.94); }
.lock-screen .key { transition: transform .08s, background .1s, box-shadow .1s; }
@media (max-height: 700px) { .lock-orbe { width: 96px; height: 96px; } }
body.desk .lock-screen .lock-orbe { width: 140px; height: 140px; }
@media (prefers-reduced-motion: reduce) {
  .lock-anillo.a1, .lock-anillo.a2, [data-lock="error"] .pin-dots, [data-lock="error"] .phrase-row { animation: none; }
  .lock-screen .pin-dots i, .lock-screen .key { transition: none; }
  .lock-screen .key:active { transform: none; }
}

/* ===== v1.28: Antares Pulpo holográfico ===== */
#stage .reactor-wrap { touch-action: manipulation; }
#stage .reactor-wrap canvas.brain { display: none; }
.pulpo-escena { position: absolute; left: 50%; top: -30%; width: 190%; height: 175%; transform: translateX(-50%); pointer-events: none; z-index: 1; }
/* Inicio en espera: el pulpo tiene su propio espacio para los 8 brazos con nombre */
body:not(.compact):not(.kb-open):not(.typing):not(.desk):is([data-estado="reposo"], [data-estado="sinkey"]) #stage .reactor-wrap { width: min(100%, 400px) !important; height: clamp(230px, 46vh, 400px) !important; flex: 0 1 auto !important; min-height: 190px; opacity: 1; filter: none; }
body:not(.compact):not(.kb-open):not(.typing):is([data-estado="reposo"], [data-estado="sinkey"]) #stage .pulpo-escena { top: 0; width: 100%; height: 100%; }
body.desk:is([data-estado="reposo"], [data-estado="sinkey"]) #stage .pulpo-escena { top: -40%; width: 240%; height: 190%; }
.pulpo-escena .pulpo-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.pulpo-brazos { position: absolute; inset: 0; pointer-events: none; }
.pulpo-brazo { position: absolute; left: 0; top: 0; pointer-events: auto; touch-action: manipulation; -webkit-user-select: none; user-select: none;
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; min-height: 28px; border-radius: 14px; white-space: nowrap;
  border: 1px solid rgba(111, 186, 255,.4); background: rgba(3, 9, 24,.82); color: #dfe8ff; font: 600 12px/1 var(--font-ui, system-ui), sans-serif; cursor: pointer; will-change: transform; }
.pulpo-brazo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5f7a7f; flex: none; }
.pulpo-brazo[data-e=pensando]::before { background: #4ff0ff; box-shadow: 0 0 8px #4ff0ff; }
.pulpo-brazo[data-e=alerta] { border-color: #ffb347; box-shadow: 0 0 12px rgba(255, 179, 71,.55); }
.pulpo-brazo[data-e=alerta]::before { background: #ffb347; box-shadow: 0 0 8px #ffb347; animation: pulpoParp .4s infinite alternate; }
.pulpo-brazo:active { transform: scale(.96); }
@keyframes pulpoParp { to { opacity: .3; } }
.pulpo-escena.sin-etiquetas .pulpo-brazos { display: none; }
/* en chat / conversación / teclado el pulpo es pequeño: menos escena */
[data-presencia="avatar3d"] .pulpo-escena { visibility: hidden; }
body.compact:not(.desk) #stage .pulpo-escena, body.kb-open #stage .pulpo-escena { top: -24%; width: 160%; height: 160%; }
.pulpo-hoja { position: fixed; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 60; max-width: 520px; margin: 0 auto;
  background: rgba(4, 10, 24,.97); border: 1px solid rgba(111, 186, 255,.45); border-radius: 18px; padding: 14px 16px; box-shadow: 0 0 30px rgba(111, 186, 255,.2);
  transform: translateY(20px); opacity: 0; transition: transform .25s, opacity .25s; }
.pulpo-hoja.ver { transform: none; opacity: 1; }
.pulpo-hoja.alerta { border-color: #ffb347; box-shadow: 0 0 30px rgba(255, 179, 71,.3); }
.pulpo-hoja .ph-t { margin: 0 0 2px; font-size: 18px; color: #4ff0ff; letter-spacing: .02em; }
.pulpo-hoja.alerta .ph-t { color: #ff4d66; }
.pulpo-hoja .ph-e { margin: 0 0 6px; font-size: 13px; color: var(--muted, #8fb7bf); }
.pulpo-hoja .ph-d { margin: 0 0 10px; font-size: 15px; line-height: 1.4; }
.pulpo-hoja .ph-acc { display: flex; gap: 8px; } .pulpo-hoja .ph-acc .btn { flex: 1; }
.ph-lista { display: flex; flex-wrap: wrap; gap: 8px; } .ph-lista .pulpo-brazo { position: static; min-height: 36px; font-size: 13.5px; }
/* bloqueo: pulpo con el candado, sin los anillos del cerebro anterior */
.lock-orbe .lock-anillo { display: none; }
.lock-orbe canvas { inset: -14%; width: 128%; height: 128%; }
@media (prefers-reduced-motion: reduce) { .pulpo-brazo[data-e=alerta]::before { animation: none; } .pulpo-hoja { transition: none; } }

/* v1.30: Viernes en Personal */
.viernes-box{display:flex;flex-direction:column;gap:8px;margin:8px 4px 4px;padding:12px;border-radius:14px;border:1px solid rgba(244,114,182,.45);background:linear-gradient(135deg,rgba(244,114,182,.12),rgba(167,139,250,.12))}
.viernes-box .btn{text-align:center;text-decoration:none;min-height:44px;display:flex;align-items:center;justify-content:center}
.viernes-note{margin:4px 0 0;font-size:13px;opacity:.85;line-height:1.4}
.viernes-card strong{color:#f9a8d4}

/* v1.31 keys de respaldo */
.extra-keys .xk-row{display:flex;gap:6px;align-items:center;margin-top:8px}
.extra-keys .xk-row input{flex:1;min-width:0}
.extra-keys .xk-st{font-size:.8em;opacity:.85;margin:2px 0 0 4px}
