:root {
  --bg: #f6f7f4;
  --card: #ffffff;
  --text: #15171a;
  --muted: #5d6470;
  --line: #e3e5e0;
  --brand: #12a150;
  --brand-ink: #ffffff;
  --brand-soft: #e4f6ec;
  --warn-soft: #fff5db;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1113;
    --card: #181b1e;
    --text: #eef0f2;
    --muted: #9aa3ad;
    --line: #2a2f34;
    --brand: #2fcf73;
    --brand-ink: #06210f;
    --brand-soft: #143322;
    --warn-soft: #2e2710;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Cabecera */
.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 800; font-size: 1.35rem; text-decoration: none; letter-spacing: -.02em; display: flex; align-items: center; gap: 6px; }
.logo .check { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: .9rem; }
.top nav a { text-decoration: none; color: var(--muted); font-size: .95rem; }

/* Portada */
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; margin: 0 0 12px; letter-spacing: -.03em; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: 1.1rem; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.badge { background: var(--brand-soft); color: var(--text); border-radius: 999px; padding: 4px 12px; font-size: .85rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 24px 0 48px; }
.tool { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
a.tool:hover { transform: translateY(-2px); border-color: var(--brand); }
.tool .ico { font-size: 1.8rem; }
.tool h3 { margin: 8px 0 4px; font-size: 1.1rem; }
.tool p { margin: 0; color: var(--muted); font-size: .95rem; }
.tool.soon { opacity: .6; }
.tag { display: inline-block; margin-top: 10px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--brand-soft); }

/* Herramienta */
.page-head { padding: 32px 0 8px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 5vw, 2.2rem); letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 16px 0; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.seg { display: flex; gap: 6px; }
.seg label { flex: 1; margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; text-align: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; }
.seg input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.check-row { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check-row input { width: auto; margin-top: 4px; }
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer; background: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }

.result h2 { margin: 0 0 12px; font-size: 1.1rem; }
.total { font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; color: var(--brand); margin: 4px 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
td small { color: var(--muted); display: block; }
tr.sub td { font-weight: 800; border-bottom: 2px solid var(--text); }
.note { background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin-top: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.info h2 { font-size: 1.2rem; margin-top: 28px; }
.info p, .info li { color: var(--muted); }
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 24px 0 40px; margin-top: 32px; }

@media print {
  .top, .form-panel, .info, footer, .actions { display: none !important; }
  body { background: #fff; color: #000; }
}
