/* Concepto: la góndola. Cada sección apoya en un estante; los números van en carteles de precio
   amarillos con el precio por kilo abajo, como en el súper. Blanco de góndola, tinta azul noche. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f2f4f8;
  --panel-2: #e7ebf2;
  --ink: #0f1a33;
  --ink-2: #4b556e;
  --ink-3: #7a8399;
  --line: #dde2eb;
  --line-2: #c3cad7;
  --tag: #ffe14a;
  --tag-ink: #0f1a33;
  --resalta: #ffe14a;
  --resalta-ink: #0f1a33;
  --cta: #0f1a33;
  --cta-ink: #ffffff;
  --estante: #0f1a33;
  --sube: #d03b3b;
  --baja: #2a78d6;
  --sombra: 0 1px 0 rgba(15, 26, 51, .06), 0 10px 30px -18px rgba(15, 26, 51, .35);
  /* serie categórica (orden fijo, validado) */
  --c0: #2a78d6; --c1: #eb6834; --c2: #1baf7a; --c3: #eda100;
  --c4: #e87ba4; --c5: #008300; --c6: #4a3aa7; --c7: #e34948;
  /* rampa secuencial naranja (costo) */
  --q1: #fff3ec; --q2: #fde0d0; --q3: #f9c4a8; --q4: #f4a07c; --q5: #ec7a4a;
  --q-ink-claro: #0f1a33; --q-ink-oscuro: #0f1a33;
  --div0: #e6e9ef; --divb1: #b7d3f6; --divb2: #6da7ec; --divb3: #2a78d6; --divr1: #f6c7c4; --divr2: #ec8a86; --divr3: #d03b3b;
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-texto: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-num: "Archivo", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1324; --panel: #151d33; --panel-2: #1c2640; --ink: #f2f4fa; --ink-2: #b2bbcf; --ink-3: #8790a6;
    --line: #253049; --line-2: #34405e; --resalta: transparent; --resalta-ink: #ffe14a; --cta: #ffe14a; --cta-ink: #0f1a33; --estante: #ffe14a;
    --sube: #e66767; --baja: #3987e5; --sombra: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px -18px rgba(0, 0, 0, .8);
    --c0: #3987e5; --c1: #d95926; --c2: #199e70; --c3: #c98500; --c4: #d55181; --c5: #008300; --c6: #9085e9; --c7: #e66767;
    --q1: #1d2236; --q2: #3a2418; --q3: #5c2a12; --q4: #8a3512; --q5: #b84716;
    --q-ink-claro: #f2f4fa; --q-ink-oscuro: #f2f4fa;
    --div0: #2b3550; --divb1: #1f4778; --divb2: #2f6cb8; --divb3: #6aa6ee; --divr1: #5b2a2e; --divr2: #a33c3c; --divr3: #ef7a77;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1324; --panel: #151d33; --panel-2: #1c2640; --ink: #f2f4fa; --ink-2: #b2bbcf; --ink-3: #8790a6;
  --line: #253049; --line-2: #34405e; --resalta: transparent; --resalta-ink: #ffe14a; --cta: #ffe14a; --cta-ink: #0f1a33; --estante: #ffe14a;
  --sube: #e66767; --baja: #3987e5; --sombra: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px -18px rgba(0, 0, 0, .8);
  --c0: #3987e5; --c1: #d95926; --c2: #199e70; --c3: #c98500; --c4: #d55181; --c5: #008300; --c6: #9085e9; --c7: #e66767;
  --q1: #1d2236; --q2: #3a2418; --q3: #5c2a12; --q4: #8a3512; --q5: #b84716;
  --q-ink-claro: #f2f4fa; --q-ink-oscuro: #f2f4fa;
    --div0: #2b3550; --divb1: #1f4778; --divb2: #2f6cb8; --divb3: #6aa6ee; --divr1: #5b2a2e; --divr2: #a33c3c; --divr3: #ef7a77;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--f-texto);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main, .pie { padding-inline: clamp(16px, 4vw, 48px); }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--c0); outline-offset: 2px; border-radius: 4px; }
.vis-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }

/* ---------- barra ---------- */
.barra {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  display: flex; align-items: center; gap: 24px;
  padding: 10px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.marca { display: flex; align-items: baseline; gap: 8px; text-decoration: none; flex: none; }
.marca-carro { width: 30px; height: 24px; align-self: center; color: var(--ink); }
.marca span { font: 800 22px/1 var(--f-display); letter-spacing: -.04em; }
.marca small { font: 600 12px/1 var(--f-texto); color: var(--ink-2); letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; padding: 7px 11px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.nav a:hover { background: var(--panel); color: var(--ink); }
@media (max-width: 720px) { .barra { flex-wrap: wrap; gap: 6px 16px; } .nav { margin-left: 0; width: 100%; } }

/* ---------- portada ---------- */
.portada {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px);
  align-items: start; padding-block: clamp(28px, 5vw, 64px) 40px; max-width: 1320px; margin: 0 auto;
}
@media (max-width: 960px) { .portada { grid-template-columns: minmax(0, 1fr); } }
.sobre { font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; }
.portada h1 { font-size: clamp(44px, 7vw, 92px); line-height: .92; font-weight: 800; letter-spacing: -.045em; font-variation-settings: "opsz" 96; }
.resalta { display: inline; background: linear-gradient(transparent 58%, var(--resalta) 58%, var(--resalta) 92%, transparent 92%); color: var(--resalta-ink); padding-inline: .04em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.bajada { margin-top: 20px; font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 46ch; }

/* cartel de precio (firma visual) */
.cartel {
  --rot: -2.5deg;
  position: relative; display: inline-grid; gap: 2px; margin-top: 28px; padding: 14px 20px 14px 26px;
  background: var(--tag); color: var(--tag-ink); border-radius: 6px; transform: rotate(var(--rot));
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 14px 28px -14px rgba(15, 26, 51, .55);
}
.cartel::before { /* agujero del riel */
  content: ""; position: absolute; left: 9px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
}
.cartel-sobre { font: 700 11px/1.2 var(--f-texto); letter-spacing: .07em; text-transform: uppercase; }
.cartel-precio { font: 900 64px/0.95 var(--f-num); font-stretch: 72%; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cartel-precio i { font-style: normal; font-size: .5em; vertical-align: .62em; margin-left: 2px; }
.cartel-precio sup { font-size: .42em; vertical-align: .95em; margin-right: 2px; }
.cartel-pie { font: 600 12px/1.25 var(--f-texto); border-top: 1.5px dashed rgba(15, 26, 51, .35); padding-top: 5px; margin-top: 3px; }
@media (prefers-reduced-motion: no-preference) { .cartel--grande { animation: cuelga 1.1s cubic-bezier(.2, .9, .3, 1.4) .2s backwards; } }
@keyframes cuelga { from { transform: rotate(-12deg) translateY(-6px); } to { transform: rotate(var(--rot)); } }

/* figura genérica */
figure { margin: 0; }
figcaption { display: grid; gap: 2px; margin-bottom: 14px; }
.fig-tit { font: 700 18px/1.25 var(--f-display); letter-spacing: -.01em; }
.fig-sub { font-size: 14px; color: var(--ink-2); }
.nota { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* carrera */
.carrera { background: var(--panel); border-radius: 16px; padding: clamp(16px, 2.4vw, 28px); }
.gondolas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip {
  border: 1.5px solid var(--line-2); background: var(--bg); border-radius: 8px; padding: 6px 11px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: baseline;
}
.chip small { font: 500 12px var(--f-num); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--cta); color: var(--cta-ink); border-color: var(--cta); }
.chip[aria-pressed="true"] small { color: inherit; opacity: .75; }
.pistas { display: grid; gap: 4px; }
.pista { display: grid; grid-template-columns: 140px minmax(0, 1fr) 82px; gap: 12px; align-items: center; min-height: 44px; }
@media (max-width: 560px) { .pista { grid-template-columns: 96px minmax(0, 1fr) 64px; gap: 8px; } }
.pista-nom { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; line-height: 1.15; min-width: 0; }
.pista-nom i { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--col); }
.pista-via { position: relative; height: 40px; }
.pista-via::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dotted var(--line-2); }
.pista-eje { position: relative; height: 18px; margin-left: 152px; margin-right: 94px; font: 500 11px var(--f-num); color: var(--ink-3); }
@media (max-width: 560px) { .pista-eje { margin-left: 104px; margin-right: 72px; } }
.pista-eje span { position: absolute; transform: translateX(-50%); top: 0; }
.pista-carro {
  position: absolute; top: 50%; left: 0; width: 34px; height: 30px; margin: -15px 0 0 -17px; color: var(--col);
  transition: left 1.2s cubic-bezier(.3, .85, .25, 1);
}
.pista-carro svg { width: 100%; height: 100%; overflow: visible; }
.pista-carro .ruedas { transform-origin: center; }
.pista-val { text-align: right; font: 800 18px/1.1 var(--f-num); font-variant-numeric: tabular-nums; font-stretch: 85%; }
.pista-val small { display: block; font: 500 11px/1.2 var(--f-texto); color: var(--ink-2); }
.pista--primera .pista-val { color: var(--ink); }
.ganador { display: inline-block; font: 800 10px/1 var(--f-texto); letter-spacing: .08em; text-transform: uppercase; background: var(--tag); color: var(--tag-ink); padding: 4px 6px; border-radius: 4px; }

/* ---------- secciones y estantes ---------- */
.seccion { max-width: 1320px; margin: 0 auto; padding-block: clamp(40px, 6vw, 80px) 0; }
.estante {
  display: grid; gap: 8px; padding-bottom: 18px; margin-bottom: 28px; position: relative;
  border-bottom: 6px solid var(--estante);
}
.estante::after { /* labio del estante */
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 8px;
  background: linear-gradient(var(--line), transparent); opacity: .9;
}
.estante h2 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1; font-weight: 800; letter-spacing: -.035em; }
.estante p { color: var(--ink-2); max-width: 70ch; font-size: 17px; }

/* botones */
.btn { border-radius: 8px; padding: 8px 13px; font-weight: 700; font-size: 14px; cursor: pointer; border: 1.5px solid transparent; }
.btn--sec { background: var(--bg); border-color: var(--line-2); color: var(--ink); }
.btn--sec:hover { border-color: var(--ink); }
.btn--pri { background: var(--cta); color: var(--cta-ink); }
.seg { display: inline-flex; background: var(--panel); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 26, 51, .15); }

/* ---------- armado ---------- */
.armado { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
@media (max-width: 960px) { .armado { grid-template-columns: minmax(0, 1fr); } }
.buscador {
  display: flex; align-items: center; gap: 10px; border: 2px solid var(--ink); border-radius: 12px; padding: 4px 6px 4px 14px; background: var(--bg);
}
.buscador svg { width: 20px; height: 20px; flex: none; color: var(--ink-2); }
.buscador input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 10px 0; }
.buscador select { flex: none; max-width: 42%; border: 0; background: var(--panel); border-radius: 8px; padding: 8px; font-size: 14px; font-weight: 600; }
.resultados {
  list-style: none; margin: 6px 0 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  box-shadow: var(--sombra); max-height: 420px; overflow-y: auto;
}
.res { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.res:hover, .res[aria-selected="true"] { background: var(--panel); }
.res-nom { min-width: 0; }
.res-nom b { display: block; font-weight: 600; font-size: 15px; line-height: 1.25; }
.res-nom small { color: var(--ink-2); font-size: 13px; }
.res-precio { text-align: right; font: 700 15px/1.2 var(--f-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-precio small { display: block; font: 500 11px var(--f-texto); color: var(--ink-2); }
.res-mas { width: 30px; height: 30px; border-radius: 8px; background: var(--cta); color: var(--cta-ink); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.res-vacio { padding: 12px; color: var(--ink-2); font-size: 14px; }

.rapidos { margin-top: 18px; }
.rapidos-tit { display: block; font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.rapidos-lista { display: flex; flex-wrap: wrap; gap: 6px; }
.rapido {
  border: 1.5px solid var(--line-2); background: var(--bg); border-radius: 8px; padding: 6px 10px 6px 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}
.rapido::before { content: "+"; font-weight: 800; color: var(--ink-3); }
.rapido:hover { border-color: var(--ink); }
.rapido--mas { border-style: dashed; color: var(--ink-2); }
.rapido--mas::before { content: "…"; }
.rapido.en-carro { background: var(--panel); border-color: var(--panel); color: var(--ink-2); }
.rapido.en-carro::before { content: "✓"; color: var(--ink-2); }

.carro-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 28px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.carro-cab h3 { font-size: 22px; font-weight: 800; }
.etiqueta-ej { font: 800 11px/1 var(--f-texto); letter-spacing: .08em; text-transform: uppercase; color: var(--tag-ink); background: var(--tag); padding: 5px 7px; border-radius: 4px; }
.carro-acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.carro { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item-nom { min-width: 0; }
.item-nom b { display: block; font-weight: 600; line-height: 1.25; }
.item-nom small { color: var(--ink-2); font-size: 13px; }
.item-mejor { font-size: 13px; color: var(--ink-2); }
.item-mejor .num { font-weight: 700; color: var(--ink); }
.item-rango { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.item-rango .num { font-weight: 600; }
.item-rango small { font-size: 12px; color: var(--ink-3); }
.rango-pista { position: relative; flex: 1 1 160px; height: 16px; min-width: 120px; margin-inline: 6px; }
.rango-pista::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--line-2); border-radius: 2px; }
.rango-pista i { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--col); box-shadow: 0 0 0 2px var(--bg); cursor: default; }
.rango-pista i:hover { transform: scale(1.35); z-index: 2; }
.cant { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.cant button { width: 32px; height: 32px; border: 0; background: var(--bg); cursor: pointer; font-weight: 800; font-size: 17px; }
.cant button:hover { background: var(--panel); }
.cant output { min-width: 26px; text-align: center; font: 700 15px var(--f-num); font-variant-numeric: tabular-nums; }
.quitar { width: 32px; height: 32px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 8px; font-size: 18px; }
.quitar:hover { background: var(--panel); color: var(--ink); }
.carro-vacio { padding: 22px 0; color: var(--ink-2); }

/* ticket con ranking */
.armado-der { position: sticky; top: 84px; }
@media (max-width: 960px) { .armado-der { position: static; } }
.ticket { background: var(--panel); border-radius: 16px; padding: clamp(16px, 2vw, 22px); }
.ticket-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ticket-cab h3 { font-size: 22px; font-weight: 800; }
.interruptor { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor span { width: 34px; height: 20px; border-radius: 6px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.interruptor span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 4px; background: var(--bg); transition: transform .2s; }
.interruptor input:checked + span { background: var(--cta); }
.interruptor input:checked + span::after { transform: translateX(14px); background: var(--cta-ink); }
.interruptor input:focus-visible + span { outline: 3px solid var(--c0); outline-offset: 2px; }
.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fila {
  display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 0 12px; align-items: center;
  background: var(--bg); border-radius: 10px; padding: 10px 12px 10px 0; overflow: hidden; position: relative;
}
.fila::before { content: ""; align-self: stretch; background: var(--col); margin: -10px 0; }
.fila-nom { min-width: 0; }
.fila-nom b { display: block; font-weight: 700; line-height: 1.2; }
.fila-nom small { font-size: 12.5px; color: var(--ink-2); }
.fila-tot { text-align: right; font: 800 22px/1 var(--f-num); font-stretch: 80%; font-variant-numeric: tabular-nums; }
.fila-tot small { display: block; font: 600 12px/1.3 var(--f-texto); color: var(--ink-2); margin-top: 3px; }
.fila--mejor { background: var(--tag); color: var(--tag-ink); }
.fila--mejor .fila-nom small, .fila--mejor .fila-tot small { color: var(--tag-ink); opacity: .8; }
.fila--incompleta { opacity: .72; }
.fila--incompleta .fila-tot { font-size: 18px; color: var(--ink-2); }
.combo { margin-top: 16px; padding-top: 14px; border-top: 1.5px dashed var(--line-2); }
.combo h4 { margin: 0 0 4px; font: 800 16px var(--f-display); }
.combo p { font-size: 14px; color: var(--ink-2); }
.combo .num { color: var(--ink); font-weight: 800; }
.combo ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.combo li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.combo li i { width: 10px; height: 10px; border-radius: 3px; background: var(--col); flex: none; }

/* ---------- mapa ---------- */
.mapa-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
@media (max-width: 960px) { .mapa-grid { grid-template-columns: minmax(0, 1fr); } }
.mapa-caja { background: var(--panel); border-radius: 16px; padding: 14px; }
.mapa-ctrl { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mapa-ctrl .seg { background: var(--bg); }
.mapa-ctrl .seg-btn[aria-pressed="true"] { background: var(--cta); color: var(--cta-ink); box-shadow: none; }
.mapa-svg { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; max-height: 640px; cursor: crosshair; touch-action: manipulation; }
.depto { fill: var(--bg); stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.depto--vacio { fill: url(#rayado); }
.depto-nom { font: 600 11px var(--f-texto); fill: var(--ink-3); pointer-events: none; text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.depto-nom--vacio { fill: var(--ink-2); font-weight: 700; }
.suc { stroke: var(--panel); stroke-width: 2; cursor: pointer; vector-effect: non-scaling-stroke; transition: r .15s; }
.suc:hover, .suc.activa { stroke: var(--ink); }
.pin-yo path { fill: var(--ink); }
.pin-yo circle { fill: var(--tag); }
.rayo { stroke-dasharray: 2 3; stroke-linecap: round; opacity: .85; vector-effect: non-scaling-stroke; }
.radio-yo { fill: none; stroke: var(--ink); stroke-dasharray: 3 4; stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: .6; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.leyenda button {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-2); background: var(--bg); border-radius: 8px;
  padding: 5px 9px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.leyenda button i { width: 10px; height: 10px; border-radius: 50%; background: var(--col); }
.leyenda button small { font: 500 12px var(--f-num); color: var(--ink-3); }
.leyenda button[aria-pressed="false"] { opacity: .45; }
.leyenda button[aria-pressed="false"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.cercanas h3 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.cercanas-lista { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.cerca { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 0 12px; background: var(--panel); border-radius: 10px; padding: 11px 12px 11px 0; overflow: hidden; cursor: pointer; border: 1.5px solid transparent; }
.cerca:hover, .cerca.activa { border-color: var(--ink); }
.cerca::before { content: ""; background: var(--col); margin: -11px 0; }
.cerca-nom { min-width: 0; }
.cerca-nom b { display: block; font-weight: 700; line-height: 1.2; }
.cerca-nom small { display: block; font-size: 13px; color: var(--ink-2); }
.cerca-dato { text-align: right; }
.cerca-dato .num { display: block; font-weight: 800; font-size: 18px; font-stretch: 85%; }
.cerca-dato small { font-size: 12px; color: var(--ink-2); }
.abierto { color: var(--ink); font-weight: 700; }

/* ---------- canasta ---------- */
.canasta-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 18px; }
.canasta-totales { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
@media (max-width: 640px) { .canasta-totales { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tot {
  position: relative; padding: 12px 14px 12px 20px; border-radius: 8px; background: var(--panel); display: grid; gap: 2px;
}
.tot::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; border-radius: 8px 0 0 8px; background: var(--col); }
.tot b { font-size: 14px; line-height: 1.2; }
.tot .num { font-size: 26px; font-weight: 800; font-stretch: 78%; line-height: 1.05; }
.tot small { font-size: 12px; color: var(--ink-2); }
.tot--mejor { background: var(--tag); color: var(--tag-ink); transform: rotate(-1.2deg); box-shadow: 0 10px 22px -14px rgba(15, 26, 51, .6); }
.tot--mejor::after { content: ""; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--bg); }
.tot--mejor small { color: var(--tag-ink); opacity: .8; }
.tabla-scroll { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.matriz { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; min-width: 820px; }
.matriz th, .matriz td { padding: 7px 8px; text-align: right; white-space: nowrap; }
.matriz thead th { position: sticky; top: 0; background: var(--bg); font-size: 12.5px; font-weight: 700; vertical-align: bottom; line-height: 1.15; white-space: normal; border-bottom: 2px solid var(--ink); }
.matriz thead th i { display: block; width: 100%; height: 5px; border-radius: 2px; background: var(--col); margin-bottom: 6px; }
.matriz th:first-child, .matriz td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg); z-index: 1; }
.matriz tbody th { font-weight: 600; }
.matriz tbody th small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.matriz td { font-family: var(--f-num); font-variant-numeric: tabular-nums; border-left: 2px solid var(--bg); border-bottom: 2px solid var(--bg); cursor: default; }
.matriz td.mejor { font-weight: 800; box-shadow: inset 0 0 0 2px var(--ink); }
.matriz tfoot th, .matriz tfoot td { border-top: 2px solid var(--ink); font-weight: 800; font-size: 15px; background: var(--bg); }

/* ---------- semana ---------- */
.semana-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(20px, 3vw, 44px); align-items: start; }
@media (max-width: 960px) { .semana-grid { grid-template-columns: minmax(0, 1fr); } }
.dv { display: grid; grid-template-columns: 128px minmax(0, 1fr) minmax(0, 1fr) 56px; align-items: center; gap: 0 0; min-height: 34px; }
@media (max-width: 560px) { .dv { grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1fr) 48px; } }
.dv-nom { font-size: 13.5px; font-weight: 700; display: flex; gap: 7px; align-items: center; line-height: 1.15; }
.dv-nom i { width: 10px; height: 10px; border-radius: 3px; background: var(--col); flex: none; }
.dv-baja, .dv-sube { position: relative; height: 22px; }
.dv-baja { border-right: 2px solid var(--ink); }
.dv-baja span, .dv-sube span { position: absolute; top: 2px; bottom: 2px; }
.dv-baja span { right: 2px; background: var(--baja); border-radius: 4px 0 0 4px; }
.dv-sube span { left: 2px; background: var(--sube); border-radius: 0 4px 4px 0; }
.dv-baja em, .dv-sube em { position: absolute; top: 50%; transform: translateY(-50%); font: 700 12px var(--f-num); font-style: normal; color: var(--ink-2); white-space: nowrap; }
.dv-val { text-align: right; font: 800 14px var(--f-num); font-variant-numeric: tabular-nums; }
.dv-cab { font-size: 12px; font-weight: 700; color: var(--ink-2); min-height: 22px; }
.dv-cab .dv-baja, .dv-cab .dv-sube { border: 0; height: auto; }
.dv-leyenda { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.dv-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.dv-leyenda i { width: 12px; height: 12px; border-radius: 3px; }
.movidas-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.movidas-ctrl select { border: 1.5px solid var(--line-2); border-radius: 8px; padding: 7px 10px; background: var(--bg); font-weight: 600; font-size: 14px; }
.movidas-lista { list-style: none; margin: 0; padding: 0; }
.mov { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mov b { font-weight: 600; line-height: 1.25; display: block; }
.mov small { color: var(--ink-2); font-size: 13px; }
.mov-var { text-align: right; font: 800 17px var(--f-num); font-variant-numeric: tabular-nums; }
.mov-var small { display: block; font: 500 12px var(--f-num); color: var(--ink-2); }
.mov-var.sube { color: var(--sube); }
.mov-var.baja { color: var(--baja); }

/* ---------- historia ---------- */
.hist-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.hist-caja { background: var(--panel); border-radius: 16px; padding: clamp(14px, 2vw, 24px); }
.hist-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.hist-ctrl select { border: 1.5px solid var(--line-2); border-radius: 8px; padding: 7px 10px; background: var(--bg); font-weight: 600; font-size: 14px; max-width: 100%; }
.linea-svg { display: block; width: 100%; height: auto; overflow: visible; }
.linea-svg .grilla line { stroke: var(--line-2); stroke-width: 1; }
.linea-svg .grilla text, .linea-svg .eje text { font: 500 11px var(--f-num); fill: var(--ink-3); }
.linea-svg .serie { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.linea-svg .serie.atenua { opacity: .18; }
.linea-svg .ref { stroke: var(--ink-2); stroke-dasharray: 5 4; fill: none; stroke-width: 2; }
.linea-svg .etq { font: 700 12px var(--f-texto); paint-order: stroke; stroke: var(--panel); stroke-width: 4px; }
.linea-svg .cruz { stroke: var(--ink-2); stroke-width: 1; }
.linea-svg .punto { stroke: var(--panel); stroke-width: 2; }
.hist-pendiente { padding: 28px; border: 2px dashed var(--line-2); border-radius: 14px; color: var(--ink-2); }

/* ---------- vacíos ---------- */
.vacios { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.vacio {
  border: 2px dashed var(--line-2); border-radius: 12px; padding: 16px 16px 18px; display: grid; gap: 6px; align-content: start;
  background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--panel) 70%, transparent) 10px 20px);
}
.vacio b { font: 800 19px/1.15 var(--f-display); letter-spacing: -.01em; }
.vacio span { font-size: 14px; color: var(--ink-2); }
.vacio .marca-vacio { font: 800 11px/1 var(--f-texto); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- método y pie ---------- */
.seccion--metodo { padding-bottom: 20px; }
.metodo { columns: 2 340px; column-gap: 40px; font-size: 15px; color: var(--ink-2); }
.metodo p { margin: 0 0 14px; break-inside: avoid; }
.metodo b { color: var(--ink); }
.metodo a { color: var(--ink); text-underline-offset: 2px; }
.pie { max-width: 1320px; margin: 40px auto 0; padding-block: 24px 40px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.pie b { color: var(--ink); }

/* tooltip */
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 280px; padding: 9px 11px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.4; box-shadow: var(--sombra);
}
.tip b { display: block; font-size: 13.5px; }
.tip .num { font-weight: 700; }
.tip i.c { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; background: var(--col); }
.tip-fila { display: flex; justify-content: space-between; gap: 14px; }

/* ---------- selector de provincia ---------- */
.elegir-prov { flex: none; border: 1.5px solid var(--line-2); background: var(--bg); border-radius: 8px; padding: 7px 10px; font-weight: 700; font-size: 14px; max-width: 46vw; }
.cargando { padding: 80px 0; text-align: center; color: var(--ink-2); font-weight: 600; }

/* ---------- vista nacional ---------- */
.portada--nac { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
.pais { background: var(--panel); border-radius: 16px; padding: clamp(16px, 2.4vw, 28px); }
.pais-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 640px) { .pais-grid { grid-template-columns: minmax(0, 1fr); } }
.pais-svg { width: 100%; height: auto; display: block; }
.prov { stroke: var(--panel); stroke-width: 1; cursor: pointer; vector-effect: non-scaling-stroke; transition: opacity .15s; }
.prov.activa, .prov:hover, .prov:focus-visible { stroke: var(--ink); stroke-width: 2; outline: none; }
.prov-caba { stroke: var(--ink); stroke-width: 1.2; }
.prov--vacia { fill: var(--bg); stroke: var(--line-2); }
.ranking-prov { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.rp { display: grid; grid-template-columns: 112px minmax(0, 1fr) 52px; gap: 8px; align-items: center; min-height: 24px; padding: 1px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.rp:hover, .rp.activa, .rp:focus-visible { background: var(--bg); outline: none; }
.rp-nom { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-via { position: relative; height: 14px; }
.rp-via::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dotted var(--line-2); }
.rp-cero { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1.5px solid var(--ink-3); }
.rp-punto { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--ink); }
.rp-val { text-align: right; font-weight: 700; font-size: 13px; }
.escala-div { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.escala-div span { display: inline-flex; align-items: center; gap: 6px; }
.escala-div i { width: 14px; height: 14px; border-radius: 3px; }
.cad-ctrl { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip-c { width: 10px; height: 10px; border-radius: 3px; background: var(--col); align-self: center; }
.cad-fig { background: var(--panel); border-radius: 16px; padding: clamp(16px, 2.4vw, 28px); }
.ct-eje { position: relative; height: 18px; margin: 0 64px 4px 150px; font: 500 11px var(--f-num); color: var(--ink-3); }
.ct-eje span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ct { display: grid; grid-template-columns: 140px minmax(0, 1fr) 56px; gap: 10px; align-items: center; min-height: 30px; cursor: pointer; border-radius: 6px; padding: 0 4px; }
.ct:hover { background: var(--bg); }
.ct-nom { font-weight: 600; font-size: 14px; }
.ct-via { position: relative; height: 18px; }
.ct-barra { position: absolute; top: 50%; height: 4px; margin-top: -2px; opacity: .45; border-radius: 2px; }
.ct-punto { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--panel); }
.ct-val { text-align: right; font-weight: 700; font-size: 14px; }
@media (max-width: 560px) { .ct { grid-template-columns: 96px minmax(0, 1fr) 50px; } .ct-eje { margin-left: 106px; margin-right: 54px; } .rp { grid-template-columns: 88px minmax(0, 1fr) 46px; } }
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pv { position: relative; display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--panel); text-decoration: none; border: 1.5px solid transparent; }
.pv:hover, .pv:focus-visible { border-color: var(--ink); outline: none; }
.pv b { font: 700 16px/1.2 var(--f-display); padding-right: 56px; }
.pv span { font-size: 13px; color: var(--ink-2); }
.pv-ind { position: absolute; top: 12px; right: 12px; font: 700 12px var(--f-num); font-style: normal; padding: 3px 6px; border-radius: 5px; color: var(--ink); }
.pv--vacia { background: repeating-linear-gradient(135deg, transparent 0 10px, var(--panel) 10px 20px); border: 1.5px dashed var(--line-2); }
