/* ==========================================================================
   CalculaTuCoche · styles.css
   Mobile-first · sin fuentes externas · sin frameworks · ~4 KB comprimido
   Índice: 1 Tokens · 2 Base · 3 Cabecera/pestañas · 4 Layout · 5 Herramienta
           6 Resultados y gráficos · 7 Contenido SEO · 8 Anuncios · 9 Cookies
           10 Diálogo · 11 Pie · 12 Utilidades · 13 Escritorio · 14 Impresión
   ========================================================================== */

/* 1 · TOKENS ------------------------------------------------------------- */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #0f1b2a;
  --muted: #586577;
  --line: #e1e6ec;
  --line-strong: #c9d2dc;
  --brand: #0d5c74;
  --brand-ink: #ffffff;
  --brand-soft: #e5f1f4;
  --accent: #d98e04;
  --ok: #0f7b5f;
  --warn-bg: #fff6e5;
  --warn-ink: #7a4a00;
  --err: #b42318;
  --wa: #128c4a;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 42, .05), 0 10px 30px rgba(15, 27, 42, .06);
  --c1: #0e7490; --c2: #e39b0b; --c3: #7c5cd6; --c4: #3b82f6;
  --c5: #64748b; --c6: #10a37f; --c7: #db2777;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c141d; --surface: #121c27; --surface-2: #17232f; --ink: #e8eef4;
    --muted: #9fb0c2; --line: #233243; --line-strong: #31455a; --brand: #4cb3cf;
    --brand-ink: #06202a; --brand-soft: #14303b; --accent: #f2b230;
    --warn-bg: #2d2412; --warn-ink: #f5cf85; --wa: #25c26a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c141d; --surface: #121c27; --surface-2: #17232f; --ink: #e8eef4;
  --muted: #9fb0c2; --line: #233243; --line-strong: #31455a; --brand: #4cb3cf;
  --brand-ink: #06202a; --brand-soft: #14303b; --accent: #f2b230;
  --warn-bg: #2d2412; --warn-ink: #f5cf85; --wa: #25c26a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* 2 · BASE ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.45rem, 1.1rem + 1.8vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 1.05rem + .9vw, 1.6rem); margin-top: .2em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 3 · CABECERA Y PESTAÑAS ------------------------------------------------ */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top__in { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding-top: .6rem; padding-bottom: .6rem; }
.logo { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo b { color: var(--brand); font-weight: 800; }
.tabs { position: relative; display: flex; gap: .3rem; width: 100%; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .25rem; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .4rem .75rem; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .88rem; text-decoration: none; white-space: nowrap; line-height: 1.15; }
.tab svg { width: 18px; height: 18px; flex: none; }
.tab:hover { color: var(--ink); background: var(--surface); }
.tab[aria-current="page"] { background: var(--brand); color: var(--brand-ink); box-shadow: 0 2px 8px rgba(13, 92, 116, .25); }

@media (max-width: 759px) { .tabs { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); } }
/* Navegación SPA: barra de progreso fina mientras llega la página */
html.cargando::before { content: ""; position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 99; background: linear-gradient(90deg, var(--brand), var(--accent)); transform-origin: left; animation: ctc-carga 1s ease-in-out infinite; }
@keyframes ctc-carga { 0% { transform: scaleX(.05); } 60% { transform: scaleX(.75); } 100% { transform: scaleX(.95); } }
main h1:focus { outline: none; }

/* 4 · LAYOUT ------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 1.1rem; padding-bottom: 2rem; }
.col-side { display: none; }
.hero { margin-bottom: .9rem; }
.hero .lead { color: var(--muted); margin: 0; max-width: 62ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { margin-top: 2.2rem; }
.section > p, .section li { max-width: 72ch; }

/* 5 · HERRAMIENTA -------------------------------------------------------- */
.tool { padding: 1rem; }
.tool__group { border: 0; margin: 0 0 .9rem; padding: 0; min-width: 0; }
.tool__title { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; display: flex; align-items: center; gap: .4rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.grid2-md { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; margin: 0 0 .7rem; border: 0; padding: 0; }
.grid2 > .field, .grid3 > .field { margin-bottom: 0; }
.grid2 + .grid2, .grid2 + .field, .grid3 + .grid3, .grid3 + .field { margin-top: .7rem; }
label, legend { font-size: .86rem; font-weight: 600; color: var(--ink); padding: 0; }
.hint { font-size: .76rem; color: var(--muted); line-height: 1.35; }
input[type="text"], select {
  width: 100%; min-height: 46px; padding: .55rem .75rem; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-s); appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2rem; }
input[type="text"]:focus, select:focus { border-color: var(--brand); background: var(--surface); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
input.is-auto { border-color: var(--ok); }
.suffix { position: relative; }
.suffix input { padding-right: 4.6rem; }
.suffix span { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); font-size: .82rem; color: var(--muted); pointer-events: none; }

.ruta { display: grid; grid-template-columns: minmax(0, 1fr) 44px; grid-template-areas: "o swap" "d swap"; gap: .5rem .5rem; align-items: end; margin-bottom: .7rem; }
.ruta .field { margin: 0; }
.ruta .f-o { grid-area: o; } .ruta .f-d { grid-area: d; }
.swap { grid-area: swap; align-self: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--brand); cursor: pointer; display: grid; place-items: center; margin-top: 1.4rem; }
.swap svg { width: 20px; height: 20px; }
.swap:hover { background: var(--brand-soft); }

/* Segmentados (radios accesibles) */
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 3px; gap: 3px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 38px; padding: .25rem .4rem; border-radius: 7px; font-size: .86rem; font-weight: 600; color: var(--muted); cursor: pointer; text-align: center; line-height: 1.1; }
.seg input:checked + label { background: var(--brand); color: var(--brand-ink); }
.seg input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .45rem; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips label { display: inline-flex; align-items: center; gap: .3rem; min-height: 38px; padding: .3rem .7rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--muted); cursor: pointer; background: var(--surface); }
.chips label small { font-weight: 500; opacity: .8; }
.chips input:checked + label { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.chips input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 1px; }

input[type="range"] { width: 100%; accent-color: var(--brand); height: 32px; }
.range-row { display: flex; align-items: center; gap: .75rem; }
.range-row output { min-width: 4.8rem; font-weight: 700; text-align: right; }

details.mas { border-top: 1px dashed var(--line-strong); margin-top: .4rem; padding-top: .5rem; }
details.mas summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--brand); padding: .3rem 0; list-style: none; }
details.mas summary::-webkit-details-marker { display: none; }
details.mas summary::before { content: "+ "; }
details.mas[open] summary::before { content: "− "; }
details.mas[open] summary { margin-bottom: .6rem; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 46px; padding: .55rem 1rem; font: inherit; font-weight: 700; font-size: .95rem; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.15; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); width: 100%; font-size: 1.02rem; min-height: 52px; }
.btn--primary:hover { color: var(--brand-ink); filter: brightness(1.08); }
.btn--wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn--wa:hover { color: #fff; filter: brightness(1.07); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn.is-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }

.estado { min-height: 1.4em; font-size: .86rem; color: var(--muted); margin: .55rem 0 0; }
.estado.is-error { color: var(--err); font-weight: 600; }
.estado.is-ok { color: var(--ok); }
.privacidad { display: flex; gap: .5rem; align-items: flex-start; font-size: .8rem; color: var(--muted); margin: .7rem .2rem 0; }
.privacidad svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--ok); }
.noscript { background: var(--warn-bg); color: var(--warn-ink); padding: .8rem; border-radius: var(--radius-s); font-size: .9rem; }

/* 6 · RESULTADOS Y GRÁFICOS ---------------------------------------------- */
.resultado { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .8rem; }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: .7rem .8rem; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.kpi__label { font-size: .76rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi__val { font-size: clamp(1.25rem, 1rem + 1.6vw, 1.7rem); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi__sub { font-size: .78rem; color: var(--muted); }
.kpi--main { grid-column: 1 / -1; background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.kpi--main .kpi__label, .kpi--main .kpi__sub { color: inherit; opacity: .88; }
.kpi--main .kpi__val { font-size: clamp(1.9rem, 1.4rem + 2.6vw, 2.6rem); }
.datos { display: grid; grid-template-columns: 1fr; gap: 0 .9rem; margin: 0 0 .8rem; }
.datos div { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.datos dt { color: var(--muted); font-size: .86rem; }
.datos dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; font-size: .92rem; }
.barra { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--line); margin: .3rem 0 .4rem; }
.barra span { display: block; height: 100%; }
.leyenda { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .78rem; color: var(--muted); margin-bottom: .9rem; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.acciones { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.fuente { font-size: .78rem; color: var(--muted); margin: .7rem 0 0; }
.copia-manual { width: 100%; min-height: 9rem; margin-top: .6rem; font: .85rem/1.4 var(--mono); padding: .6rem; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); }
.aviso { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius-s); padding: .65rem .8rem; font-size: .86rem; margin: .6rem 0 0; }

/* Donut (conic-gradient: 0 KB de librería) */
.donut-wrap { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: center; margin: .4rem 0 1rem; }
.donut { position: relative; width: min(220px, 70vw); aspect-ratio: 1; border-radius: 50%; margin: 0 auto; background: var(--line); }
.donut::after { content: ""; position: absolute; inset: 21%; border-radius: 50%; background: var(--surface); }
.donut__c { position: absolute; inset: 24%; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.15; }
.donut__c strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.donut__c span { font-size: .74rem; color: var(--muted); }

/* Tablas */
.tabla-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-s); }
table { border-collapse: collapse; width: 100%; font-size: .84rem; font-variant-numeric: tabular-nums; }
th, td { padding: .5rem .45rem; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th { background: var(--surface-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 800; background: var(--surface-2); border-top: 2px solid var(--line-strong); border-bottom: 0; }
.desglose tbody tr { cursor: pointer; }
.desglose tbody tr:hover, .desglose tbody tr.is-sel { background: var(--brand-soft); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: 0; }
.desglose td:first-child { min-width: 7.5rem; }

/* Barras anuales SVG */
.anual { margin-top: 1.1rem; }
.anual svg { display: block; width: 100%; height: auto; }
.anual rect[data-y] { cursor: pointer; }
.anual text { fill: var(--muted); font: 11px var(--font); }
.anual .eje { stroke: var(--line-strong); }
.anual-cap { font-size: .84rem; color: var(--ink); background: var(--surface-2); border-radius: var(--radius-s); padding: .55rem .7rem; margin: .4rem 0 0; min-height: 2.6em; }

/* Resumen vivo (TCO): el resultado se ve sin bajar */
.vivo { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin: -.2rem 0 1rem; padding: .55rem .8rem; border-radius: var(--radius-s); background: var(--brand-soft); color: var(--ink); text-decoration: none; font-size: .9rem; }
.vivo small { display: block; font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.vivo > span:first-child { min-width: 0; }
.vivo strong { display: block; font-size: clamp(.95rem, 4.1vw, 1.08rem); color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vivo span:last-child { font-size: .8rem; color: var(--brand); font-weight: 700; white-space: nowrap; }

/* Afiliados contextuales */
.afi { display: block; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-s); padding: .65rem .8rem; margin-top: .7rem; background: var(--surface); font-size: .88rem; }
.afi__tag { display: inline-block; margin-right: .45rem; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 .3rem; vertical-align: 1px; }
.afi a { font-weight: 700; }

/* Veredicto (financiación, motores) */
.veredicto { display: flex; gap: .7rem; align-items: flex-start; border-radius: var(--radius-s); padding: .8rem .9rem; margin: .2rem 0 .9rem; background: var(--brand-soft); border: 1px solid var(--brand); font-size: .94rem; line-height: 1.45; }
.veredicto--no { background: var(--warn-bg); border-color: var(--accent); color: var(--warn-ink); }
.veredicto__ico { font-size: 1.3rem; line-height: 1.1; flex: none; }
td.gana { color: var(--ok); font-weight: 800; }
#m-tabla td:last-child { white-space: normal; line-height: 1.25; }
#f-comp-tabla td:first-child { white-space: nowrap; min-width: 0; }
@media (max-width: 420px) { #f-comp table { font-size: .8rem; } #f-comp th, #f-comp td { padding: .45rem .35rem; } .ok-ico { display: none; } }
#m-tabla small { color: var(--muted); font-weight: 600; }
td[data-sel] { background: var(--brand-soft); }
tr.is-sel td { background: var(--brand-soft); font-weight: 700; }
.hbar { display: grid; grid-template-columns: 1fr; gap: .2rem; margin: .55rem 0; }
.hbar__n { font-size: .84rem; color: var(--muted); }
.hbar__t { display: block; height: 14px; background: var(--line); border-radius: 99px; overflow: hidden; }
.hbar__t span { display: block; height: 100%; border-radius: 99px; }
.hbar__v { font-variant-numeric: tabular-nums; font-size: .95rem; }
.toggle-comp { width: 100%; margin-top: 1rem; border-style: dashed; border-color: var(--brand); color: var(--brand); }
.comp { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.check { display: flex; gap: .55rem; align-items: center; min-height: 46px; font-size: .9rem; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
/* Dos vehículos lado a lado (también en móvil: comparar es la tarea) */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.duo__col { border: 1px solid var(--line); border-radius: var(--radius-s); padding: .7rem .6rem; min-width: 0; }
.duo__col .field { margin-bottom: .55rem; }
.duo__tit { display: flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .9rem; margin: 0 0 .5rem; }
.duo__tit i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.duo .suffix input { padding-right: 3.6rem; }
.duo .suffix span { font-size: .72rem; right: .5rem; }
.duo select, .duo input[type="text"] { padding-left: .55rem; }
.lista-herr { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.lista-herr a { display: flex; gap: .6rem; align-items: center; padding: .7rem .8rem; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.lista-herr svg { width: 22px; height: 22px; color: var(--brand); flex: none; }
.lista-herr a:hover { border-color: var(--brand); }

/* 7 · CONTENIDO SEO ------------------------------------------------------ */
.pasos { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .8rem; counter-reset: paso; }
.pasos li { position: relative; padding: 1rem 1rem 1rem 3.6rem; max-width: none; }
.pasos li::before { counter-increment: paso; content: counter(paso); position: absolute; left: 1rem; top: 1rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; }
.pasos h3 { margin-bottom: .25rem; }
.pasos p { margin: 0; color: var(--muted); font-size: .94rem; }
.formula { font-family: var(--mono); font-size: .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: .7rem .9rem; overflow-x: auto; white-space: nowrap; }
.cards { display: grid; gap: .8rem; margin-top: 1rem; }
.cards .card { padding: 1rem; }
.cards h3 { display: flex; gap: .5rem; align-items: center; }
.cards p { margin: 0; font-size: .94rem; color: var(--muted); }
.consejos { padding-left: 1.2rem; }
.consejos li { margin-bottom: .55rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: .9rem 2rem .9rem 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .3rem; top: .75rem; font-size: 1.3rem; color: var(--brand); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq .resp { padding: 0 0 .9rem; color: var(--ink); }
.faq .resp p:last-child { margin-bottom: 0; }
.mas-herr { display: grid; gap: .8rem; }
.mas-herr a { display: flex; gap: .8rem; align-items: center; padding: 1rem; text-decoration: none; color: var(--ink); }
.mas-herr a:hover { border-color: var(--brand); }
.mas-herr svg { width: 34px; height: 34px; color: var(--brand); flex: none; }
.mas-herr strong { display: block; }
.mas-herr span { color: var(--muted); font-size: .9rem; }
.legal h2 { margin-top: 1.6rem; }
.legal .todo { background: var(--warn-bg); color: var(--warn-ink); padding: 0 .25rem; border-radius: 4px; font-weight: 600; }
.migas { font-size: .82rem; color: var(--muted); margin-bottom: .4rem; }
.migas a { color: var(--muted); }

/* 8 · ANUNCIOS (solo contenedores; el código de AdSense se pega después) - */
.ad { display: flex; align-items: center; justify-content: center; margin: 1.2rem auto; max-width: 100%;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(127, 140, 155, .07) 10px 20px), var(--surface-2);
  border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); overflow: hidden; }
.ad > span { font-size: .7rem; font-weight: 700; letter-spacing: .18em; }
.ad--leader { width: 100%; max-width: 728px; min-height: 100px; }   /* 320x100 móvil · 728x90 escritorio */
.ad--square { width: 300px; min-height: 250px; }                    /* 300x250 */
.ad--side { width: 300px; min-height: 600px; margin-top: 0; }        /* 300x600, solo escritorio */
.ad--modal { width: 300px; min-height: 250px; margin: .8rem auto; }
.ad-corner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(15, 27, 42, .12);
  padding: .35rem 2.6rem .35rem .5rem; padding-bottom: calc(.35rem + env(safe-area-inset-bottom, 0px)); transform: translateY(110%); transition: transform .25s ease; }
.ad-corner.is-in { transform: none; }
.ad-corner .ad { margin: 0 auto; width: 320px; min-height: 50px; border-radius: 6px; }  /* 320x50 ancla móvil */
.ad-corner__x { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1.1rem; line-height: 1; }
body.con-esquina { padding-bottom: 72px; }

/* 9 · COOKIES ------------------------------------------------------------ */
.cookie { position: fixed; left: .5rem; right: .5rem; bottom: .5rem; bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: 640px; margin: 0 auto; padding: .85rem .9rem; }
.cookie h2 { font-size: 1rem; margin-bottom: .35rem; }
.cookie p { font-size: .86rem; color: var(--muted); margin-bottom: .7rem; }
.cookie__btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.cookie__btns .btn { min-height: 44px; font-size: .86rem; padding: .4rem .3rem; }
.cookie__btns .btn--full { grid-column: 1 / -1; }
.cookie__btns .btn--solid { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.cookie__panel { border-top: 1px solid var(--line); margin: .2rem 0 .8rem; padding-top: .6rem; }
.cookie__opt { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; font-size: .86rem; }
.cookie__opt input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); flex: none; }
.cookie__opt span { color: var(--muted); display: block; font-size: .8rem; }

/* 10 · DIÁLOGO (pop-up no intrusivo, se cierra con ×, Esc o clic fuera) --- */
.dlg { border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); width: min(360px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dlg::backdrop { background: rgba(10, 18, 28, .55); }
.dlg__in { position: relative; padding: 1.1rem 1rem 1rem; text-align: center; }
.dlg__in h2 { font-size: 1.05rem; margin: 0 2rem .2rem; }
.dlg__in p { font-size: .86rem; color: var(--muted); margin: 0; }
.dlg__x { position: absolute; top: .5rem; right: .5rem; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.dlg .btn { width: 100%; }

/* 11 · PIE --------------------------------------------------------------- */
.pie { background: var(--surface); border-top: 1px solid var(--line); margin-top: 2rem; padding: 1.6rem 0 2rem; font-size: .88rem; color: var(--muted); }
.pie__grid { display: grid; gap: 1.2rem; }
.pie h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin-bottom: .5rem; }
.pie ul { list-style: none; padding: 0; margin: 0; }
.pie li { margin-bottom: .35rem; }
.pie a, .pie .link-btn { color: var(--muted); }
.pie a:hover, .pie .link-btn:hover { color: var(--brand); }
.pie__legal { border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: 1rem; font-size: .8rem; }

/* 12 · UTILIDADES -------------------------------------------------------- */
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mt0 { margin-top: 0; }

/* 13 · TABLET / ESCRITORIO ----------------------------------------------- */
@media (min-width: 560px) {
  .acciones { grid-template-columns: 1fr 1fr; }
  .acciones .btn--wa { grid-column: 1 / -1; }
  .acciones:has(> [hidden]:last-child) > :nth-child(2) { grid-column: 1 / -1; }
  .datos { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: repeat(3, 1fr); }
  .grid2-md { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .pie__grid { grid-template-columns: repeat(3, 1fr); }
  .mas-herr { grid-template-columns: 1fr 1fr; }
  .hbar { grid-template-columns: 11rem 1fr 6rem; align-items: center; }
  .hbar__v { text-align: right; }
  .ad-corner { left: auto; right: 1rem; bottom: 1rem; width: 336px; border: 1px solid var(--line); border-radius: 12px; padding: .5rem 2.8rem .5rem .5rem; }
  .ad-corner .ad { width: 100%; min-height: 100px; }   /* 300x100 caja de esquina */
  body.con-esquina { padding-bottom: 0; }
}
@media (min-width: 760px) {
  .wrap { padding-left: 1.5rem; padding-right: 1.5rem; }
  .top__in { flex-wrap: nowrap; justify-content: space-between; }
  .tabs { width: auto; max-width: calc(100% - 210px); }
  .tool { padding: 1.4rem; }
  .ruta { grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); grid-template-areas: "o swap d"; }
  .swap { transform: rotate(90deg); margin-top: 1.4rem; }
  .donut-wrap { grid-template-columns: 220px 1fr; }
  .pasos { grid-template-columns: repeat(3, 1fr); }
  .ad--leader { min-height: 90px; }
}
@media (min-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 2.2rem; }
  .col-side { display: block; }
}

/* 14 · IMPRESIÓN --------------------------------------------------------- */
@media print {
  .top .tabs, .ad, .ad-corner, .cookie, .dlg, .acciones, .pie, .col-side, .afi, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; }
}
