/* FL Platform · nodo central
   Sistema visual compartido con la interfaz del nodo (flpnode/static/index.html):
   superficies claras con sombras suaves, un acento cobalto para lo que controla el central
   y colores de señal (verde/ámbar/rojo) reservados para estados, siempre acompañados de icono.
   Los nombres de las variables (--paper, --panel, --cobalt, --ok…) se usan también en línea
   desde app.js: no renombrarlas. */

:root {
  /* superficies y tinta */
  --paper: #F3F5F9;
  --panel: #FFFFFF;
  --sunk: #EDF0F5;
  --line: #DCE2EA;
  --line-2: #C5CEDA;
  --ink: #121B2C;
  --ink-2: #44516A;
  --ink-3: #5F6C82;
  /* acento y señales */
  --cobalt: #3450DC;
  --cobalt-soft: #E7EBFD;
  --btn: #3450DC;
  --btn-ink: #FFFFFF;
  --ok: #1D7646;
  --ok-soft: #E0F2E7;
  --warn: #965F00;
  --warn-soft: #FCF0D4;
  --bad: #BE3329;
  --bad-soft: #FCE5E2;
  --violet: #6E45C6;
  --s1: #3450DC; --s2: #D0661A; --s3: #1D8A55; --s4: #7A4BD0; --s5: #C93A5E; --s6: #0B8291;
  /* forma */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 36px rgba(16, 24, 40, .18);
  --ring: 0 0 0 3px color-mix(in srgb, var(--cobalt) 28%, transparent);
  --glow: var(--shadow);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}
/* Tema: oscuro por defecto (data-theme en <html>, lo pone index.html antes de pintar);
   «system» sigue al sistema operativo. El selector está al pie del menú. */
:root[data-theme="dark"] {
    --paper: #0A0E16; --panel: #111725; --sunk: #172034; --line: #222C40; --line-2: #2F3B54;
    --ink: #E9EEF7; --ink-2: #B2BCCE; --ink-3: #8894AA;
    --cobalt: #8FA3FF; --cobalt-soft: #1B2550; --btn: #4E66EE; --btn-ink: #FFFFFF;
    --ok: #5FD394; --ok-soft: #10301F; --warn: #F4BA55; --warn-soft: #36290C;
    --bad: #FF8E83; --bad-soft: #3B1916; --violet: #BBA0FF;
    --s1: #8FA3FF; --s2: #F2A463; --s3: #5FD394; --s4: #C5A9FF; --s5: #FF92AB; --s6: #52D3E0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .28);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .6);
    --glow: 0 0 0 1px rgba(143, 163, 255, .10), 0 10px 30px rgba(36, 56, 160, .18);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --paper: #0A0E16; --panel: #111725; --sunk: #172034; --line: #222C40; --line-2: #2F3B54;
      --ink: #E9EEF7; --ink-2: #B2BCCE; --ink-3: #8894AA;
      --cobalt: #8FA3FF; --cobalt-soft: #1B2550; --btn: #4E66EE; --btn-ink: #FFFFFF;
      --ok: #5FD394; --ok-soft: #10301F; --warn: #F4BA55; --warn-soft: #36290C;
      --bad: #FF8E83; --bad-soft: #3B1916; --violet: #BBA0FF;
      --s1: #8FA3FF; --s2: #F2A463; --s3: #5FD394; --s4: #C5A9FF; --s5: #FF92AB; --s6: #52D3E0;
      --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
      --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .28);
      --shadow-lg: 0 18px 48px rgba(0, 0, 0, .6);
      --glow: 0 0 0 1px rgba(143, 163, 255, .10), 0 10px 30px rgba(36, 56, 160, .18);
      color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
a { color: var(--cobalt); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.012em; }
h1 { font-size: 27px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 8px; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--sunk); padding: 1px 5px; border-radius: 5px; }
pre code { background: none; padding: 0; }
small, .muted { color: var(--ink-3); }
.muted { font-size: 13px; }
::selection { background: color-mix(in srgb, var(--cobalt) 30%, transparent); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px 16px; position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.brand { display: flex; gap: 11px; align-items: center; padding: 2px 8px 20px; color: var(--ink); }
.brand svg { flex: none; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #25358F, #3450DC 60%, #5B78FF); color: #fff; box-shadow: var(--shadow-sm); }
.brand b { font-size: 15px; display: block; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--ink-3); }
.navlist { display: flex; flex-direction: column; gap: 2px; }
.rail a.nav { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: 14.5px; position: relative; transition: background .15s, color .15s; }
.rail a.nav svg { flex: none; width: 18px; height: 18px; opacity: .8; }
.rail a.nav .lbl { flex: 1; min-width: 0; }
.rail a.nav:hover { background: var(--sunk); text-decoration: none; color: var(--ink); }
.rail a.nav.on { background: var(--cobalt-soft); color: var(--cobalt); font-weight: 600; }
.rail a.nav.on svg { opacity: 1; }
.rail a.nav.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cobalt); }
.rail .badge { font-size: 11px; font-weight: 700; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 1px 7px; }
.rail .foot { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); display: grid; gap: 10px; }
.user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px;
  background: var(--cobalt-soft); color: var(--cobalt); text-transform: uppercase; }
a.avatar:hover { text-decoration: none; box-shadow: var(--ring); }
.user a { font-weight: 600; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user small { display: block; font-size: 12px; }
.foot .row { justify-content: space-between; }
main { padding: 26px 40px 64px; max-width: 1280px; width: 100%; margin: 0 auto; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.head > div:first-child { min-width: 0; }
.head p { color: var(--ink-2); margin: 8px 0 0; max-width: 72ch; }
.head h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.crumb::before { content: "←"; }
.crumb:hover { color: var(--cobalt); text-decoration: none; }

/* ---------- panels & grids ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow-sm); min-width: 0; }
#main > .panel + .panel, #main > .panel + .grid2, #main > .grid2 + .panel, .stack > * + * { margin-top: 16px; }
#main > .facts + .panel, #main > .facts + .split, #main > .facts + .topo, #main > .summary + .facts { margin-top: 16px; }
.panel > h2, .panel > h3 { margin-bottom: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
.panel > h2 .muted { font-weight: 400; font-size: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { display: flex; align-items: center; gap: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; align-items: start; }
details.panel > summary { list-style: none; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14.5px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
details.panel[open] > summary::before { transform: rotate(45deg); }
details.panel[open] > summary { margin-bottom: 8px; }

/* tarjetas de resumen (cifras) */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.facts > div, .facts > a { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--ink); position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
.facts > a:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.facts b { display: block; font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.facts span { font-size: 13px; color: var(--ink-2); }
.facts .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px;
  background: var(--cobalt-soft); color: var(--cobalt); }
.facts .ico svg { width: 18px; height: 18px; }
.facts .ico.ok { background: var(--ok-soft); color: var(--ok); }
.facts .ico.warn { background: var(--warn-soft); color: var(--warn); }
.facts .ico.violet { background: color-mix(in srgb, var(--violet) 14%, var(--panel)); color: var(--violet); }
.facts .ico.bad { background: var(--bad-soft); color: var(--bad); }
.facts .ico.teal { background: color-mix(in srgb, var(--s6) 14%, var(--panel)); color: var(--s6); }
.facts .ico.live { position: relative; }
.facts .ico.live::after { content: ""; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--cobalt);
  border: 2px solid var(--panel); animation: pulse 1.4s ease-in-out infinite; }
.facts .progress { margin-top: 8px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { white-space: nowrap; text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px; letter-spacing: .02em;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--sunk); }
th:first-child { border-top-left-radius: var(--r-sm); }
th:last-child { border-top-right-radius: var(--r-sm); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: color-mix(in srgb, var(--cobalt-soft) 55%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { white-space: nowrap; }
td b { font-weight: 600; }
.tablewrap, .scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tablewrap > table, .scroll > table { min-width: 100%; }

/* ---------- state chips: color + icono ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 10px 2px 6px; line-height: 1.5;
  border-radius: 20px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.chip::before { content: ""; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: currentColor; opacity: .7; flex: none; }
.chip.ok, .chip.warn, .chip.bad, .chip.info { padding-left: 4px; }
.chip.ok::before, .chip.warn::before, .chip.bad::before, .chip.info::before {
  width: 15px; height: 15px; margin: 0; opacity: 1; display: inline-grid; place-items: center; font-size: 9.5px; font-weight: 800; line-height: 1; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.ok::before { content: "✓"; background: var(--ok); color: var(--ok-soft); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.warn::before { content: "!"; background: var(--warn); color: var(--warn-soft); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.bad::before { content: "✕"; background: var(--bad); color: var(--bad-soft); font-size: 8.5px; }
.chip.info { background: var(--cobalt-soft); color: var(--cobalt); }
.chip.info::before { content: "i"; background: var(--cobalt); color: var(--cobalt-soft); font-family: Georgia, serif; font-style: italic; }
.chip.live { background: var(--cobalt-soft); color: var(--cobalt); }
.chip.live::before { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 25%, transparent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- forms ---------- */
label.f { display: block; font-size: 13px; color: var(--ink-2); font-weight: 550; min-width: 0; }
label.f > input, label.f > select, label.f > textarea { margin-top: 5px; }
input, select, textarea { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 11px; min-height: 38px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink-3) 60%, var(--line-2)); }
input[type=file] { padding: 6px 8px; background: var(--sunk); border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
  border-radius: 6px; padding: 4px 10px; margin-right: 10px; cursor: pointer; }
select { cursor: pointer; }
textarea { font-family: var(--mono); font-size: 12.5px; min-height: 90px; resize: vertical; line-height: 1.5; }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; margin: 0 8px 0 0; accent-color: var(--cobalt); vertical-align: -3px; cursor: pointer; }
label.f > span:has(> input[type=checkbox]) { display: inline-flex; align-items: center; color: var(--ink); font-weight: 500; font-size: 14px; padding-top: 6px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: var(--ring); }
input:disabled, select:disabled { background: var(--sunk); color: var(--ink-3); }
::placeholder { color: color-mix(in srgb, var(--ink-3) 80%, transparent); }
.hint { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 4px; font-weight: 400; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 16px; }
.fields .wide { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 0; }
.formsec { padding: 22px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; }
.formsec:first-child { border-top: 0; padding-top: 4px; }
.formsec > header h3 { margin-bottom: 6px; display: flex; align-items: center; flex-wrap: wrap; }
.formsec > header p { font-size: 13px; color: var(--ink-3); }
button, .btn { font: inherit; font-size: 14px; font-weight: 550; border-radius: var(--r-sm); padding: 7px 14px; min-height: 36px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, box-shadow .15s, filter .15s; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--ink-3); background: color-mix(in srgb, var(--sunk) 60%, var(--panel)); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .12); }
button.primary:hover, .btn.primary:hover { background: var(--btn); filter: brightness(1.1); }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
button.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
button.ghost, .btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); box-shadow: none; padding: 6px 10px; }
button.ghost:hover, .btn.ghost:hover { background: var(--sunk); border-color: transparent; color: var(--ink); }
button:disabled, button:disabled:hover { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--line); box-shadow: none; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }

/* ---------- opciones en tarjetas (privacidad / estrategia / asistente) ---------- */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.choice, .card { position: relative; border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; cursor: pointer; background: var(--panel);
  color: var(--ink); text-align: left; display: block; white-space: normal; font: inherit; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, background .15s; }
.choice:hover, .card:hover { border-color: var(--ink-3); background: var(--panel); box-shadow: var(--shadow); }
.choice.on, .card.on { border-color: var(--cobalt); background: color-mix(in srgb, var(--cobalt-soft) 50%, var(--panel)); box-shadow: 0 0 0 1px var(--cobalt), var(--shadow-sm); }
.choice.on::after, .card.on::after { content: "✓"; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--cobalt); color: var(--btn-ink); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
:root[data-theme="dark"] .choice.on::after, :root[data-theme="dark"] .card.on::after { background: var(--btn); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .choice.on::after, :root[data-theme="system"] .card.on::after { background: var(--btn); } }
.choice b, .card b { display: block; font-size: 14.5px; font-weight: 600; padding-right: 24px; }
.choice span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.choice em { display: inline-block; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--cobalt); margin-top: 6px; }

/* ---------- checks / validation ---------- */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.checks li:last-child { border-bottom: 0; }
.checks .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 11px; margin-top: 1px; }
.checks .ok .mark { color: var(--ok-soft); background: var(--ok); }
.checks .ko .mark { color: var(--bad-soft); background: var(--bad); }
.checks pre { white-space: pre-wrap; margin: 4px 0 0; color: var(--ink-2); font-size: 12px; max-height: 180px; overflow: auto; }

/* avisos: borde + fondo suave + icono */
.note { position: relative; border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-soft); color: var(--ink);
  padding: 10px 14px 10px 42px; border-radius: var(--r-sm); font-size: 13.5px; margin: 8px 0; overflow-wrap: anywhere; }
.note::before { content: "!"; position: absolute; left: 13px; top: 11px; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; line-height: 1; background: var(--warn); color: var(--warn-soft); }
.note.err { border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: var(--bad-soft); }
.note.err::before { content: "✕"; background: var(--bad); color: var(--bad-soft); font-size: 10px; }
.note.info { border-color: color-mix(in srgb, var(--cobalt) 25%, transparent); background: var(--cobalt-soft); }
.note.info::before { content: "i"; background: var(--cobalt); color: var(--cobalt-soft); font-family: Georgia, serif; font-style: italic; }
.note.ok { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-soft); }
.note.ok::before { content: "✓"; background: var(--ok); color: var(--ok-soft); }
.note.warn { color: var(--ink); }
.note a { font-weight: 600; }
.note pre.code { margin-top: 4px; }

/* ---------- code viewer ---------- */
.code { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; overflow: auto; max-height: 520px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre; tab-size: 4; color: var(--ink); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 10px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--ink-2); padding: 6px 12px; box-shadow: none; font-family: var(--mono); font-size: 13px; }
.tabs button:hover { background: var(--sunk); }
.tabs button.on { border-bottom-color: var(--cobalt); color: var(--ink); font-weight: 600; }
.log { background: #0B1018; color: #CBD5E1; border-radius: var(--r-sm); padding: 12px 14px; font-family: var(--mono); font-size: 12px;
  line-height: 1.55; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 10px 0 0; border: 1px solid #1E293B; }
details > summary { cursor: pointer; color: var(--ink-2); font-size: 13.5px; }
details > summary:hover { color: var(--ink); }

/* ---------- topología en vivo ---------- */
.topo { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px 12px; overflow: hidden;
  box-shadow: var(--shadow-sm);
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink-3) 22%, transparent) 1px, transparent 0); background-size: 18px 18px; }
.topo svg { display: block; width: 100%; height: auto; }
.topo .wire { stroke: var(--line-2); stroke-width: 2; fill: none; }
.topo .wire.active { stroke: var(--cobalt); stroke-dasharray: 6 8; animation: flow 1s linear infinite; }
.topo .wire.ok { stroke: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.topo .wire.failed { stroke: var(--bad); stroke-dasharray: 2 6; }
.topo .wire.skip { stroke-dasharray: 1 6; opacity: .7; }
.topo .tn.skip > rect.box { fill: var(--sunk); stroke-dasharray: 4 4; filter: none; }
.topo .tn.skip text { opacity: .75; }
@keyframes flow { to { stroke-dashoffset: -28; } }
.topo text { font-family: var(--font); fill: var(--ink); }
.topo .sub { fill: var(--ink-3); font-size: 11.5px; }
.topo .hub rect { fill: #1B2A6B; }
.topo .hub text { fill: #fff; }
.topo .hub .sub { fill: #C9D3FF; }
.topo .tn > rect.box { fill: var(--panel); stroke: var(--line-2); stroke-width: 1.2; filter: drop-shadow(0 1px 2px rgba(16, 24, 40, .08)); }
.topo .tn .bar { fill: var(--ink-3); }
.topo .tn .badge { fill: var(--ink-3); }
.topo .tn .glyph { fill: var(--panel); font-size: 10px; font-weight: 800; }
.topo .tn.live .bar, .topo .tn.live .badge { fill: var(--cobalt); }
.topo .tn.ok .bar, .topo .tn.ok .badge { fill: var(--ok); }
.topo .tn.bad > rect.box { fill: var(--bad-soft); stroke: var(--bad); }
.topo .tn.bad .bar, .topo .tn.bad .badge { fill: var(--bad); }
.topo .tn.live .badge { animation: pulse 1.4s ease-in-out infinite; }
.topo-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); padding: 2px 4px 0; }
.topo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.topo-legend i { width: 18px; height: 0; border-top: 2px solid var(--line-2); display: inline-block; }
.topo-legend i.active { border-top: 2px dashed var(--cobalt); }
.topo-legend i.ok { border-top-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.topo-legend i.failed { border-top: 2px dotted var(--bad); }
.topo-legend i.skip { border-top: 2px dotted var(--line-2); }
.topo-list li.skip { border-left-style: dashed; background: var(--sunk); }
/* El dibujo depende del ancho de su caja, no de la pantalla: si es estrecha, lista */
.topo { container-type: inline-size; }
@container (max-width: 480px) {
  .topo > svg, .topo > .topo-legend { display: none; }
  .topo > .topo-list { display: grid; }
}
.topo-list { display: none; list-style: none; margin: 0; padding: 0; gap: 8px; }
.topo-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; background: var(--panel);
  border: 1px solid var(--line); border-left: 4px solid var(--ink-3); border-radius: var(--r-sm); padding: 9px 12px; font-size: 13.5px; }
.topo-list li .chip { grid-row: span 2; }
.topo-list li small { grid-column: 2; color: var(--ink-3); font-size: 12px; overflow-wrap: anywhere; }
.topo-list li.hub { background: #1B2A6B; color: #fff; border-color: #1B2A6B; display: block; }
.topo-list li.hub small { color: #C9D3FF; display: block; }
.topo-list li.live { border-left-color: var(--cobalt); }
.topo-list li.ok { border-left-color: var(--ok); }
.topo-list li.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.progress { height: 6px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cobalt), color-mix(in srgb, var(--cobalt) 70%, #7FD3FF)); border-radius: 4px; transition: width .4s ease; }

/* ---------- gráficas ---------- */
.chart { position: relative; }
.chart > svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart .axis { stroke: var(--line-2); }
.chart .tick { fill: var(--ink-3); font-size: 13px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .alabel { fill: var(--ink-3); font-size: 13px; font-family: var(--font); font-weight: 600; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.chart .cross { stroke: var(--ink-3); stroke-dasharray: 3 3; opacity: 0; pointer-events: none; }
.chart .hot { fill: transparent; cursor: crosshair; }
.chart .hot:hover + .cross, .chart .col.on .cross { opacity: .7; }
.chart .col.on .dot { r: 5; }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend svg { flex: none; }
.chart-tip { position: absolute; z-index: 900; pointer-events: none; background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; min-width: 150px; max-width: 280px; }
.chart-tip b { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }
.chart-tip div { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.chart-tip div span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); min-width: 0; }
.chart-tip i { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.chart-tip div span:last-child { font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art { color: #fff; padding: 48px 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 110% -10%, rgba(126, 150, 255, .45), transparent 60%),
              radial-gradient(800px 500px at -20% 120%, rgba(43, 197, 160, .25), transparent 60%),
              linear-gradient(155deg, #0F1838, #1B2A6B 55%, #2F45C5); }
.login .art::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .16) 1px, transparent 0); background-size: 22px 22px; }
.login .art > * { position: relative; z-index: 1; }
.login .art h1 { font-size: 42px; font-weight: 650; max-width: 16ch; letter-spacing: -0.025em; margin-bottom: 16px; line-height: 1.1; }
.login .art p { color: rgba(255, 255, 255, .78); max-width: 46ch; font-size: 16px; }
.login .art b { color: #fff; }
.login .art small { color: rgba(255, 255, 255, .7); }
.login form { align-self: center; justify-self: center; width: min(400px, 92%); display: grid; gap: 14px; background: var(--panel); padding: 30px 30px 26px;
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); margin: 32px 0; }
.login form h2 { font-size: 22px; margin-bottom: 4px; }
.login form button.primary { min-height: 42px; font-size: 15px; }
.login form select.lang { justify-self: start; }

/* ---------- misc ---------- */
#toast { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 1100; max-width: calc(100vw - 32px); }
#toast > div { display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: var(--paper); padding: 11px 16px 11px 12px; border-radius: var(--r-sm);
  font-size: 14px; max-width: 440px; box-shadow: var(--shadow-lg); animation: toastin .2s ease-out; }
#toast > div::before { content: "✓"; flex: none; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--ok); color: #fff; margin-top: 1px; }
#toast > div.err { background: var(--bad); color: #fff; }
#toast > div.err::before { content: "!"; background: #fff; color: var(--bad); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }
.empty { padding: 32px 20px; text-align: center; color: var(--ink-2); border: 1.5px dashed var(--line-2); border-radius: var(--r); background: color-mix(in srgb, var(--sunk) 45%, transparent); }
.empty p { margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
dialog { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); color: var(--ink); padding: 22px; width: min(560px, 92vw); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 16, 28, .5); }
[hidden] { display: none !important; }
select.lang { width: auto; min-height: 32px; padding: 4px 8px; font-size: 13px; }

/* ---------- asistente paso a paso ---------- */
.stepper { list-style: none; display: flex; gap: 0; padding: 0; margin: 0 0 18px; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 14px; font-weight: 500; min-width: 0; white-space: nowrap; }
.stepper li::after { content: ""; flex: 1; height: 2px; min-width: 16px; background: var(--line); border-radius: 2px; margin: 0 12px 0 2px; }
.stepper li:last-child { flex: none; }
.stepper li:last-child::after { display: none; }
.stepper li span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 2px solid var(--line-2);
  font-size: 13px; font-weight: 700; flex: none; color: var(--ink-3); }
.stepper li.on { color: var(--ink); font-weight: 650; }
.stepper li.on span { background: var(--btn); border-color: var(--btn); color: #fff; box-shadow: var(--ring); }
.stepper li.done { color: var(--ink-2); }
.stepper li.done::after { background: var(--ok); }
.stepper li.done span { background: var(--ok); border-color: var(--ok); color: #fff; font-size: 0; }
.stepper li.done span::before { content: "✓"; font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.card { display: grid; gap: 5px; padding: 14px 16px; }
.card span { color: var(--ink-2); font-size: 13.5px; }
.card em { font-style: normal; color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.wizard h2 { margin-top: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wizard h3 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wizard .pname { font-weight: 600; color: var(--ink); }

/* lista de pasos (puesta en marcha, ayuda) */
.checklist { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); }
.checklist li:hover { background: var(--sunk); }
.checklist li > span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; color: var(--ink-2); }
.checklist li > div { min-width: 0; }
.checklist li.done { color: var(--ink-3); }
.checklist li.done > span { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist li a { font-weight: 600; }
.setup-progress { display: flex; align-items: center; gap: 12px; }
.setup-progress .progress { flex: 1; max-width: 260px; }

.deploy { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-top: 12px; background: color-mix(in srgb, var(--sunk) 35%, var(--panel)); }
.deploy.revoked { opacity: .6; }

/* resúmenes en lenguaje claro */
.summary { position: relative; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); padding: 16px 20px 16px 62px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm); overflow-wrap: anywhere;
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--cobalt-soft) 70%, transparent), transparent 260px); }
.summary::before { content: "i"; position: absolute; left: 18px; top: 15px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: italic 800 15px/1 Georgia, serif; background: var(--cobalt); color: var(--cobalt-soft); }
.summary.ok { background-image: linear-gradient(90deg, color-mix(in srgb, var(--ok-soft) 80%, transparent), transparent 260px); }
.summary.ok::before { content: "✓"; font: 800 14px/1 var(--font); background: var(--ok); color: var(--ok-soft); }
.summary.bad { background-image: linear-gradient(90deg, color-mix(in srgb, var(--bad-soft) 80%, transparent), transparent 260px); }
.summary.bad::before { content: "✕"; font: 800 13px/1 var(--font); background: var(--bad); color: var(--bad-soft); }
.summary.warn { background-image: linear-gradient(90deg, color-mix(in srgb, var(--warn-soft) 85%, transparent), transparent 260px); }
.summary.warn::before { content: "!"; font: 800 15px/1 var(--font); background: var(--warn); color: var(--warn-soft); }
.summary h2 { margin: 3px 0 6px; font-size: 17px; }
.summary p { margin: 4px 0; font-size: 14.5px; }
.summary ul { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.summary li { margin: 3px 0; }
.summary .note { margin-top: 8px; }
.ptable td { vertical-align: top; }
.ptable .pname { font-family: var(--mono); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ptable input, .ptable select { min-width: 110px; }
.nodecheck { display: grid; gap: 8px; margin-top: 10px; }
.nodecheck .ok-line { position: relative; border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-soft); padding: 8px 12px; border-radius: var(--r-sm); font-size: 13.5px; }
th .ayuda-tip { margin-left: 4px; }

/* ---------- móvil y tableta ---------- */
@media (max-width: 1180px) {
  .split, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .split > aside { position: static !important; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px 0; gap: 6px;
    border-right: 0; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: visible; }
  .rail .brand { padding: 0; flex: 1; min-width: 0; }
  .brand .logo { width: 32px; height: 32px; }
  .rail .foot { margin: 0; border: 0; padding: 0; display: flex; align-items: center; gap: 6px; }
  .rail .foot .user small, .rail .foot .user > div { display: none; }
  .rail .foot .row { gap: 4px; flex-wrap: nowrap; }
  .rail .foot button .lbl { display: none; }
  .navlist { order: 3; flex-direction: row; width: calc(100% + 24px); margin: 4px -12px 0; padding: 0 8px 8px; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .navlist::-webkit-scrollbar { display: none; }
  .rail a.nav { flex: none; padding: 7px 11px; font-size: 14px; white-space: nowrap; }
  .rail a.nav.on::before { left: 10px; right: 10px; top: auto; bottom: -8px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  main { padding: 20px 16px 48px; }
  .split, .grid2, .grid3, .formsec, .login { grid-template-columns: minmax(0, 1fr); }
  .split > aside { position: static !important; }
  .formsec { gap: 12px; }
  .login .art { padding: 32px 24px; }
  .login .art h1 { font-size: 30px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 23px; }
  .head { margin-bottom: 18px; }
  .head > .row { width: 100%; }
  .panel { padding: 16px; overflow-x: auto; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .facts > div, .facts > a { padding: 14px; }
  .facts b { font-size: 22px; }
  .facts .ico { margin-bottom: 6px; width: 30px; height: 30px; }
  .rail .foot .user a { display: none; }
  .stepper li:not(.on) { font-size: 0; gap: 0; }
  .stepper li::after { margin: 0 6px; }
  .stepper li.on { flex: none; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { font-size: 12.5px; margin-top: 8px; }
  .summary { padding: 14px 14px 14px 52px; }
  .summary::before { left: 13px; width: 28px; height: 28px; }
  .topo { background-image: none; padding: 10px; }
  #toast { left: 16px; right: 16px; bottom: 16px; }
  #toast > div { max-width: none; }
  .login form { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* kit de prueba (código + datos inventados + check_code.py) */
.kitbar { display: flex; gap: 12px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px;
  border: 1px dashed var(--line-2); border-radius: var(--r); background: color-mix(in srgb, var(--sunk) 55%, var(--panel)); }
.kitbar > div:first-child { display: grid; gap: 2px; min-width: 0; flex: 1 1 280px; }
a.choice { text-decoration: none; }
a.choice b { display: block; margin-bottom: 2px; }

/* =====================================================================
   Navegación por secciones, pestañas, menús y pulido visual
   ===================================================================== */
/* menú lateral: 5 secciones */
.rail a.nav { padding: 10px 12px; font-size: 15px; }
.rail .navlist { gap: 4px; }
.rail .foot .row { gap: 4px; }
.iconbtn { width: 34px; min-height: 34px; padding: 0 !important; }
.iconbtn.on { color: var(--cobalt); background: var(--cobalt-soft); }
.rail .foot select.lang { flex: 1; }

/* subpestañas de la sección (arriba de cada página) */
.subnav { display: flex; gap: 4px; margin: 0 0 22px; padding: 4px; border-radius: 12px; background: var(--sunk);
  border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 6px 14px; border-radius: 9px; color: var(--ink-2); font-weight: 550; font-size: 14px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease); }
.subnav a:hover { color: var(--ink); text-decoration: none; background: color-mix(in srgb, var(--panel) 60%, transparent); }
.subnav a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.subnav .badge { font-size: 11px; font-weight: 700; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 0 7px; }

/* pestañas dentro de una ficha */
.tabset { margin-top: 18px; }
.tabbar { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar .tab { position: relative; border: 0; background: none; box-shadow: none; border-radius: 8px 8px 0 0; padding: 9px 14px 11px; color: var(--ink-2);
  font-weight: 550; font-size: 14.5px; min-height: 0; white-space: nowrap; }
.tabbar .tab:hover { background: var(--sunk); color: var(--ink); border: 0; }
.tabbar .tab.on { color: var(--ink); font-weight: 650; }
.tabbar .tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--cobalt);
  animation: ink .28s var(--ease) both; }
@keyframes ink { from { transform: scaleX(.2); opacity: 0; } }
.tbadge { font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 10px; background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line); }
.tab.on .tbadge { background: var(--cobalt-soft); color: var(--cobalt); border-color: transparent; }
.tbadge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tabpanel.enter { animation: rise .3s var(--ease) both; }
.tabpanel > :first-child, .tabpanel > .grid2:first-child { margin-top: 0 !important; }

/* menú «⋯» de acciones secundarias */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--sunk); color: var(--ink); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 230px; display: grid; gap: 2px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); animation: pop .16s var(--ease) both; }
.menu-pop > button, .menu-pop > a { justify-content: flex-start; width: 100%; border: 0; box-shadow: none; background: none; color: var(--ink); font-weight: 500; padding: 8px 10px; }
.menu-pop > button:hover, .menu-pop > a:hover { background: var(--sunk); border: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
td.actions { width: 1%; text-align: right; }
td.actions details.menu > summary { min-height: 30px; padding: 4px 8px; }

/* modelos: tarjetas compactas */
.model-card .panel-head h2 .muted { font-weight: 400; font-size: 13px; }
td.clamp { max-width: 300px; }
td.clamp > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
details.older { margin-top: 10px; }
details.older > summary { font-size: 13.5px; color: var(--cobalt); font-weight: 550; padding: 4px 0; }
details.older[open] > summary { margin-bottom: 8px; }

/* resumen del experimento a la derecha, fijo al hacer scroll */
.split > aside { position: sticky; top: 16px; }

/* pulido: superficies, profundidad y entradas suaves */
.panel, .facts > div, .facts > a, .summary, .topo { border-radius: 14px; }
:root[data-theme="dark"] .panel, :root[data-theme="dark"] .facts > div, :root[data-theme="dark"] .facts > a, :root[data-theme="dark"] .summary {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 120px); }
:root[data-theme="dark"] .summary { background-image: linear-gradient(90deg, color-mix(in srgb, var(--cobalt-soft) 70%, transparent), transparent 260px); }
:root[data-theme="dark"] .summary.ok { background-image: linear-gradient(90deg, color-mix(in srgb, var(--ok-soft) 85%, transparent), transparent 260px); }
:root[data-theme="dark"] .summary.bad { background-image: linear-gradient(90deg, color-mix(in srgb, var(--bad-soft) 85%, transparent), transparent 260px); }
:root[data-theme="dark"] .summary.warn { background-image: linear-gradient(90deg, color-mix(in srgb, var(--warn-soft) 90%, transparent), transparent 260px); }
:root[data-theme="dark"] .rail { background: linear-gradient(180deg, #0E1422, #0B101B); }
:root[data-theme="dark"] .topo .hub rect { fill: #2A3A8F; }
:root[data-theme="dark"] .log { background: #070A10; }
.facts > div, .facts > a { transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.facts > div:hover { border-color: var(--line-2); }
.panel { transition: border-color .2s var(--ease); }
button.primary, .btn.primary { background-image: linear-gradient(180deg, rgba(255, 255, 255, .10), transparent); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
/* solo al llegar a una página (no en cada actualización en vivo) */
#main.enter > * { animation: rise .35s var(--ease) both; }
#main.enter > *:nth-child(2) { animation-delay: .03s; } #main.enter > *:nth-child(3) { animation-delay: .06s; }
#main.enter > *:nth-child(4) { animation-delay: .09s; } #main.enter > *:nth-child(n+5) { animation-delay: .12s; }
.progress > i { position: relative; overflow: hidden; }
.facts .ico.live ~ .progress > i::after, .progress.live > i::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ayuda-tip { transition: transform .15s var(--ease) !important; }
.ayuda-tip:hover { transform: scale(1.08) !important; }

/* móvil: la barra de secciones sigue arriba; subpestañas a todo el ancho */
@media (max-width: 960px) {
  .stepper li small { display: none !important; }
  .stepper li:not(.on) { font-size: 0; gap: 0; }
  .stepper li::after { margin: 0 6px; }
  .stepper li.on { flex: none; }
  .subnav { width: 100%; margin-bottom: 16px; }
  .split > aside { position: static; }
}

/* Inicio: lista de pendientes */
.todo-panel { display: grid; gap: 8px; }
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--sunk) 50%, var(--panel)); }
.todo .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; font-weight: 800; background: var(--warn-soft); color: var(--warn); }
.todo.info .ic { background: var(--cobalt-soft); color: var(--cobalt); }
.todo.bad .ic { background: var(--bad-soft); color: var(--bad); }
.todo > div { flex: 1; min-width: 0; } .todo b { display: block; font-size: 14.5px; font-weight: 600; } .todo span { color: var(--ink-3); font-size: 13px; }
.btn.small, button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }

/* comparar ejecuciones */
#cmpbar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 900; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .2s var(--ease) both; }
.cmpchk { margin: 0 !important; }
.cmpchips { display: flex; flex-wrap: wrap; gap: 8px; }
.cmpchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; }
.cmpchip:hover { text-decoration: none; border-color: var(--line-2); }
.cmpdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
td.best { color: var(--ok); font-weight: 700; }
/* análisis de una búsqueda */
.scatgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 6px; }
.scatgrid b { font-size: 13px; }
.chart .spt { fill: var(--cobalt); opacity: .7; stroke: var(--panel); stroke-width: 1.5; }
.chart .sbest { fill: var(--ok); stroke: var(--panel); stroke-width: 2; }
#vmon h3 { font-size: 13.5px; color: var(--ink-2); font-weight: 600; margin: 4px 0 2px; }

/* progreso: barra fina arriba, botón ocupado y esqueleto de carga */
#topbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: linear-gradient(90deg, transparent, var(--cobalt), color-mix(in srgb, var(--cobalt) 60%, #7FD3FF), transparent); background-size: 50% 100%;
  background-repeat: no-repeat; animation: topbar 1.1s linear infinite; }
#topbar.on { opacity: 1; }
@keyframes topbar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.busy { position: relative; color: transparent !important; pointer-events: none; }
.busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 2px solid var(--ink-3); border-right-color: transparent; animation: spin .7s linear infinite; }
button.primary.busy::after, .btn.primary.busy::after { border-color: #fff; border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { display: grid; gap: 14px; max-width: 1100px; }
.skel i { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--sunk), color-mix(in srgb, var(--sunk) 55%, var(--panel)), var(--sunk));
  background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite; }
.skel .sk-title { width: 260px; height: 30px; } .skel .sk-line { width: 55%; height: 14px; }
.skel .sk-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; } .skel .sk-row i { height: 96px; }
.skel .sk-block { height: 260px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
