:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1b2533;
  --muted: #5b6676;
  --line: #e2ddd2;
  --accent: #0b7a62;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2ec;
  --warn-bg: #fff6e0;
  --warn-line: #f0d48a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .05), 0 6px 20px rgba(20, 30, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1a2029;
    --ink: #e8ebef;
    --muted: #a2abb8;
    --line: #2c3440;
    --accent: #3cc5a0;
    --accent-ink: #0d1a16;
    --accent-soft: #17312a;
    --warn-bg: #2d2615;
    --warn-line: #6a5521;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Cabecera */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* Tipografía */
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); line-height: 1.15; letter-spacing: -.02em; margin: 32px 0 10px; }
h2 { font-size: 1.4rem; line-height: 1.25; margin: 40px 0 10px; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; margin: 24px 0 6px; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 24px; max-width: 70ch; }
.badge { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 12px; margin-top: 28px; }
.prose p, .prose li { max-width: 72ch; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-top: 18px; }
.breadcrumb a { color: var(--muted); }

/* Calculadora */
.calc { display: grid; grid-template-columns: 1fr; gap: 20px; margin: 8px 0 12px; }
@media (min-width: 820px) { .calc { grid-template-columns: 1.05fr 1fr; align-items: start; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.field { margin-bottom: 16px; }
.field label, .field .label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
input[type="number"], input[type="date"], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 46px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; margin-bottom: 14px; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); }
.btn { display: inline-block; width: 100%; font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 13px 18px; background: var(--accent); color: var(--accent-ink); cursor: pointer; min-height: 48px; }
.btn:hover { filter: brightness(1.05); }

.result-main { text-align: center; padding: 6px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.result-label { font-size: .9rem; color: var(--muted); }
.result-big { font-size: clamp(2rem, 7vw, 2.7rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--accent); }
.result-sub { font-size: .95rem; color: var(--muted); margin-top: 4px; }
.breakdown { width: 100%; border-collapse: collapse; font-size: .95rem; }
.breakdown td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.breakdown td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 12px; }
.breakdown tr.total td { font-weight: 700; border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 12px 14px; font-size: .9rem; margin-top: 14px; }

/* Tablas de contenido */
.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--surface); border-radius: 10px; overflow: hidden; }
table.data th, table.data td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
table.data th { background: var(--accent-soft); }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 2px; }

/* Portada */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 20px 0; }
.tool { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.tool:hover { transform: translateY(-2px); border-color: var(--accent); }
.tool h2, .tool h3 { margin: 0 0 6px; font-size: 1.15rem; }
.tool p { margin: 0; color: var(--muted); font-size: .95rem; }
.tool .go { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 700; font-size: .95rem; }
.tool.soon { opacity: .7; box-shadow: none; }
.tool.soon:hover { transform: none; border-color: var(--line); }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 0; list-style: none; }
.points li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.points strong { display: block; margin-bottom: 4px; }

.related { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; list-style: none; }
.related a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; }

.placeholder { background: var(--warn-bg); border-bottom: 2px dashed var(--warn-line); padding: 0 4px; }

/* Pie */
.site-footer { margin-top: 56px; padding: 28px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }
