/* CanadaPaycheque: lienzo gris claro, tarjetas blancas muy redondeadas, un solo acento verde.
   Móvil primero. El neto es verde; los descuentos van en una escala de grises verdosos (la misma
   en la barra, las tarjetas, la tabla y las imágenes OG). */

@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/InterTight-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --canvas: #f1f3f0;
  --surface: #ffffff;
  --surface-2: #f4f6f3;
  --ink: #0f1713;
  --muted: #66716b;
  --line: #e4e8e3;
  --brand: #166646;
  --brand-hover: #0f5238;
  --brand-dark: #0b3a28;
  --brand-mid: #2e8f64;
  --brand-light: #9ad6b6;
  --brand-soft: #e3f2e9;
  --on-brand: #ffffff;
  --accent: #2e8f64;
  --c-federal: #1a2620;
  --c-provincial: #56665d;
  --c-cpp: #95a79c;
  --c-cpp2: #b6c4bb;
  --c-ei: #d3dcd6;
  --c-other: #e9eee9;
  --c-net: #1f7a52;
  --hatch: #dfe5df;
  --radius: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 19, 0.04), 0 8px 24px -16px rgba(15, 23, 19, 0.18);
  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0c110e;
    --surface: #151c18;
    --surface-2: #1b2420;
    --ink: #edf2ee;
    --muted: #97a39c;
    --line: #26312b;
    --brand: #3fbf85;
    --brand-hover: #5bd39b;
    --brand-dark: #0f3a28;
    --brand-mid: #3fbf85;
    --brand-light: #2f7d5a;
    --brand-soft: #16291f;
    --on-brand: #ffffff;
    --accent: #3fbf85;
    --c-federal: #e6ece8;
    --c-provincial: #a9b7af;
    --c-cpp: #72857a;
    --c-cpp2: #5a6b62;
    --c-ei: #43524a;
    --c-other: #333f39;
    --c-net: #3fbf85;
    --hatch: #26312b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px -18px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0c110e;
  --surface: #151c18;
  --surface-2: #1b2420;
  --ink: #edf2ee;
  --muted: #97a39c;
  --line: #26312b;
  --brand: #3fbf85;
  --brand-hover: #5bd39b;
  --brand-dark: #0f3a28;
  --brand-mid: #3fbf85;
  --brand-light: #2f7d5a;
  --brand-soft: #16291f;
  --on-brand: #ffffff;
  --accent: #3fbf85;
  --c-federal: #e6ece8;
  --c-provincial: #a9b7af;
  --c-cpp: #72857a;
  --c-cpp2: #5a6b62;
  --c-ei: #43524a;
  --c-other: #333f39;
  --c-net: #3fbf85;
  --hatch: #26312b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px -18px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.95rem, 6.4vw, 3.4rem); }
h2 { font-size: clamp(1.45rem, 3.6vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 14px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* --- Cabecera ------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 6; background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: blur(10px); }
.topbar { display: flex; align-items: center; gap: 8px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 1.05rem; letter-spacing: -0.02em; margin-right: auto; }
.logo:hover { color: var(--ink); }
.logo b, .footer-brand b { font-weight: 800; }
.logo-mark { width: 30px; height: 30px; color: var(--ink); flex: none; }
.nav { display: flex; gap: 2px; background: var(--surface); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.9rem; font-weight: 500; padding: 7px 13px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand); color: var(--on-brand); }
.show-sm { display: none; }
.icon-btn { border: 0; background: var(--surface); color: var(--ink); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; box-shadow: var(--shadow); }
/* EN / FR: solo en las páginas que tienen versión en el otro idioma */
.lang-btn { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; text-decoration: none; }
.lang-btn:hover { color: var(--brand); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}
@media (max-width: 959px) {
  .topbar { flex-wrap: wrap; padding-top: 8px; padding-bottom: 6px; }
  .nav { order: 3; width: 100%; }
  .nav a { flex: 1; text-align: center; padding: 8px 6px; }
}
@media (max-width: 560px) {
  .nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 18px; }
  .nav a { padding: 8px 2px; }
}
@media (max-width: 560px) {
  .hide-sm { display: none !important; }
  .show-sm { display: inline; }
  /* Móvil: el menú pasa a una segunda fila con las tres opciones a lo ancho, y la cabecera deja de ser
     fija para no comerse la pantalla (la barra fija del neto ya va abajo) */
  .site-header { position: static; backdrop-filter: none; background: transparent; }
  .topbar { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 4px; }
  .logo { gap: 6px; font-size: 0.98rem; }
  .logo-mark { width: 26px; height: 26px; }
  .nav { order: 3; width: 100%; }
  .nav a { flex: 1; text-align: center; padding: 8px 4px; font-size: 0.86rem; }
  .icon-btn { width: 36px; height: 36px; }
}

/* --- Cabecera de cada página ---------------------------------------------- */
.crumbs { font-size: 0.82rem; color: var(--muted); padding-top: 10px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 6px; opacity: 0.6; }
.hero { padding: 14px 0 16px; max-width: 760px; }
.hero.narrow { padding-top: 40px; }
.hero h1 { margin-bottom: 0.25em; }
.lead { font-size: 1rem; color: var(--muted); max-width: 620px; margin-bottom: 0; }
@media (min-width: 720px) { .hero { padding: 28px 0 24px; } .lead { font-size: 1.1rem; } }
.edition { display: inline-flex; align-items: center; gap: 8px; font-size: 0.76rem; font-weight: 600; color: var(--brand); background: var(--surface); box-shadow: var(--shadow); padding: 6px 12px; border-radius: 999px; margin-bottom: 14px; }
.edition-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-mid); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-mid) 25%, transparent); }

/* --- Calculadora ---------------------------------------------------------- */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 960px) { .calc-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: 18px; align-items: start; } .inputs { position: sticky; top: 76px; } }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
@media (min-width: 720px) { .panel { padding: 24px; } }
.result.panel { background: transparent; box-shadow: none; padding: 0; }
.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 7px; padding: 0; }
.field-row { display: flex; gap: 10px; align-items: flex-end; }
.field-row .field { margin-bottom: 0; }
.grow { flex: 1; min-width: 0; }
.hours { width: 96px; flex: none; }
.inputs > .field-row { margin-bottom: 4px; }
input, select { font: inherit; color: inherit; }
.select { position: relative; }
.select::after { content: ""; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
select, .hours input {
  width: 100%; appearance: none; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 1rem; font-weight: 500; min-height: 50px;
}
select { padding-right: 40px; cursor: pointer; }
.money-input { display: flex; align-items: center; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); min-height: 50px; padding-left: 16px; }
.money-input span { color: var(--muted); font-weight: 600; }
.money-input input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 14px 12px 6px; font-size: 1rem; outline: none; }
#f-amount { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.field.grow .money-input { min-height: 60px; }
.money-input:focus-within, select:focus, .hours input:focus { border-color: var(--brand); background: var(--surface); outline: none; }
/* En francés el símbolo va detrás: 60 000 $ */
.money-input.suffix { padding-left: 0; padding-right: 16px; }
.money-input.suffix input { order: -1; padding: 12px 6px 12px 16px; }
.money-input input::placeholder { color: var(--muted); opacity: 0.7; font-size: 0.9rem; }

/* Píldoras (periodicidad, tipo de importe): en fila; si no caben, pasan a la línea siguiente */
.seg-control { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 -2px; padding: 2px; }
.seg-control::-webkit-scrollbar { display: none; }
.seg-control label { margin: 0; position: relative; flex: 1 0 auto; }
.seg-control input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg-control span { display: block; text-align: center; padding: 9px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; font-size: 0.9rem; font-weight: 600; color: var(--ink); background: var(--surface-2); }
.seg-control input:checked + span { background: var(--ink); color: var(--surface); }
.seg-control input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 420px) { .seg-control { gap: 4px; } .seg-control span { padding: 9px 6px; font-size: 0.84rem; } }

.more { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
.more summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--brand); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; display: inline-block; width: 1.2em; font-weight: 700; }
.more[open] summary::before { content: "−"; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin-top: 14px; }
.more-grid .money-input { min-height: 46px; }
.hint { font-size: 0.78rem; color: var(--muted); margin: 0; }
@media (max-width: 380px) { .more-grid { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--brand); color: var(--on-brand); border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 650; cursor: pointer; min-height: 50px; width: 100%; margin-top: 14px; }
.btn:hover { background: var(--brand-hover); }
.js .calc-submit { display: none; }

/* --- Resultado: mosaico de tarjetas ---------------------------------------- */
.bento { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 720px) { .bento { gap: 14px; } }
.tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
@media (min-width: 720px) { .tile { padding: 22px; } }
.tile-label { display: flex; align-items: center; gap: 7px; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.tile-sub { font-size: 0.82rem; color: var(--muted); margin: 0; }
.tile-text { margin: 0; font-size: 0.92rem; }
.tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tile-head .tile-label { margin: 0; }
.tile-figure { margin: 0; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.tile-figure span { font-size: 0.8rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.cents { opacity: 0.45; }

.hero-tile { background: linear-gradient(150deg, var(--brand) 0%, var(--brand-dark) 100%); color: var(--on-brand); position: relative; overflow: hidden; }
.hero-tile::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%); pointer-events: none; }
.hero-tile .tile-label, .hero-tile .tile-sub { color: rgba(255, 255, 255, 0.78); }
/* El tamaño sigue al ancho de la tarjeta (cqi), no al de la pantalla */
.hero-tile { container-type: inline-size; }
.big { font-size: 2.6rem; font-size: clamp(2.3rem, 15.5cqi, 4.4rem); font-weight: 800; line-height: 1; letter-spacing: -0.045em; margin: 4px 0 8px; font-variant-numeric: lining-nums tabular-nums; }
.big .per { font-size: 1rem; font-weight: 500; letter-spacing: 0; opacity: 0.75; margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chips span { font-size: 0.8rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #fff; }

.minis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .minis { gap: 14px; } }
.mini { padding: 15px 16px; }
.mid { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 2px; white-space: nowrap; }
@media (min-width: 720px) { .mid { font-size: 1.5rem; } }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; flex: none; }

@media (min-width: 1100px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento > .wide { grid-column: 1 / -1; }
  .mini { display: flex; flex-direction: column; justify-content: center; }
}

/* Barra apilada y leyenda */
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 3px; margin: 10px 0 12px; }
.stack .seg { display: block; height: 100%; min-width: 3px; border-radius: 3px; transition: width 0.25s ease; }
.seg-federal { background: var(--c-federal); }
.seg-provincial { background: var(--c-provincial); }
.seg-cpp { background: var(--c-cpp); }
.seg-cpp2 { background: var(--c-cpp2); }
.seg-ei { background: var(--c-ei); }
.seg-other { background: repeating-linear-gradient(135deg, var(--c-cpp) 0 2px, var(--c-other) 2px 5px); }
.seg-net { background: var(--c-net); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .stack .seg, .paybars b { transition: none; } }

/* Los pagos del año */
.paybars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: clamp(1px, 0.6vw, 5px); height: 104px; align-items: end; margin-bottom: 12px; }
.paybars .pay { display: flex; align-items: flex-end; height: 100%; border-radius: 999px; background: repeating-linear-gradient(135deg, var(--hatch) 0 2px, transparent 2px 6px); overflow: hidden; }
.paybars b { display: block; width: 100%; border-radius: 999px; background: var(--brand-light); transition: height 0.25s ease; }
.paybars .pay.up b { background: var(--c-net); }

/* Coste para la empresa, tipos y tabla completa */
.employer b { font-weight: 700; }
.rates-tile { display: flex; align-items: center; gap: 18px; }
.ring { width: 112px; height: 112px; flex: none; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--c-net); stroke-width: 10; stroke-linecap: round; }
.ring text { font-size: 20px; font-weight: 800; fill: var(--ink); letter-spacing: -0.5px; }
.ring .ring-sub { font-size: 9px; font-weight: 500; fill: var(--muted); letter-spacing: 0; }
.rate-list { flex: 1; display: grid; gap: 8px; }
.rate-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 7px; }
.rate-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.rate-list span { font-size: 0.85rem; color: var(--muted); }
.rate-list strong { font-size: 1.15rem; letter-spacing: -0.02em; }

.full summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; list-style: none; display: flex; justify-content: space-between; }
.full summary::-webkit-details-marker { display: none; }
.full summary::after { content: "+"; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.full[open] summary::after { content: "−"; }
.full[open] summary { margin-bottom: 10px; }
.breakdown { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.breakdown th, .breakdown td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.breakdown th .dot { margin-right: 8px; vertical-align: 0; }
.breakdown thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding-top: 0; }
.breakdown .num { text-align: right; padding-left: 12px; white-space: nowrap; }
.breakdown .gross th, .breakdown .gross td { color: var(--muted); }
.breakdown .total th, .breakdown .total td { font-weight: 700; border-bottom: 0; }
.breakdown .total td { color: var(--c-net); }

/* Barra fija con el neto (móvil, mientras el resultado está debajo) */
.sticky-net { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 7; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--brand-dark); color: #fff; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5); }
.sticky-net[hidden] { display: none; }
.sticky-net span { font-size: 0.8rem; opacity: 0.8; }
.sticky-net strong { font-size: 1.15rem; letter-spacing: -0.02em; margin-right: auto; }
.sticky-net a { color: var(--brand-dark); background: #fff; text-decoration: none; font-size: 0.82rem; font-weight: 700; padding: 8px 14px; border-radius: 999px; }
@media (min-width: 960px) { .sticky-net { display: none !important; } }

/* Sello de comprobación contra la PDOC */
.pdoc-badge { display: flex; gap: 12px; align-items: center; margin: 12px 0 0; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-size: 0.9rem; }
.pdoc-badge:hover { color: var(--ink); }
.pdoc-badge svg { width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--brand-soft); flex: none; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Tarjetas de datos de cada provincia */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
@media (min-width: 900px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.fact { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.fact-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.fact-value { font-size: clamp(1.35rem, 5vw, 2rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 4px; }
.fact-sub { font-size: 0.78rem; color: var(--muted); margin: 0; }
.fact.accent { background: linear-gradient(150deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; }
.fact.accent .fact-label, .fact.accent .fact-sub { color: rgba(255, 255, 255, 0.78); }

/* --- Secciones ------------------------------------------------------------ */
.section { margin: 44px 0; }
@media (min-width: 720px) { .section { margin: 64px 0; } }
.section-head { margin-bottom: 16px; }
.section-head h2 { margin-bottom: 0.2em; }
.section-head p { margin: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; } }
.two-col > div > .table-card + .table-card { margin-top: 14px; }
.prose { max-width: 680px; }
.prose.wide { max-width: 760px; padding: 8px 0 24px; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }
.prose h2 { margin-top: 1.4em; }
.page-title { margin-top: 0.4em; }
.notes { list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.notes li { background: var(--surface); border-radius: var(--radius-md); padding: 14px 16px; margin: 0; box-shadow: var(--shadow); font-size: 0.95rem; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-card { padding: 6px 18px 12px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table caption { text-align: left; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; padding: 14px 0 6px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.table tbody th { font-weight: 600; }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .strong { font-weight: 700; color: var(--c-net); }
.table .rank { color: var(--muted); width: 2.2em; }
.table tr.hl th, .table tr.hl td { background: var(--brand-soft); }
.table-note { font-size: 0.78rem; color: var(--muted); margin: 8px 0 4px; }
.ok { color: var(--brand); font-weight: 600; }
.warn { color: #b4532a; font-weight: 600; }
code { font-size: 0.88em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* Provincias */
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
@media (min-width: 720px) { .prov-grid { gap: 14px; } }
.prov-tile { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; }
.prov-name { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.02rem; letter-spacing: -0.02em; margin: 0 0 8px; }
.prov-name .code { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em; flex: none; }
.prov-stat { font-size: 0.82rem; color: var(--muted); margin: 0 0 10px; }
.prov-stat span { color: var(--ink); font-weight: 700; }
.prov-links { margin: auto 0 0; display: flex; gap: 8px; font-size: 0.84rem; font-weight: 600; }
.prov-links a { text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); }
.prov-tile.soon { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); }
.prov-tile.soon .prov-links span { color: var(--muted); font-weight: 500; padding: 6px 0; }

/* FAQ */
.faq { display: grid; gap: 8px; max-width: 820px; }
.faq-item { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 0 18px; }
.faq-item summary { cursor: pointer; padding: 15px 28px 15px 0; font-weight: 600; list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 0; top: 12px; font-size: 1.3rem; color: var(--muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 16px; color: var(--muted); }

/* Enlaces al final de la página */
.related { display: grid; gap: 10px; }
@media (min-width: 720px) { .related { grid-template-columns: 1fr 1fr; gap: 14px; } }
.related-card { display: block; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.related-card:hover { color: var(--ink); outline: 2px solid var(--brand-soft); }
.related-card span { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.related-card strong { display: block; font-size: 1.2rem; letter-spacing: -0.02em; margin: 3px 0; }
.related-card em { font-style: normal; color: var(--muted); font-size: 0.9rem; }

/* --- Pie -------------------------------------------------------------------- */
.footer { margin-top: 64px; padding: 32px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 0.86rem; color: var(--muted); }
.footer-grid { display: grid; gap: 20px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.2fr 1.4fr 1fr; gap: 32px; padding: 28px; } }
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 1rem; margin-bottom: 8px; }
.footer-title { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--ink); }
.disclaimer { margin: 18px 4px 0; font-size: 0.78rem; }
/* Con la barra fija visible, el pie no queda tapado */
@media (max-width: 959px) { .footer { padding-bottom: calc(90px + env(safe-area-inset-bottom)); } }

/* Cookies: una tarjeta por elemento (una tabla de 4 columnas no cabe en el móvil) */
.cookie-list { display: grid; gap: 10px; margin: 0 0 1em; }
.cookie-card { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 16px 18px; }
.cookie-card p { margin: 0 0 8px; }
.cookie-card p:last-child { margin: 0; }
.cookie-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cookie-name span { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.cookie-meta { font-size: 0.82rem; color: var(--muted); }

/* --- Impuesto anual: desglose por tramo -------------------------------------- */
.brk-cols { display: grid; gap: 18px; margin-top: 10px; }
@media (min-width: 640px) { .brk-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; } }
.brk-title { font-size: 0.82rem; font-weight: 650; margin: 0 0 6px; }
.brk { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.brk li { display: grid; grid-template-columns: 3.6em minmax(0, 1fr) auto; grid-template-areas: "rate bar tax" "rate on tax"; column-gap: 10px; align-items: center; font-variant-numeric: tabular-nums; font-size: 0.86rem; }
.brk-rate { grid-area: rate; font-weight: 650; }
.brk-bar { grid-area: bar; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.brk-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.brk-on { grid-area: on; color: var(--muted); font-size: 0.78rem; }
.brk li b { grid-area: tax; font-weight: 600; }
.brk-line { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.brk-line span { color: var(--muted); }
.brk-line.total { border-top: 0; padding-top: 0; margin-top: 4px; font-weight: 700; }
.brk-line.total span { color: var(--ink); }
.after-tax { flex-direction: column; align-items: stretch; }

/* --- Ejemplo paso a paso de los tramos ---------------------------------------- */
.example-cols { display: grid; gap: 14px; margin: 14px 0; }
@media (min-width: 720px) { .example-cols { grid-template-columns: 1fr 1fr; } }
.example-cols > div { background: var(--surface); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow); }
.steps { list-style: none; padding: 0 !important; margin: 6px 0 10px; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.steps li { padding: 4px 0; border-bottom: 1px solid var(--line); margin: 0; }
.btn.ghost { width: auto; background: var(--surface); color: var(--brand); box-shadow: var(--shadow); text-decoration: none; }
.btn.ghost:hover { background: var(--surface-2); }
