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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171412;
    --surface: #211d1a;
    --text: #f3ede7;
    --muted: #b0a59b;
    --border: #3a332d;
    --accent: #2dd4bf;
    --accent-ink: #04201d;
    --accent-soft: #122b28;
    --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"], input[type="text"], select, textarea {
  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; }
}

textarea { min-height: 84px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .row { grid-template-columns: 1fr 1fr; } }
.radio { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin: 4px 0; }
.manager { border: 1px dashed var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.errors { background: var(--accent-soft); border-left: 4px solid var(--error); border-radius: 10px; padding: 10px 14px; }
.errors ul { margin: 0; padding-left: 18px; color: var(--error); }

.tools { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tool { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.tool:hover { border-color: var(--accent); }
.tool h3 { margin: 0 0 6px; color: var(--accent); }
.tool p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: middle; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tab { font: inherit; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.doc { background: #fff; color: #111; border: 1px solid var(--border); border-radius: 6px; padding: 28px; font-family: "Times New Roman", Georgia, serif; font-size: 15px; line-height: 1.55; white-space: pre-wrap; }
.doc .doc-title { text-align: center; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 14px; }
.doc p { margin: 0 0 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions .btn { width: auto; }
.steps { padding-left: 22px; }
.steps li { margin-bottom: 10px; }

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .hero, .no-print, .tabs, .actions { display: none !important; }
  .card { border: 0; padding: 0; margin: 0; }
  .doc { border: 0; padding: 0; font-size: 12pt; }
}
@media (max-width: 599px) { .doc { padding: 16px; font-size: 14px; } }
.scen-cards { display: none; }
.scen-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.scen-card.scen-best { border-color: var(--accent); background: var(--accent-soft); }
.scen-card h3 { margin: 0 0 8px; font-size: 1rem; }
.scen-card dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-size: 0.92rem; }
.scen-card dt { color: var(--muted); }
.scen-card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.scen-card .scen-net { font-weight: 700; color: var(--text); }
@media (max-width: 599px) { .scen-cards { display: block; } .scen-table { display: none; } }
