:root {
  color-scheme: dark;
  --bg: #071018;
  --panel: #101b26;
  --panel-soft: #142433;
  --text: #eef6ff;
  --muted: #9fb1c4;
  --line: rgba(255,255,255,.12);
  --ok: #50d890;
  --warn: #f7c948;
  --bad: #ff6b6b;
  --accent: #78a6ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(120,166,255,.20), transparent 34rem),
    linear-gradient(135deg, #071018 0%, #0b1420 100%);
  color: var(--text);
}

.topbar, .footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}

.footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
  font-size: .85rem;
}

h1, h2, p { margin-top: 0; }

h1 { font-size: clamp(2rem, 4vw, 4rem); margin-bottom: .4rem; }
h2 { font-size: 1.25rem; margin-bottom: .9rem; }

.subtitle { color: var(--muted); margin-bottom: 0; max-width: 62rem; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 800; margin-bottom: .35rem; }

.layout {
  padding: clamp(1rem, 3vw, 2.5rem);
  display: grid;
  gap: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: rgba(16,27,38,.88);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 20px 70px rgba(0,0,0,.25);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, .65fr);
  gap: 1rem;
  align-items: start;
}

.status-pill, .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .45rem .75rem;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  white-space: nowrap;
  font-weight: 800;
  font-size: .85rem;
}

.status-pill.ok, .chip.ok { color: var(--ok); border-color: rgba(80,216,144,.35); }
.status-pill.warn, .chip.warn { color: var(--warn); border-color: rgba(247,201,72,.35); }
.status-pill.bad, .chip.bad { color: var(--bad); border-color: rgba(255,107,107,.35); }

.safety-grid, .kv-list {
  display: grid;
  grid-template-columns: minmax(9rem, .75fr) minmax(0, 1fr);
  gap: .65rem .9rem;
  margin: 0;
}

dt { color: var(--muted); }
dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

.position-row, .timeline-item {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  border-radius: .9rem;
  padding: .9rem;
  margin-top: .75rem;
}

.position-row:first-child, .timeline-item:first-child { margin-top: 0; }

.row-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: .65rem;
}

code {
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  border-radius: .4rem;
  padding: .12rem .35rem;
}

.warning {
  border-color: rgba(247,201,72,.35);
}

@media (max-width: 850px) {
  .grid.two, .hero-card {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .safety-grid, .kv-list {
    grid-template-columns: 1fr;
  }
}


.empty-state {
  border: 1px dashed var(--line);
  border-radius: .9rem;
  padding: 1rem;
  background: rgba(255,255,255,.025);
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  display: block;
  margin-bottom: .35rem;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .85rem;
}

.source-status {
  display: grid;
  gap: .55rem;
  margin-bottom: 1rem;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .4rem .65rem;
  align-items: center;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: rgba(255,255,255,.03);
}

.source-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow-wrap: anywhere;
}


.nav-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .75rem clamp(1rem, 3vw, 2.5rem);
  background: rgba(7,16,24,.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.nav-tabs a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .55rem .85rem;
  white-space: nowrap;
  font-weight: 800;
  font-size: .86rem;
}

.nav-tabs a.active {
  color: var(--text);
  border-color: rgba(120,166,255,.55);
  background: rgba(120,166,255,.12);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: 1rem;
}

.input {
  min-width: min(100%, 18rem);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: .7rem .8rem;
}

.input::placeholder {
  color: var(--muted);
}
