:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #5d6f6a;
  --line: #c9d8d3;
  --panel: #f8fbfa;
  --paper: #ffffff;
  --green: #1e6f5c;
  --blue: #285f9f;
  --amber: #a46200;
  --red: #9e2f3d;
  --violet: #5f4aa3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #edf4f1;
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  font-weight: 760;
}

h2 {
  font-size: 16px;
  font-weight: 720;
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 28px 36px;
}

.status-strip,
.mission,
.toolbar,
.panel-card-header,
.metric-row {
  display: flex;
  align-items: center;
}

.status-strip {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef5f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.pill.private {
  border-color: #b7b0d9;
  background: #eeeaf9;
  color: var(--violet);
}

.pill.measured,
.pill.fresh {
  border-color: #a6d6ca;
  background: #e6f5f0;
  color: var(--green);
}

.pill.stale,
.pill.partial,
.pill.pending {
  border-color: #e8c690;
  background: #fff5df;
  color: var(--amber);
}

.pill.missing,
.pill.blocked {
  border-color: #e2a7ae;
  background: #fff0f2;
  color: var(--red);
}

.hidden {
  display: none;
}

.mission {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mission article,
.panel-card,
.timeline,
.source-drawer,
.toolbar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mission article {
  padding: 16px;
}

.mission span,
.toolbar label,
.panel-sources,
.summary {
  color: var(--muted);
  font-size: 13px;
}

.mission strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.toolbar {
  gap: 14px;
  margin-top: 14px;
  padding: 12px;
  flex-wrap: wrap;
}

.toolbar label {
  display: grid;
  gap: 5px;
  min-width: 170px;
  font-weight: 700;
}

select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  background: #fbfefd;
  color: var(--ink);
}

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

.panel-card {
  padding: 16px;
  min-height: 180px;
}

.panel-card-header {
  justify-content: space-between;
  gap: 12px;
}

.summary {
  min-height: 44px;
  margin-top: 10px;
  line-height: 1.45;
}

.metric-row {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.metric {
  min-width: 116px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.panel-sources {
  margin-top: 12px;
  word-break: break-word;
}

.timeline,
.source-drawer {
  margin-top: 14px;
  padding: 16px;
}

.timeline ol {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.timeline li {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 700;
}

#source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.source-link {
  color: var(--blue);
  text-decoration: none;
  word-break: break-word;
}

.source-link:hover {
  text-decoration: underline;
}

@media (max-width: 960px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

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

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

@media (max-width: 620px) {
  main,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .mission,
  .panel-grid,
  .timeline ol {
    grid-template-columns: 1fr;
  }

  .toolbar label {
    min-width: 100%;
  }
}
