:root {
  color-scheme: light;
  --ink: #1b2430;
  --muted: #5b6675;
  --line: #e2e6ec;
  --bg: #ffffff;
  --soft: #f5f7fa;
  --accent: #0f5c4d;
  --accent-ink: #ffffff;
  --field-bg: #ffffff;
  --field-border: #c3cad4;
  --total-bg: #eaf4f1;
  --error: #a12a2a;
  --focus: #9ad3c6;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7edf4;
  --muted: #a3b0bf;
  --line: #2a3646;
  --bg: #0e151d;
  --soft: #151e29;
  --accent: #4cc2a6;
  --accent-ink: #05211b;
  --field-bg: #0b1118;
  --field-border: #3d4d61;
  --total-bg: #14302a;
  --error: #ff9a9a;
  --focus: #2f8573;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 1rem; }
.notice {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding: 0.4rem 1rem;
}
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.9rem; padding-bottom: 0.9rem; flex-wrap: wrap; gap: 0.5rem;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--accent); text-decoration: none; }
.header-right { display: flex; align-items: center; gap: 0.25rem; }
nav a { margin-left: 1rem; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
nav a:hover { text-decoration: underline; }
main { padding-top: 1.5rem; padding-bottom: 2.5rem; min-height: 60vh; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.3rem; margin-top: 2rem; }
a { color: var(--accent); }
.lead { font-size: 1.1rem; color: var(--muted); }
.card {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.25rem; background: var(--soft); margin: 1.25rem 0;
}
.state-list { list-style: none; padding: 0; display: grid; gap: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.state-list li { border: 1px solid var(--line); border-radius: 8px; padding: 0.7rem 0.9rem; }
.state-list .soon { color: var(--muted); font-size: 0.85rem; }
.site-footer { border-top: 1px solid var(--line); background: var(--soft);
  font-size: 0.85rem; color: var(--muted); padding: 1.2rem 0; }

/* Calculator */
.meta { font-size: 0.85rem; color: var(--muted); margin-top: 0; }
.calc { border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.25rem; background: var(--soft); margin: 1.25rem 0; }
.calc label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; }
.calc label:first-child { margin-top: 0; }
.calc .optional { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.calc select, .calc input[type="text"] {
  width: 100%; padding: 0.6rem 0.7rem; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--field-border); border-radius: 6px; background: var(--field-bg); color: var(--ink);
}
.calc select:focus, .calc input:focus, .calc button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 0; }
.calc button {
  margin-top: 1.1rem; padding: 0.7rem 1.4rem; font-size: 1rem; font-weight: 600; font-family: inherit;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; cursor: pointer;
}
.calc button:hover { filter: brightness(1.1); }
.result { margin: 1rem 0; }
.result h2 { margin-top: 0.5rem; }
.result-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1rem; }
.result-table th, .result-table td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.result-table td { white-space: nowrap; }
.result-table tr.total th, .result-table tr.total td { font-weight: 700; background: var(--total-bg); border-bottom: 2px solid var(--accent); }
.error { color: var(--error); font-weight: 600; }
@media (max-width: 520px) { .result-table td { white-space: normal; } }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; margin-left: 0.75rem; padding: 0;
  background: transparent; color: var(--ink); cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%;
}
.theme-toggle:hover { background: var(--soft); }
.theme-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-toggle svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
