/* ─────────────────────────────────────────────────────────────────────────────
   BRAND COLORS AND FONTS: edit this block to restyle the whole site.
   Light values first, dark values in the block below. Names and text live in
   shared/brand.js.
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #e9edf1;
  --fg: #141b22;
  --muted: #56626e;
  --line: #d5dce3;
  --accent: #1f4fd1;
  --accent-ink: #ffffff;
  --accent-soft: #e3eaff;
  --down: #c62828;
  --down-soft: #fdeaea;
  --warn: #a85400;
  --warn-soft: #fff1e0;
  --ok: #1d7a46;
  --ok-soft: #e3f4ea;
  --note: #fff6cf;
  --note-fg: #5c4700;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 10px;
}
/* Dark values. Used when the visitor picks dark with the switch in the header,
   or when their device is set to dark and they haven't picked light. */
:root[data-theme="dark"] {
  --bg: #0e1318; --surface: #161d24; --surface-2: #1e2731; --fg: #e8edf2; --muted: #95a2ae; --line: #2b3641;
  --accent: #7c9dff; --accent-ink: #0b1020; --accent-soft: #1c2747;
  --down: #ff6b62; --down-soft: #3a1816; --warn: #ffab4c; --warn-soft: #3a2711; --ok: #4fd18a; --ok-soft: #12301f;
  --note: #3a3210; --note-fg: #f3df8c;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1318; --surface: #161d24; --surface-2: #1e2731; --fg: #e8edf2; --muted: #95a2ae; --line: #2b3641;
    --accent: #7c9dff; --accent-ink: #0b1020; --accent-soft: #1c2747;
    --down: #ff6b62; --down-soft: #3a1816; --warn: #ffab4c; --warn-soft: #3a2711; --ok: #4fd18a; --ok-soft: #12301f;
    --note: #3a3210; --note-fg: #f3df8c;
    color-scheme: dark;
  }
}
:root[data-theme="light"] { color-scheme: light; }

/* ── Base ─────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.5; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 760px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.4rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ── Header and footer ────────────────────────────────────────────────────── */
header.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo-bg { fill: var(--fg); }
.logo-ring { stroke: var(--bg); stroke-width: 2.6; fill: none; stroke-linecap: round; }
.logo-arrow { stroke: var(--accent); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.logo-word { font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.logo-word b { color: var(--accent); font-weight: 800; }
.logo-word.small { font-size: 1rem; }
.top-nav { display: flex; gap: 4px; justify-content: flex-end; }
.top-nav a { white-space: nowrap; color: var(--fg); text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 7px 10px; border-radius: 8px; }
.top-nav a:hover { background: var(--surface-2); }
.top-nav a:first-child { background: var(--accent); color: var(--accent-ink); }
.top-nav { align-items: center; }
.top-nav .short { display: none; }
.theme-toggle { flex: none; width: 34px; height: 34px; margin-left: 4px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--fg); padding: 0; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* The button shows where a tap takes you: a moon in light mode, a sun in dark mode. */
.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ico-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .ico-moon { display: none; }
}
@media (max-width: 600px) { .top-nav .wide { display: none; } .top-nav .short { display: inline; } }
@media (max-width: 520px) {
  header.top .wrap { gap: 8px; }
  .logo { gap: 7px; }
  .top-nav { gap: 2px; }
  .top-nav a { padding: 6px 7px; font-size: 0.82rem; }
  .logo-word { font-size: 1.05rem; }
  .logo-mark { width: 26px; height: 26px; }
  .theme-toggle { width: 30px; height: 30px; margin-left: 2px; }
}

.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.site-footer .wrap { padding-top: 22px; padding-bottom: 28px; display: grid; gap: 16px; font-size: 0.86rem; }
.disclaimer-line { background: var(--note); color: var(--note-fg); border-radius: 8px; padding: 10px 12px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 14px 32px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer nav a { color: var(--fg); text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }

/* ── Buttons, inputs, pills ───────────────────────────────────────────────── */
.btn { border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; font-weight: 600; font-size: 0.95rem; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 7px 11px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.is-ok[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.is-bad[aria-pressed="true"] { background: var(--down); border-color: var(--down); color: #fff; }

.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 600; font-size: 0.9rem; }
.field .hint { font-size: 0.82rem; color: var(--muted); }
input[type="text"], input[type="tel"], input[type="search"], input[type="password"], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

.pill { font-size: 0.76rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.down { color: var(--down); background: var(--down-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.neutral { color: var(--muted); background: var(--surface-2); }
.tag { font-size: 0.74rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); white-space: nowrap; }
.tag.official { background: var(--accent-soft); color: var(--accent); }

.notice { border-radius: 8px; padding: 12px 14px; font-size: 0.92rem; }
.notice.info { background: var(--accent-soft); }
.notice.warn { background: var(--note); color: var(--note-fg); }
.notice.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.notice.bad { background: var(--down-soft); color: var(--down); font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }

/* ── Home ─────────────────────────────────────────────────────────────────── */
.hero { padding-top: 34px; padding-bottom: 24px; }
.hero h1 { max-width: 18ch; }
.hero .lede { color: var(--muted); margin-top: 10px; max-width: 60ch; font-size: 1.05rem; }
.search { margin-top: 20px; display: flex; gap: 8px; background: var(--surface); border: 2px solid var(--fg); border-radius: 12px; padding: 6px; max-width: 760px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px; font-size: 1.05rem; outline: none; min-height: 0; }
.suggest { max-width: 760px; margin-top: 8px; display: grid; gap: 6px; }
.suggest a { display: flex; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-decoration: none; color: var(--fg); font-weight: 600; }
.suggest a span { color: var(--accent); white-space: nowrap; }
.locate { margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); }
.locate input { width: 110px; min-height: 38px; padding: 6px 10px; }

section.band { padding-top: 28px; padding-bottom: 28px; }
section.band + section.band { border-top: 1px solid var(--line); }
.band-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.band-head p { color: var(--muted); font-size: 0.9rem; max-width: 52ch; }

.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.area-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: left; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; text-decoration: none; color: var(--fg); width: 100%; }
.area-tile:hover { border-color: var(--fg); }
.area-tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.area-ico { width: 40px; height: 40px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; }
.area-ico svg { width: 22px; height: 22px; stroke: var(--fg); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.area-tile .name { font-family: var(--display); font-weight: 700; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.area-tile .blurb { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.area-tile .count { font-family: var(--mono); font-size: 0.76rem; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: var(--down-soft); color: var(--down); }
.area-tile .count.zero { background: var(--surface-2); color: var(--muted); }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 400px) { .board { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card h3 a { color: var(--fg); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card .meta { font-size: 0.83rem; color: var(--muted); }
.card .detail { font-size: 0.9rem; overflow-wrap: anywhere; }
.card-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.empty { padding: 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); grid-column: 1 / -1; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--down); margin-right: 6px; vertical-align: 1px; }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: pulse 1.8s ease-in-out infinite; } @keyframes pulse { 50% { opacity: 0.35; } } }

.cta-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.cta-pair .panel { display: grid; gap: 10px; align-content: start; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 160px; }

/* ── Help flow and case page ──────────────────────────────────────────────── */
.page-head { padding-top: 28px; padding-bottom: 8px; display: grid; gap: 8px; }
.crumbs { font-size: 0.85rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crumbs button { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.choice-list { display: grid; gap: 10px; }
.choice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-align: left; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; align-items: center; width: 100%; }
.choice:hover { border-color: var(--fg); }
.choice .go { color: var(--accent); font-family: var(--mono); }

.case-bar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.case-code { font-family: var(--mono); font-size: 1.15rem; font-weight: 500; letter-spacing: 0.04em; }
.steps { display: grid; gap: 12px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; overflow: hidden; }
.step.safety { border-left: 4px solid var(--down); }
.step.state-done { border-color: var(--ok); }
.step.state-failed:not(.open), .step.state-skipped:not(.open) { opacity: 0.75; }
.step.state-done .step ul, .step ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.step .variant { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.step .variant summary { font-weight: 700; cursor: pointer; }
.step .variant ol { margin-top: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.step-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.step-buttons .muted { font-size: 0.85rem; margin-right: 4px; }
.places { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.places li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.places li:last-child { border-bottom: 0; }
.places .pname { font-weight: 600; }
.places .pmeta { font-size: 0.82rem; color: var(--muted); grid-column: 1; overflow-wrap: anywhere; }
.places .pdist { font-family: var(--mono); font-size: 0.85rem; text-align: right; }

.chat { display: grid; gap: 10px; }
.chat-log { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.msg { border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 92%; font-size: 0.95rem; }
.msg.user { background: var(--accent); color: var(--accent-ink); justify-self: end; }
.msg.assistant { background: var(--surface-2); justify-self: start; }
.msg.pending { opacity: 0.6; font-style: italic; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 0.85rem; }
.chip:hover { border-color: var(--fg); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; font-size: 0.92rem; }
.timeline time { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); padding-top: 2px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kv .num { font-family: var(--mono); font-size: 1.3rem; }
.kv .lbl { font-size: 0.78rem; color: var(--muted); }

.prose { display: grid; gap: 14px; max-width: 70ch; }
.prose h2 { margin-top: 10px; font-size: 1.2rem; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data th, table.data td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
table.data td.n, table.data th.n { text-align: right; font-family: var(--mono); }
.table-scroll { overflow-x: auto; }

/* Admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tabs button { border: 1px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: 0.92rem; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.tabs button:hover { background: var(--surface-2); color: var(--fg); }
.tabs button[aria-selected="true"] { background: var(--surface); border-color: var(--line); color: var(--fg); }
.tabs .badge { margin-left: 6px; font-family: var(--mono); font-size: 0.76rem; background: var(--down-soft); color: var(--down); border-radius: 999px; padding: 1px 7px; }
.admin-list { display: grid; gap: 10px; }
.admin-item { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.admin-item h3 { font-size: 1rem; overflow-wrap: anywhere; }
.admin-item .quote { font-size: 0.88rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; overflow-wrap: anywhere; }
.btn-danger { background: var(--surface); border-color: var(--down); color: var(--down); }
.btn-danger[data-armed="true"] { background: var(--down); color: #fff; }
table.data td { vertical-align: top; overflow-wrap: anywhere; }

/* ── Ads and partner offers (see shared/monetize.js) ───────────────────────── */
.ad-slot { margin: 18px 0 0; text-align: center; }
.ad-slot img { max-width: 100%; height: auto; border-radius: 10px; }
.ad-label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
span.ad-label { margin-bottom: 0; }
.ad-sample { border: 2px dashed var(--line); border-radius: 12px; padding: 18px 14px; display: grid; gap: 4px; color: var(--muted); font-size: 0.88rem; background: var(--surface); }
.ad-sample strong { color: var(--fg); }
.offer-list { display: grid; gap: 10px; }
.offer { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.offer > div { flex: 1 1 240px; min-width: 0; }
.offer .muted { font-size: 0.9rem; margin-top: 2px; }
.offer [aria-disabled="true"] { opacity: 0.6; cursor: default; }

/* What an area is watching, shown when its outage list is empty. */
.watching { margin: 14px auto 0; max-width: 620px; text-align: left; border-top: 1px solid var(--line); padding-top: 12px; font-size: 0.88rem; color: var(--muted); display: grid; gap: 6px; }
.watching p { margin: 0; }

/* ── Case page: hero, progress, accordion steps, two columns ──────────────── */
.ico { display: inline-grid; place-items: center; }
.ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.case-hero { margin-top: 22px; background: linear-gradient(135deg, var(--accent-soft), var(--surface) 62%); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: grid; gap: 16px; }
.case-hero-top { display: flex; gap: 16px; align-items: flex-start; }
.case-hero-top .area-ico { flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.case-hero-top .area-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.case-hero h1 { font-size: clamp(1.45rem, 3.6vw, 2rem); margin: 2px 0 4px; }
.case-hero p { margin: 0; }
.progress { display: grid; gap: 8px; }
.progress-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width 0.35s ease; }
.progress-row { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.progress-label { font-size: 0.9rem; font-weight: 600; }
.progress-dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.dot.is-done { background: var(--ok); border-color: var(--ok); }
.dot.is-failed { background: var(--down); border-color: var(--down); }
.dot.is-skipped { background: var(--muted); border-color: var(--muted); }
.case-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.case-chip { display: inline-flex; gap: 8px; align-items: baseline; background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 6px 12px; margin-right: 4px; }
.case-chip .case-code { font-size: 1rem; }
.disclaimer-mini { font-size: 0.84rem; color: var(--muted); }
.disclaimer-mini summary { cursor: pointer; }
.disclaimer-mini p { margin-top: 6px; }
.case-jump { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.case-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); margin-top: 18px; align-items: start; }
.case-main, .case-aside { display: grid; gap: 16px; min-width: 0; }
.case-main > h2 { margin: 0; scroll-margin-top: 80px; }
#assistant, #close-box { scroll-margin-top: 80px; }
@media (min-width: 940px) {
  .case-layout { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); }
  .case-aside { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; }
  .case-jump { display: none; }
}
.step-toggle { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; }
.step-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 14px; }
.step-marker { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--fg); font-family: var(--mono); font-size: 0.9rem; }
.step.open .step-marker { background: var(--accent); color: var(--accent-ink); }
.step.safety .step-marker { background: var(--down-soft); color: var(--down); }
.step.state-done .step-marker { background: var(--ok); color: #fff; }
.step.state-failed .step-marker { background: var(--down-soft); color: var(--down); }
.step-title { flex: 1; min-width: 0; display: grid; gap: 1px; }
.step-num { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.step.safety .step-num { color: var(--down); }
.step-name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.step-state { flex: none; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.step.state-done .step-state { color: var(--ok); }
.step.state-failed .step-state { color: var(--down); }
.step-chevron { flex: none; font-size: 1.4rem; line-height: 1; color: var(--muted); transition: transform 0.2s ease; }
.step.open .step-chevron { transform: rotate(90deg); }
.step.open { border-color: var(--accent); box-shadow: 0 6px 22px rgba(16, 22, 28, 0.08); }
.step.open.safety { border-color: var(--down); }
.step-body { padding: 2px 16px 16px 70px; display: grid; gap: 12px; }
.step-body[hidden] { display: none; }
.step-body p { margin: 0; }
.step ul.ticks { list-style: none; padding-left: 0; gap: 8px; }
.step ul.ticks li { position: relative; padding-left: 24px; }
.step ul.ticks li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.step.safety ul.ticks li::before { background: var(--down); }
@media (max-width: 560px) { .step-body { padding-left: 16px; } .case-hero { padding: 16px; } .case-hero-top .area-ico { width: 44px; height: 44px; } }
.outcomes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.outcome { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-weight: 600; background: var(--surface); }
.outcome:hover { background: var(--surface-2); }
.outcome:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.outcome .ico { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); flex: none; }
.outcome.is-ok { border-color: var(--ok); }
.outcome.is-ok .ico { background: var(--ok); color: #fff; }
.case-aside .chat-log { max-height: 340px; }

/* ── Service status pages and service links ────────────────────────────────── */
.verdict { display: flex; gap: 10px; align-items: center; font-size: 1.15rem; font-weight: 700; border-radius: 12px; padding: 14px 16px; margin: 4px 0; }
.verdict .live-dot { flex: none; background: currentColor; }
.verdict.ok { color: var(--ok); background: var(--ok-soft); }
.verdict.warn { color: var(--warn); background: var(--warn-soft); }
.verdict.down { color: var(--down); background: var(--down-soft); }
.svc-groups { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.svc-group { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.svc-group summary { cursor: pointer; padding: 12px 0; font-family: var(--display); font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 8px; list-style: none; }
.svc-group summary::-webkit-details-marker { display: none; }
.svc-group summary::after { content: "›"; color: var(--muted); font-size: 1.3rem; line-height: 1; transition: transform 0.2s ease; }
.svc-group[open] summary::after { transform: rotate(90deg); }
.svc-group summary .n { font-family: var(--mono); font-size: 0.74rem; font-weight: 500; color: var(--muted); margin-right: auto; }
.svc-group .chips { padding-bottom: 14px; }
a[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }

/* ── Home: area options open in place, and the compact live feed ───────────── */
.areas > #area-help { grid-column: 1 / -1; margin: 0 !important; border-color: var(--accent); }
@media (max-width: 560px) {
  .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .area-tile { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 10px; align-items: center; }
  .area-tile .area-ico { width: 28px; height: 28px; }
  .area-tile .name { font-size: 0.88rem; line-height: 1.2; }
  .area-tile .blurb { display: none; }
  /* The count sits on the icon corner like a notification badge, so long names (Transportation) have room. */
  .area-tile { position: relative; }
  .area-tile .count { position: absolute; top: 3px; left: 26px; font-size: 0.66rem; padding: 0 5px; line-height: 1.5; }
  .area-tile .count.zero { display: none; }
}
.feed-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.feed-filters::-webkit-scrollbar { display: none; }
.chip.filter { flex: none; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; color: var(--fg); font-weight: 600; }
.chip.filter .n { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.chip.filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.filter[aria-pressed="true"] .n { color: inherit; opacity: 0.85; }
.chip.filter.near { border-style: dashed; }
.feed-group { display: flex; align-items: baseline; gap: 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0; padding: 14px 16px 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.feed-row + .feed-group, .feed-clear + .feed-group { border-top: 1px solid var(--line); }
.feed-group .n { font-family: var(--mono); font-size: 0.74rem; }
.feed-clear { margin: 0; padding: 14px 16px; font-size: 0.92rem; color: var(--muted); }
.feed-note { display: block; font-size: 0.84rem; font-weight: 600; color: var(--fg); margin: 1px 0; }
.feed-clear strong { color: var(--fg); }
.local-note { margin: 8px 0 0; font-weight: 600; }
.feed { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.feed > .empty { border: 0; border-radius: 0; }
.feed.ssr > .feed-row:nth-child(n + 7) { display: none; }
.feed-row + .feed-row { border-top: 1px solid var(--line); }
.feed-head { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; }
.feed-head:hover { background: var(--surface-2); }
.feed-head:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.sev { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.sev.down { background: var(--down); box-shadow: 0 0 0 4px var(--down-soft); }
.sev.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.sev.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.feed-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.feed-title { font-weight: 600; font-size: 0.95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-row.open .feed-title { -webkit-line-clamp: unset; }
.feed-meta { font-size: 0.78rem; color: var(--muted); }
.feed-chevron { flex: none; font-size: 1.3rem; line-height: 1; color: var(--muted); transition: transform 0.2s ease; }
.feed-row.open .feed-chevron { transform: rotate(90deg); }
.feed-row.open { background: var(--bg); }
.feed-body { padding: 0 14px 14px 36px; display: grid; gap: 10px; }
.feed-body[hidden] { display: none; }
.feed-body .detail { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.feed-more { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 12px; font-size: 0.85rem; }
.feed-more:empty { display: none; }

/* ── Admin sign-in and devices ─────────────────────────────────────────────── */
.signin-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); max-width: 860px; align-items: start; }
.check { display: flex; gap: 10px; align-items: center; font-size: 0.94rem; }
.check input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.pair-code { border: 1px dashed var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; }
.pair-code .code { font-size: clamp(1.8rem, 8vw, 2.4rem); font-weight: 500; letter-spacing: 0.12em; }
.plain-steps { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.notice.independent { background: var(--surface-2); color: var(--fg); font-size: 0.86rem; margin-top: 10px; }
