:root {
  color-scheme: light dark;
  --bg: #f3f6f2;
  --ink: #14241c;
  --muted: #243f34;
  --line: #d5e0d8;
  --card: #ffffff;
  --metric: #e5f2ec;
  --accent: #085544;
  --accent-ink: #ffffff;
  --accent-hover: #064536;
  --link: #085544;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101714;
    --ink: #e8f3ec;
    --muted: #c5d6cc;
    --line: #2d3d35;
    --card: #18211c;
    --metric: #1c312c;
    --accent: #8fd8c4;
    --accent-ink: #06241c;
    --accent-hover: #b3eadb;
    --link: #9ee0cc;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

main { flex: 1; }

:focus {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--card);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  z-index: 2;
}

.skip:focus { transform: none; }

a { color: var(--link); text-underline-offset: 0.15em; }

.logo {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.logo:hover, .logo:focus { text-decoration: underline; }

header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 4px 0 var(--accent);
}

.header-inner, .footer-inner, main {
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.25rem;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--ink);
}

nav a[aria-current="page"] { font-weight: 700; }

main { padding: 1.6rem 0 2.75rem; }

h1 {
  font-size: clamp(1.85rem, 4.4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.7rem;
}

h2 { font-size: 1.35rem; line-height: 1.25; margin: 2rem 0 0.6rem; }

h3 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }

p, li { max-width: 42rem; }

.lede { font-size: 1.15rem; margin-top: 0; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.1rem 1.15rem 1.25rem;
  max-width: 42rem;
  margin-top: 1.25rem;
}

.panel h2 { margin-top: 0; }

#status { font-weight: 700; margin: 0 0 0.75rem; }

.meter {
  height: 0.5rem;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 1rem;
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.button {
  appearance: none;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  min-height: 48px;
  min-width: 11rem;
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--accent);
  border-radius: 0.5rem;
  cursor: pointer;
}

.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.button:disabled {
  background: var(--line);
  border-color: var(--line);
  color: var(--ink);
  cursor: not-allowed;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}

.metrics div {
  background: var(--metric);
  border-radius: 0.5rem;
  padding: 0.7rem 0.8rem 0.8rem;
}

.metrics dt {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

.metrics dd {
  margin: 0.15rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(1.7rem, 7vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.unit { color: var(--muted); }

#summary { margin-bottom: 0.4rem; }

.note, footer, .source { color: var(--muted); }

footer {
  border-top: 1px solid var(--line);
  padding: 1.1rem 0 2rem;
  font-size: 0.98rem;
}

footer p { margin: 0.35rem 0; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95em; }

.table-scroll { overflow-x: auto; max-width: 42rem; }

table { width: 100%; border-collapse: collapse; }

caption { text-align: left; font-weight: 700; color: var(--ink); margin: 0 0 0.4rem; }

th, td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

ul, ol { padding-left: 1.2rem; }

li + li { margin-top: 0.35rem }

.form { max-width: 42rem; }

.form label { display: block; font-weight: 700; margin: 0.95rem 0 0.35rem; }

.form input, .form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.65rem 0.7rem;
  min-height: 48px;
}

.form textarea { min-height: 9rem; resize: vertical; }

.form-error { font-weight: 700; }

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 380px) {
  .metrics { grid-template-columns: 1fr; }
}

@media (forced-colors: active) {
  .button { border: 2px solid ButtonText; }
  .meter span { background: Highlight; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
