:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #1b1f24; --muted: #5b6573; --line: #d8dde4;
  --accent: #1a56db; --accent-text: #ffffff; --ok: #137a3a; --wait: #8a5a00; --bad: #b42318;
  --ok-bg: #e6f4ea; --wait-bg: #fff4d6; --bad-bg: #fde8e6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151a; --card: #1a2027; --text: #e8ecf1; --muted: #9aa5b3; --line: #2c3540;
    --accent: #6ea1ff; --accent-text: #0b1220; --ok: #5ed38a; --wait: #f1c35d; --bad: #ff8a80;
    --ok-bg: #12301d; --wait-bg: #382d0f; --bad-bg: #3b1714;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 52rem; margin: 0 auto; padding: 0 16px 48px; }
h1 { font-size: 1.5rem; margin: 1.25rem 0 0.5rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.25rem; }
a { color: var(--accent); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; overflow-wrap: anywhere; }
.top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.status { color: var(--muted); font-size: 0.9rem; }
.status .ok { color: var(--ok); }
.status .blockers { color: var(--bad); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 12px 0; }
label { display: block; margin: 10px 0; font-size: 0.9rem; color: var(--muted); }
input, textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
input:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: inherit; cursor: pointer; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
form.inline { display: inline; margin-left: auto; }
.actions form.inline { margin-left: 0; margin-right: 8px; }
.notice { padding: 10px 12px; border-radius: 6px; margin: 12px 0; }
.notice.error { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.small { font-size: 0.85rem; color: var(--muted); }
.chip { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.wait { background: var(--wait-bg); color: var(--wait); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
ul.versions, ul.checklist, ul.codes { list-style: none; padding: 0; margin: 8px 0; }
li.version { padding: 8px 0; border-top: 1px solid var(--line); }
ul.codes { columns: 2; }
ul.checklist li { padding: 3px 0; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--accent); }
@media (max-width: 480px) { ul.codes { columns: 1; } .card { padding: 12px; } }

/* Screens: navigation, kill-switch link, tables, meters, alerts (WP-9). Colour is never the only signal; every state also has words. */
.top .stop { color: var(--bad); font-weight: 600; text-decoration: none; border: 1px solid var(--bad); border-radius: 6px; padding: 2px 10px; }
.nav, .filters { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.filters { border-bottom: none; padding-top: 0; }
.nav a, .filters a { text-decoration: none; padding: 6px 2px; }
.nav a[aria-current="page"], .filters a[aria-current="page"] { font-weight: 700; border-bottom: 2px solid var(--accent); }
.blocker-list { margin: 8px 0; }
.blockers-list, ul.plain, ul.alerts { list-style: none; padding: 0; margin: 8px 0; }
ul.alerts li { padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
ul.alerts li.critical { border-left: 4px solid var(--bad); padding-left: 10px; }
.inline-form { margin-top: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); font-weight: 600; }
.scroll { overflow-x: auto; }
meter { width: 100%; height: 14px; }
.meter { margin: 12px 0; }
dl.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 8px 16px; margin: 8px 0; }
dl.facts div { padding: 6px 0; border-top: 1px solid var(--line); }
dl.facts dt { color: var(--muted); font-size: 0.85rem; }
dl.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
blockquote { margin: 8px 0; padding: 8px 12px; border-left: 4px solid var(--bad); background: var(--bad-bg); overflow-wrap: anywhere; }
label.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
label.check input { display: inline-block; width: auto; margin-top: 4px; }
form.search { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
form.search label { flex: 1 1 14rem; margin: 0; }
@media (max-width: 480px) { th, td { padding: 6px 4px; } .nav { gap: 2px 10px; } }

/* The approval card and the candle chart (WP-9). */
figure.chart { margin: 8px 0; }
figure.chart svg { width: 100%; height: auto; display: block; }
.chart-bg { fill: var(--card); }
.chart .candle line { stroke-width: 1; }
.chart .candle.up line, .chart .candle.up rect { stroke: var(--ok); fill: var(--ok); }
.chart .candle.down line, .chart .candle.down rect { stroke: var(--bad); fill: var(--bad); }
.chart .line line { stroke-width: 1; stroke-dasharray: 4 3; stroke: var(--muted); }
.chart .line text { font-size: 10px; fill: var(--muted); }
.chart .line.entry line { stroke: var(--accent); stroke-dasharray: none; }
.chart .line.entry text { fill: var(--accent); }
.chart .line.stop line, .chart .line.stop text { stroke: var(--bad); fill: var(--bad); stroke-dasharray: none; }
.chart .line.stop text { stroke: none; }
.chart .line.target line, .chart .line.target text { stroke: var(--ok); fill: var(--ok); stroke-dasharray: none; }
.chart .line.target text { stroke: none; }
ol.progress { list-style: none; padding: 0; margin: 8px 0; }
ol.progress li { padding: 3px 0; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Settings (WP-9). */
ul.settings { list-style: none; padding: 0; margin: 8px 0; }
li.setting { padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
form.setting-form { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
form.setting-form input, form.setting-form select { flex: 1 1 12rem; width: auto; margin: 0; }
.pending { margin-top: 6px; padding: 8px 10px; background: var(--wait-bg); border-radius: 6px; }

/* Analysts and providers (WP-9). */
.actions-block form { margin: 10px 0; padding-top: 8px; border-top: 1px solid var(--line); }
pre.prompt { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 0.85rem; max-height: 24rem; overflow: auto; }
ul.reasons li { margin: 4px 0; }
