/* ============================================================
   Validador de Productos Amazon MX — sistema visual 4.0
   Dirección: A + C. Anillos de actividad (Fitness) + isla
   dinámica y notificaciones (iPhone). Configuración: lista de
   Ajustes de iOS dentro de una barra lateral de macOS.
   Inter (interfaz) + JetBrains Mono (datos). Solo transform/opacity.
   ============================================================ */

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.36, 0.5, 1);

  --t-xs: 13px;
  --t-sm: 15px;
  --t-body: 17px;
  --t-lead: 28px;
  --t-h: 56px;
  --t-display: clamp(96px, 11.5vw, 184px);

  --gut: clamp(16px, 2.4vw, 36px);
  --bar: 56px;
  --r-card: 20px;
  --r-grupo: 14px;

  /* Día (base) */
  color-scheme: light;
  --page: #E8E8ED;
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #F2F2F7;
  --field: #FFFFFF;
  --sheet: #F5F5F7;
  --ink: #1D1D1F;
  --ink-2: #515154;
  --ink-3: #6E6E73;
  --line: rgba(0, 0, 0, .09);
  --display: #1D1D1F;
  --accent: #0071E3;
  --link: #0066CC;
  --on-accent: #FFFFFF;
  --sel: rgba(0, 113, 227, .20);
  --ok: #1F7A35;
  --rep: #0066CC;
  --cat: #8944AB;
  --warn: #A05A00;
  --err: #D70015;
  --ring-av: #FA2D5A;
  --ring-ok: #34C759;
  --ring-rp: #0A84FF;
  --on-warn: #FFFFFF;
  --scrim: rgba(0, 0, 0, .22);
  --sombra: 0 10px 30px -18px rgba(0, 0, 0, .28);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #000000;
  --bg: #0B0B0F;
  --surface: #1C1C1E;
  --surface-2: #2C2C2E;
  --field: #1C1C1E;
  --sheet: #141417;
  --ink: #F5F5F7;
  --ink-2: #A1A1A6;
  --ink-3: #8E8E93;
  --line: rgba(255, 255, 255, .09);
  --display: #FFFFFF;
  --accent: #0A84FF;
  --link: #4DA3FF;
  --on-accent: #FFFFFF;
  --sel: rgba(10, 132, 255, .32);
  --ok: #30D158;
  --rep: #64D2FF;
  --cat: #BF5AF2;
  --warn: #FFD60A;
  --err: #FF453A;
  --ring-av: #FF375F;
  --ring-ok: #30D158;
  --ring-rp: #64D2FF;
  --on-warn: #1D1D1F;
  --scrim: rgba(0, 0, 0, .55);
  --sombra: 0 14px 34px -20px rgba(0, 0, 0, .8);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #000000; --bg: #0B0B0F; --surface: #1C1C1E; --surface-2: #2C2C2E; --field: #1C1C1E; --sheet: #141417;
    --ink: #F5F5F7; --ink-2: #A1A1A6; --ink-3: #8E8E93; --line: rgba(255,255,255,.09); --display: #FFFFFF;
    --accent: #0A84FF; --link: #4DA3FF; --on-accent: #FFFFFF; --sel: rgba(10,132,255,.32);
    --ok: #30D158; --rep: #64D2FF; --cat: #BF5AF2; --warn: #FFD60A; --err: #FF453A;
    --ring-av: #FF375F; --ring-ok: #30D158; --ring-rp: #64D2FF; --on-warn: #1D1D1F;
    --scrim: rgba(0,0,0,.55); --sombra: 0 14px 34px -20px rgba(0,0,0,.8);
  }
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 400 var(--t-body)/1.47 var(--font);
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  overflow: hidden;
}
h1, h2, h3, p, dl, dd, ol, ul, fieldset, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
::selection { background: var(--sel); color: var(--ink); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
input, select, textarea, button { font: inherit; color: inherit; letter-spacing: inherit; caret-color: var(--accent); accent-color: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: .07em; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: fixed; left: 16px; top: -64px; z-index: 50;
  padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 16px; }
code { font-family: var(--mono); font-size: .92em; overflow-wrap: anywhere; }

/* ── Ventana ──────────────────────────────────────────────── */
.app {
  position: fixed; inset: 8px; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; background: var(--bg);
}
@media (display-mode: standalone) { .app { inset: 0; border-radius: 0; } }

/* ── Barra superior ───────────────────────────────────────── */
.bar {
  height: var(--bar); flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 calc(var(--gut) - 8px) 0 var(--gut); -webkit-app-region: drag;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: var(--t-body); white-space: nowrap; }
.brand a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.b-short { display: none; }
.ver-tag {
  flex: none; display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 99px;
  background: var(--surface); color: var(--ink-2); font: 500 var(--t-xs)/1 var(--mono); text-decoration: none; -webkit-app-region: no-drag;
}
.ver-tag:hover { color: var(--ink); }
.nav { display: flex; align-items: center; gap: 2px; -webkit-app-region: no-drag; }
.nav a, .nav button.link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 11px;
  font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); text-decoration: none;
  background: none; border: 0; cursor: pointer; border-radius: 10px; transition: color .18s var(--ease), background-color .18s;
}
.nav a:hover, .nav button.link:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.nav .who { font-size: var(--t-sm); color: var(--ink-2); padding: 0 11px; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav form { display: contents; }
.dot { width: 44px; height: 44px; border: 0; padding: 0; background: none; cursor: pointer; display: inline-grid; place-items: center; color: var(--ink-2); }
.dot span { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; transition: transform .25s var(--spring), color .18s; }
.dot:hover span { transform: scale(1.1); color: var(--ink); }
.dot svg { width: 14px; height: 14px; }
.ico-sun { display: none; }
:root[data-theme="dark"] .ico-sun { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }
.menu { display: none; position: relative; -webkit-app-region: no-drag; }
.menu summary { list-style: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] .menu-sheet { display: flex; }
.menu-sheet {
  display: none; position: fixed; inset: var(--bar) 0 0 0; z-index: 40; flex-direction: column; gap: 2px;
  padding: 20px var(--gut); background: var(--bg); overscroll-behavior: contain; animation: subir .35s var(--ease);
}
.menu-sheet a, .menu-sheet button.link {
  min-height: 56px; display: flex; align-items: center; font-size: var(--t-lead); font-weight: 700; letter-spacing: -.02em;
  text-decoration: none; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--ink);
}
.menu-ver { margin-top: auto; font: var(--t-xs) var(--mono); color: var(--ink-2); }
@keyframes subir { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Escenario del panel ──────────────────────────────────── */
.stage {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr;
  column-gap: 28px; align-items: center; padding: 0 var(--gut) 124px;
}
.isla-wrap { grid-column: 1 / -1; grid-row: 1; display: flex; justify-content: center; padding-top: 4px; }
.metrics { grid-column: 1 / span 4; grid-row: 2; min-width: 0; }
.core-wrap { grid-column: 5 / span 4; grid-row: 2; justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.side { grid-column: 9 / span 4; grid-row: 2; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* Isla dinámica */
.isla {
  display: flex; align-items: center; gap: 12px; height: 50px; min-width: 260px; max-width: min(560px, 100%);
  padding: 0 8px 0 12px; border-radius: 99px; background: #000000; color: #F5F5F7;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 18px 40px -20px rgba(0,0,0,.7);
  transition: min-width .55s var(--spring), transform .55s var(--spring);
}
.isla.pop { min-width: min(480px, 100%); transform: scale(1.02); }
.isla-ic { flex: none; width: 26px; height: 26px; position: relative; }
.isla-ic svg { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.isla[data-modo="busca"] .i-busca { display: block; color: #64D2FF; animation: giro 1s linear infinite; }
.isla[data-modo="ok"] .i-ok { display: block; color: #30D158; }
.isla[data-modo="listo"] .i-punto { display: block; color: #30D158; animation: respira 2.4s ease-in-out infinite; }
.isla[data-modo="vacio"] .i-punto { display: block; color: #8E8E93; }
.isla[data-modo="pausa"] .i-pausa { display: block; color: #FFD60A; }
.isla[data-modo="alerta"] .i-alerta { display: block; color: #FF453A; }
.isla-tx { flex: 1; min-width: 0; font: 500 var(--t-sm)/1.2 var(--mono); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isla-tx.entra { animation: desenfoca .45s var(--ease); }
.isla-pct { flex: none; padding: 7px 12px; border-radius: 99px; background: #1C1C1E; font: 600 var(--t-xs)/1 var(--font); font-variant-numeric: tabular-nums; }
@keyframes giro { to { transform: rotate(360deg); } }
@keyframes respira { 0%, 100% { transform: scale(.8); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }
@keyframes desenfoca { from { opacity: 0; filter: blur(6px); transform: translateY(3px); } to { opacity: 1; filter: none; transform: none; } }

/* Número enorme y fase */
.display {
  display: flex; align-items: baseline; gap: .02em; color: var(--display);
  font-size: var(--t-display); font-weight: 800; line-height: .9; letter-spacing: -.055em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.display[data-len="5"] { font-size: calc(var(--t-display) * .8); }
.display[data-len="6"], .display[data-len="7"] { font-size: calc(var(--t-display) * .66); }
.display .unit { font-size: .46em; font-weight: 700; color: var(--ink-2); letter-spacing: -.02em; }
.display .unit.word { font-size: var(--t-lead); font-weight: 600; letter-spacing: -.01em; margin-left: .35em; }
.phase { margin-top: 22px; font-size: var(--t-lead); font-weight: 700; line-height: 1.12; letter-spacing: -.022em; color: var(--ink); }
.meta { margin-top: 12px; font-size: var(--t-sm); line-height: 1.75; color: var(--ink-2); }
.meta > div { display: flex; flex-wrap: wrap; column-gap: .5ch; }
.meta dt::after { content: ":"; }
.meta dd b { color: var(--ink); font: 500 var(--t-sm) var(--mono); letter-spacing: 0; }
.note { margin-top: 12px; max-width: 44ch; color: var(--ink); font-size: var(--t-sm); line-height: 1.5; }
.note.err { color: var(--err); }

.catalog { margin-top: 18px; display: flex; flex-direction: column; gap: 0; }
.catalog p { font-size: var(--t-sm); color: var(--ink-2); }
.catalog .cat-line { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; }
.cat-name {
  display: inline-flex; align-items: center; min-height: 40px; max-width: 100%; color: var(--link);
  font: 500 var(--t-sm) var(--mono); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none;
}
.cat-name:hover { text-decoration: underline; }

.accion { margin-top: 18px; max-width: 520px; }
.accion legend, .pend legend { font-size: var(--t-xs); color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.accion legend b { color: var(--ink); font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: 13px; background: var(--surface-2); }
:root[data-theme="dark"] .seg { background: var(--surface); }
.seg label {
  position: relative; min-height: 40px; display: grid; place-items: center; padding: 0 8px; border-radius: 10px;
  font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); cursor: pointer; text-align: center;
  transition: background-color .2s var(--ease), color .2s, box-shadow .2s;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 3px 10px -4px rgba(0,0,0,.25), 0 0 0 .5px var(--line); }
:root[data-theme="dark"] .seg label:has(input:checked) { background: var(--surface-2); }
.seg label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.seg.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg.dos label { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 62px; padding: 9px 13px; text-align: left; }
.seg.dos b { font-size: var(--t-sm); font-weight: 600; }
.seg.dos small { font-size: 12.5px; font-weight: 400; line-height: 1.3; color: var(--ink-2); }
.seg label.off { opacity: .45; cursor: not-allowed; }
.aviso { margin-top: 10px; font-size: var(--t-xs); color: var(--warn); max-width: 52ch; }
.pend { margin-top: 16px; max-width: 520px; }
.pend legend { color: var(--warn); }

/* Anillos de actividad */
.anillos { width: clamp(240px, 24vw, 380px); height: auto; overflow: visible; display: block; }
.anillos circle { fill: none; }
.anillos .pista { stroke-width: 28; stroke-opacity: .16; }
.anillos .arco { stroke-width: 28; stroke-linecap: round; transition: stroke-dasharray .9s var(--ease); }
.anillos .r-av { stroke: var(--ring-av); }
.anillos .r-ok { stroke: var(--ring-ok); }
.anillos .r-rp { stroke: var(--ring-rp); }
.anillos .arco.cero { opacity: 0; }
.anillos .escaner { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 2 12; opacity: .35; transform-origin: 180px 180px; animation: giro 8s linear infinite; animation-play-state: paused; }
.is-running .anillos .escaner { animation-play-state: running; opacity: .8; }
.anillos .punta { fill: var(--ring-av); opacity: 0; transform-box: fill-box; transform-origin: center; }
.is-running .anillos .punta { animation: latido 1.4s ease-out infinite; }
.anillos .an-n { fill: var(--ink); font: 700 38px var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.anillos .an-sub { fill: var(--ink-2); font: 400 14px var(--mono); }
.anillos.deco .dibuja { animation: dibuja 1.6s var(--ease) both; }
.anillos.deco .r-ok.dibuja { animation-delay: .15s; }
.anillos.deco .r-rp.dibuja { animation-delay: .3s; }
@keyframes latido { 0% { transform: scale(1); opacity: .95; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes dibuja { from { stroke-dasharray: 0 1000; } }
.leyenda { display: flex; gap: 16px; font-size: var(--t-xs); color: var(--ink-2); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.leyenda .l-av::before { background: var(--ring-av); }
.leyenda .l-ok::before { background: var(--ring-ok); }
.leyenda .l-rp::before { background: var(--ring-rp); }
.hilos { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-2); }
.hilos i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); opacity: .35; transition: opacity .6s, transform .6s var(--spring), background-color .6s; }
.hilos i.on { opacity: 1; background: var(--ring-ok); transform: scale(1.5); transition-duration: .08s; }
.hilos span { margin-left: 6px; }

/* Widgets */
.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.widgets .w { background: var(--surface); border-radius: var(--r-card); padding: 13px 16px 12px; box-shadow: var(--sombra); }
.widgets dt { font-size: var(--t-xs); font-weight: 600; }
.widgets dd { margin-top: 2px; font-size: 30px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.s-ok dt, .ver-sum .s-ok { color: var(--ok); } .s-rep dt, .ver-sum .s-rep { color: var(--rep); } .s-cat dt, .ver-sum .s-cat { color: var(--cat); }
.s-err dt, .ver-sum .s-err { color: var(--err); } .s-sin dt, .ver-sum .s-sin { color: var(--warn); }

/* Notificaciones (actividad) */
.feed { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.card {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--sombra); min-width: 0;
  animation: baja .55s var(--spring) both;
}
.card:nth-child(2) { opacity: .88; } .card:nth-child(3) { opacity: .72; } .card:nth-child(4) { opacity: .55; } .card:nth-child(5) { opacity: .38; }
.card .ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 12px/1 var(--font); color: #000; letter-spacing: 0; }
.card.ok .ic { background: var(--ring-ok); }
.card.rep .ic { background: var(--ring-rp); }
.card.cat .ic { background: #BF5AF2; }
.card.sin .ic, .card.warn .ic { background: #FFD60A; }
.card.err .ic { background: #FF453A; }
.card .cx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card .cx b { font: 600 var(--t-sm)/1.3 var(--mono); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cx span { font-size: var(--t-xs); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card time { flex: none; font: 400 12px var(--mono); color: var(--ink-3); }
.card.sys { background: transparent; box-shadow: none; padding-top: 6px; padding-bottom: 6px; }
.card.sys .cx b { font: 500 var(--t-xs) var(--font); color: var(--ink-2); }
.card.warn .cx b { font-family: var(--font); color: var(--warn); }
@keyframes baja { from { opacity: 0; transform: translateY(-16px) scale(.97); } }

/* ── Botón principal ──────────────────────────────────────── */
.cta { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.holo {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 28px 0 24px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--bg); font: 600 var(--t-body)/1 var(--font); letter-spacing: -.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer; box-shadow: 0 14px 34px -16px rgba(0,0,0,.55);
  transition: transform .35s var(--spring), background-color .25s, color .25s, box-shadow .25s;
}
.holo svg { width: 15px; height: 15px; flex: none; }
.holo:hover { transform: scale(1.04); }
.holo:active { transform: scale(.98); transition-duration: .12s; }
.holo:focus-visible { outline-offset: 4px; border-radius: 999px; }
.holo.stop { background: var(--surface); color: var(--err); box-shadow: var(--sombra), 0 0 0 1px var(--line); }
.holo.armed { background: var(--warn); color: var(--on-warn); max-width: calc(100vw - 32px); }
.holo[disabled], .holo[aria-busy="true"] { opacity: .6; cursor: progress; transform: none; }
.holo.sm { min-height: 44px; padding: 0 22px; font-size: var(--t-sm); }
.cta-alt { white-space: nowrap; color: var(--link); min-height: 36px; text-decoration: none; }
.cta-alt:hover { text-decoration: underline; }

/* Botones secundarios = enlaces */
.link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; background: none; border: 0; cursor: pointer;
  font-size: var(--t-body); font-weight: 500; color: var(--link); text-decoration: none; transition: opacity .18s;
}
.link:hover { text-decoration: underline; }
.link.sm { font-size: var(--t-sm); }
.link.danger { color: var(--err); }
.link.armed { color: #FFFFFF; background: var(--err); padding: 0 12px; border-radius: 10px; text-decoration: none; }
.link[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Hojas laterales (catálogo / resultados) ──────────────── */
.sheet {
  position: fixed; top: calc(8px + var(--bar)); right: 8px; bottom: 8px; z-index: 30; width: min(460px, calc(100% - 16px));
  display: flex; flex-direction: column; background: var(--sheet); border-radius: 22px 0 14px 22px;
  box-shadow: -24px 0 60px -30px rgba(0,0,0,.5);
  transform: translateX(105%); visibility: hidden; transition: transform .5s var(--ease), visibility 0s linear .5s; overscroll-behavior: contain;
}
.sheet:target, .sheet.open { transform: none; visibility: visible; transition: transform .5s var(--ease), visibility 0s; }
.scrim { position: fixed; inset: calc(8px + var(--bar)) 8px 8px 8px; z-index: 29; border-radius: 0 0 14px 14px; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.sheet:target ~ .scrim, .scrim.open { opacity: 1; pointer-events: auto; }
.sheet header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 4px; }
.sheet h2 { font-size: var(--t-lead); font-weight: 700; letter-spacing: -.022em; line-height: 1.1; }
.sheet h2:focus { outline: none; }
.sheet .body { flex: 1; overflow: auto; padding: 8px 24px 32px; overscroll-behavior: contain; }
.sheet h3 { margin: 28px 0 8px; font-size: var(--t-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.layouts { display: flex; flex-wrap: wrap; gap: 0 18px; margin-bottom: 6px; }
.layouts a::before { content: "↓ "; }
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin-top: 10px;
  padding: 30px 20px; border-radius: 18px; background: var(--surface); cursor: pointer; box-shadow: var(--sombra);
  transition: transform .3s var(--spring), box-shadow .2s;
}
.drop::before { content: ""; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 12px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 16V5m0 0l-4 4m4-4l4 4M5 19h14'/%3E%3C/svg%3E") center / 22px no-repeat; }
.drop:hover, .drop.over { transform: scale(1.015); }
.drop.over { box-shadow: 0 0 0 3px var(--accent); }
.drop:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
.drop b { font-size: var(--t-body); font-weight: 600; }
.drop span { font-size: var(--t-xs); color: var(--ink-2); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.est { margin-top: 12px; font: var(--t-xs)/1.8 var(--mono); letter-spacing: 0; color: var(--ink-2); }
.est b { color: var(--ink); font-weight: 500; }
.items { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-grupo); overflow: hidden; }
.items a, .items .it {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center;
  min-height: 56px; padding: 9px 16px; text-decoration: none; transition: background-color .15s;
}
.items > * + * { box-shadow: inset 0 1px 0 var(--line); }
.items a:hover { background: var(--surface-2); }
.items a[aria-current="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.items a[aria-current="true"] .nm::after { content: "  ✓"; color: var(--accent); }
.items .nm { font-size: var(--t-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items .sub { grid-column: 1; font-size: var(--t-xs); color: var(--ink-2); }
.items .sub .w { color: var(--warn); }
.items .go { grid-row: 1 / span 2; grid-column: 2; font-size: var(--t-sm); color: var(--ink-2); }
.items .it { grid-template-columns: minmax(0, 1fr); }
.items .it .go { grid-row: auto; grid-column: 1; display: flex; flex-wrap: wrap; gap: 0 18px; align-items: center; margin-top: 2px; }
.items .it .go .link { min-height: 36px; }
.items .it .go form, .espacio form { display: inline; }
.items:has(> .empty) { background: transparent; }
.empty { font-size: var(--t-xs); color: var(--ink-2); max-width: 44ch; }
.rule { margin-top: 28px; font-size: var(--t-xs); color: var(--ink-2); max-width: 44ch; }
.rule b { color: var(--ink); font-weight: 600; }
.espacio { margin: 4px 0 12px; font-size: var(--t-sm); background: var(--surface); border-radius: var(--r-grupo); padding: 0 16px; }
.espacio > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 46px; }
.espacio > div + div { box-shadow: inset 0 1px 0 var(--line); }
.espacio dt { color: var(--ink-2); }
.espacio dd { color: var(--ink); text-align: right; font-family: var(--mono); font-size: var(--t-xs); }
.espacio dd b { font-weight: 600; }

/* Interruptor (estilo iOS) */
.switch { position: relative; display: flex; align-items: flex-start; gap: 14px; min-height: 44px; padding-top: 10px; cursor: pointer; font-size: var(--t-body); }
.switch input, .fila.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tr { flex: none; width: 51px; height: 31px; border-radius: 99px; background: color-mix(in srgb, var(--ink-3) 45%, transparent); position: relative; transition: background-color .25s; }
.tr::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 3px 8px rgba(0,0,0,.2); transition: transform .3s var(--spring); }
input:checked + .tr { background: #34C759; }
input:checked + .tr.rojo { background: #FF3B30; }
input:checked + .tr::after { transform: translateX(20px); }
input:focus-visible + .tr { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.switch .tr { margin-top: -4px; }
.switch small { display: block; margin-top: 2px; font-size: var(--t-xs); color: var(--ink-2); }

/* ── Visor de resultados ──────────────────────────────────── */
.scroll { flex: 1; overflow: auto; overscroll-behavior: contain; }
.ver { padding: 28px var(--gut) 64px; max-width: 1400px; margin: 0 auto; }
.ver-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.ver-head h1 { font-size: clamp(26px, 3vw, var(--t-lead)); font-weight: 700; letter-spacing: -.022em; line-height: 1.12; overflow-wrap: anywhere; }
.crumb { margin-bottom: 2px; }
.ver-sum { margin-top: 8px; font: var(--t-xs) var(--mono); letter-spacing: 0; color: var(--ink-2); }
.ver-acts { display: flex; align-items: center; gap: 20px; flex: none; }
.buscar { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; max-width: 520px; }
.buscar .inp { min-height: 44px; }
.tabla { overflow-x: auto; }
.tabla table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: var(--t-sm); }
.tabla th { text-align: left; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); padding: 0 12px 2px; white-space: nowrap; }
.tabla td { padding: 8px 12px; background: var(--surface); vertical-align: middle; }
.tabla td:first-child { border-radius: 14px 0 0 14px; }
.tabla td:last-child { border-radius: 0 14px 14px 0; }
.ver-tabla table { min-width: 860px; table-layout: fixed; }
.ver-tabla col.w-img { width: 80px; } .ver-tabla col.w-asin { width: 150px; } .ver-tabla col.w-est { width: 150px; }
.ver-tabla col.w-pre { width: 120px; } .ver-tabla col.w-mas { width: 100px; } .ver-tabla col.w-rep { width: 150px; }
.ver-tabla td { white-space: normal; }
.ver-tabla td.c-nom b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.ver-tabla td.mono { white-space: nowrap; font-size: var(--t-xs); }
.m-only { display: none; }
.promo { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: .06em; }
.d-datos small { font-size: 12px; color: var(--ink-2); text-decoration: none; }
.c-img img, .noimg { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; display: block; background: #FFFFFF; }
.noimg { background: var(--surface-2); }
.noimg.grande { width: 100%; height: 220px; border-radius: 18px; }
.c-nom b { display: block; font-size: var(--t-sm); font-weight: 600; }
.c-nom span { font-size: var(--t-xs); color: var(--ink-2); }
.ver-tabla .asin { font-family: var(--mono); color: var(--link); min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; letter-spacing: 0; }
.ver-tabla .asin:hover { text-decoration: underline; }
.ver-tabla tr[aria-current="true"] td { box-shadow: inset 0 0 0 2px var(--accent); }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 99px; font: 600 var(--t-xs) var(--font); background: color-mix(in srgb, currentColor 14%, transparent); }
.pill.na { color: var(--ink-3); }
.pill.ok { color: var(--ok); } .pill.rep { color: var(--rep); } .pill.cat { color: var(--cat); } .pill.sin { color: var(--warn); } .pill.err { color: var(--err); }
.d-foto { margin: 8px 0 16px; border-radius: 18px; overflow: hidden; background: #FFFFFF; }
.d-foto img { width: 100%; max-height: 320px; object-fit: contain; display: block; }
.detalle figcaption { padding: 10px 0 0; font-size: var(--t-xs); color: var(--ink-2); }
.d-nom { margin: 12px 0 14px; font-size: var(--t-body); font-weight: 600; line-height: 1.35; }
.d-datos { background: var(--surface); border-radius: var(--r-grupo); padding: 0 14px; }
.d-datos > div { display: grid; grid-template-columns: 12ch 1fr; column-gap: 12px; padding: 10px 0; font-size: var(--t-xs); }
.d-datos > div + div { box-shadow: inset 0 1px 0 var(--line); }
.d-datos dt { color: var(--ink-2); }
.d-datos dd { overflow-wrap: anywhere; }
.d-orig { margin-top: 16px; display: flex; align-items: center; gap: 10px; font-size: var(--t-xs); color: var(--ink-2); }
.d-orig img { border-radius: 8px; background: #FFFFFF; }

/* ── Aviso flotante ───────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; top: calc(14px + var(--bar)); z-index: 60; max-width: min(560px, calc(100% - 32px));
  padding: 13px 18px; border-radius: 99px; background: #000000; color: #F5F5F7; font-size: var(--t-sm); font-weight: 500;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 18px 40px -18px rgba(0,0,0,.7);
  transform: translate(-50%, -10px) scale(.96); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .45s var(--spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.err { background: #FF453A; color: #FFFFFF; box-shadow: 0 18px 40px -18px rgba(255,69,58,.6); }

/* ── Acceso (entrar / inicio) ─────────────────────────────── */
.auth .isla-wrap { display: none; }
.auth .display { font-size: clamp(84px, 10vw, 168px); }
.auth .phase { font-size: var(--t-lead); }
.auth .core-wrap .anillos { width: clamp(220px, 22vw, 340px); }
.form { display: flex; flex-direction: column; max-width: 380px; width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; min-width: 0; }
.field > label { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.field > label span { color: var(--ink-3); font-weight: 400; }
.inp, .sel {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 0; border-radius: 12px;
  background: var(--field); color: var(--ink); font-size: var(--t-body); line-height: 1.3;
  box-shadow: 0 0 0 1px var(--line); transition: box-shadow .18s var(--ease);
}
.inp::placeholder { color: var(--ink-3); }
.inp.key { font-family: var(--mono); letter-spacing: 0; }
.inp:focus, .sel:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
.inp[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--err); }
.sel { -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23808089' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.sel option, .sel-fila option { color: #1D1D1F; background: #FFFFFF; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
.error { margin-top: 16px; color: var(--err); font-size: var(--t-sm); font-weight: 500; }
.help { margin-top: 16px; font-size: var(--t-sm); color: var(--ink-2); max-width: 44ch; }

/* ── Configuración: lista de Ajustes + detalle ────────────── */
.ajustes { flex: 1; min-height: 0; display: flex; }
.lista {
  flex: 0 0 340px; min-width: 0; overflow: auto; overscroll-behavior: contain;
  padding: 10px 16px 28px clamp(16px, 1.8vw, 24px); border-right: 1px solid var(--line);
}
.lt { margin: 4px 4px 14px; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.buscar-aj { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px; background: var(--surface-2); color: var(--ink-3); margin-bottom: 16px; }
:root[data-theme="dark"] .buscar-aj { background: var(--surface); }
.buscar-aj svg { width: 15px; height: 15px; flex: none; }
.buscar-aj input { border: 0; background: transparent; outline: none; width: 100%; color: var(--ink); font-size: var(--t-sm); }
.buscar-aj input::placeholder { color: var(--ink-3); }
.grupo-t { margin: 18px 14px 6px; font-size: var(--t-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.grupo { background: var(--surface); border-radius: var(--r-grupo); overflow: hidden; }
.grupo > * + * { background-image: linear-gradient(var(--line), var(--line)); background-repeat: no-repeat; background-size: calc(100% - 16px) 1px; background-position: right top; }
.lista .grupo > .it + .it { background-size: calc(100% - 52px) 1px; }
.lista .it {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px 0 10px; text-decoration: none; color: var(--ink);
  transition: background-color .15s;
}
.lista .it:hover { background-color: var(--surface-2); }
.lista .it[aria-current="page"] { background: #0071E3; color: #FFFFFF; box-shadow: none; }
.lista .it[aria-current="page"] + .it { box-shadow: none; }
.lista .it[aria-current="page"] .dt, .lista .it[aria-current="page"] .chev, .lista .it[aria-current="page"] small { color: rgba(255,255,255,.85); }
.lista .tx { flex: 1; min-width: 0; font-size: var(--t-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .dt { flex: none; font-size: var(--t-sm); color: var(--ink-3); white-space: nowrap; }
.lista .dt.mal { color: var(--err); font-weight: 600; }
.lista .chev { width: 8px; height: 13px; flex: none; color: var(--ink-3); }
.lista .it.cuenta { min-height: 68px; border-radius: var(--r-grupo); background: var(--surface); margin-bottom: 4px; }
.lista .it.cuenta .tx { display: flex; flex-direction: column; }
.lista .it.cuenta b { font-size: var(--t-body); font-weight: 600; }
.lista .it.cuenta small { font-size: var(--t-xs); color: var(--ink-2); }
.lista .it.cuenta[aria-current="page"] { background: #0071E3; }
.sin-res { margin: 12px 14px; font-size: var(--t-sm); color: var(--ink-2); }
.lista .volver { margin: 18px 6px 0; }
.ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #FFFFFF; }
.ic svg { width: 17px; height: 17px; }
.ic.grande { width: 56px; height: 56px; border-radius: 15px; }
.ic.grande svg { width: 30px; height: 30px; }
.verde { background: #34C759; } .azul { background: #0A84FF; } .morado { background: #AF52DE; } .gris { background: #8E8E93; } .naranja { background: #FF9500; } .grafito { background: #636366; }
.av { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #5E5CE6, #0A84FF); color: #FFFFFF; font-weight: 700; font-size: 16px; letter-spacing: 0; }
.av.grande { width: 64px; height: 64px; font-size: 24px; }

.detalle-aj { flex: 1; min-width: 0; overflow: auto; overscroll-behavior: contain; padding: 18px var(--gut) 0; }
.detalle-aj > .tab { max-width: 720px; margin: 0 auto; padding-bottom: 40px; animation: subir .35s var(--ease); }
.atras { display: none; align-items: center; gap: 6px; min-height: 44px; color: var(--link); text-decoration: none; font-size: var(--t-body); }
.atras svg { width: 10px; height: 16px; }
.aj-cab { display: flex; align-items: center; gap: 16px; margin: 6px 0 22px; }
.aj-cab h2 { font-size: var(--t-lead); font-weight: 700; letter-spacing: -.022em; line-height: 1.12; }
.aj-cab h2:focus { outline: none; }
.aj-cab p { margin-top: 3px; font-size: var(--t-sm); color: var(--ink-2); }
.fila {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 50px; padding: 4px 16px;
  font-size: var(--t-body); margin: 0; width: 100%; background-color: transparent; border: 0; text-align: left; color: var(--ink);
}
.fila .et { flex: 1 1 auto; min-width: 0; }
.fila .et small { font-size: var(--t-xs); color: var(--ink-3); margin-left: 4px; }
.fila .et.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-sm); }
.fila .et.nm small { display: block; margin-left: 0; }
.fila .vl { flex: none; color: var(--ink-2); font-size: var(--t-sm); text-align: right; max-width: 60%; overflow-wrap: anywhere; }
.fila .vl.mono { font-size: var(--t-xs); }
.fila .mal { color: var(--err); }
.fila .ctl { flex: 0 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.inp-fila, .sel-fila {
  flex: 0 1 300px; min-width: 0; width: 300px; max-width: 58%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 9px;
  background: var(--surface-2); color: var(--ink); font-size: var(--t-sm); text-align: right;
}
:root[data-theme="dark"] .inp-fila, :root[data-theme="dark"] .sel-fila { background: var(--surface-2); }
.inp-fila.key { font-family: var(--mono); letter-spacing: 0; text-align: left; }
.inp-fila.num { width: 110px; flex-basis: 110px; font-variant-numeric: tabular-nums; }
.inp-fila::placeholder { color: var(--ink-3); }
.inp-fila:focus, .sel-fila:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
.ctl .inp-fila, .ctl .sel-fila { width: 220px; max-width: none; flex-basis: 220px; text-align: left; }
.sel-fila { -webkit-appearance: none; appearance: none; text-align: left; padding-right: 30px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 6.5l3-3 3 3M5 9.5l3 3 3-3' fill='none' stroke='%23808089' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
.fila.sw { cursor: pointer; position: relative; }
.accion-fila { display: flex; align-items: center; min-height: 50px; padding: 0 16px; width: 100%; border: 0; background-color: transparent; color: var(--link); font-size: var(--t-body); text-align: left; cursor: pointer; }
.accion-fila:hover { background-color: var(--surface-2); }
.accion-fila.peligro, .et.peligro { color: var(--err); }
.accion-fila.armed { background: var(--err); color: #FFFFFF; }
.pie { margin: 8px 16px 0; font-size: var(--t-xs); color: var(--ink-2); line-height: 1.45; }
.probe { margin: 8px 16px 0; font: var(--t-xs)/1.5 var(--mono); letter-spacing: 0; display: flex; flex-direction: column; gap: 3px; }
.probe:empty { display: none; }
.probe .y { color: var(--ok); } .probe .n { color: var(--err); } .probe .k { color: var(--ink-2); }
.probe b { color: var(--ink); font-weight: 600; }
.persona { margin-bottom: 14px; }
.persona.off { opacity: .6; }
.cab-persona { min-height: 64px; }
.cab-persona .et { display: flex; flex-direction: column; }
.cab-persona .et b { font-weight: 600; }
.cab-persona .et small { margin-left: 0; }
.cab-persona .av { width: 40px; height: 40px; font-size: 15px; }
.esp-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin: 0 4px 16px; }
.esp-total b { font-size: var(--t-h); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.esp-total span { font-size: var(--t-sm); color: var(--ink-2); }
/* Cuota de espacio y corridas (mismo aspecto en la hoja Resultados y en Configuración) */
.cuota { margin: 0 4px 6px; }
.cuota .esp-total { margin: 0 0 12px; }
.barra { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ink-3) 22%, transparent); overflow: hidden; }
.barra span { display: block; height: 100%; border-radius: inherit; background: var(--ring-ok); transform-origin: left; animation: llena .9s var(--ease) both; }
.cuota.alto .barra span { background: #FF9F0A; }
.cuota.lleno .barra span { background: var(--err); }
.cuota .pie { margin: 10px 0 0; }
.cuota.alto .pie { color: var(--warn); font-weight: 600; }
.cuota.lleno .pie { color: var(--err); font-weight: 600; }
@keyframes llena { from { transform: scaleX(0); } }
.corrida { margin-bottom: 12px; }
.cab-corrida { min-height: 64px; }
.cab-corrida .ic { width: 34px; height: 34px; border-radius: 9px; }
.cab-corrida .et b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab-corrida .et small { display: block; margin-left: 0; white-space: normal; }
.fila.acciones { justify-content: flex-start; gap: 4px 22px; flex-wrap: wrap; min-height: 46px; }
.fila.acciones form { display: inline; }
.grupo-t.primero { margin-top: 6px; }
.sheet .grupo-t { margin-left: 4px; }
.sheet .pie { margin-left: 4px; margin-bottom: 4px; }
.cuota-aviso a { color: inherit; }
.ver-grande { margin: 0 4px 16px; font: 800 var(--t-h)/1 var(--font); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 22px 0 0; padding: 12px 12px 12px 18px; border-radius: 99px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 0 0 1px var(--line), var(--sombra);
}
.savebar .state { font-size: var(--t-xs); color: var(--ink-2); }
.savebar.dirty .state { color: var(--warn); font-weight: 600; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1180px) {
  .stage { grid-template-rows: auto auto auto; row-gap: 28px; align-content: start; padding-top: 4px; overflow: auto; }
  .metrics { grid-column: 1 / span 7; grid-row: 2; }
  .core-wrap { grid-column: 8 / span 5; grid-row: 2; }
  .side { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .app { position: relative; inset: auto; min-height: 100vh; min-height: 100dvh; border-radius: 0; }
  .nav .hide-m { display: none; }
  .b-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .b-short { display: inline; }
  .menu { display: block; }
  .stage { display: flex; flex-direction: column; align-items: stretch; gap: 26px; overflow: visible; padding: 4px var(--gut) calc(140px + env(safe-area-inset-bottom)); }
  .isla { min-width: 0; width: 100%; height: 46px; }
  .isla.pop { min-width: 0; }
  .core-wrap { order: 1; align-self: center; }
  .metrics { order: 2; }
  .side { order: 3; display: flex; align-items: stretch; }
  .anillos { width: min(250px, 68vw); }
  .display { font-size: clamp(84px, 26vw, 124px); }
  .phase { font-size: 24px; margin-top: 16px; }
  .widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); width: calc(100% - 32px); }
  .cta .holo { width: 100%; }
  .cta-alt { background: var(--bg); padding: 0 12px; border-radius: 99px; }
  .holo.armed { font-size: var(--t-sm); }
  .sheet { inset: var(--bar) 0 0 0; width: 100%; border-radius: 22px 22px 0 0; top: var(--bar); right: 0; bottom: 0; }
  .scrim { inset: var(--bar) 0 0 0; border-radius: 0; }
  .ver-acts { width: 100%; justify-content: space-between; }
  .ver-tabla table { min-width: 0; }
  .ver-tabla th:nth-child(n+5), .ver-tabla td:nth-child(n+5), .ver-tabla col:nth-child(n+5),
  .ver-tabla th:nth-child(2), .ver-tabla td:nth-child(2), .ver-tabla col:nth-child(2) { display: none; }
  .ver-tabla col.w-img { width: 64px; } .ver-tabla col.w-est { width: 104px; }
  .ver-tabla .m-only { display: inline-flex; min-height: 36px; font-size: 13px; }
  .ver-tabla td.c-nom b { -webkit-line-clamp: 3; }
  .c-nom span { display: none; }
  .ver-tabla .pill { padding: 3px 8px; font-size: 12px; }
  .ver-tabla td { padding: 6px 8px; }
  .ver-head h1 { font-size: 22px; }
  .two { grid-template-columns: 1fr; }
  .form { max-width: none; }
  .auth.stage { gap: 24px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .auth .core-wrap .anillos { width: min(170px, 46vw); }
  .auth .cta { position: static; transform: none; width: 100%; }
  .auth .holo { width: 100%; }

  /* Configuración: primero la lista; al tocar una sección, solo el detalle */
  .ajustes { flex-direction: column; overflow: visible; }
  .lista { flex: none; border-right: 0; padding: 4px var(--gut) 28px; overflow: visible; }
  .detalle-aj { overflow: visible; padding: 4px var(--gut) 24px; }
  .ajustes[data-explicita="0"] .detalle-aj { display: none; }
  .ajustes[data-explicita="1"] .lista { display: none; }
  .atras { display: inline-flex; }
  .lista .it[aria-current="page"], .lista .it.cuenta[aria-current="page"] { background-color: var(--surface); color: var(--ink); }
  .lista .it[aria-current="page"] .dt, .lista .it[aria-current="page"] .chev { color: var(--ink-3); }
  .lista .it[aria-current="page"] small { color: var(--ink-2); }
  .lista .it[aria-current="page"] .dt.mal { color: var(--err); }
  .lista .grupo > .it[aria-current="page"] + .it { background-image: linear-gradient(var(--line), var(--line)); }
  .fila { flex-wrap: wrap; row-gap: 6px; }
  .inp-fila, .sel-fila { max-width: 100%; width: 100%; flex-basis: 100%; text-align: left; }
  .inp-fila.num { width: 110px; flex-basis: 110px; text-align: right; }
  .ctl { width: 100%; }
  .ctl .inp-fila, .ctl .sel-fila { flex: 1 1 auto; width: auto; }
  .savebar { border-radius: 22px; }
  .cab-persona .et { flex: 1 1 0; }
  .cab-corrida, form.fila:not(:has(.ctl)) { flex-wrap: nowrap; }
  .cab-corrida .et, form.fila:not(:has(.ctl)) .et { flex: 1 1 0; min-width: 0; }
  .cab-persona .vl { order: 3; flex-basis: 100%; max-width: none; text-align: left; padding-left: 54px; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .lista { flex-basis: 300px; }
  .lista .it { gap: 10px; }
  .lista .dt { font-size: var(--t-xs); }
  .b-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .b-short { display: inline; }
}

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