:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --text: #15181a;
  --muted: #5d666c;
  --line: #e2e5e3;
  --accent: #0f8a5f;
  --false: #c62e2e;
  --misleading: #c2700a;
  --context: #2f6fbf;
  --disputed: #7a4fc2;
  --unproven: #6b7378;
  --ok: #128a52;
  --warn: #c2700a;
  --bad: #c62e2e;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1213; --surface: #171b1d; --text: #e9eceb; --muted: #9aa4a9; --line: #283033;
    --accent: #3fc28c; --false: #ff6b6b; --misleading: #f0a43a; --context: #6aa6f0; --disputed: #b48cf5;
    --unproven: #9aa4a9; --ok: #3fc28c; --warn: #f0a43a; --bad: #ff6b6b; color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f1213; --surface: #171b1d; --text: #e9eceb; --muted: #9aa4a9; --line: #283033;
  --accent: #3fc28c; --false: #ff6b6b; --misleading: #f0a43a; --context: #6aa6f0; --disputed: #b48cf5;
  --unproven: #9aa4a9; --ok: #3fc28c; --warn: #f0a43a; --bad: #ff6b6b; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px 64px; }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0 8px; }
.brand { font-weight: 700; letter-spacing: -0.01em; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tools { display: flex; gap: 6px; }
.tools button {
  border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.tools button[aria-pressed='true'] { border-color: var(--text); font-weight: 600; }

h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 20px 0 10px; }
.lede { color: var(--muted); max-width: 640px; margin: 0 0 24px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.live-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-bottom: 36px; }
@media (max-width: 720px) { .live-grid { grid-template-columns: 1fr; } }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.overall { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.overall .big { font-size: 22px; font-weight: 700; }
.badge-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.s-operational { background: var(--ok); }
.s-degraded_performance, .s-minor { background: var(--warn); }
.s-partial_outage, .s-major_outage, .s-major, .s-critical { background: var(--bad); }
.s-none { background: var(--ok); }
.s-under_maintenance, .s-maintenance { background: var(--context); }

.comp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
@media (max-width: 480px) { .comp-list { grid-template-columns: 1fr; } }
.comp-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.comp-list li span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-list .badge-dot { width: 9px; height: 9px; }
.note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.price .sym { font-size: 12px; color: var(--muted); font-weight: 600; }
.price .val { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; }
.stat { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.stat div b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat div span { font-size: 12px; color: var(--muted); }

h2 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 6px; }
.section-sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filters button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.filters button[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; border-left: 5px solid var(--v); }
.card .verdict { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--v); margin-bottom: 6px; }
.card .claim { font-size: 19px; font-weight: 650; line-height: 1.35; margin: 0 0 12px; }
.card ul.facts { margin: 0 0 12px; padding-left: 20px; }
.card ul.facts li { margin: 4px 0; }
.card .sources { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.card .live-box { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.card .live-box .label { margin-bottom: 6px; }
.v-false { --v: var(--false); }
.v-partly { --v: var(--misleading); }
.v-misleading { --v: var(--misleading); }
.v-context { --v: var(--context); }
.v-disputed { --v: var(--disputed); }
.v-unproven { --v: var(--unproven); }

.incidents { list-style: none; margin: 0; padding: 0; }
.incidents li { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.incidents li:first-child { border-top: 0; }
.incidents .d { color: var(--muted); font-variant-numeric: tabular-nums; }
.incidents .dur { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.incidents .t { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.incidents .t .badge-dot { width: 8px; height: 8px; transform: translateY(-1px); }
@media (max-width: 480px) { .incidents li { grid-template-columns: 1fr auto; } .incidents .d { grid-column: 1 / -1; } }

.posts li { margin: 6px 0; }
.pending { color: var(--muted); font-size: 13px; }
footer { margin-top: 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 16px; }
.skeleton { color: var(--muted); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 340px; }
.login h1 { font-size: 24px; margin: 0 0 6px; }
.login p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.login input { width: 100%; font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin-bottom: 10px; }
.login button { width: 100%; font: inherit; font-weight: 600; padding: 11px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.login .err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 8px; }

.tbl-wrap { overflow-x: auto; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.cmp th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 8px 4px 0; }
table.cmp td { padding: 5px 8px 5px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.calc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.calc label { font-weight: 600; }
.calc input { width: 110px; font: inherit; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.calc ul { list-style: none; margin: 8px 0 0; padding: 0; }
.calc li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); }
.calc li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.cmp th.grp { text-align: left; border-bottom: 1px solid var(--line); color: var(--text); }
table.cmp td.sp { font-weight: 600; }
table.cmp td.dev { color: var(--muted); font-size: 12px; }
table.cmp th.fu { color: var(--accent); }
