:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5b6676;
  --border: #dfe3e9;
  --accent: #0b7a5c;
  --accent-soft: #e6f4ef;
  --error: #b42318;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b2129;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --border: #2c3440;
    --accent: #3ccf9e;
    --accent-soft: #173229;
    --error: #ff8a80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--accent); }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
header.site .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  padding-top: 12px; padding-bottom: 12px;
}
header.site .logo { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.1rem; }
header.site .logo span { color: var(--accent); }
header.site nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95rem; }
header.site nav a { text-decoration: none; color: var(--muted); }
header.site nav a:hover, header.site nav a[aria-current] { color: var(--accent); }

main { padding: 24px 0 48px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin-top: 36px; }
h3 { font-size: 1.05rem; margin: 20px 0 8px; }
.lead { color: var(--muted); margin-top: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
}

form .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select {
  width: 100%; padding: 10px 12px; font: inherit;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.inline { display: flex; gap: 8px; }
.inline select { width: auto; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; }
button {
  margin-top: 18px; padding: 11px 22px; font: inherit; font-weight: 600;
  background: var(--accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer;
}
@media (prefers-color-scheme: dark) { button { color: #0b1a14; } }

#resultado { border-color: var(--accent); }
.destacado { font-size: 1.15rem; background: var(--accent-soft); padding: 12px 14px; border-radius: 8px; margin-top: 0; }
table.res { width: 100%; border-collapse: collapse; }
table.res th, table.res td { padding: 8px 4px; border-bottom: 1px solid var(--border); text-align: left; font-weight: 400; }
table.res td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.res tr.total th, table.res tr.total td { font-weight: 700; border-bottom: 0; }
.dias { color: var(--muted); font-size: .85rem; }
.nota { color: var(--muted); font-size: .9rem; }
.error { color: var(--error); }

.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tools a.card { display: block; margin: 0; text-decoration: none; color: var(--text); }
.tools a.card:hover { border-color: var(--accent); }
.tools a.card strong { display: block; color: var(--accent); margin-bottom: 4px; }

/* Espacio reservado para anuncios (AdSense) */
.ad-slot {
  min-height: 100px; margin: 24px 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--muted); font-size: .8rem;
}

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