:root {
  --bg: #ffffff;
  --soft: #f6f7f5;
  --surface: #ffffff;
  --text: #16201b;
  --muted: #64716a;
  --line: #e4e7e3;
  --brand: #0f6b4f;
  --brand-ink: #ffffff;
  --brand-soft: #eef6f2;
  --res-bg: #f2f8f5;
  --res-line: #cfe5d9;
  --accent: #c2410c;
  --radius: 14px;
  --max: 760px;
  --shadow: 0 1px 2px rgba(16, 32, 24, .04), 0 4px 16px rgba(16, 32, 24, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412; --soft: #151c19; --surface: #18201c; --text: #e7eee9; --muted: #9eb0a6;
    --line: #28322d; --brand: #43b98f; --brand-ink: #0b1310; --brand-soft: #1a2a23;
    --res-bg: #15241d; --res-line: #24443a; --accent: #fb923c; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
a { color: var(--brand); text-underline-offset: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Encabezado */
header.site { border-bottom: 1px solid var(--line); background: var(--bg); }
header.site .wrap { display: flex; align-items: center; gap: 20px; min-height: 56px; }
.logo { font-weight: 800; font-size: 1.05rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.logo span { color: var(--brand); }
nav.top { display: flex; gap: 18px; font-size: 0.9rem; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
nav.top::-webkit-scrollbar { display: none; }
nav.top a { color: var(--muted); text-decoration: none; white-space: nowrap; padding: 4px 0; }
nav.top a:hover, nav.top a[aria-current] { color: var(--text); }
nav.top a[aria-current] { box-shadow: inset 0 -2px 0 var(--brand); }
@media (max-width: 640px) { nav.top a[href="/"] { display: none; } }

main { padding: 20px 0 48px; }
.crumbs { font-size: 0.8rem; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs span { margin: 0 6px; opacity: .6; }
h1 { font-size: clamp(1.7rem, 5vw, 2.35rem); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.025em; font-weight: 700; }
h2 { font-size: 1.3rem; margin: 36px 0 8px; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; margin: 20px 0 4px; }
.lead { color: var(--muted); margin: 0 0 22px; font-size: 1rem; }
.updated { font-size: 0.82rem; color: var(--muted); }

/* Calculadora */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
form.calc { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } .card { padding: 16px; } }
label { display: grid; gap: 5px; font-weight: 600; font-size: 0.85rem; color: var(--text); align-content: start; }
label small { font-weight: 400; color: var(--muted); font-size: 0.78rem; order: 3; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.92rem; }
input, select {
  font: inherit; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--soft); color: var(--text); width: 100%; min-height: 46px;
  transition: border-color .15s, background .15s;
}
input:hover, select:hover { border-color: #cdd3ce; }
input:focus, select:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
label.check input { width: 20px; min-height: 20px; accent-color: var(--brand); }
.money-in { position: relative; display: block; }
.money-in > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; pointer-events: none; }
.money-in input { padding-left: 26px; }

/* Resultado */
#resultado { margin-top: 18px; }
.res-hero { background: var(--res-bg); border: 1px solid var(--res-line); border-radius: 12px; padding: 18px 20px; margin-bottom: 8px; }
.res-label { margin: 0; color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.res-amount { margin: 2px 0 0; font-size: clamp(2.3rem, 9vw, 3.2rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.res-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--res-line); }
.res-stats dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.res-stats dd { margin: 2px 0 0; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.res-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.res-table th, .res-table td { padding: 11px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.res-table th { font-weight: 500; }
.res-table td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.res-table .res-total th, .res-table .res-total td { font-weight: 800; border-bottom: 0; font-size: 1rem; }
.res-table .res-sub th, .res-table .res-sub td { font-weight: 700; }
.res-note { font-size: 0.88rem; color: var(--muted); }
.res-error { color: var(--accent); font-weight: 600; margin: 0; }

/* Tarjetas de calculadoras */
.tools { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 16px 0; padding: 0; list-style: none; }
.tools a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.tools a:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.tools strong { display: block; color: var(--text); margin-bottom: 4px; }
.tools strong::after { content: " →"; color: var(--brand); }
.tools span { font-size: 0.9rem; color: var(--muted); }

.ad-slot { margin: 24px 0; min-height: 100px; display: flex; align-items: center; justify-content: center; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 8px 0 0; }
.disclaimer { font-size: 0.82rem; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 12px 14px; margin-top: 28px; }
.related { margin-top: 32px; }
footer.site { border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: 0.85rem; color: var(--muted); background: var(--soft); }
footer.site nav { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
footer.site a { color: var(--muted); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 8px 0; }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
table.data thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.grid2.fija { grid-template-columns: 1.4fr 1fr; }
details.mas { border: 0; padding: 0; }
details.mas > summary { font-size: 0.88rem; color: var(--brand); font-weight: 600; list-style: none; }
details.mas > summary::-webkit-details-marker { display: none; }
details.mas > summary::before { content: "+ "; }
details.mas[open] > summary::before { content: "− "; }
.mas-in { display: grid; gap: 14px; margin-top: 14px; }
.grid2.par { grid-template-columns: 1fr 1fr; }
[data-show-if]:not([hidden]) { display: grid; gap: 14px; }
@media (max-width: 380px) { .grid2.par { grid-template-columns: 1fr; } }
.grid2 > *, label { min-width: 0; }
input, select { min-width: 0; }
.res-stats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 420px) { .res-stats dd { font-size: 0.95rem; } .res-stats dt { font-size: 0.64rem; } .res-hero { padding: 16px; } }

/* PDF de pago */
.pdf-cta { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; margin-top: 16px; padding: 16px; border: 1px dashed var(--res-line); border-radius: 12px; }
.pdf-cta strong { display: block; font-size: 0.95rem; }
.pdf-cta span { display: block; font-size: 0.85rem; color: var(--muted); }
.pdf-msg { grid-column: 1 / -1; margin: 0; font-size: 0.85rem; color: var(--accent); }
.pdf-msg:empty { display: none; }
@media (max-width: 560px) { .pdf-cta { grid-template-columns: 1fr; } .pdf-cta .go { width: 100%; } }
.go, a.go { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 12px 18px; min-height: 46px; background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.go:hover { filter: brightness(1.08); }
.go:disabled { opacity: .6; cursor: wait; }
.descarga #descarga-estado { font-weight: 600; margin-top: 0; }
