:root {
  color-scheme: dark;
  --background: #070b0f;
  --panel: #0d151c;
  --line: #20303b;
  --line-strong: #304654;
  --text: #edf5f6;
  --text-soft: #b8c8cd;
  --muted: #82969e;
  --healthy: #61dcae;
  --degraded: #e6b85c;
  --unhealthy: #f06c75;
  --stale: #d89556;
  --unknown: #8ca1ad;
  --maintenance: #7e9fd0;
  --accent: #42a9d8;
  --shadow: 0 18px 50px rgb(0 0 0 / 24%);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgb(80 137 160 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(80 137 160 / 4%) 1px, transparent 1px),
    radial-gradient(circle at 85% -5%, rgb(35 105 135 / 20%), transparent 34%),
    var(--background);
  background-size: 32px 32px, 32px 32px, auto, auto;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; }

h1, h2, h3, p, dl, dd, ul { margin: 0; }

ul {
  padding: 0;
  list-style: none;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--text);
  color: var(--background);
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.masthead {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 2px;
}

.identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.identity img {
  flex: 0 0 auto;
  filter: drop-shadow(0 0 16px rgb(97 220 174 / 12%));
}

.identity h1 {
  overflow: hidden;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 650;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deployment,
.section-meta,
.snapshot-label,
.header-status time,
footer,
.record-time,
.record-meta,
.evidence-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.deployment {
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.header-status {
  display: grid;
  justify-items: end;
  gap: 3px;
  text-align: right;
}

.status-badge,
.small-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.status-badge {
  margin-top: 6px;
  padding: 9px 12px;
  background: rgb(255 255 255 / 2%);
}

.small-status { padding: 6px 8px; }

.status-dot,
.freshness-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.status-healthy { color: var(--healthy); }
.status-degraded { color: var(--degraded); }
.status-unhealthy { color: var(--unhealthy); }
.status-stale { color: var(--stale); }
.status-unknown { color: var(--unknown); }
.status-maintenance { color: var(--maintenance); }

.coverage-alert {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 0 0 16px;
  border: 1px solid rgb(230 184 92 / 48%);
  border-left: 4px solid var(--degraded);
  border-radius: 9px;
  padding: 14px 16px;
  background: rgb(94 69 22 / 28%);
}

.coverage-alert[hidden] { display: none; }

.coverage-alert h2 { font-size: 0.92rem; }

.coverage-alert p {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.coverage-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--degraded);
  border-radius: 50%;
  color: var(--degraded);
  font: 800 0.8rem/1 ui-monospace, "Cascadia Mono", monospace;
}

main {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgb(16 27 35 / 97%), rgb(10 17 23 / 97%));
  box-shadow: var(--shadow);
}

.mission-panel {
  position: relative;
  display: grid;
  min-height: 250px;
  grid-template-columns: minmax(0, 1.6fr) minmax(340px, 0.8fr);
  align-items: end;
  gap: 32px;
  overflow: hidden;
  padding: clamp(24px, 4vw, 42px);
}

.mission-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--unknown);
  content: "";
}

.mission-panel.status-healthy::before { background: var(--healthy); }
.mission-panel.status-degraded::before,
.mission-panel.status-stale::before { background: var(--degraded); }
.mission-panel.status-unhealthy::before { background: var(--unhealthy); }
.mission-panel.status-maintenance::before { background: var(--maintenance); }

.mission-copy h2 {
  max-width: 780px;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.freshness {
  max-width: 720px;
  margin-top: 15px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.evidence-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font: 0.72rem/1.3 ui-monospace, "Cascadia Mono", monospace;
}

.freshness-fresh { color: var(--healthy); }
.freshness-aging { color: var(--degraded); }
.freshness-stale,
.freshness-error { color: var(--unhealthy); }
.freshness-unknown { color: var(--unknown); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
}

.summary-grid > div {
  min-height: 88px;
  padding: 15px;
  background: rgb(7 13 18 / 92%);
}

.summary-grid dt {
  color: var(--muted);
  font-size: 0.68rem;
}

.summary-grid dd {
  margin-top: 8px;
  color: var(--text);
  font: 650 1.75rem/1 ui-monospace, "Cascadia Mono", monospace;
}

.summary-grid small {
  color: var(--muted);
  font-size: 0.72rem;
}

.section-block { padding: 4px 0 0; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 1.12rem;
  font-weight: 650;
}

.compact-heading {
  align-items: center;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
}

.capability-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.capability-card {
  position: relative;
  min-height: 116px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: rgb(13 21 28 / 88%);
}

.capability-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: currentColor;
  content: "";
}

.capability-card h3 {
  margin-top: 12px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.capability-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.triage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.section-panel { padding: 20px; }

.record-list {
  display: grid;
  gap: 9px;
  padding-top: 12px;
}

.record-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px;
  background: rgb(255 255 255 / 2.4%);
}

.record-card:hover { border-color: var(--line); }

.record-copy { min-width: 0; }

.record-copy h3 {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.record-copy p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.record-time { white-space: nowrap; }

.severity {
  display: inline-grid;
  min-width: 32px;
  height: 24px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 5px;
  font: 750 0.65rem/1 ui-monospace, "Cascadia Mono", monospace;
}

.severity-p0,
.severity-p1 { color: var(--unhealthy); }
.severity-p2 { color: var(--degraded); }
.severity-p3 { color: var(--unknown); }

.operation-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.flag {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--text-soft);
  font-size: 0.62rem;
}

.flag-missing {
  border-color: rgb(230 184 92 / 42%);
  color: var(--degraded);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding-top: 14px;
}

.evidence-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgb(5 11 15 / 40%);
}

.evidence-card h3 {
  color: var(--text);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.evidence-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.evidence-card .status-dot { margin-top: 4px; }

.outcome-warning {
  display: inline-block;
  margin-top: 7px;
  color: var(--degraded);
  font: 0.64rem/1.2 ui-monospace, "Cascadia Mono", monospace;
}

.hardware-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 14px;
}

.hardware-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 15px;
  background: rgb(5 11 15 / 45%);
}

.hardware-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.hardware-card h3 {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.hardware-card > p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.signal-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.signal-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgb(32 48 59 / 70%);
  padding-top: 7px;
  color: var(--text-soft);
  font-size: 0.68rem;
}

.signal-row span:nth-child(2) { overflow-wrap: anywhere; }

.empty-state {
  display: grid;
  min-height: 92px;
  grid-column: 1 / -1;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 2px 32px;
}

footer p:last-child { text-align: right; }

@media (max-width: 900px) {
  .mission-panel {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .triage-grid,
  .hardware-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 18px, 1240px); }

  .masthead {
    align-items: flex-start;
    gap: 16px;
  }

  .identity { gap: 10px; }

  .identity img {
    width: 42px;
    height: 42px;
  }

  .identity h1 { max-width: 48vw; }

  .snapshot-label,
  .header-status time { display: none; }

  .status-badge {
    margin-top: 3px;
    padding: 8px 10px;
  }

  .mission-panel,
  .section-panel { padding: 18px; }

  .mission-panel {
    min-height: 0;
    gap: 24px;
  }

  .mission-copy h2 { font-size: clamp(1.65rem, 10vw, 2.45rem); }

  .capability-strip {
    display: flex;
    margin-right: -9px;
    padding-right: 9px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .capability-card {
    min-width: min(78vw, 260px);
    scroll-snap-align: start;
  }

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

  .record-card,
  .evidence-card { grid-template-columns: auto minmax(0, 1fr); }

  .record-time,
  .evidence-meta { grid-column: 2; }

  .section-heading { align-items: start; }

  footer { flex-direction: column; }
  footer p:last-child { text-align: left; }
}

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

  .summary-grid > div { min-height: 70px; }

  .header-status { justify-items: start; }

  .masthead { flex-direction: column; }

  .identity h1 { max-width: calc(100vw - 96px); }
}

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