:root {
  --bg: #fdfaf6;
  --surface: #ffffff;
  --text: #1f1a17;
  --muted: #6b625b;
  --border: #e8e0d7;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fff1e8;
  --error: #b91c1c;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171412;
    --surface: #211d1a;
    --text: #f3ede7;
    --muted: #b0a59b;
    --border: #3a332d;
    --accent: #fb923c;
    --accent-ink: #1a0f08;
    --accent-soft: #2f2119;
    --error: #f87171;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

.site-header { border-bottom: 1px solid var(--border); padding: 14px 0; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.1rem; }
.brand span { color: var(--accent); }

.hero { padding: 32px 0 16px; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.15; margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 1.1rem; margin: 0; }

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

.field { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="date"], input[type="number"] {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
input:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hint { color: var(--muted); font-size: 0.9rem; margin: 6px 0 0; }
.error { color: var(--error); font-weight: 600; }

.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

.months { margin-bottom: 18px; }
.months-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.months-grid label { font-weight: 500; font-size: 0.85rem; margin-bottom: 2px; color: var(--muted); }
.months-grid input { padding: 6px 8px; }

.options { margin-bottom: 18px; }
.options summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 10px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); margin-top: 16px; }

.results { margin: 24px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.stat-main { background: var(--accent-soft); border-color: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-value { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 0.85rem; }

.notes p { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin: 12px 0 0; font-size: 0.95rem; }

.dates { padding-left: 20px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
th { color: var(--muted); font-weight: 600; }
.num { text-align: right; }
tr.second td { color: var(--muted); }
tr.phase-row td { font-weight: 700; color: var(--text); background: var(--accent-soft); }

.partners ul { padding-left: 20px; }

.content { margin: 32px 0; }
.content h2 { margin-top: 32px; }
.content details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.content summary { cursor: pointer; font-weight: 600; }

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

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 600px) {
  .btn { width: auto; }
}
