/* Jarvis · The Web Tailors
   Estilo "data terminal": tarjetas más oscuras que el fondo, cifras tabulares, un solo azul
   para lo que está pasando ahora y para la voz que escucha. Ámbar = vence pronto, rojo = tarde o falló.
   Rejilla a 1440: riel 56 + lienzo (32 + 1296 + 32 + 24 de margen) = columna principal 1fr y lateral 384, separadas 24. */

:root {
  color-scheme: dark;
  --ground: #171719;
  --surface: #131217;
  --raised: #212023;
  --border: #222224;
  --rule: #1b1a1f;
  --control: #3a3a3e;
  --text: #ffffff;
  --muted: #8a8c92;
  --accent: #4a8ad6;
  --positive: #44a282;
  --negative: #e5566f;
  --warning: #d9a441;
  --pill-pos-bg: #1b2828; --pill-pos-ink: #5fc39c;
  --pill-neg-bg: #2c1a20; --pill-neg-ink: #e5566f;
  --pill-warn-bg: #2a2416; --pill-warn-ink: #d9a441;
  --pill-neutral-bg: #212023; --pill-neutral-ink: #bdbdc0;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.2);

  /* charts.js */
  --chart-1: var(--accent);
  --chart-muted: #63656b;
  --grid: #222224;
  --axis-ink: var(--muted);
  --ink: var(--text);

  --font: "Public Sans", Inter, system-ui, sans-serif;
  --fs-title: 26px; --fs-card: 16px; --fs-kpi: 24px; --fs-body: 13px; --fs-small: 12px;
  --rail: 56px; --gap: 24px; --pad: 32px;
  --radius-card: 6px;
  --control-h: 34px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --t-press: 160ms; --t-hover: 150ms; --t-ui: 200ms;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--control) var(--ground); scrollbar-width: thin; }
body { margin: 0; background: var(--ground); color: var(--text); font: var(--fs-body)/20px var(--font); -webkit-font-smoothing: antialiased; caret-color: var(--accent); }
h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
::selection { background: rgba(74, 138, 214, 0.38); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, table, .cifra-valor, .fila-dato, .sello { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.simbolos { position: absolute; }
[hidden] { display: none !important; }

/* ---------- riel de íconos ---------- */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100svh; }
.rail { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; align-items: center; padding: 14px 0 16px; border-right: 1px solid var(--border); background: var(--ground); z-index: 10; }
.marca { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; }
.marca svg { width: 28px; height: 28px; overflow: visible; }
.marca-j { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linecap: round; }
.marca-punto { fill: var(--accent); }
.rail-lista { display: grid; gap: 4px; margin-top: 28px; }
.rail-abajo { margin-top: auto; }
.rail-item { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); transition: color var(--t-hover) ease, background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.rail-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.rail-item span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rail-item[aria-current="page"] { color: var(--text); }
/* la selección: una línea azul de 1px sobre el borde del riel */
.rail-item[aria-current="page"]::after { content: ""; position: absolute; right: -10.5px; top: 9px; bottom: 9px; width: 1px; background: var(--accent); }
.rail-item:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .rail-item:hover { color: var(--text); background: var(--raised); } }

.tip { position: fixed; z-index: 30; padding: 4px 8px; border-radius: 4px; background: var(--raised); color: var(--text); font-size: var(--fs-small); line-height: 16px; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); pointer-events: none; opacity: 0; transform: translateX(-4px); transform-origin: left center; transition: opacity 125ms ease-out, transform 125ms var(--ease-out); }
.tip[data-visible="true"] { opacity: 1; transform: none; }
.tip[data-instant="true"] { transition-duration: 0ms; }

/* ---------- lienzo y título ---------- */
.lienzo { min-width: 0; padding: 28px var(--pad) 48px; }
.titulo { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.titulo h1 { font-size: var(--fs-title); line-height: 32px; font-weight: 700; letter-spacing: -0.01em; }
.hallazgo { margin-top: 6px; max-width: 75ch; font-size: 15px; line-height: 22px; text-wrap: pretty; }
.titulo-acciones { display: flex; align-items: center; gap: 12px; flex: none; }
.sello { color: var(--muted); font-size: var(--fs-small); }
.boton { display: inline-flex; align-items: center; gap: 8px; height: var(--control-h); padding: 0 14px; border: 1px solid var(--control); border-radius: 999px; background: transparent; font-weight: 500; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.boton svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: opacity var(--t-ui) ease; }
.boton:active { transform: scale(0.97); }
.boton[data-cargando="true"] svg { opacity: 0.4; }
@media (hover: hover) and (pointer: fine) { .boton:hover { background: var(--raised); } }

.aviso-demo { margin: -4px 0 20px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-card); color: var(--muted); font-size: var(--fs-body); line-height: 19px; }
.aviso-demo strong { color: var(--text); font-weight: 600; }

.esqueleto { display: inline-block; max-width: 100%; border-radius: 4px; background: var(--raised); }
.esqueleto-frase { width: 420px; }

/* ---------- rejilla ---------- */
.tablero { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: var(--gap); align-items: start; }
.principal, .lateral { display: grid; gap: var(--gap); min-width: 0; }
.panel { min-width: 0; padding: 20px 24px 24px; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); }
.panel-cabeza, .bloque-cabeza { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-cabeza { margin-bottom: 12px; }
.bloque-cabeza { margin-bottom: 8px; }
.panel h2, .bloque-titulo { font-size: var(--fs-card); line-height: 22px; font-weight: 600; }
.bloque > .bloque-titulo { margin-bottom: 8px; }
.meta { color: var(--muted); font-size: var(--fs-small); white-space: nowrap; }
.par { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); align-items: stretch; }

.enlace { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; padding: 0; border: 0; background: none; font-weight: 500; text-underline-offset: 3px; }
.enlace::after { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--flecha) center / 12px no-repeat; mask: var(--flecha) center / 12px no-repeat; transition: transform var(--t-ui) var(--ease-out); }
.enlace[aria-expanded="true"]::after { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .enlace:hover { text-decoration: underline; } }
:root { --flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* ---------- "Lo que sigue": columnas fijas, como tablero de salidas ---------- */
.tabla-sigue { margin: 0 -24px; overflow-x: auto; }
.tabla-sigue table { width: 100%; border-collapse: collapse; }
.tabla-sigue th { height: 32px; padding: 0 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: var(--fs-small); font-weight: 400; text-align: left; white-space: nowrap; }
.tabla-sigue td { padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.tabla-sigue tbody tr:last-child td { border-bottom: 0; }
.tabla-sigue th:first-child, .tabla-sigue td:first-child { padding-left: 24px; }
.tabla-sigue th:last-child, .tabla-sigue td:last-child { padding-right: 24px; }
.c-hora { width: 92px; }
td.c-hora { font-size: 15px; font-weight: 500; white-space: nowrap; transition: color var(--t-ui) ease; }
td.c-que { font-weight: 500; }
td.c-quien { max-width: 0; width: 38%; }
.quien-nombre, .quien-detalle { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quien-detalle { color: var(--muted); font-size: var(--fs-small); line-height: 18px; }
th.c-accion, td.c-accion { width: 1%; text-align: right; white-space: nowrap; }
/* la fila de ahora: 1px azul en el borde del panel */
.tabla-sigue tr.ahora td:first-child { box-shadow: inset 1px 0 0 var(--accent); }
/* una fila nueva conserva su hora en azul hasta que la ves */
.tabla-sigue tr.nuevo td.c-hora { color: var(--accent); }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); font-size: var(--fs-small); font-weight: 500; white-space: nowrap; flex: none; }
.pill.tarde { background: var(--pill-neg-bg); color: var(--pill-neg-ink); }
.pill.pronto { background: var(--pill-warn-bg); color: var(--pill-warn-ink); }
.pill.ok { background: var(--pill-pos-bg); color: var(--pill-pos-ink); }

.accion { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--control); border-radius: 999px; font-size: var(--fs-body); font-weight: 500; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.accion svg { width: 12px; height: 12px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.accion:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .accion:hover { background: var(--raised); } }

.vacio { padding: 20px 24px; color: var(--muted); }
.gris { color: var(--muted); }
.cabeza-derecha { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
.cabeza-derecha .enlace { margin-top: 0; font-size: var(--fs-small); }
.enlace-afuera::after { -webkit-mask-image: var(--afuera); mask-image: var(--afuera); }
:root { --afuera: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 2.5h5.5V8M9.5 2.5l-7 7' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.tabla-recientes th.n, .tabla-recientes td.n { text-align: right; }
.tabla-recientes td.c-quien { width: 34%; }

/* ---------- cifras: una franja dividida ---------- */
.cifras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); }
.cifra { min-width: 0; padding: 16px 24px 18px; }
.cifra + .cifra { border-left: 1px solid var(--border); }
.cifra-etiqueta { color: var(--muted); }
.cifra-valor { margin-top: 6px; font-size: var(--fs-kpi); line-height: 30px; font-weight: 500; letter-spacing: -0.01em; }
.cifra-valor.malo { color: var(--negative); }
.cifra-nota { margin-top: 2px; color: var(--muted); font-size: var(--fs-small); line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- gráfica y embudo ---------- */
.grafica { height: 176px; }
.embudo { display: grid; gap: 9px; }
.embudo li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; }
.embudo .etapa { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embudo .cuantos { font-weight: 500; font-variant-numeric: tabular-nums; }
.embudo .barra { grid-column: 1 / -1; height: 2px; margin-top: 5px; background: var(--chart-muted); transform-origin: left center; }
.embudo .cero .barra { background: transparent; }

/* ---------- columna derecha ---------- */
.lista-panel { padding: 4px 20px; }
.filas li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: center; min-height: 52px; padding: 8px 0; }
.filas li + li { border-top: 1px solid var(--rule); }
.filas a.fila-enlace { display: contents; }
.fila-titulo, .fila-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-titulo { font-weight: 500; }
.fila-sub { color: var(--muted); font-size: var(--fs-small); line-height: 18px; }
.fila-dato { text-align: right; white-space: nowrap; }
.fila-dato .fila-sub { text-align: right; }
.fila-dato.pronto { color: var(--warning); }
.fila-dato.tarde { color: var(--negative); }
.lista-panel .enlace { margin: 4px 0 14px; }
.estado { display: inline-flex; align-items: center; gap: 7px; }
.estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.estado.ok::before { background: var(--positive); }
.estado.pronto::before { background: var(--warning); }
.estado.tarde::before { background: var(--negative); }

/* ---------- Pregúntale a Jarvis ---------- */
.jarvis { padding: 20px; }
.respuesta { min-height: 0; }
.respuesta-pregunta { margin-bottom: 6px; color: var(--muted); font-size: var(--fs-small); line-height: 18px; }
.respuesta-texto { font-size: 14px; line-height: 21px; text-wrap: pretty; transition: opacity var(--t-ui) ease, filter var(--t-ui) ease; }
.jarvis[data-estado="pensando"] .respuesta-texto { opacity: 0.55; filter: blur(1.5px); }
.sugerencias { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 16px; }
.chip { height: 28px; padding: 0 11px; border: 1px solid var(--control); border-radius: 999px; background: transparent; color: var(--muted); font-size: var(--fs-body); transition: color var(--t-hover) ease, border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.chip:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .chip:hover { color: var(--text); border-color: #55565b; } }
.preguntar { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 8px; align-items: center; }
.mic, .enviar { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.mic { position: relative; border: 1px solid var(--control); background: transparent; }
.mic svg, .enviar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mic:active, .enviar:active { transform: scale(0.95); }
.mic:disabled { color: var(--muted); cursor: not-allowed; }
.mic[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.nivel { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 2px; }
.nivel i { width: 2px; height: 16px; border-radius: 1px; background: var(--accent); transform: scaleY(0.15); }
.mic[aria-pressed="true"] .mic-icono { visibility: hidden; }
.mic[aria-pressed="true"] .nivel { display: flex; }
.campo { width: 100%; height: 38px; padding: 0 14px; border: 1px solid var(--control); border-radius: 999px; background: var(--ground); outline: none; transition: border-color var(--t-hover) ease; }
.campo::placeholder { color: var(--muted); }
.campo:focus-visible { border-color: var(--accent); }
.enviar { border: 0; background: var(--text); color: #121214; }
.enviar:disabled { opacity: 0.5; cursor: wait; }
.jarvis-nota { margin-top: 10px; color: var(--muted); font-size: var(--fs-small); line-height: 18px; }
.jarvis-nota:empty { display: none; }
@media (hover: hover) and (pointer: fine) {
  .mic:not(:disabled):hover { background: var(--raised); }
  .enviar:hover { background: #e6e6e8; }
}

/* ---------- tablet y celular ---------- */
@media (max-width: 1100px) {
  .tablero { grid-template-columns: minmax(0, 1fr); }
  .lateral { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  /* el riel se vuelve una barra abajo con nombre bajo cada ícono */
  .rail { position: fixed; inset: auto 0 0 0; top: auto; display: block; height: auto; padding: 0 0 env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--border); }
  .rail .rail-lista { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; margin: 0; }
  .rail .marca, .rail .rail-lista.rail-abajo { display: none; }
  .rail .solo-escritorio { display: none; }
  .rail-item { width: 100%; height: 58px; gap: 3px; align-content: center; border-radius: 0; }
  .rail-item span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; font-size: 11px; line-height: 14px; }
  .rail-item[aria-current="page"]::after { top: -1px; bottom: auto; left: 50%; right: auto; width: 32px; height: 1px; transform: translateX(-50%); }
  .tip { display: none; }
  .lienzo { padding: 20px 16px calc(84px + env(safe-area-inset-bottom)); }
  .titulo { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .lateral { grid-template-columns: minmax(0, 1fr); }
  .cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cifra:nth-child(3) { border-left: 0; }
  .cifra:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .cifra { padding: 14px 16px; }
  .par { grid-template-columns: minmax(0, 1fr); }
  .esqueleto-frase { width: 100%; }
  .panel-cabeza { flex-wrap: wrap; row-gap: 4px; }
  .solo-ancho { display: none; }
}
@media (max-width: 640px) {
  .panel { padding: 16px; }
  .tabla-sigue { margin: 0 -16px; }
  .tabla-sigue thead { display: none; }
  .tabla-sigue table, .tabla-sigue tbody { display: block; }
  .tabla-sigue tr { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "hora que estado" ". quien quien" ". accion accion"; row-gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
  .tabla-sigue tbody tr:last-child { border-bottom: 0; }
  .tabla-sigue td, .tabla-sigue td:first-child, .tabla-sigue td:last-child { padding: 0; border: 0; }
  .tabla-sigue td.c-hora { grid-area: hora; width: auto; }
  .tabla-sigue td.c-que { grid-area: que; }
  .tabla-sigue td.c-quien { grid-area: quien; width: auto; max-width: none; }
  .tabla-sigue td.c-estado { grid-area: estado; }
  .tabla-sigue td.c-accion { grid-area: accion; width: auto; text-align: left; margin-top: 6px; }
  .tabla-sigue tr.ahora td:first-child { box-shadow: none; }
  .tabla-sigue tr.ahora { box-shadow: inset 1px 0 0 var(--accent); }
  .tabla-sigue.tabla-recientes tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "quien ultimo" "etapa precio"; column-gap: 12px; }
  .tabla-sigue.tabla-recientes td.c-quien { grid-area: quien; }
  .tabla-sigue.tabla-recientes td.c-etapa { grid-area: etapa; color: var(--muted); font-size: var(--fs-small); }
  .tabla-sigue.tabla-recientes td.c-prio { display: none; }
  .tabla-sigue.tabla-recientes td.c-precio { grid-area: precio; }
  .tabla-sigue.tabla-recientes td.c-ultimo { grid-area: ultimo; }
  .lista-panel { padding: 4px 16px; }
  .jarvis { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

/* ---------- entrada ---------- */
.entrar { display: grid; place-items: center; min-height: 100svh; padding: 24px 16px; }
.entrar-caja { width: min(360px, 100%); }
.entrar-marca { width: 36px; height: 36px; overflow: visible; margin-bottom: 16px; }
.entrar h1 { font-size: var(--fs-title); line-height: 32px; font-weight: 700; }
.entrar-sub { margin: 4px 0 24px; color: var(--muted); }
.entrar-form { display: grid; gap: 8px; }
.entrar-form label { font-weight: 500; }
.entrar-error { min-height: 18px; color: var(--negative); font-size: var(--fs-small); line-height: 18px; }
.entrar-boton { justify-content: center; height: 38px; border: 0; background: var(--text); color: #121214; }
@media (hover: hover) and (pointer: fine) { .entrar-boton:hover { background: #e6e6e8; } }

/* ---------- vistas ---------- */
.panel-separado { margin-top: var(--gap); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; color: var(--text); }
kbd { margin-left: 6px; padding: 1px 5px; border: 1px solid var(--control); border-radius: 4px; color: var(--muted); font: 11px/14px var(--font); }
.boton-icono { width: var(--control-h); padding: 0; justify-content: center; }
.boton-icono[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.boton-hud { border-color: rgba(74, 138, 214, 0.55); }
.boton-hud svg { stroke: var(--accent); }

/* tabla de habilidades */
.tabla-hab td { vertical-align: top; }
.tabla-hab td:first-child { width: 34%; }
.hab-nombre { display: block; font-weight: 600; }
.hab-texto { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-small); line-height: 18px; }
.hab-acciones { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.hab-accion { padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font-size: 11px; line-height: 18px; }
.hab-accion.escribe { border-color: rgba(217, 164, 65, 0.45); color: var(--warning); }
.diag { display: block; margin-top: 6px; font-size: var(--fs-small); line-height: 18px; }
.diag.bien { color: var(--positive); } .diag.mal { color: var(--negative); } .diag.nada { color: var(--muted); }

/* ---------- núcleo de voz (diseño propio: anillos con marcas, como un dial) ---------- */
.nucleo { overflow: visible; }
.nucleo .n-marcas line { stroke: rgba(74, 138, 214, 0.45); stroke-width: 1; }
.nucleo .n-marcas line.larga { stroke: rgba(74, 138, 214, 0.9); }
.nucleo .n-anillo { fill: none; stroke: rgba(74, 138, 214, 0.35); stroke-width: 1; }
.nucleo .n-arcos { fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 88 22; }
.nucleo .n-interior { fill: none; stroke: rgba(74, 138, 214, 0.6); stroke-width: 1.25; }
.nucleo .n-pulso { fill: rgba(74, 138, 214, 0.12); stroke: none; transform-origin: 100px 100px; transition: transform 90ms linear; }
.nucleo .n-centro { fill: var(--accent); }
.nucleo .n-giro { transform-origin: 100px 100px; }
.nucleo .n-lento { animation: girar 90s linear infinite; }
.nucleo .n-rapido { animation: girar 24s linear infinite reverse; }
[data-estado="pensando"] .nucleo .n-rapido { animation-duration: 1.4s; }
[data-estado="escuchando"] .nucleo .n-arcos, [data-estado="hablando"] .nucleo .n-arcos { stroke-dasharray: 104 6; }
@keyframes girar { to { transform: rotate(360deg); } }

.jarvis-cabeza { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.nucleo-chico { width: 64px; height: 64px; flex: none; }
.jarvis-quien { display: grid; gap: 2px; min-width: 0; }
.jarvis-estado { font-weight: 600; }
.jarvis[data-estado="escuchando"] .jarvis-estado, .jarvis[data-estado="hablando"] .jarvis-estado { color: var(--accent); }
.enlace.quien { margin: 0; color: var(--muted); font-size: var(--fs-small); font-weight: 400; }

/* propuestas que esperan confirmación */
.propuestas:empty { display: none; }
.propuestas { display: grid; gap: 8px; margin-top: 12px; }
.propuesta { display: grid; gap: 10px; padding: 12px; border: 1px solid rgba(217, 164, 65, 0.4); border-radius: var(--radius-card); background: var(--pill-warn-bg); text-align: left; }
.propuesta p { line-height: 19px; }
.propuesta-botones { display: flex; gap: 8px; }
.propuesta .confirmar { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--warning); color: #17140c; font-weight: 600; transition: transform var(--t-press) var(--ease-out); }
.propuesta .confirmar:active { transform: scale(0.97); }
.propuesta .cancelar { height: 30px; padding: 0 12px; border: 1px solid var(--control); border-radius: 999px; background: transparent; }

/* ¿quién eres? */
.duenos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.duenos p { width: 100%; color: var(--muted); font-size: var(--fs-small); }

/* ---------- Modo Jarvis: pantalla completa estilo HUD ---------- */
.hud { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 20px; padding: 24px 32px 28px; background: #0e0e11; color: var(--text); overflow: auto; }
.hud-arriba { display: flex; align-items: baseline; gap: 20px; }
.hud-reloj { font-size: 40px; line-height: 44px; font-weight: 300; letter-spacing: -0.02em; }
.hud-fecha, .hud-clima { color: var(--muted); font-size: 14px; }
.hud-arriba .boton { margin-left: auto; align-self: center; }
.hud-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px) minmax(0, 1fr); gap: 32px; align-items: center; min-height: 0; }
.hud-centro { display: grid; justify-items: center; text-align: center; gap: 10px; }
.nucleo-grande { width: min(320px, 38vh); height: auto; aspect-ratio: 1; }
.hud-estado { color: var(--accent); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.hud-pregunta { min-height: 20px; color: var(--muted); }
.hud-respuesta { max-width: 44ch; font-size: 17px; line-height: 26px; text-wrap: pretty; }
.hud-derecha { display: grid; gap: 24px; }
.hud-panel { position: relative; padding: 18px 20px; border: 1px solid #1d2733; border-radius: 4px; background: rgba(19, 18, 23, 0.86); }
/* esquinas de HUD: 1px azul en dos esquinas opuestas */
.hud-panel::before, .hud-panel::after { content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; }
.hud-panel::before { top: -1px; left: -1px; border-top: 1px solid var(--accent); border-left: 1px solid var(--accent); }
.hud-panel::after { right: -1px; bottom: -1px; border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); }
.hud-panel h2 { margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.hud-lista { display: grid; }
.hud-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 9px 0; border-top: 1px solid #1b1f27; }
.hud-lista li:first-child { border-top: 0; padding-top: 0; }
.hud-lista .t { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-lista .s { display: block; color: var(--muted); font-size: var(--fs-small); line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-lista .d { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-lista .d.pronto { color: var(--warning); } .hud-lista .d.tarde { color: var(--negative); } .hud-lista .d.ok { color: var(--positive); }
#hud-sigue li { grid-template-columns: 64px minmax(0, 1fr) auto; }
#hud-sigue .h { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
#hud-sigue li:first-child .h { color: var(--accent); }
.medidores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.medidor { display: grid; justify-items: center; gap: 4px; }
.medidor svg { width: 76px; height: 76px; }
.medidor .pista { fill: none; stroke: #222224; stroke-width: 4; }
.medidor .valor { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 40px 40px; }
.medidor .valor.pronto { stroke: var(--warning); } .medidor .valor.tarde { stroke: var(--negative); }
.medidor text { fill: var(--text); font: 500 15px var(--font); font-variant-numeric: tabular-nums; }
.medidor p { color: var(--muted); font-size: var(--fs-small); }
.hud-preguntar { width: min(640px, 100%); justify-self: center; }
.hud-preguntar .campo { background: rgba(19, 18, 23, 0.9); }

@media (max-width: 1100px) {
  .hud-cuerpo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hud-centro { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 860px) {
  .hud { grid-template-rows: auto max-content auto; padding: 16px 16px 20px; }
  .hud-arriba { flex-wrap: wrap; row-gap: 4px; }
  .hud-cuerpo { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hud-reloj { font-size: 30px; line-height: 34px; }
  .hud-fecha { display: none; }
  .nucleo-grande { width: 200px; }
}
@media (max-width: 640px) {
  .titulo-acciones { flex: 1 1 100%; flex-wrap: wrap; }
  .sello { width: 100%; }
  .tabla-sigue.tabla-hab tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "a c" "b b" "d d"; }
  .tabla-sigue.tabla-hab td:nth-child(1) { grid-area: a; width: auto; }
  .tabla-sigue.tabla-hab td:nth-child(2) { grid-area: b; color: var(--muted); font-size: var(--fs-small); }
  .tabla-sigue.tabla-hab td:nth-child(3) { grid-area: c; }
  .tabla-sigue.tabla-hab td:nth-child(4) { grid-area: d; color: var(--muted); font-size: var(--fs-small); }
}
@media (prefers-reduced-motion: reduce) {
  .nucleo .n-giro { animation: none !important; }
}
body.con-hud { overflow: hidden; }
