:root {
  --ink: #14181f; --ink-2: #4a5160; --ink-3: #6b7280;
  --navy: #101a30; --navy-hover: #1d2a47;
  --line: #e6e8ec; --line-strong: #d3d7de;
  --surface: #fff; --surface-2: #f7f8fa;
  --link: #1e4fd7;
  --ok: #137034; --ok-bg: #e8f5ec; --ok-bar: #22a05a;
  --warn: #a15c07; --warn-bg: #fdf3e2; --warn-bar: #e8a33a;
  --bad: #b42318; --bad-bg: #fdecea; --bad-bar: #d9483b;
  --maint: #1e4fd7; --maint-bg: #eaf0fd; --maint-bar: #5b7fe0;
  --empty-bar: #e3e6eb;
  --radius: 12px; --radius-sm: 8px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }


.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 880px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; }
.brand-divider { width: 1px; height: 22px; background: var(--line-strong); }
.brand-label { font-size: 16px; font-weight: 500; color: var(--ink-2); }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.link-quiet { color: var(--ink-2); font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; border: 0; cursor: pointer; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

main { max-width: 880px; margin: 0 auto; padding: 40px 24px 64px; }

/* overall banner */
.overall { display: flex; align-items: center; gap: 16px; padding: 22px 24px; border-radius: var(--radius); border: 1px solid; }
.overall[data-tone="ok"] { background: var(--ok-bg); border-color: #cde9d6; }
.overall[data-tone="warn"] { background: var(--warn-bg); border-color: #f3dcb2; }
.overall[data-tone="maint"] { background: var(--maint-bg); border-color: #cbd8f8; }
.overall-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.overall[data-tone="ok"] .overall-icon { background: var(--ok); }
.overall[data-tone="warn"] .overall-icon { background: var(--warn-bar); }
.overall[data-tone="maint"] .overall-icon { background: var(--maint); }
.overall-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.overall h1 { font-size: 22px; font-weight: 600; }
.overall p { font-size: 14px; color: var(--ink-2); margin-top: 2px; }

/* active incident */
.incident { margin-top: 20px; border: 1px solid var(--line); border-left: 4px solid var(--warn-bar); border-radius: var(--radius); padding: 20px 24px; }
.incident[data-kind="maint"] { border-left-color: var(--maint-bar); }
.incident-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.incident h2 { font-size: 18px; font-weight: 600; }
.incident-affects { font-size: 13px; color: var(--ink-3); }
.timeline { list-style: none; margin: 16px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 116px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.timeline li:first-child { border-top: 0; padding-top: 4px; }
.tl-stage { font-weight: 600; }
.tl-time { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.tl-body { color: var(--ink-2); }

/* components */
.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-head h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.section-head .legend { font-size: 12px; color: var(--ink-3); }
.components { border: 1px solid var(--line); border-radius: var(--radius); }
.comp { padding: 18px 24px; border-top: 1px solid var(--line); }
.comp:first-child { border-top: 0; }
.comp-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.comp-name { font-weight: 600; font-size: 15px; }
.comp-desc { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill[data-s="ok"] { background: var(--ok-bg); color: var(--ok); }
.pill[data-s="warn"] { background: var(--warn-bg); color: var(--warn); }
.pill[data-s="bad"] { background: var(--bad-bg); color: var(--bad); }
.pill[data-s="maint"] { background: var(--maint-bg); color: var(--maint); }
.bars { display: flex; gap: 2px; height: 30px; margin-top: 14px; }
.bars span { flex: 1; border-radius: 2px; background: var(--ok-bar); }
.bars span[data-d="warn"] { background: var(--warn-bar); }
.bars span[data-d="bad"] { background: var(--bad-bar); }
.bars span[data-d="maint"] { background: var(--maint-bar); }
.bars span[data-d="none"] { background: var(--empty-bar); }
.bars-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.bars-foot strong { color: var(--ink-2); font-weight: 500; font-family: var(--mono); font-size: 12px; }

/* history */
.history { border: 1px solid var(--line); border-radius: var(--radius); }
.day { padding: 16px 24px; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.day-date { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.day-empty { font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.past { margin-top: 6px; }
.past a { font-weight: 600; font-size: 15px; color: var(--ink); }
.past p { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.past .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.more { display: inline-block; margin-top: 14px; font-size: 14px; }

.footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: 880px; margin: 0 auto; padding: 24px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 13px; color: var(--ink-3); }
.footer-inner nav { display: flex; gap: 20px; }
.footer-inner a { color: var(--ink-2); }

/* subscribe dialog */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(460px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(16,26,48,.25); color: var(--ink); }
dialog::backdrop { background: rgba(16,26,48,.45); }
.dlg { padding: 24px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg h2 { font-size: 19px; font-weight: 600; }
.dlg-close { border: 0; background: none; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; color: var(--ink-3); }
.dlg-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }
.dlg-lede { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.field { margin-top: 18px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field input[type=email] { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.field input[type=email]:focus { outline: 2px solid var(--link); outline-offset: 0; border-color: transparent; }
fieldset { border: 0; padding: 0; margin: 18px 0 0; }
legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 8px; }
.radio { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 4px 0; }
.radio input { margin-top: 4px; }
.comp-picks { margin: 6px 0 0 26px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.comp-picks[hidden] { display: none; }
.dlg-actions { margin-top: 22px; display: flex; gap: 10px; justify-content: flex-end; }
.dlg-note { font-size: 12px; color: var(--ink-3); margin-top: 14px; }
.sent { text-align: center; padding: 12px 0 4px; }
.sent-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--ok-bg); display: grid; place-items: center; margin: 0 auto 12px; }
.sent-icon svg { width: 22px; height: 22px; stroke: var(--ok); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 640px) {
  .link-quiet { display: none; }
  .brand-label { font-size: 15px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .bars span:nth-child(-n+60) { display: none; }
  .bars-foot .since90 { display: none; }
  .bars-foot .since30 { display: inline; }
}
.since30 { display: none; }
@media (prefers-reduced-motion: no-preference) { .btn { transition: background-color .15s ease; } }

/* --- Beyond the mockup --- */
.overall[data-tone="bad"] { background: var(--bad-bg); border-color: #f5c7c2; }
.overall[data-tone="bad"] .overall-icon { background: var(--bad); }
.overall[data-tone="unknown"] { background: var(--surface-2); border-color: var(--line); }
.overall[data-tone="unknown"] .overall-icon { background: var(--ink-3); }
.incident[data-kind="bad"] { border-left-color: var(--bad-bar); }
.incident .meta, .incident-page .meta { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.tl-body p + p { margin-top: 8px; }
.bars span { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -48px; z-index: 20; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); }
.skip:focus { top: 8px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-secondary:hover { background: var(--surface-2); }
.dlg-close:hover { background: var(--surface-2); }
.check { display: flex; gap: 8px; align-items: center; min-height: 24px; }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field-error { font-size: 13px; color: var(--bad); margin-top: 6px; }
.form-alert { font-size: 14px; color: var(--bad); margin-top: 14px; }
.form-alert:empty, .field-error:empty { display: none; }
.turnstile { margin-top: 18px; min-height: 0; }
.dlg-note a { color: var(--ink-2); text-decoration: underline; }

/* Server-rendered pages (confirm, manage, incident, history) */
main.narrow { max-width: 560px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card h1 { font-size: 22px; font-weight: 600; }
.card .lede { font-size: 15px; color: var(--ink-2); margin-top: 10px; }
.actions { margin-top: 22px; display: flex; gap: 10px; }
.actions.secondary { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.notice { margin-top: 14px; font-size: 14px; color: var(--ok); }
.crumbs { font-size: 14px; color: var(--ink-3); margin-bottom: 16px; }
.incident-page { margin-top: 0; }
.incident-page h1 { font-size: 22px; font-weight: 600; }
.page-title { font-size: 22px !important; text-transform: none !important; letter-spacing: -0.015em !important; color: var(--ink) !important; }
.section.first { margin-top: 0; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; font-size: 14px; }
@media (max-width: 640px) {
  main { padding: 28px 16px 48px; }
  .topbar-inner, .footer-inner { padding-left: 16px; padding-right: 16px; }
  .overall, .incident, .comp, .day, .card { padding-left: 16px; padding-right: 16px; }
  .btn { padding: 10px 14px; }
}
.incident h2 a { color: var(--ink); }
