:root {
  color-scheme: dark;
  --bg: #06070a;
  --surface: #0c0e13;
  --surface-2: #11141b;
  --surface-3: #171b24;
  --line: #222835;
  --line-2: #313a4b;
  --text: #f4f7fb;
  --muted: #a1abba;
  --dim: #7d8798;
  --brand: #c9ff5c;
  --critical: #ff5d6c;
  --warning: #ffbd57;
  --notice: #6dc8ff;
  --critical-dim: rgba(255, 93, 108, 0.1);
  --warning-dim: rgba(255, 189, 87, 0.1);
  --notice-dim: rgba(109, 200, 255, 0.09);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(760px 440px at 10% -12%, rgba(201, 255, 92, 0.09), transparent 62%),
    radial-gradient(860px 520px at 96% -4%, rgba(109, 200, 255, 0.07), transparent 58%),
    linear-gradient(180deg, #090b10 0%, var(--bg) 44%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 58%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 58%);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

::selection {
  background: rgba(201, 255, 92, 0.25);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--brand);
  color: #0a0d05;
  font-weight: 700;
  font-size: 12px;
  padding: 9px 13px;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* ---------- boot error ---------- */

.boot-error {
  position: relative;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 24px;
  background: rgba(255, 93, 108, 0.12);
  border-bottom: 1px solid rgba(255, 93, 108, 0.4);
  color: #ffd7db;
  font-size: 12px;
}

.boot-error[hidden] {
  display: none;
}

.boot-error strong {
  color: #fff;
}

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(6, 7, 10, 0.86);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.masthead-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 13px 24px 10px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex: none;
}

.brand-mark {
  color: var(--brand);
  display: block;
  filter: drop-shadow(0 0 9px rgba(201, 255, 92, 0.35));
}

.brand-word {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.brand-domain {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 6px;
  letter-spacing: 0.02em;
  margin-left: 1px;
}

.clock-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  flex: none;
}

.clock {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.clock-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.window-picker {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  min-width: 0;
}

.window-picker label {
  position: relative;
  flex: 1;
  cursor: pointer;
}

.window-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.window-picker span {
  display: block;
  padding: 6px 11px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}

.window-picker label:hover span {
  color: var(--text);
}

.window-picker input:checked + span {
  background: var(--brand);
  color: #0a0d05;
  font-weight: 700;
}

.window-picker input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.refresh-state {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.3;
  cursor: pointer;
  flex: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.refresh-state:hover {
  border-color: var(--line-2);
  color: var(--text);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(201, 255, 92, 0.45);
  animation: live 2.2s ease-out infinite;
  flex: none;
}

@keyframes live {
  0% {
    box-shadow: 0 0 0 0 rgba(201, 255, 92, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(201, 255, 92, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(201, 255, 92, 0);
  }
}

.refresh-state.is-paused {
  color: var(--dim);
  border-style: dashed;
}

.refresh-state.is-paused .live-dot {
  background: var(--dim);
  animation: none;
  box-shadow: none;
}

.refresh-state.is-loading .live-dot {
  background: var(--warning);
}

.masthead-meta {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 9px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
}

.asof b {
  color: var(--muted);
  font-weight: 500;
}

.load-state {
  color: var(--dim);
  text-align: right;
}

.masthead-progress {
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

#refresh-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--brand), rgba(201, 255, 92, 0.18));
  transition: width 1s linear;
}

/* ---------- layout ---------- */

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 24px 56px;
}

/* ---------- KPI band ---------- */

.kpi-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  margin-bottom: 28px;
  box-shadow: 0 18px 50px -30px rgba(0, 0, 0, 0.9);
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 20px 14px;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.kpi:first-child {
  border-left: 0;
}

.kpi-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  font-family: var(--mono);
  font-size: clamp(30px, 3.4vw, 45px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: opacity 0.2s ease;
}

.kpi-value.is-empty {
  color: var(--dim);
}

.kpi-context {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  min-height: 2.9em;
}

.kpi-source {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--dim);
}

.kpi-source code {
  overflow-wrap: anywhere;
}

body.is-loading .kpi-value {
  opacity: 0.45;
}

/* ---------- feed ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(300px, 0.88fr);
  gap: 26px;
  align-items: start;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.022em;
  line-height: 1.2;
  margin: 0;
}

.section-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  margin: 5px 0 0;
}

.tally {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
}

.tally-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tally-item i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sev);
}

.tally-item b {
  color: var(--text);
  font-weight: 600;
  font-size: 10.5px;
}

.sev-critical {
  --sev: var(--critical);
  --sev-soft: var(--critical-dim);
}

.sev-warning {
  --sev: var(--warning);
  --sev-soft: var(--warning-dim);
}

.sev-notice {
  --sev: var(--notice);
  --sev-soft: var(--notice-dim);
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.feed-row {
  display: grid;
  grid-template-columns: 54px 16px minmax(0, 1fr);
  gap: 10px;
  --sev: var(--notice);
  --sev-soft: var(--notice-dim);
}

.feed-row.sev-critical {
  --sev: var(--critical);
  --sev-soft: var(--critical-dim);
}

.feed-row.sev-warning {
  --sev: var(--warning);
  --sev-soft: var(--warning-dim);
}

.feed-row.sev-notice {
  --sev: var(--notice);
  --sev-soft: var(--notice-dim);
}

.feed-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 15px;
  text-align: right;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.feed-time .d {
  font-size: 9px;
  color: var(--dim);
}

.feed-rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.feed-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -13px;
  width: 1px;
  background: var(--line);
}

.feed-row:last-child .feed-rail::before {
  bottom: auto;
  height: 22px;
}

.feed-rail .dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 20px;
  border-radius: 50%;
  background: var(--sev);
  box-shadow: 0 0 0 4px var(--bg);
}

.card {
  position: relative;
  min-width: 0;
  padding: 15px 18px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--sev);
  border-radius: 2px 14px 14px 2px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: border-color 0.18s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, var(--sev-soft), transparent 24%);
}

.card:hover {
  border-color: var(--line-2);
  border-left-color: var(--sev);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.sev {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--sev);
  font-weight: 700;
}

.src {
  color: var(--muted);
}

.src::before {
  content: "·";
  margin-right: 8px;
  color: var(--line-2);
}

.flag {
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--muted);
}

.when {
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--dim);
}

.headline {
  position: relative;
  margin: 9px 0 12px;
  max-width: 64ch;
  font-size: clamp(17px, 1.55vw, 21px);
  font-weight: 550;
  letter-spacing: -0.017em;
  line-height: 1.34;
  text-wrap: pretty;
}

.headline .subject {
  font-family: var(--mono);
  font-size: 0.94em;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  padding: 0 5px;
  overflow-wrap: anywhere;
}

.mono,
.headline b.mono {
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stats {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 58px;
}

.stat b {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat span {
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

.card-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.evidence-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.4;
  cursor: pointer;
}

.evidence-toggle:hover {
  color: var(--text);
}

.chev {
  opacity: 0.7;
  transition: transform 0.18s ease;
}

.evidence-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.inspect {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid rgba(201, 255, 92, 0.28);
  border-radius: 999px;
  background: rgba(201, 255, 92, 0.08);
  color: var(--brand);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.inspect:hover {
  background: rgba(201, 255, 92, 0.16);
  border-color: rgba(201, 255, 92, 0.45);
}

.no-inspect {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
}

.evidence {
  position: relative;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed var(--line-2);
}

.evidence[hidden] {
  display: none;
}

.evidence-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
  color: var(--dim);
}

.evidence-head code {
  max-width: 76%;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.raw {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.raw > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 5px 8px;
  background: rgba(7, 9, 13, 0.78);
  font-family: var(--mono);
  font-size: 9.5px;
}

.raw dt {
  color: var(--dim);
  white-space: nowrap;
}

.raw dd {
  margin: 0;
  min-width: 0;
  text-align: right;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.raw dd.null {
  color: #56606f;
  font-style: italic;
}

.raw dd.true {
  color: var(--brand);
}

.raw dd.false {
  color: var(--warning);
}

/* ---------- gaps / empty / loading ---------- */

.feed-gap-row {
  list-style: none;
}

.source-gaps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gap-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.012);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--dim);
}

.gap-row b {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gap-row code {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
  overflow-wrap: anywhere;
  max-width: 100%;
}

.gap-row small {
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--dim);
  white-space: nowrap;
}

.gap-row.is-error {
  border-color: rgba(255, 93, 108, 0.32);
  background: rgba(255, 93, 108, 0.045);
}

.gap-row.is-error b,
.gap-row.is-error span {
  color: var(--critical);
}

.feed-empty-row {
  list-style: none;
}

.feed-empty {
  padding: 26px;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.feed-empty-kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.feed-empty h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.022em;
  line-height: 1.25;
}

.feed-empty > p {
  margin: 0 0 14px;
  max-width: 62ch;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.feed-empty .source-gaps {
  margin-bottom: 14px;
}

.retry {
  appearance: none;
  padding: 7px 12px;
  border: 1px solid rgba(201, 255, 92, 0.32);
  border-radius: 999px;
  background: rgba(201, 255, 92, 0.08);
  color: var(--brand);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
}

.retry:hover {
  background: rgba(201, 255, 92, 0.16);
}

.feed-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

.feed-loading[hidden] {
  display: none;
}

.feed-loading b {
  display: block;
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
}

.feed-loading span {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
}

.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid var(--line-2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.feed-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.feed-notes[hidden] {
  display: none;
}

.feed-notes p {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.65;
  color: var(--dim);
}

/* ---------- panel source lines ---------- */

.panel-source {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
  color: var(--dim);
}

.panel-source code {
  color: var(--dim);
  overflow-wrap: anywhere;
}

.panel-source b {
  color: var(--muted);
  font-weight: 500;
}

.feed-source {
  margin-top: 14px;
}

/* ---------- rail ---------- */

.rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 126px;
  min-width: 0;
}

.panel {
  min-width: 0;
  padding: 15px 16px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
}

.panel h2 {
  margin: 0;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-kicker {
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--dim);
  white-space: nowrap;
}

/* ---------- sparkline ---------- */

.spark {
  min-height: 84px;
  display: flex;
  align-items: center;
}

.spark svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.spark-base {
  stroke: var(--line-2);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.spark-bar {
  fill: var(--brand);
}

.spark-bar.critical {
  fill: var(--critical);
}

.spark-bar.warning {
  fill: var(--warning);
}

.spark-bar.notice {
  fill: var(--notice);
}

.spark-bar.zero {
  fill: var(--line);
}

.spark-fail {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
}

.spark-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--dim);
}

.spark-meta {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--muted);
}

.spark-meta b {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.spark-empty {
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--dim);
}

.spark-empty[hidden] {
  display: none;
}

/* ---------- sources ---------- */

.source-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.source-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.source-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.source-dot {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: #3a4352;
}

.source-dot.ok {
  background: var(--brand);
}

.source-dot.empty {
  background: var(--notice);
}

.source-dot.error {
  background: var(--critical);
  box-shadow: 0 0 0 3px rgba(255, 93, 108, 0.12);
}

.source-dot.waiting {
  background: var(--dim);
}

.source-name {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.source-detail {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
}

.source-detail.is-error {
  color: var(--critical);
}

.source-endpoint {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.45;
  color: var(--dim);
  overflow-wrap: anywhere;
}

.source-time {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--dim);
  white-space: nowrap;
}

/* ---------- rubric ---------- */

.rubric {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rubric li {
  display: grid;
  grid-template-columns: 4px 62px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.45;
  color: var(--muted);
}

.rubric li:first-child {
  padding-top: 0;
  border-top: 0;
}

.swatch {
  width: 4px;
  height: 15px;
  margin-top: 1px;
  border-radius: 2px;
  background: var(--sev);
}

.rubric li b {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sev);
}

.rubric-note {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 9px;
  line-height: 1.6;
  color: var(--dim);
}

/* ---------- footer ---------- */

.site-foot {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 24px 36px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.7;
  color: var(--dim);
}

/* ---------- responsive ---------- */

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(288px, 0.9fr);
    gap: 22px;
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rubric-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .window-picker {
    margin-left: 0;
  }

  .masthead-inner {
    gap: 14px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .masthead-inner {
    padding: 11px 16px 9px;
    gap: 10px;
  }

  .brand {
    order: 1;
  }

  .brand-word {
    font-size: 20px;
  }

  .clock-wrap {
    order: 2;
    margin-right: auto;
    padding-left: 0;
    border-left: 0;
  }

  .clock {
    font-size: 15px;
  }

  .refresh-state {
    order: 3;
    min-width: 0;
    padding: 7px 10px;
    font-size: 9.5px;
  }

  .window-picker {
    order: 4;
    width: 100%;
    margin-left: 0;
  }

  .window-picker span {
    padding: 7px 8px;
    font-size: 10.5px;
  }

  .masthead-meta {
    padding: 0 16px 8px;
    flex-direction: column;
    gap: 2px;
    font-size: 8.5px;
  }

  .load-state {
    text-align: left;
  }

  main {
    padding: 18px 16px 44px;
  }

  .kpi-band {
    grid-template-columns: 1fr;
    margin-bottom: 22px;
    border-radius: 14px;
  }

  .kpi {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label value"
      "context value"
      "source source";
    align-items: center;
    column-gap: 14px;
    row-gap: 3px;
    padding: 12px 15px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .kpi:first-child {
    border-top: 0;
  }

  .kpi-label {
    grid-area: label;
  }

  .kpi-value {
    grid-area: value;
    font-size: 33px;
  }

  .kpi-context {
    grid-area: context;
    min-height: 0;
    font-size: 10.5px;
  }

  .kpi-source {
    grid-area: source;
    margin-top: 7px;
    padding-top: 7px;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    font-size: 8px;
  }

  .section-head {
    align-items: flex-start;
    gap: 10px;
  }

  .section-head h2 {
    font-size: 18px;
  }

  .tally {
    gap: 9px;
  }

  .feed-row {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 8px;
  }

  .feed-time {
    display: none;
  }

  .feed-rail .dot {
    margin-top: 18px;
  }

  .feed-rail::before {
    bottom: -13px;
  }

  .feed-row:last-child .feed-rail::before {
    height: 20px;
  }

  .card {
    padding: 13px 13px 12px;
    border-radius: 2px 12px 12px 2px;
  }

  .card-top {
    gap: 7px;
  }

  .when {
    flex-basis: 100%;
    margin-left: 0;
  }

  .headline {
    margin: 8px 0 11px;
    font-size: 17px;
  }

  .stats {
    gap: 16px;
  }

  .stat b {
    font-size: 15px;
  }

  .evidence-head code {
    max-width: 100%;
  }

  .raw {
    grid-template-columns: 1fr;
  }

  .raw > div {
    padding: 5px 9px;
    font-size: 9px;
  }

  .gap-row code {
    flex-basis: 100%;
    margin-left: 0;
  }

  .feed-empty {
    padding: 20px;
  }

  .feed-empty h3 {
    font-size: 19px;
  }

  .rail {
    grid-template-columns: 1fr;
  }

  .rubric-panel {
    grid-column: auto;
  }

  .site-foot {
    padding: 16px 16px 30px;
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .live-dot {
    animation: none;
    box-shadow: none;
  }
}
