/* Design tokens and base styles, carried over from the concept mockup (mockup/index.html) */
:root {
  --ground: #F1F4EE; --surface: #FFFFFF; --surface-2: #E8EDE5; --line: #D5DCD1; --line-2: #BAC4B6;
  --ink: #14201A; --ink-2: #44524A; --ink-3: #6B7870;
  --accent: #1F5B3A; --accent-ink: #FFFFFF; --accent-soft: #DDEBE0;
  --flag: #E0337A; --series: #2a78d6;
  --st-active: #d03b3b; --st-monitor: #e09a00; --st-restored: #0ca30c; --st-reported: #7a857e;
  --shadow: 0 1px 2px rgba(20,32,26,.06), 0 10px 28px rgba(20,32,26,.08);
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0F1512; --surface: #161E19; --surface-2: #1F2923; --line: #2B3730; --line-2: #3B4840;
    --ink: #E6ECE7; --ink-2: #AEBAB2; --ink-3: #86938B;
    --accent: #72C394; --accent-ink: #0B150F; --accent-soft: #1D3627;
    --flag: #FF5E9C; --series: #3987e5;
    --st-active: #e25c5c; --st-monitor: #fab219; --st-restored: #2fb52f; --st-reported: #95a19a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-body); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--flag); outline-offset: 2px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.latin { font-style: italic; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }

/* top bar */
.bar { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand-name { font-family: var(--font-display); font-size: 21px; font-weight: 650; letter-spacing: -.02em; }
.brand-sub { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; padding-left: 10px; border-left: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; }
.tab { padding: 7px 13px; border-radius: 8px; color: var(--ink-2); font-weight: 550; text-decoration: none; white-space: nowrap; }
.tab:hover { background: var(--surface-2); }
.tab[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

main { max-width: 1340px; margin: 0 auto; padding: 22px 24px 36px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.view-head h1 { font-size: 27px; font-weight: 650; line-height: 1.15; }
.view-head p { color: var(--ink-2); max-width: 66ch; margin-top: 4px; }
.crumb { font-size: 13px; margin-bottom: 6px; display: inline-block; }
footer { max-width: 1340px; margin: 0 auto; padding: 0 24px 32px; font-size: 12px; color: var(--ink-3); }
footer p { max-width: 110ch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.card-body { padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.card-body > .btn { justify-self: start; }
.card h2 { font-size: 16px; font-weight: 650; }
.hsub { font-size: 12.5px; color: var(--ink-3); margin: 2px 0 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 18px; align-items: start; }
.empty { padding: 28px 18px; color: var(--ink-3); text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--ink); text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.button_to { display: inline; }

/* statuses */
.st-active { --c: var(--st-active); }
.st-monitoring { --c: var(--st-monitor); }
.st-restored { --c: var(--st-restored); }
.st-reported, .st-dismissed { --c: var(--st-reported); }
.glyph { flex: none; }
.glyph .fill { fill: var(--c); }
.glyph .hollow { fill: var(--surface); stroke: var(--c); stroke-width: 1.8; stroke-dasharray: 2.2 1.5; }
.glyph .tick { fill: none; stroke: var(--surface); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 6px; border-radius: 999px; background: color-mix(in oklab, var(--c) 15%, var(--surface)); color: var(--ink); white-space: nowrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag.inv { border-color: color-mix(in oklab, var(--st-active) 45%, transparent); color: var(--st-active); }
.tag.nat { border-color: color-mix(in oklab, var(--st-restored) 45%, transparent); color: var(--st-restored); }
.tag.warn { border-color: color-mix(in oklab, var(--st-monitor) 55%, transparent); color: var(--ink); }

/* chips (filters) */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.toolbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 550; color: var(--ink); text-decoration: none; }
.chip .n { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.chip[aria-current="true"] { background: var(--surface-2); border-color: var(--ink-3); }

/* facts and notes */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.facts div { display: grid; gap: 1px; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.callout { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); margin-bottom: 14px; }
.err { padding: 10px 12px; border-radius: 8px; background: color-mix(in oklab, var(--st-active) 12%, var(--surface)); font-size: 13px; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td a.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
td a.row-link:hover { text-decoration: underline; }
td input[type=checkbox], th input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
tr.skip td:not(:first-child), tr.skip .latin { color: var(--ink-3); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 5px 0; }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--surface); border: 2px solid var(--ink-3); box-shadow: 0 0 0 3px var(--surface); z-index: 1; }
.timeline .d { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }

/* forms */
.field { display: grid; gap: 4px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.input, .select { font-size: 14px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); }

@media (max-width: 1040px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; gap: 10px 16px; padding: 10px 14px; }
  .brand-sub { display: none; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  main { padding: 16px 14px 28px; }
}
