/* ============================================================
   galaxy.css — Capa de diseño «Galáctico» de SPECTRA OS.
   Se carga la ÚLTIMA y reinterpreta el lenguaje visual sin
   tocar la lógica: fondo de nebulosa con estrellas, cristal
   profundo, degradados violeta→cian, tipografía Space Grotesk
   para títulos e Inter para lectura, botones más grandes y
   textos en frase normal (menos MAYÚSCULAS = más legible).
   El Escáner conserva la LENTE PURA: nada se dibuja sobre la
   cámara.
   ============================================================ */

:root {
  --bg-void: #04040b;
  --bg-deep: #070814;
  --bg-panel: rgba(16, 18, 38, 0.62);
  --bg-panel-solid: #0f1126;
  --bg-elev: rgba(28, 30, 60, 0.78);
  --bg-inset: rgba(4, 5, 14, 0.55);

  --neon-cyan: #38e1ff;
  --neon-violet: #b18cff;
  --neon-pink: #ff6ad5;
  --neon-amber: #ffc857;
  --neon-green: #4ef0b0;
  --neon-red: #ff6b81;

  --cyan-dim: rgba(56, 225, 255, 0.14);
  --violet-dim: rgba(177, 140, 255, 0.16);
  --pink-dim: rgba(255, 106, 213, 0.14);

  --grad-cosmic: linear-gradient(135deg, #7c3aed 0%, #4f46e5 38%, #06b6d4 100%);
  --grad-aurora: linear-gradient(120deg, #b18cff, #38e1ff 55%, #4ef0b0);
  --grad-text: linear-gradient(100deg, #f5f3ff 0%, #c4b5fd 45%, #67e8f9 100%);

  --txt-hi: #f5f7ff;
  --txt: #d5dbf0;
  --txt-lo: #a3acc9;
  --txt-ghost: #737ca0;

  --line: rgba(160, 170, 230, 0.16);
  --line-soft: rgba(160, 170, 230, 0.09);

  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;

  --fs-nano: 11px;
  --fs-micro: 12px;
  --fs-xs: 13px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 19px;
  --fs-xl: 28px;

  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --shadow-panel: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --glow-cosmic: 0 10px 34px rgba(124, 58, 237, 0.38), 0 0 60px rgba(6, 182, 212, 0.16);
}

/* ---------- Fondo: nebulosa + estrellas ---------- */
html, body { background: var(--bg-void); }
body {
  background-image: none;
  font-size: var(--fs-sm);
  letter-spacing: 0;
}
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 600ms var(--ease);
}
.nebula {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 32% at 18% 12%, rgba(124, 58, 237, 0.30), transparent 70%),
    radial-gradient(34% 28% at 88% 22%, rgba(6, 182, 212, 0.20), transparent 70%),
    radial-gradient(40% 30% at 70% 92%, rgba(236, 72, 153, 0.16), transparent 70%),
    radial-gradient(30% 24% at 8% 80%, rgba(79, 70, 229, 0.18), transparent 70%);
  filter: blur(8px) saturate(1.2);
  animation: nebula-drift 60s ease-in-out infinite alternate;
}
@keyframes nebula-drift {
  from { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  to { transform: translate3d(-3%, 2%, 0) rotate(6deg) scale(1.08); }
}
/* Los colores de fase tiñen la nebulosa */
body[data-phase="presence"] .nebula { filter: blur(8px) saturate(1.2) hue-rotate(-60deg); }
body[data-phase="contact"] .nebula,
body[data-phase="comm"] .nebula { filter: blur(8px) saturate(1.5) hue-rotate(20deg); }
#app { z-index: 1; }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4, .screen-title, .boot-name, .ceremony-title, .call-title, .empty-title {
  font-family: var(--font-display);
}
.screen-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.screen-head { border-bottom: 0; padding-bottom: 0; margin-bottom: var(--s4); }
.screen-sub {
  font-family: var(--font-ui);
  font-size: var(--fs-nano);
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
}

/* ---------- Paneles de cristal profundo ---------- */
.panel {
  background: linear-gradient(160deg, rgba(30, 32, 70, 0.55), rgba(10, 12, 30, 0.62));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.panel::before {
  /* reemplaza las scanlines por un brillo superior sutil */
  background: radial-gradient(120% 60% at 0% 0%, rgba(177, 140, 255, 0.10), transparent 60%);
  mix-blend-mode: normal;
  opacity: 1;
}
.panel-title {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--txt);
}
.panel-title::after { background: linear-gradient(to right, rgba(177, 140, 255, 0.35), transparent); }
.panel-note { font-size: var(--fs-xs); line-height: 1.65; color: var(--txt-lo); }

/* Hero de Inicio */
.panel--hero {
  border: 1px solid rgba(177, 140, 255, 0.28);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(56, 225, 255, 0.16), transparent 55%),
    radial-gradient(120% 90% at 0% 100%, rgba(124, 58, 237, 0.24), transparent 60%),
    linear-gradient(160deg, rgba(34, 30, 80, 0.7), rgba(10, 10, 30, 0.7));
  box-shadow: var(--shadow-panel), 0 0 0 1px rgba(255, 255, 255, 0.02), 0 30px 80px rgba(76, 29, 149, 0.25);
}
.panel--hero h3, #lp-hero h3 {
  font-size: 21px;
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1.2;
}
#lp-hero-sub { font-size: var(--fs-xs) !important; color: var(--txt-lo); }
.hero-foot { font-size: var(--fs-nano); text-align: center; margin: var(--s3) 0 var(--s2); color: var(--txt-ghost); }
.panel--hero .sigil {
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(177, 140, 255, 0.3), 0 0 40px rgba(56, 225, 255, 0.3);
  animation: sigil-float 6s ease-in-out infinite;
}
@keyframes sigil-float { 50% { transform: translateY(-4px) rotate(4deg); } }

/* ---------- Botones ---------- */
.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--r-md);
  min-height: 46px;
  font-size: var(--fs-xs);
}
.btn--sm { min-height: 38px; font-size: var(--fs-nano); border-radius: 12px; }
.btn--hero { min-height: 58px; font-size: var(--fs-md); border-radius: 18px; }
.btn--primary {
  background: var(--grad-cosmic);
  border: 0;
  color: #fff;
  box-shadow: var(--glow-cosmic), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.btn--primary:hover { filter: brightness(1.08); }
body[data-phase="presence"] .btn--primary { background: linear-gradient(135deg, #f59e0b, #ec4899); }
body[data-phase="contact"] .btn--primary,
body[data-phase="comm"] .btn--primary { background: linear-gradient(135deg, #a855f7, #ec4899); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  color: var(--txt);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.07); color: var(--txt-hi); }
.btn--danger { border-radius: var(--r-md); }
.btn:focus-visible, .chip:focus-visible, .nav-btn:focus-visible, .hub-tile:focus-visible, .toggle:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}

/* ---------- Chips, toggles, campos ---------- */
.chip {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.03em;
  min-height: 36px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.035);
}
.chip.is-active {
  background: var(--grad-cosmic);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}
.toggle-label { font-weight: 600; letter-spacing: 0.01em; color: var(--txt-hi); }
.toggle-hint { font-size: var(--fs-nano); color: var(--txt-lo); letter-spacing: 0; text-transform: none; }
.switch[aria-checked="true"] {
  background: var(--grad-cosmic);
  border-color: transparent;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.45);
}
.input, .textarea, .select {
  border-radius: 14px;
  background: rgba(4, 5, 16, 0.6);
  border: 1px solid var(--line);
  min-height: 46px;
  font-size: 16px; /* evita el zoom automático de iOS */
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--neon-violet);
  box-shadow: 0 0 0 3px rgba(177, 140, 255, 0.2);
}
.badge { border-radius: 999px; font-weight: 600; }

/* ---------- Hub de accesos ---------- */
.hub-tile {
  border-radius: var(--r-lg);
  font-family: var(--font-ui);
  font-size: var(--fs-nano);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--txt);
  background: linear-gradient(160deg, rgba(30, 32, 70, 0.55), rgba(10, 12, 30, 0.6));
  border: 1px solid var(--line);
  min-height: 88px;
}
.hub-tile:hover { transform: translateY(-2px); border-color: rgba(177, 140, 255, 0.4); }
.hub-ico { width: 44px; height: 44px; border: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.hub-ico svg { width: 20px; height: 20px; }

/* ---------- Guía de 3 pasos ---------- */
.steps { list-style: none; margin: var(--s3) 0 0; padding: 0; counter-reset: st; display: grid; gap: var(--s2); }
.steps li {
  counter-increment: st;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px var(--s3);
  align-items: start;
  padding: var(--s3);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
}
.steps li::before {
  content: counter(st);
  grid-row: span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-cosmic);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
}
.steps b { color: var(--txt-hi); font-size: var(--fs-sm); font-family: var(--font-display); }
.steps span { color: var(--txt-lo); font-size: var(--fs-xs); line-height: 1.55; }

/* ---------- Chip de nube ---------- */
.cloud-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: calc(-1 * var(--s2)) 0 var(--s3);
  padding: 7px 13px 7px 10px;
  border-radius: 999px;
  font-size: var(--fs-nano);
  font-weight: 600;
  color: var(--txt);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.cloud-chip svg { width: 16px; height: 16px; }
.cloud-chip[data-state="synced"] { color: var(--neon-green); border-color: rgba(78, 240, 176, 0.35); background: rgba(78, 240, 176, 0.08); }
.cloud-chip[data-state="syncing"] { color: var(--neon-cyan); border-color: rgba(56, 225, 255, 0.35); }
.cloud-chip[data-state="syncing"] svg { animation: pulse-soft 1.1s ease-in-out infinite; }
.cloud-chip[data-state="offline"], .cloud-chip[data-state="error"], .cloud-chip[data-state="auth"] {
  color: var(--neon-amber); border-color: rgba(255, 200, 87, 0.35); background: rgba(255, 200, 87, 0.07);
}
@keyframes pulse-soft { 50% { opacity: 0.35; } }

/* Panel de cuenta en Ajustes */
.cloud-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.cloud-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-cosmic); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  box-shadow: 0 0 28px rgba(124, 58, 237, 0.45);
}
.cloud-name { display: block; font-family: var(--font-display); font-size: var(--fs-md); color: var(--txt-hi); }
.cloud-sub { display: block; font-size: var(--fs-nano); color: var(--txt-lo); }
.cloud-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--txt-ghost); }
.cloud-dot[data-state="synced"] { background: var(--neon-green); box-shadow: 0 0 12px var(--neon-green); }
.cloud-dot[data-state="syncing"] { background: var(--neon-cyan); animation: pulse-soft 1s infinite; }
.cloud-dot[data-state="offline"], .cloud-dot[data-state="error"] { background: var(--neon-amber); }
.cloud-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin-bottom: var(--s3); }
.cloud-stats div {
  text-align: center; padding: 10px 4px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line-soft);
}
.cloud-stats b { display: block; font-family: var(--font-display); font-size: 20px; color: var(--txt-hi); }
.cloud-stats span { font-size: 10.5px; color: var(--txt-lo); }

/* ---------- Pantalla de acceso ---------- */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  background:
    radial-gradient(60% 40% at 20% 10%, rgba(124, 58, 237, 0.35), transparent 70%),
    radial-gradient(60% 40% at 90% 90%, rgba(6, 182, 212, 0.25), transparent 70%),
    rgba(3, 3, 10, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.auth-gate.is-open { display: flex; animation: screen-in 420ms var(--ease); }
.auth-card {
  width: 100%;
  max-width: 380px;
  padding: var(--s6) var(--s5) var(--s5);
  border-radius: var(--r-xl);
  text-align: center;
  background: linear-gradient(160deg, rgba(34, 30, 80, 0.8), rgba(10, 10, 30, 0.85));
  border: 1px solid rgba(177, 140, 255, 0.3);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 80px rgba(124, 58, 237, 0.25);
}
.auth-card.shake { animation: shake 420ms ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.auth-logo {
  width: 84px; height: 84px; border-radius: 24px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 50px rgba(56, 225, 255, 0.35);
  animation: sigil-float 6s ease-in-out infinite;
}
.auth-card h2 {
  margin: var(--s3) 0 2px;
  font-size: 26px;
  letter-spacing: 0.08em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-sub { color: var(--txt-lo); font-size: var(--fs-xs); margin: 0 0 var(--s4); }
.auth-form { text-align: left; display: flex; flex-direction: column; gap: 6px; }
.auth-form .field-label { margin-top: 6px; font-size: var(--fs-nano); color: var(--txt-lo); letter-spacing: 0.02em; text-transform: none; }
.auth-form .btn--hero { margin-top: var(--s3); }
.auth-pass-row { display: flex; gap: var(--s2); }
.auth-pass-row .input { flex: 1; }
.auth-pass-row .btn--icon { width: 46px; min-height: 46px; }
.auth-pass-row .btn--icon svg { width: 18px; height: 18px; }
.auth-error {
  margin: 6px 0 0; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 107, 129, 0.12); border: 1px solid rgba(255, 107, 129, 0.4);
  color: #ffd1d8; font-size: var(--fs-xs);
}
.auth-local {
  margin-top: var(--s4);
  color: var(--txt-lo);
  font-size: var(--fs-xs);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
}

/* ---------- Navegación inferior flotante ---------- */
#nav {
  margin: 0 10px calc(8px + var(--safe-b));
  height: var(--nav-h);
  padding-bottom: 0;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(12, 13, 32, 0.78);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.nav-btn { border-radius: 18px; margin: 6px 2px; color: var(--txt-ghost); }
.nav-btn span { font-size: 10.5px; font-weight: 600; }
.nav-btn.is-active {
  color: #fff;
  text-shadow: none;
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.45), rgba(6, 182, 212, 0.25));
  box-shadow: inset 0 0 0 1px rgba(177, 140, 255, 0.35), 0 6px 18px rgba(124, 58, 237, 0.3);
}
.nav-btn.is-active::before { display: none; }
.nav-btn.is-active svg { filter: drop-shadow(0 0 6px rgba(56, 225, 255, 0.6)); }
#toasts { bottom: calc(var(--nav-h) + var(--safe-b) + 24px); }

/* ---------- Toasts ---------- */
.toast {
  border-radius: 16px;
  background: rgba(16, 16, 40, 0.94);
  border: 1px solid rgba(177, 140, 255, 0.35);
  font-size: var(--fs-xs);
  letter-spacing: 0.01em;
  padding: 12px 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}

/* ---------- Modales ---------- */
.modal { background: rgba(3, 3, 12, 0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.modal-card { border-radius: var(--r-xl); border-color: rgba(177, 140, 255, 0.28); }
@media (max-width: 520px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-card {
    max-width: none;
    border-radius: 28px 28px 0 0;
    padding-bottom: calc(var(--s5) + var(--safe-b));
    animation: sheet-up 340ms var(--ease);
  }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Métricas / listas / vacíos ---------- */
.metric, .weekly-cell, .item, .kv { border-radius: 16px; }
.metric-v, .weekly-cell b { font-family: var(--font-display); }
.metric-k { letter-spacing: 0.04em; text-transform: none; font-size: var(--fs-nano); }
.kv-k { letter-spacing: 0.02em; text-transform: none; font-size: var(--fs-nano); }
.item { background: rgba(255, 255, 255, 0.03); }
.empty-glyph {
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.25), rgba(6, 182, 212, 0.15));
  border: 0;
  color: #e9e4ff;
}
.empty-title { text-transform: none; letter-spacing: -0.01em; font-size: var(--fs-md); }
.shot { border-radius: 16px; overflow: hidden; }

/* ---------- Escáner: la puerta y la ceremonia ---------- */
.cam-gate {
  background:
    radial-gradient(50% 40% at 50% 38%, rgba(124, 58, 237, 0.28), transparent 70%),
    radial-gradient(60% 40% at 50% 100%, rgba(6, 182, 212, 0.15), transparent 70%),
    rgba(4, 4, 11, 0.94);
}
.cam-gate h2 {
  text-transform: none;
  letter-spacing: -0.02em;
  font-size: 30px;
  text-shadow: none;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cam-gate p { font-size: var(--fs-sm); line-height: 1.65; max-width: 360px; }
.cam-gate .sigil-lg {
  filter: drop-shadow(0 0 30px rgba(56, 225, 255, 0.45));
  animation: sigil-float 6s ease-in-out infinite;
}
#stage { background: #000; }

/* Boot */
#boot {
  background:
    radial-gradient(50% 40% at 50% 40%, rgba(124, 58, 237, 0.3), transparent 70%),
    var(--bg-void);
}
.boot-name {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* Ajustes: grupos con respiración */
.settings-group { margin-bottom: var(--s3); }
.danger-zone { border-radius: var(--r-lg); }

/* Pantallas grandes: columna centrada y cómoda */
@media (min-width: 900px) {
  #nav { max-width: 560px; margin-left: auto; margin-right: auto; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .nebula, .panel--hero .sigil, .auth-logo, .cam-gate .sigil-lg { animation: none !important; }
}

/* ============================================================
   Escáner en modo SENCILLO: menos ruido, más cámara.
   ============================================================ */
body[data-ui="simple"] #hud-sim,
body[data-ui="simple"] #hud-sig,
body[data-ui="simple"] #hud-recurrence { display: none !important; }
body[data-ui="simple"] .hud-chipstack { max-width: 62%; }
body[data-ui="simple"] .hud-chip { font-size: 10px; letter-spacing: 0.04em; }
/* Registro de detecciones: solo las 2 últimas, compactas */
body[data-ui="simple"] .detect-log-item:nth-child(n+3) { display: none; }
body[data-ui="simple"] .detect-log { bottom: calc(var(--s3) + 176px); }
.detect-log-item { border-radius: 12px; }
.hud-chip { border-radius: 999px; }
.presence-box { border-radius: 18px; }

/* Herramientas: botones grandes y legibles */
.tool {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 10px 13px;
  border-radius: 14px;
  min-height: 42px;
  text-transform: none;
}
body[data-ui="expert"] .tool { text-transform: uppercase; font-size: 9px; }
.tool svg { width: 16px; height: 16px; }
.tool--shot {
  background: var(--grad-cosmic) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: var(--glow-cosmic);
}
body[data-ui="simple"] .hud-toolbar { justify-content: center; flex-wrap: wrap; overflow: visible; }
.hud-sens { border-radius: 999px; }
.hud-sens-btn { border-radius: 999px; font-weight: 600; }

/* Onboarding */
.ob-card { text-align: center; }
.ob-title { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 var(--s3); }
.ob-text { color: var(--txt-lo); font-size: var(--fs-sm); line-height: 1.7; margin: 0 auto; max-width: 320px; }
.ob-text b { color: var(--txt-hi); }
.ob-slide .sigil { filter: drop-shadow(0 0 24px rgba(56, 225, 255, 0.45)); }

/* Chat */
.term-head .screen-title { margin-bottom: 4px; }
.chat-log { border-radius: var(--r-lg); }
.composer { gap: var(--s2); }
.composer .btn--icon { width: 48px; min-height: 48px; border-radius: 16px; }
.composer .btn--icon svg { width: 20px; height: 20px; }
.composer .textarea { border-radius: 18px; }

/* Con un modal (hoja inferior) abierto, los avisos suben arriba */
body:has(.modal.is-open) #toasts { bottom: auto; top: calc(var(--safe-t) + 14px); }
/* Chat: la caja de texto no se corta */
#chat-input { min-height: 48px !important; padding: 13px 14px; line-height: 1.35; }
#chat-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
