:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --accent: #2a78d6;

  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --unknown: #898781;
  --serious: #ec835a;
  --government: #6250d6;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 4px 16px rgba(11, 11, 11, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --muted: #898781;
    --line: #2c2c2a;
    --accent: #3987e5;

    --good: #0ca30c;
    --warning: #fab219;
    --critical: #e66767;
    --unknown: #898781;
    --government: #9085e9;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: calc(15px + 2pt);
  line-height: 1.55;
}

.wrap { max-width: 1280px; margin: 0 auto; padding: 32px 16px 56px; }

header { margin-bottom: 28px; }
h1 { font-size: calc(26px + 2pt); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
.tagline { color: var(--text-secondary); margin: 0 0 12px; }
.generated-at { color: var(--muted); font-size: calc(13px + 2pt); margin: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface-1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.service-name { font-size: calc(18px + 2pt); font-weight: 600; letter-spacing: -0.01em; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: calc(13px + 2pt);
  white-space: nowrap;
  color: var(--text-primary);
}
.badge svg { width: 14px; height: 14px; flex-shrink: 0; }
.badge.good { background: color-mix(in srgb, var(--good) 16%, var(--surface-1)); }
.badge.good svg { color: var(--good); }
.badge.possible_outage { background: color-mix(in srgb, var(--warning) 22%, var(--surface-1)); }
.badge.possible_outage svg { color: var(--warning); }
.badge.confirmed_outage { background: color-mix(in srgb, var(--critical) 16%, var(--surface-1)); }
.badge.confirmed_outage svg { color: var(--critical); }
.badge.check_failed { background: color-mix(in srgb, var(--unknown) 16%, var(--surface-1)); color: var(--text-secondary); }
.badge.check_failed svg { color: var(--unknown); }
.badge.rumor { background: color-mix(in srgb, var(--unknown) 16%, var(--surface-1)); color: var(--text-secondary); }
.badge.rumor svg { color: var(--unknown); }
.badge.cve_reported { background: color-mix(in srgb, var(--serious) 20%, var(--surface-1)); }
.badge.cve_reported svg { color: var(--serious); }

.checked-at { color: var(--muted); font-size: calc(12.5px + 2pt); margin: 0 0 12px; }


.errors { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--unknown) 10%, var(--surface-1)); font-size: calc(12.5px + 2pt); color: var(--text-secondary); }
.errors p { margin: 0 0 2px; font-weight: 600; color: var(--text-primary); }

.empty { color: var(--text-secondary); text-align: center; padding: 48px 24px; }

#discovered { margin-top: 16px; }
#cards:empty + #discovered { margin-top: 0; }
.plain-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.plain-list li { font-size: calc(13.5px + 2pt); color: var(--text-secondary); }
.plain-list a { color: var(--accent); text-decoration: none; }
.plain-list a:hover { text-decoration: underline; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.headlines { background: var(--surface-1); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.column-title { font-size: calc(17px + 2pt); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.headlines ol { margin: 0; padding-left: 2em; display: flex; flex-direction: column; gap: 10px; }
.headlines li { font-size: calc(13.5px + 2pt); line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.headlines a { color: var(--accent); text-decoration: none; }
.headlines a:hover { text-decoration: underline; }
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.span-line { color: var(--muted); font-size: calc(12.5px + 2pt); margin: 0 0 12px; }
.timeline-title { font-weight: 600; font-size: calc(13.5px + 2pt); margin: 0 0 10px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--unknown)); }
.timeline li::after { content: ""; position: absolute; left: 4.5px; top: 20px; bottom: -4px; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.event-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.event-title { font-weight: 600; font-size: calc(13.5px + 2pt); }
.event-time { color: var(--muted); font-size: calc(11.5px + 2pt); white-space: nowrap; font-variant-numeric: tabular-nums; }
.event-detail { color: var(--text-secondary); font-size: calc(12.5px + 2pt); overflow-wrap: anywhere; }
.event-detail a { color: var(--accent); text-decoration: none; }
.event-detail a:hover { text-decoration: underline; }
.tone-confirmed_outage { --dot: var(--critical); }
.tone-possible_outage { --dot: var(--warning); }
.tone-cve_reported { --dot: var(--serious); }
.tone-rumor { --dot: var(--unknown); }
.tone-news { --dot: var(--accent); }
.tone-government { --dot: var(--government); }
.stamp { display: block; color: var(--muted); font-size: calc(11.5px + 2pt); font-variant-numeric: tabular-nums; }
.tm { font-size: 0.5em; font-weight: 500; vertical-align: super; margin-left: 2px; }
