:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f7f7f4;
  --line: #d8dcd5;
  --line-strong: #9ca39a;
  --text: #111111;
  --muted: #5b5f5a;
  --quiet: #777c76;
  --accent: #111111;
  --good: #156f3a;
  --bad: #9d2f22;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0;
}

.topbar {
  min-height: 118px;
  border-bottom: 1px solid var(--line-strong);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 26px clamp(14px, 4vw, 42px);
  background: var(--bg);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

a {
  color: inherit;
}

.kicker {
  color: var(--good);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.kicker a {
  color: var(--accent);
  text-decoration: none;
}

.status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status span,
.panel-head a,
.metric-label {
  border: 1px solid var(--line);
  padding: 7px 9px;
  background: var(--panel);
}

main {
  padding: clamp(14px, 4vw, 42px);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metrics div,
.panel,
.filters {
  background: var(--panel);
  border: 1px solid var(--line);
}

.metrics div {
  padding: 16px;
}

.metric-label {
  display: inline-block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.metrics strong {
  display: block;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1;
}

.source-tape {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.source-tape-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.source-tape-head .kicker {
  margin: 0;
}

.source-desk {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.source-card {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
  display: grid;
  gap: 5px;
}

.source-card:last-child {
  border-right: 0;
}

.source-card strong,
.source-card span {
  text-transform: uppercase;
}

.source-card span,
.source-card small,
.evidence-note {
  color: var(--muted);
  font-size: 10px;
}

.source-card.status-ok {
  border-top-color: var(--good);
}

.source-card.status-challenged,
.source-card.status-error {
  border-top-color: var(--bad);
}

.source-card.status-degraded {
  border-top-color: #a46b12;
}

.evidence-note {
  max-width: 32ch;
  margin-top: 5px;
}

.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.filters {
  padding: 14px;
  display: grid;
  gap: 14px;
  align-content: start;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  min-height: 38px;
  padding: 8px;
  font: inherit;
}

input:focus,
select:focus,
.panel-head a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.panel {
  min-width: 0;
}

.panel-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head a {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

canvas {
  display: block;
  width: 100%;
  height: 320px;
}

.table-wrap {
  overflow: auto;
  max-height: 58vh;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  color: var(--muted);
  text-transform: uppercase;
}

tr {
  cursor: pointer;
}

tr:hover,
tr.active {
  background: var(--panel-2);
}

.title {
  font-weight: 800;
  color: var(--text);
}

.subtle {
  color: var(--muted);
  margin-top: 4px;
}

.price {
  font-size: 18px;
  color: var(--accent);
  font-weight: 800;
}

.down {
  color: var(--good);
}

.up {
  color: var(--bad);
}

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

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

  .metrics,
  .workspace,
  .source-desk {
    grid-template-columns: 1fr;
  }

  .source-tape-head {
    flex-direction: column;
  }

  .source-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  canvas {
    height: 260px;
  }
}
