:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #d8dee7;
  --text: #0f172a;
  --text-muted: #5a6982;
  --accent: #4a7c00;
  --accent-text: #ffffff;
  --warn-bg: #fef6e7;
  --warn-border: #e0b34d;
  --warn-text: #6b4a05;
  --radius: 6px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #131c2e;
    --surface-alt: #1b2639;
    --border: #2c3852;
    --text: #e6ecf5;
    --text-muted: #9aa9c0;
    --accent: #76b900;
    --accent-text: #0b1120;
    --warn-bg: #33280d;
    --warn-border: #7d6320;
    --warn-text: #f0d089;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

main, .ref-masthead, .crumbs, .ref-footer {
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

.ref-masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 0 0.9rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.cta {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.crumbs {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.8rem 0 0;
}

.crumbs .sep { margin: 0 0.45rem; opacity: 0.6; }

h1 {
  font-size: 1.7rem;
  line-height: 1.25;
  margin: 0.7rem 0 0.5rem;
}

h2 {
  font-size: 1.15rem;
  margin: 2rem 0 0.6rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

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

.standfirst {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0 0 1.2rem;
}

p { margin: 0 0 0.9rem; }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-alt);
  padding: 0.1em 0.32em;
  border-radius: 3px;
}

/* Wide tables scroll inside their own box rather than the page. */
.table-wrap { overflow-x: auto; margin: 0 0 1rem; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface-alt);
}

tbody tr:last-child td { border-bottom: none; }

td.num { text-align: right; font-variant-numeric: tabular-nums; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.7rem;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
}

.spec-grid li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}

.spec-grid .k {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.spec-grid .v { font-size: 1.05rem; font-weight: 600; }

.note {
  background: var(--surface-alt);
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
}

.note.warn {
  background: var(--warn-bg);
  border-left-color: var(--warn-border);
  color: var(--warn-text);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 0.12em 0.5em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  vertical-align: middle;
}

.badge.confirmed { border-color: var(--accent); color: var(--accent); }
.badge.needs-verification,
.badge.placeholder {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
  padding: 0;
  margin: 0 0 1.2rem;
  list-style: none;
}

.card-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
}

.card-list a { font-weight: 600; text-decoration: none; }
.card-list a:hover { text-decoration: underline; }
.card-list p { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--text-muted); }

ul.plain { padding-left: 1.1rem; }
ul.plain li { margin-bottom: 0.35rem; }

.source {
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
  margin-top: 1.6rem;
}

.ref-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
