/* ═══════════════════════════════════════════════════════════════
   SueldoPartido — hoja de estilos
   Identidad editorial: papel cálido, tinta azulada, acento verde agua.
   Tipografías: Fraunces (display) + Archivo (interfaz y cifras tabulares).
   Principios: sin side-tabs, sin gris sobre color, sin negros puros,
   sin sombras rebotonas, controles ≥44 px, movimiento sobrio.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #f5f1e8;
  --bg-grano: #efe9dc;
  --surface: #fffdf7;
  --ink: #1e2833;
  --ink-suave: #4c5866;
  --muted: #5d6875;
  --line: #e3dccd;
  --line-fuerte: #d3cab6;
  --accent: #0d5c63;
  --accent-fuerte: #0a454b;
  --accent-claro: #9fd8ce;
  --oro: #f4c95d;
  --up: #177a48;
  --up-bg: #e3f1e7;
  --down: #9c1e16;
  --down-bg: #fbeae7;
  --radius: 14px;
  --radius-sm: 10px;
  --sombra: 0 1px 2px rgba(38, 33, 20, 0.05), 0 10px 28px -14px rgba(38, 33, 20, 0.22);
  --sombra-alta: 0 2px 4px rgba(38, 33, 20, 0.06), 0 18px 40px -16px rgba(38, 33, 20, 0.3);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --fuente-ui: 'Archivo', 'Helvetica Neue', Helvetica, sans-serif;
  --fuente-display: 'Antonio', 'Archivo', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--fuente-ui);
  font-size: 16px;
  background:
    radial-gradient(1100px 420px at 85% -80px, rgba(15, 92, 99, 0.06), transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.num { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ─── Cabecera tipo cabecera de periódico ─── */
.masthead {
  background: linear-gradient(180deg, #16232f 0%, #101b26 100%);
  color: #f2ecdd;
  padding: 54px 0 46px;
  position: relative;
  overflow: hidden;
}
.masthead::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(700px 260px at 20% 0%, rgba(159, 216, 206, 0.1), transparent 65%);
  pointer-events: none;
}
.masthead .wrap { position: relative; z-index: 1; }
.masthead h1 {
  font-family: var(--fuente-display);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 66px);
  line-height: 0.98;
  letter-spacing: 0.004em;
  margin: 0 0 18px;
  max-width: 17ch;
  text-transform: uppercase;
}
.masthead h1 .oro { color: var(--oro); }
.tagline {
  margin: 0 0 22px;
  max-width: 56ch;
  font-size: clamp(15px, 2.4vw, 17.5px);
  color: #cfd8db;
}
.tagline strong { color: #f2ecdd; font-weight: 600; }

/* franja de urna: los siete partidos + la ley */
.tally {
  display: flex; gap: 5px; height: 7px; width: min(340px, 100%);
  margin-bottom: 16px; border-radius: 99px; overflow: hidden;
}
.tally i { flex: 1; border-radius: 2px; background: var(--c, #888); }
.fecha {
  margin: 0; font-size: 13px; color: #93a3ad;
}
.fecha a { color: var(--accent-claro); text-decoration: none; border-bottom: 1px solid rgba(159, 216, 206, 0.4); }
.fecha a:hover { border-bottom-color: var(--accent-claro); }

/* ─── Panel de configuración ─── */
.config {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--sombra);
  margin: -30px auto 0;
  position: relative;
  z-index: 2;
  padding: 26px 28px 28px;
}
.config-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.config-top h2 {
  margin: 0; font-family: var(--fuente-display); font-size: 22px; font-weight: 600;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.acciones { display: flex; gap: 10px; align-items: center; }

.seg {
  display: inline-flex; background: var(--bg-grano);
  border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px;
}
.seg button {
  border: 0; background: transparent; padding: 9px 16px; font-size: 14px; font-weight: 600;
  color: var(--ink-suave); border-radius: 9px; cursor: pointer; min-height: 40px;
  transition: color .15s var(--ease), background .15s var(--ease);
  font-family: inherit;
}
.seg button.on { background: var(--ink); color: var(--surface); }
.seg button:not(.on):hover { color: var(--ink); }

.btn-icono {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-fuerte); background: var(--surface); color: var(--accent);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  border-radius: 999px; padding: 9px 16px; min-height: 40px; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.btn-icono:hover { border-color: var(--accent); background: #f2f8f7; }

.campos { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 740px) { .campos { grid-template-columns: 3fr 2fr; } .span2 { grid-column: 1 / -1; } }

label.campo {
  display: block; font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.09em; margin: 0 0 7px;
}

.bruto-fila { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.bruto-caja {
  display: flex; align-items: baseline; gap: 6px; border: 1.5px solid var(--line-fuerte);
  border-radius: 12px; padding: 6px 14px; background: #fffefb;
  transition: border-color .15s var(--ease);
}
.bruto-caja:focus-within { border-color: var(--accent); }
.bruto-caja input {
  border: 0; outline: 0; font-size: 26px; font-weight: 700; width: 128px;
  font-family: inherit; font-variant-numeric: tabular-nums; background: transparent; color: var(--ink);
}
.bruto-caja .unidad { font-size: 15px; color: var(--muted); font-weight: 600; }

input[type='range'] {
  flex: 1; min-width: 150px; accent-color: var(--accent); margin: 6px 0; height: 40px;
}

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.presets button {
  border: 1px solid var(--line-fuerte); background: var(--surface); color: var(--ink-suave);
  border-radius: 999px; padding: 7px 13px; min-height: 36px; font-size: 13px; cursor: pointer;
  font-family: inherit; font-variant-numeric: tabular-nums;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.presets button:hover, .presets button.on { border-color: var(--accent); color: var(--accent); background: #f0f7f6; }

.fila-selects { display: flex; gap: 14px; flex-wrap: wrap; }
.fila-selects .grupo { flex: 1; min-width: 108px; }
select, .autonomo-fields input[type='number'] {
  width: 100%; min-height: 44px; padding: 9px 11px;
  border: 1.5px solid var(--line-fuerte); border-radius: 12px;
  background: #fffefb; font-size: 16px; font-family: inherit; color: var(--ink);
  transition: border-color .15s var(--ease);
}
select:focus, .autonomo-fields input[type='number']:focus { border-color: var(--accent); outline: none; }

.check-linea {
  display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-suave);
  margin-top: 12px; min-height: 32px; cursor: pointer;
}
.check-linea input { width: 18px; height: 18px; accent-color: var(--accent); }

.autonomo-fields { display: none; gap: 14px; flex-wrap: wrap; }
.autonomo-fields.visible { display: flex; }
.autonomo-fields .grupo { flex: 1; min-width: 160px; }
.empleado-fields { display: none; }
.empleado-fields.visible { display: block; }

/* ─── Resultados ─── */
.results { padding: 34px 0 8px; }
.results h2 {
  font-family: var(--fuente-display); font-size: 27px; font-weight: 600;
  margin: 0 0 6px; letter-spacing: 0.02em; text-transform: uppercase;
}
#resumen {
  margin: 0 0 18px; font-size: 15.5px; color: var(--ink-suave); max-width: 68ch;
}
#resumen strong { color: var(--ink); font-weight: 700; }
#resumen .cifra {
  font-family: var(--fuente-display); font-style: italic; font-weight: 600;
  color: var(--accent-fuerte); font-size: 1.06em;
}

.cards { display: flex; flex-direction: column; gap: 11px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(38, 33, 20, 0.04);
  overflow: hidden;
  scroll-margin-top: 76px;
  transition: box-shadow .18s var(--ease), transform .18s var(--ease), border-color .18s var(--ease);
}
.card:hover { box-shadow: var(--sombra); transform: translateY(-1px); }
.card.ley { border-color: var(--line-fuerte); background: #fbf8f0; }
.card.open { border-color: var(--line-fuerte); box-shadow: var(--sombra-alta); transform: none; }

.card-head {
  width: 100%; display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 15px; align-items: center;
  padding: 14px 16px 18px;
  background: none; border: 0; cursor: pointer; text-align: left;
  font: inherit; color: inherit; position: relative;
}
.card-head:hover { background: #fdfbf5; }
.card.open .card-head { background: #faf7ee; }

.chip {
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12.5px; letter-spacing: -0.01em;
  background: var(--c); color: var(--ct, #fff);
  box-shadow: inset 0 -2px 0 rgba(20, 26, 33, 0.18);
}
.card .quien { min-width: 0; }
.card .quien h3 { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.card .quien p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.card .neto { text-align: right; }
.card .neto strong {
  display: block; font-size: 21px; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.card.ley .neto strong { font-family: var(--fuente-ui); font-weight: 800; font-size: 21px; }
.card .neto span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.delta {
  font-size: 13px; font-weight: 700; white-space: nowrap; text-align: right;
  font-variant-numeric: tabular-nums;
  border-radius: 999px; padding: 4px 11px; align-self: center;
}
.delta.up { color: var(--up); background: var(--up-bg); }
.delta.down { color: var(--down); background: var(--down-bg); }
.delta.cero { color: var(--muted); background: var(--bg-grano); font-weight: 600; }
.delta small { display: block; font-weight: 600; opacity: 0.85; font-size: 11px; }

/* barra de datos al pie de la cabecera de la tarjeta */
.barra {
  position: absolute; left: 0; right: 0; bottom: 6px; height: 5px;
  background: var(--bg-grano); border-radius: 99px; overflow: hidden;
}
.barra i {
  display: block; height: 100%; border-radius: 99px;
  background: var(--c); opacity: 0.9;
  transition: width .45s var(--ease);
}

/* detalle desplegable */
.card-cuerpo-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.card.open .card-cuerpo-wrap { grid-template-rows: 1fr; }
.card-cuerpo-wrap > div { overflow: hidden; }
.card-cuerpo { border-top: 1px solid var(--line); padding: 20px 18px 22px; }

.detalle-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 740px) { .detalle-grid { grid-template-columns: 5fr 7fr; } }

table.desglose { border-collapse: collapse; width: 100%; font-size: 14.5px; }
table.desglose th, table.desglose td { padding: 8px 2px; border-bottom: 1px solid var(--line); text-align: left; }
table.desglose th.num, table.desglose td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.desglose th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; border-bottom: 1.5px solid var(--line-fuerte); }
table.desglose tr.total td { font-weight: 800; border-bottom: 0; font-size: 15.5px; }
table.desglose tr.total td.num { color: var(--accent-fuerte); }
.efectiva { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.6; }

.card h4 {
  margin: 0 0 9px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); font-weight: 700;
}
.bloque + .bloque { margin-top: 18px; }
ul.medidas { margin: 0; padding: 0; list-style: none; font-size: 14.5px; }
ul.medidas li { position: relative; padding-left: 18px; margin: 7px 0; }
ul.medidas li::before {
  content: ''; position: absolute; left: 0; top: 0.55em;
  width: 8px; height: 8px; border-radius: 2.5px; background: var(--c);
}
.fuentes { margin: 4px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.fuentes li { margin: 4px 0; }
.fuentes a {
  color: var(--accent); text-decoration: underline; text-decoration-color: rgba(13, 92, 99, 0.35);
  text-underline-offset: 2.5px;
}
.fuentes a:hover { text-decoration-color: var(--accent); }
.nota-modelo {
  margin-top: 16px; font-size: 12.5px; color: #6d5a1e; background: #f9f1da;
  border: 1px solid #ead9a8; border-radius: 10px; padding: 10px 13px; line-height: 1.6;
}
.nota-modelo strong { color: #57480f; }
.pendiente {
  font-size: 13.5px; color: var(--ink-suave); background: var(--bg-grano);
  border-radius: 10px; padding: 10px 13px;
}

/* ─── Barra de un vistazo (fija al hacer scroll) ─── */
.quickbar {
  position: sticky; top: 10px; z-index: 30;
  display: flex; align-items: center; gap: 13px;
  background: rgba(255, 253, 247, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line-fuerte);
  border-radius: 999px; box-shadow: var(--sombra);
  padding: 8px 10px 8px 16px;
  margin: 14px 0 16px;
}
.qb-fijo { flex: 0 0 auto; text-align: left; line-height: 1.15; }
.qb-fijo .etq { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.qb-fijo strong { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qb-track { position: relative; flex: 1 1 auto; height: 38px; min-width: 110px; }
.qb-track::before {
  content: ''; position: absolute; left: 2px; right: 2px; top: 50%; height: 2px;
  margin-top: -1px; border-radius: 2px; background: var(--line-fuerte);
}
.qb-ley {
  position: absolute; top: 5px; bottom: 5px; width: 2px; border-radius: 2px;
  background: var(--ink); opacity: 0.75; transform: translateX(-50%);
  transition: left .45s var(--ease);
}
.qb-dot {
  position: absolute; width: 24px; height: 24px; padding: 0; border: 0;
  background: none; cursor: pointer; transform: translate(-50%, -50%);
  transition: left .45s var(--ease);
}
.qb-dot::before {
  content: ''; position: absolute; inset: 5px; border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px rgba(30, 40, 51, 0.2);
  transition: box-shadow .15s var(--ease);
}
.qb-dot:hover::before, .qb-dot:focus-visible::before {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--c);
}
.qb-hueco {
  flex: 0 0 auto; background: var(--bg-grano); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-suave);
  font-variant-numeric: tabular-nums; cursor: help;
}
.qb-hueco b { color: var(--accent-fuerte); font-weight: 800; }

/* ─── Gráfica de curvas ─── */
.curva { padding: 44px 0 6px; }
.curva h2 {
  font-family: var(--fuente-display); font-size: 27px; font-weight: 600;
  margin: 0 0 6px; letter-spacing: 0.02em; text-transform: uppercase;
}
.curva .desc { font-size: 14.5px; color: var(--ink-suave); max-width: 72ch; margin: 0; }
.curva-controles { display: flex; gap: 10px; margin: 14px 0 12px; flex-wrap: wrap; }

.grafico {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 10px 6px; box-shadow: 0 1px 2px rgba(38, 33, 20, 0.04);
}
.grafico svg { display: block; width: 100%; touch-action: pan-y; }
.grafico .gl { stroke: var(--line); stroke-width: 1; }
.grafico .gl2 { stroke: var(--line-fuerte); stroke-width: 1; }
.grafico .marco { fill: none; stroke: var(--line-fuerte); stroke-width: 1; }
.grafico text { font-family: var(--fuente-ui); fill: var(--muted); font-size: 11px; }
.grafico text.etqMarca { fill: var(--accent-fuerte); font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; }
.grafico .marcaBruto { stroke: var(--accent); stroke-dasharray: 3 3; stroke-width: 1.3; opacity: 0.85; }
.grafico .cursor { stroke: var(--ink); stroke-width: 1; opacity: 0.45; }
.grafico .puntoCurva { stroke: var(--surface); stroke-width: 1.5; }

.globo {
  position: absolute; top: 12px; z-index: 5; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line-fuerte);
  border-radius: 10px; box-shadow: var(--sombra-alta);
  padding: 9px 12px; font-size: 12.5px; min-width: 148px;
}
.globo strong { display: block; margin-bottom: 5px; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.globo div { display: flex; align-items: center; gap: 7px; padding: 1.5px 0; }
.globo i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
.globo .nombre { color: var(--ink-suave); font-weight: 600; margin-right: auto; }
.globo b { font-variant-numeric: tabular-nums; font-weight: 700; }

.ejeCap {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin: 9px 2px 0; text-align: center;
}
.leyenda { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.leyChip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-fuerte); background: var(--surface); color: var(--ink-suave);
  font-family: inherit; font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 5px 12px; min-height: 32px; cursor: pointer;
  transition: opacity .15s var(--ease), border-color .15s var(--ease);
}
.leyChip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.leyChip:hover { border-color: var(--accent); }
.leyChip.leyRef { border-style: dashed; }
.leyChip.off { opacity: 0.42; }
.leyChip.off i { background: var(--muted); }

/* ─── Publicidad ─── */
.anuncio { margin: 0 auto 18px; max-width: 728px; }
.anuncio--demo {
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--line-fuerte); border-radius: 12px;
  background: var(--bg-grano); color: var(--muted); font-size: 12.5px;
  text-align: center; padding: 12px;
}
.anuncio--activo { min-height: 100px; }   /* evita saltos de página al cargar */
.anuncio--activo + .cards { margin-top: 18px; }

/* ─── Metodología ─── */
.metodo { padding: 46px 0 10px; }
.metodo h2 {
  font-family: var(--fuente-display); font-size: 27px; font-weight: 600;
  margin: 30px 0 10px; letter-spacing: 0.02em; text-transform: uppercase;
}
.metodo p { font-size: 15px; color: var(--ink-suave); max-width: 72ch; }
.metodo ul { padding: 0; list-style: none; max-width: 72ch; }
.metodo li {
  position: relative; padding-left: 20px; margin: 9px 0;
  font-size: 14.5px; color: var(--ink-suave); line-height: 1.65;
}
.metodo li::before {
  content: ''; position: absolute; left: 0; top: 0.62em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-claro);
}
.metodo strong { color: var(--ink); }
.metodo code {
  background: var(--bg-grano); padding: 1px 6px; border-radius: 5px; font-size: 13px;
  color: var(--accent-fuerte);
}

/* ─── Pie ─── */
.site-footer {
  margin-top: 52px; background: #101b26; color: #c3ccd2; padding: 34px 0 44px;
  font-size: 13.5px;
}
.site-footer .filas { max-width: 760px; margin: 0 auto; }
.site-footer p { margin: 0 0 10px; line-height: 1.7; }
.site-footer strong { color: #f2ecdd; }
.site-footer a { color: var(--accent-claro); text-decoration: none; border-bottom: 1px solid rgba(159, 216, 206, 0.35); }
.site-footer a:hover { border-bottom-color: var(--accent-claro); }

/* ─── Toast ─── */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px; box-shadow: var(--sombra-alta);
  opacity: 0; pointer-events: none; transition: opacity .22s var(--ease), transform .22s var(--ease);
  z-index: 50;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ─── Vista países ─── */
body[data-vista='paises'] .solo-partidos { display: none !important; }
#notaPaises { display: none; margin: 10px 0 0; }
body[data-vista='paises'] #notaPaises { display: block; }
.explica {
  display: none; margin: 0 0 16px; padding: 13px 16px;
  background: #e9f3f1; border: 1px solid #bfe0da; border-radius: 12px;
  color: #14464b; font-size: 14px; line-height: 1.65;
}
body[data-vista='paises'] .explica { display: block; }
.explica strong { color: #0a363b; }

/* analogía urnas → mapa */
.analogia {
  margin: 0 0 16px; padding: 13px 16px;
  background: #f9f3e4; border: 1px solid #e8dab2; border-radius: 12px;
  color: #4a3d1f; font-size: 14px; line-height: 1.6;
}
.analogia strong { color: #3a3012; }
.analogia-filas { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 9px 0 4px; }
.analogia-fila {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fffdf7; border: 1px solid #e8dab2; border-radius: 999px;
  padding: 4px 12px; font-size: 13px; color: #4a3d1f; font-variant-numeric: tabular-nums;
}
.analogia-fila::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
.analogia-fila b { font-weight: 700; }
.analogia-fila .destino { color: #6d5c2c; }
.analogia small { display: block; margin-top: 7px; color: #8a7a52; font-size: 11.5px; line-height: 1.5; }
.chip .bandera { font-size: 23px; line-height: 1; }
.seg-vista button { padding-inline: 13px; }
@media (max-width: 700px) {
  .acciones { width: 100%; flex-wrap: wrap; gap: 8px; }
  .seg-vista, .seg-modo { width: 100%; }
  .seg-vista button, .seg-modo button { flex: 1; padding-inline: 10px; white-space: nowrap; }
  #compartir { width: 100%; justify-content: center; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .masthead { padding: 38px 0 34px; }
  .masthead h1 { font-size: clamp(34px, 10.5vw, 48px); max-width: none; }
  .tagline { font-size: 14.5px; }
  .config { padding: 18px 16px 20px; margin-top: -22px; }
  .config-top { margin-bottom: 14px; }
  .config-top h2 { font-size: 20px; }
  .results { padding-top: 26px; }
  .results h2 { font-size: 24px; }
  .metodo { padding-top: 34px; }
  .metodo h2 { font-size: 24px; }
  .detalle-grid { gap: 16px; }
  .card-cuerpo { padding: 16px 14px 18px; }
  table.desglose { font-size: 13.5px; }
  .site-footer { padding: 26px 0 34px; }
}

@media (max-width: 640px) {
  .quickbar { top: 6px; gap: 9px; padding: 6px 7px 6px 12px; margin: 10px 0 12px; }
  .qb-fijo .etq { font-size: 8.5px; }
  .qb-fijo strong { font-size: 13.5px; }
  .qb-track { height: 34px; }
  .qb-hueco { padding: 5px 9px; font-size: 11.5px; }

  .card-head {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 12px; row-gap: 3px;
    padding: 12px 13px 16px;
  }
  .chip { width: 40px; height: 40px; font-size: 10.5px; border-radius: 11px; }
  .card .quien h3 { font-size: 15px; }
  .card .quien p { font-size: 11.5px; }
  .card .neto { grid-column: 3; grid-row: 1; align-self: center; }
  .card .neto strong { font-size: 17px; }
  .card .neto span { display: block; font-size: 10.5px; }
  .delta { grid-column: 2 / 4; grid-row: 2; justify-self: start; padding: 3px 9px; font-size: 12px; }
  .delta small { font-size: 10px; }
  .barra { bottom: 4px; height: 4px; }
  .card { scroll-margin-top: 64px; }
  .bruto-caja input { font-size: 22px; width: 104px; }
}

@media (max-width: 380px) {
  .fila-selects .grupo { min-width: 100%; }
}

/* ─── Movimiento reducido ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
