:root {
  --navy: #19224c;
  --ink: #2b3456;
  --muted: #4a5578;
  --faint: #5b6585;
  --ground: #f4f7fb;
  --surface: #ffffff;
  --line: #dfe4ec;
  --line-soft: #edf0f5;
  --tint: #f9fafc;
  --accent: #1678f2;
  --link: #1361c4;
  --ok: #2fb170;
  --ok-text: #157a45;
  --warn: #f2a33a;
  --warn-text: #9a5b00;
  --bad: #c53030;
  --bad-text: #b42318;
  --maint: #5b7bd5;
  --nodata: #dfe4ec;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--navy);
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--link); }
a:hover { color: #0d4a96; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-top: 18px; padding-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand-logo { display: block; height: 32px; width: auto; }
.brand-tag { font-size: 13px; font-weight: 600; color: var(--muted); padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; }
.site-nav { display: flex; align-items: center; gap: 20px; font-size: 15px; }
.site-nav a { text-decoration: none; font-weight: 500; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; border: none; background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { color: #fff; background: #0f66d4; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { padding-top: 24px; padding-bottom: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.site-footer a { text-decoration: none; }

main.wrap { padding-top: 40px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 40px; }
h1, h2, h3 { margin: 0; }
section h2 { font-size: 22px; font-weight: 700; }

/* Overall banner */
.banner { border-radius: 16px; padding: 28px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--surface); border: 1px solid #cfe9da; }
.banner .icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.banner .text { flex-grow: 1; min-width: 220px; }
.banner h1 { font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.banner p { margin: 6px 0 0; color: #3d476a; }
.banner .checked { margin: 0; font-size: 14px; color: var(--muted); }
.banner.degraded { background: #fffaf0; border-color: #f5d9a8; }
.banner.degraded .icon { background: #d97706; }
.banner.outage { background: #fff5f5; border-color: #f3c4c4; }
.banner.outage .icon { background: var(--bad); }
.banner.unknown { border-color: var(--line); }
.banner.unknown .icon { background: #8a93ad; }

/* Active incident cards */
.incident-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--bad); border-radius: 14px; padding: 24px 28px; display: flex; flex-direction: column; gap: 10px; }
.incident-card.minor { border-top-color: #d97706; }
.incident-card .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.incident-card .phase { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bad-text); }
.incident-card.minor .phase { color: var(--warn-text); }
.incident-card h2 { font-size: 20px; }
.incident-card p { margin: 0; color: #3d476a; }
.incident-card .when { font-size: 14px; color: var(--muted); }

/* Components */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.group h3 { padding: 14px 24px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--tint); border-bottom: 1px solid var(--line); }
.component { padding: 18px 24px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 12px; }
.component:last-child { border-bottom: none; }
.component .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.component .name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--link); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.s-ok { color: var(--ok-text); } .s-ok .dot { background: var(--ok); }
.s-degraded { color: var(--warn-text); } .s-degraded .dot { background: var(--warn); }
.s-outage { color: var(--bad-text); } .s-outage .dot { background: var(--bad); }
.s-maint { color: #3550a8; } .s-maint .dot { background: var(--maint); }
.s-nodata { color: var(--faint); } .s-nodata .dot { background: #aab2c8; }
.bars { display: flex; gap: 2px; height: 34px; }
.bars span { flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--nodata); }
.bars .b-ok { background: var(--ok); }
.bars .b-degraded { background: var(--warn); }
.bars .b-outage { background: var(--bad); }
.bars .b-maint { background: var(--maint); }
.scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }
.checks { margin: 0; padding: 4px 0 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.checks li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--tint); border-radius: 8px; font-size: 14px; }
.checks .status { font-size: 13px; }
.checks .dot { width: 8px; height: 8px; }

/* History */
.history { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 24px; }
.history .day { padding: 18px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.history .day:last-child { border-bottom: none; }
.history h3 { font-size: 15px; font-weight: 700; }
.history .none { margin: 0; font-size: 14px; color: var(--faint); }
.past { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--navy); }
.past:hover { border-color: #b9c3d6; color: var(--navy); }
.past .title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.past .title { font-weight: 600; color: var(--link); }
.past .summary { font-size: 14px; color: #3d476a; }
.pill { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px; }
.pill.resolved { color: var(--ok-text); background: #e8f6ee; }
.pill.draft { color: var(--warn-text); background: #fdf1dc; }

/* Subscribe */
.subscribe { background: var(--navy); color: #fff; border-radius: 16px; padding: 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.subscribe .copy { min-width: 240px; flex: 1 1 320px; }
.subscribe p { margin: 6px 0 0; color: #c9d1ea; }
.subscribe form { display: flex; gap: 10px; flex: 1 1 360px; flex-wrap: wrap; }
.subscribe input { flex: 1 1 220px; min-height: 48px; padding: 0 14px; border: 1px solid #3b4675; border-radius: 10px; background: #fff; color: var(--navy); font: inherit; }
.subscribe .btn { min-height: 48px; padding: 0 22px; }
.subscribe .note { flex-basis: 100%; margin: 0; font-size: 14px; color: #c9d1ea; }

/* Incident detail page */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px 28px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { font-size: 20px; }
.card p { margin: 0; color: var(--ink); }
.updates { margin: 0; padding: 0; list-style: none; }
.updates li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.updates li:last-child { border-bottom: none; }
.updates .phase { font-weight: 700; }
.updates .time { font-size: 14px; color: var(--muted); }
.updates p { margin: 0; }
.ph-resolved { color: var(--ok-text); } .ph-monitoring { color: var(--link); } .ph-identified { color: var(--warn-text); } .ph-investigating, .ph-impact { color: var(--bad-text); }

.error { background: #fff5f5; border: 1px solid #f3c4c4; border-radius: 12px; padding: 16px 20px; color: var(--bad-text); }

@media (max-width: 640px) {
  .banner h1 { font-size: 24px; }
  .checks { grid-template-columns: minmax(0, 1fr); }
  .updates li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .site-nav { gap: 14px; }
}
