/* CálculoCasa · v2 · estilo fintech minimalista. Sin frameworks. */

/* ---------- 1. Tokens ---------- */
:root {
  --ink: #0a0a0b;
  --ink-2: #27272a;
  --muted: #6b6b73;
  --faint: #9e9ea7;
  --line: #e7e7ea;
  --line-2: #d9d9de;
  --soft: #f4f4f5;
  --soft-2: #fafafa;
  --bg: #ffffff;
  --lime: #c8f547;
  --lime-soft: #f2fcd6;
  --lime-ink: #3b5a0a;
  --seg-2: #74747c;
  --seg-3: #c9c9d0;
  --r-lg: 28px;
  --r-md: 16px;
  --r-sm: 12px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --bar-h: 0px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55; letter-spacing: -0.006em;
  font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }
p { margin: 0 0 1em; }
strong, b { font-weight: 600; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tabnum { font-variant-numeric: tabular-nums; }

/* ---------- 3. Cabecera ---------- */
.hdr { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
.hdr-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: var(--lime); }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -0.035em; }
.nav { display: flex; gap: 2px; font-size: 14px; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; transition: color .15s, background .15s; }
.nav a:hover { color: var(--ink); background: var(--soft); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--soft); }
.nav a[aria-current="page"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 1.5px var(--ink); }

/* ---------- 4. Calculadora ---------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; padding-top: 64px; padding-bottom: 64px; align-items: start; }
.kicker { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 20px; }
.kicker::before { content: ""; width: 24px; height: 1px; background: var(--ink); }
.news { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; margin-bottom: 22px; padding: 4px 14px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; transition: border-color .2s, background .2s; }
.news:hover { border-color: var(--line-2); background: var(--soft); }
.news-k { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 3px 9px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; }
.news-k::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.news-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-go { flex: none; color: var(--muted); transition: transform .2s var(--ease); }
.news:hover .news-go { transform: translateX(3px); color: var(--ink); }
.cc:target { border-color: var(--ink); box-shadow: 0 0 0 4px var(--lime-soft); }
h1 { font-size: clamp(2.2rem, 1.3rem + 2.1vw, 3.2rem); letter-spacing: -0.045em; line-height: 1.02; max-width: 15ch; }
.sub { font-size: 17px; color: var(--muted); max-width: 44ch; margin: 18px 0 40px; line-height: 1.5; }

.form { display: flex; flex-direction: column; gap: 20px; }
.fld { margin: 0; padding: 0; border: 0; min-width: 0; }
.fld > label, .fld > legend { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 8px; padding: 0; }
.lbl-s { color: var(--faint); font-weight: 400; }
.tag { font-size: 11px; font-weight: 500; color: var(--ink); background: var(--lime); border-radius: 6px; padding: 1px 6px; }
.tag[hidden] { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.inp { position: relative; display: flex; align-items: center; background: var(--soft); border-radius: var(--r-sm); border: 1px solid transparent; transition: background .15s, border-color .15s, box-shadow .15s; }
.inp:hover { background: #efeff1; }
.inp:focus-within { background: var(--bg); border-color: var(--ink); box-shadow: 0 0 0 4px rgba(10, 10, 11, .06); }
.inp[hidden] { display: none; }
.inp input, .inp select { flex: 1; min-width: 0; width: 100%; height: 52px; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); padding: 0 16px; outline: none; font-variant-numeric: tabular-nums; }
.inp input::placeholder { color: var(--faint); }
.unit { padding-right: 16px; color: var(--muted); font-weight: 500; }
.inp--price input { height: 84px; font-size: clamp(2.1rem, 1.6rem + 1.4vw, 2.75rem); font-weight: 600; letter-spacing: -0.04em; padding-left: 20px; }
.inp--price .unit { font-size: 24px; padding-right: 22px; }
.inp--sel::after { content: ""; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.inp--sel select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--soft); border-radius: var(--r-sm); padding: 4px; height: 52px; }
.seg label { position: relative; display: flex; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { flex: 1; display: grid; place-items: center; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--muted); transition: background .2s var(--ease), color .2s; white-space: nowrap; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.box { border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 18px; }
.box-row { min-height: 56px; display: flex; align-items: center; }
.box-body { padding: 2px 0 18px; }
.box-body[hidden] { display: none; }
.sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; cursor: pointer; user-select: none; }
.sw-t { font-size: 15px; font-weight: 500; color: var(--ink); }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-ui { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: #d4d4d8; transition: background .2s var(--ease); }
.sw-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.sw input:checked + .sw-ui { background: var(--ink); }
.sw input:checked + .sw-ui::after { transform: translateX(18px); }
.sw input:focus-visible + .sw-ui { outline: 2px solid var(--ink); outline-offset: 2px; }
.sw--sm { height: 21px; margin-bottom: 8px; }
.sw--sm .sw-t { font-size: 13px; color: var(--muted); }
.sw--sm .sw-ui { width: 36px; height: 21px; }
.sw--sm .sw-ui::after { width: 15px; height: 15px; }
.sw--sm input:checked + .sw-ui::after { transform: translateX(15px); }

.range-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.range-top label { font-size: 13px; color: var(--muted); font-weight: 500; }
output { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
input[type="range"] { --p: 77.8%; -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--ink) var(--p), var(--line-2) var(--p)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--lime); }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.hint a { color: var(--ink); }

.more { border-top: 1px solid var(--line); }
.more summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 18px 28px 18px 0; position: relative; }
.more summary::-webkit-details-marker { display: none; }
.more summary span { font-size: 15px; font-weight: 500; }
.more summary small { font-size: 13px; color: var(--faint); }
.more summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 12px; height: 12px; background: linear-gradient(var(--ink), var(--ink)) center/12px 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center/1.5px 12px no-repeat; transform: translateY(-50%); transition: transform .2s var(--ease); }
.more[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.more-b { display: flex; flex-direction: column; gap: 16px; padding-bottom: 6px; }
.noscript { font-size: 14px; background: var(--lime-soft); padding: 10px 14px; border-radius: 10px; }

/* ---------- 5. Resultado ---------- */
.app-out { position: sticky; top: 88px; }
.out { background: var(--soft); border-radius: var(--r-lg); padding: 32px; }
.res-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.res-head > span { white-space: nowrap; }
.res-label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.res-loc { font-size: 12.5px; color: var(--muted); text-align: right; }
.res-num { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 6px; font-size: clamp(3.4rem, 2.4rem + 3.2vw, 5.4rem); font-weight: 600; letter-spacing: -0.055em; line-height: .95; font-variant-numeric: tabular-nums; }
.res-c { font-size: .42em; letter-spacing: -0.02em; color: var(--muted); font-weight: 500; }
.res-sub { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.res-sub b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { display: flex; gap: 3px; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); }
.bar-seg { display: block; height: 100%; min-width: 0; transition: width .55s var(--ease); }
.bar-entrada { background: var(--ink); }
.bar-impuestos { background: var(--lime); }
.bar-nr { background: var(--seg-2); }
.bar-otros { background: var(--seg-3); }
.legend { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.legend i { flex: none; width: 8px; height: 8px; border-radius: 2px; }
.legend b { margin-left: auto; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lg-entrada i { background: var(--ink); }
.lg-impuestos i { background: var(--lime); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.lg-nr i { background: var(--seg-2); }
.lg-otros i { background: var(--seg-3); }

/* Recibo */
.receipt { position: relative; background: var(--bg); border-radius: 18px 18px 6px 6px; padding: 22px 24px 20px; margin: 26px 0 30px; box-shadow: 0 1px 0 rgba(0, 0, 0, .03); }
.receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 14px; background: radial-gradient(circle at 7px 7px, var(--soft) 6px, transparent 6.5px) -1px 0 / 14px 14px repeat-x; }
.rc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--line-2); margin-bottom: 6px; }
.rc-title { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.rc-meta { font-size: 12px; color: var(--faint); text-align: right; }
.rc { margin: 0; }
.rc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 6px 0; font-size: 14px; }
.rc-row dt { margin: 0; color: var(--ink-2); min-width: 0; }
.rc-row dt small { display: block; font-size: 12px; color: var(--faint); line-height: 1.35; margin-top: 1px; }
.rc-row dd { margin: 0; font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.01em; }
.rc-chip { display: inline-block; font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; letter-spacing: 0; }
.rc-strong dt, .rc-strong dd { color: var(--ink); font-weight: 600; }
.rc-muted dt, .rc-muted dd { color: var(--muted); }
.rc-off { font-family: var(--sans); font-size: 12.5px; color: var(--faint); }
.rc-detail { padding: 2px 0 2px 12px; font-size: 12.5px; }
.rc-detail dt { color: var(--muted); }
.rc-detail dd { font-size: 12.5px; color: var(--muted); }
.rc-sep { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.rc-sep::after { content: ""; flex: 1; border-top: 1px dashed var(--line-2); }
.rc-subtotal { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.rc-subtotal dt, .rc-subtotal dd { font-weight: 600; color: var(--ink); }
.rc-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 3px double var(--ink); font-weight: 600; font-size: 15px; }
.rc-total strong { font-family: var(--mono); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-bank { font-size: 12.5px; line-height: 1.45; color: var(--lime-ink); background: var(--lime-soft); border-radius: 10px; padding: 10px 12px; margin: 16px 0 0; }
.rc-bank strong { color: var(--lime-ink); }
.rc-notes { list-style: none; margin: 12px 0 0; padding: 0; font-size: 12px; color: var(--muted); }
.rc-notes li { position: relative; padding-left: 14px; margin-top: 4px; line-height: 1.4; }
.rc-notes li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }

.actions { display: flex; flex-direction: column; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; transition: background .2s, transform .1s, color .2s; }
.btn:hover { background: var(--ink-2); }
.btn:active { transform: scale(.99); }
.btn.is-done { background: var(--lime); color: var(--ink); }
.btn--ghost { background: var(--soft); color: var(--ink); min-height: 48px; }
.btn--ghost:hover { background: #ebebee; }
.btn-link { background: none; border: 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; padding: 6px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.btn-link:hover { color: var(--ink); }
.fine { font-size: 12px; color: var(--faint); text-align: center; margin: 14px 0 0; }
.fine a { color: var(--muted); }

/* ---------- 6. Huecos de anuncio (placeholders) ---------- */
.ad-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--soft-2); border: 1px solid var(--line); border-radius: var(--r-md); margin: 0 auto; text-align: center; }
.ad-label { font-size: 10.5px; font-weight: 600; letter-spacing: .24em; color: var(--faint); }
.ad-size { font-family: var(--mono); font-size: 11px; color: var(--seg-3); }
.ad-slot--leaderboard { max-width: 970px; min-height: 110px; margin-bottom: 8px; }
.ad-slot--incontent { max-width: 336px; min-height: 280px; margin: 64px auto 0; }
.ad-slot.is-live { display: block; background: none; border: 0; border-radius: 0; min-height: 0; width: 100%; }
.ad-slot.is-live .adsbygoogle { min-height: 100px; }
.ad-slot.is-live:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-note { display: block; margin-bottom: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }

.copy-modal { border: 0; padding: 0; border-radius: 24px; width: min(360px, calc(100vw - 32px)); background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.copy-modal::backdrop { background: rgba(10, 10, 11, .45); backdrop-filter: blur(3px); }
.copy-modal-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px 22px 20px; }
.copy-modal-msg { align-self: stretch; margin: 0 34px 0 0; font-size: 15px; font-weight: 500; line-height: 1.4; }
.copy-modal-msg span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--lime); font-size: 12px; margin-right: 6px; vertical-align: -3px; }
.copy-modal .btn--ghost { align-self: stretch; }
.copy-modal.is-fallback { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 90; }
.copy-fallback { display: block; width: 100%; margin-top: 10px; font: inherit; font-size: 13px; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; }
.x-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.x-close:hover { background: #e9e9ec; }

/* ---------- 7. Páginas de contenido ---------- */
.out-link { display: inline-flex; gap: 6px; margin: 20px 0 18px; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 2px; }
.out-link:hover { border-color: var(--ink); }

.page-hero { padding-top: 72px; padding-bottom: 12px; }
.page-hero h1 { max-width: 20ch; }
.lead { font-size: 18px; color: var(--muted); max-width: 64ch; margin: 22px 0 0; line-height: 1.55; }
.lead strong { color: var(--ink); }
.blk { padding-top: 64px; padding-bottom: 8px; }
.blk-h { max-width: 720px; margin-bottom: 28px; }
.blk-h h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -0.04em; line-height: 1.1; }
.blk-intro { color: var(--muted); font-size: 16px; margin: 10px 0 0; }
.blk-intro a { color: var(--ink); }
.blk--narrow > * { max-width: 820px; }
.blk--table > .table-wrap, .blk--table > .note { max-width: 980px; }
.h3 { font-size: 20px; letter-spacing: -0.025em; margin: 48px 0 12px; }

/* Inicio: accesos a las demás páginas */
.explore { padding-top: 64px; padding-bottom: 8px; }
.explore-h { font-size: clamp(1.4rem, 1.15rem + .8vw, 1.8rem); letter-spacing: -0.04em; margin: 0 0 22px; }
.xp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.xp-card { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 196px; padding: 22px 22px 24px; border-radius: 22px; background: var(--soft); color: var(--ink); text-decoration: none; transition: background .2s, transform .2s var(--ease); }
.xp-card:hover { background: #ececef; transform: translateY(-2px); }
.xp-t { margin-top: auto; font-size: 18px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.xp-d { font-size: 14px; color: var(--muted); line-height: 1.45; }
.xp-go { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--lime); font-size: 15px; transition: transform .2s var(--ease); }
.xp-card:hover .xp-go { transform: translateX(3px); }
.aviso-home { padding-top: 48px; padding-bottom: 80px; }
.aviso-home { max-width: 940px; }
.aviso-k { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); border-top: 1px solid var(--line); padding-top: 24px; margin: 0 0 10px; }

/* Llamada a la calculadora */
.cta { padding-top: 72px; padding-bottom: 88px; }
.cta-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; background: var(--ink); color: #fff; border-radius: 28px; padding: 32px 36px; }
.cta-t { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.2; margin: 0; max-width: 28ch; }
a.btn { text-decoration: none; }
.btn--lime { background: var(--lime); color: var(--ink); font-weight: 600; }
.btn--lime:hover { background: #d7fb6c; }

/* Ranking con su propio precio */
.rk-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: end; max-width: 720px; padding: 18px; border-radius: 24px; background: var(--soft); }
.rk-tools .inp, .rk-tools .seg { background: var(--bg); }
.rk-tools .inp:hover { background: var(--bg); }
.rk-tools .inp input { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; }
.rk-cap { color: var(--muted); font-size: 15px; margin: 26px 0 0; }
.rk-cap b { color: var(--ink); font-variant-numeric: tabular-nums; }
.rank { list-style: none; margin: 14px 0 0; padding: 0; max-width: 960px; }
.rk-row { display: grid; grid-template-columns: 230px minmax(0, 1fr) 96px 64px; align-items: center; gap: 16px; height: 40px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rk-name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-bar { height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.rk-bar i { display: block; height: 100%; border-radius: 999px; background: #cfcfd6; transition: width .5s var(--ease); }
.rk-val { text-align: right; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.rk-pct { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rk-row.is-sel .rk-name { color: var(--ink); font-weight: 600; }
.rk-row.is-sel .rk-name::after { content: "Tu comunidad"; margin-left: 8px; font-size: 10.5px; font-weight: 600; background: var(--lime); color: var(--ink); padding: 2px 6px; border-radius: 6px; vertical-align: 1px; }
.rk-row.is-sel .rk-bar i { background: var(--ink); }
.rk-more { margin: 28px 0 0; }

/* Tarjetas de tipos por comunidad */
.cc-group + .cc-group { margin-top: 48px; }
.cc-gh { display: flex; align-items: center; gap: 10px; font-size: 18px; letter-spacing: -0.025em; margin: 0 0 16px; }
.cc-gh span { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 2px 8px; }
.cc-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: -4px 0 18px; padding: 0; font-size: 13.5px; color: var(--muted); }
.cc-legend li { display: flex; align-items: center; gap: 8px; }
.cc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cc-grid--flat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cc { display: flex; flex-direction: column; padding: 20px 20px 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); scroll-margin-top: 96px; transition: border-color .2s, box-shadow .2s; }
.cc:hover { border-color: var(--line-2); }
.cc:target { border-color: var(--ink); box-shadow: 0 0 0 4px var(--lime); }
.cc-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; margin-bottom: 14px; }
.cc-h h3 { font-size: 16px; letter-spacing: -0.02em; }
.cc-tag { flex: none; font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.cc-tag--progressive { background: var(--lime-soft); color: var(--lime-ink); }
.cc-tag--whole { background: var(--ink); color: #fff; }
.cc-k { font-size: 11.5px; font-weight: 500; color: var(--faint); margin: 0 0 4px; }
.cc-rate { font-size: 40px; font-weight: 600; letter-spacing: -0.055em; line-height: 1; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.cc--flat .cc-rate { font-size: 36px; }
.cc-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; line-height: 1.45; }
.cc-scale { list-style: none; margin: 14px 0 10px; padding: 0; }
.cc-scale li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.cc-l { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cc-scale b { font-family: var(--mono); font-size: 13px; font-weight: 500; white-space: nowrap; }
.cc-new { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: auto 0 0; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.cc-new > div { min-width: 0; }
.cc-new dt { font-size: 11.5px; font-weight: 500; color: var(--faint); }
.cc-new dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.cc-new dd small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.note--wide { margin-top: 20px; max-width: 980px; }

/* Tablas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); }
thead th { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding-top: 0; }
tbody th { font-weight: 600; color: var(--ink); }
td { color: var(--ink-2); }
.pill { display: inline-block; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill--you { background: var(--ink); color: #fff; }
.pill--bank { background: var(--lime); color: var(--ink); }
.pill--seller { background: var(--soft); color: var(--ink-2); }
.who small { color: var(--faint); }
.note { font-size: 14px; color: var(--muted); background: var(--soft-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 20px; }
.note strong { color: var(--ink); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 980px; }
.stat { border-top: 2px solid var(--ink); padding-top: 18px; }
.stat-k { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 6px; }
.stat-v { font-size: clamp(2.4rem, 1.8rem + 1.6vw, 3.4rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1; margin: 0 0 16px; color: var(--ink); }
.stat-v span { font-size: .45em; letter-spacing: -0.02em; color: var(--muted); font-weight: 500; }
.stat p:last-child { font-size: 15px; color: var(--muted); margin: 0; }
.stat p:last-child strong { color: var(--ink); }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 18px 0 18px 56px; border-bottom: 1px solid var(--line); color: var(--muted); }
.steps li:first-child { padding-top: 0; }
.steps li:first-child::before { top: 0; }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 18px; font-family: var(--mono); font-size: 13px; color: var(--ink); }
.steps li strong { color: var(--ink); }

.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { list-style: none; cursor: pointer; position: relative; padding: 22px 44px 22px 0; font-size: 17px; font-weight: 500; letter-spacing: -0.015em; color: var(--ink); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; background: linear-gradient(var(--ink), var(--ink)) center/14px 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center/1.5px 14px no-repeat; transform: translateY(-50%); transition: transform .25s var(--ease); }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-a { color: var(--muted); padding: 0 44px 8px 0; }
.faq-a p { margin-bottom: 18px; }

.updated { font-size: 14px; color: var(--muted); max-width: 820px; }
.sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 24px; }
.sources h3 { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.sources ul { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.sources li { padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.4; }
.sources a { text-decoration: none; color: var(--ink-2); }
.sources a:hover { color: var(--ink); text-decoration: underline; }
.disclaimer p { font-size: 15px; color: var(--muted); margin: 0; }
.disclaimer strong { color: var(--ink); }

/* Páginas legales */
.no-mbar { --bar-h: 0px; }
.legal { max-width: 800px; padding-top: 64px; padding-bottom: 96px; }
.legal h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem); letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 28px; max-width: none; }
.legal h2 { font-size: 18px; letter-spacing: -0.02em; margin: 36px 0 8px; }
.legal p, .legal li { color: var(--ink-2); }

/* ---------- 8. Pie ---------- */
.ftr { background: var(--ink); color: #a1a1aa; padding: 44px 0 calc(44px + var(--bar-h)); font-size: 13px; }
.ftr-in { display: flex; flex-direction: column; gap: 24px; }
.ftr-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
.ftr-top p { margin: 0; }
.ftr-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 32px; padding-top: 20px; border-top: 1px solid #27272a; }
.ftr nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.ftr a { color: #e4e4e7; text-decoration: none; }
.ftr a:hover { color: #fff; }
.brand--inv { color: #fff; }
.brand--inv .brand-mark { background: var(--lime); color: var(--ink); }

/* ---------- 9. Barra móvil ---------- */
.mbar { display: none; }

/* ---------- 10. Responsive ---------- */
@media (max-width: 1080px) {
  .app { gap: 44px; }
  .xp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-grid--flat { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav a { padding: 8px 10px; }
}
@media (max-width: 900px) {
  :root { --bar-h: 72px; }
  .no-mbar { --bar-h: 0px; }
  .hdr { position: relative; }
  .hdr-in { flex-wrap: wrap; height: auto; padding-top: 12px; }
  .brand { height: 34px; }
  .nav { order: 2; flex: 1 0 100%; gap: 6px; margin: 10px -20px 0; padding: 0 20px 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; background: var(--soft); padding: 7px 13px; font-size: 13.5px; }
  .nav a[aria-current="page"] { background: var(--ink); color: #fff; }
  .nav a[aria-current="page"]::before { box-shadow: none; }
  .app { grid-template-columns: 1fr; gap: 36px; padding-top: 32px; padding-bottom: 40px; }
  .app-out { position: static; }
  h1 { max-width: 16ch; }
  .sub { margin-bottom: 28px; }
  .page-hero { padding-top: 40px; }
  .blk { padding-top: 48px; }
  .mbar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--ink); color: #fff; padding-bottom: env(safe-area-inset-bottom); }
  .mbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--bar-h); padding: 0 20px; max-width: 700px; margin: 0 auto; }
  .mbar-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
  .mbar-label { font-size: 11px; font-weight: 500; letter-spacing: .02em; color: #a1a1aa; }
  .mbar-num { font-size: 26px; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .mbar-btn { flex: none; background: var(--lime); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; padding: 11px 18px; border-radius: 999px; }
  }
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .nav { margin: 10px -16px 0; padding: 0 16px 12px; }
  h1 { font-size: 2.15rem; }
  .sub, .lead { font-size: 16px; }
  .grid-2 { grid-template-columns: 1fr; gap: 20px; }
  .inp--price input { height: 76px; }
  .out { padding: 22px 18px; border-radius: 22px; margin: 0 -4px; }
  .res-num { font-size: 3.6rem; }
  .receipt { padding: 18px 16px 18px; }
  .legend { grid-template-columns: 1fr; }
  .xp-grid { grid-template-columns: 1fr; gap: 10px; }
  .xp-card { min-height: 0; padding: 18px 64px 20px 20px; }
  .xp-go { top: 50%; transform: translateY(-50%); }
  .xp-card:hover .xp-go { transform: translate(3px, -50%); }
  .cc-grid { grid-template-columns: 1fr; gap: 12px; }
  .cc-grid--flat { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cc--flat { padding: 16px 14px 14px; }
  .cc--flat .cc-rate { font-size: 30px; }
  .cc--flat .cc-new { grid-template-columns: 1fr; gap: 8px; }
  .cc { padding: 20px 18px 18px; }
  .rk-tools { grid-template-columns: 1fr; padding: 14px; border-radius: 20px; }
  .stats { grid-template-columns: 1fr; gap: 28px; }
  .sources { grid-template-columns: 1fr; gap: 24px; }
  .rk-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name val" "bar bar"; gap: 6px 12px; height: auto; padding: 10px 0 12px; font-size: 14px; }
  .rk-name { grid-area: name; }
  .rk-val { grid-area: val; }
  .rk-bar { grid-area: bar; height: 6px; }
  .rk-pct { display: none; }
  .more summary small { flex-basis: 100%; }
  .ad-slot--leaderboard { max-width: 320px; min-height: 100px; }
  .faq-item summary { font-size: 16px; }
  .cta-in { padding: 26px 22px; border-radius: 22px; }
  .cta-in .btn { width: 100%; }
  /* Tabla de quién paga como lista */
  .who thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .who tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .who th, .who td { display: block; border: 0; padding: 3px 0; }
  .who tbody th { font-size: 15px; padding-bottom: 6px; }
  .who td { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 8px; }
  .who td::before { content: attr(data-label); font-family: var(--sans); font-size: 12px; color: var(--faint); }
  .who td > * { justify-self: start; }
  .who td > small { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar-seg, .rk-bar i, }
@media print {
  .hdr, .ad-slot, .mbar,   .app { display: block; padding: 0; }
  .out { background: #fff; }
}
