:root {
  --ink: #151717;
  --muted: #616968;
  --paper: #f7f9f8;
  --line: #d7ddda;
  --panel: #ffffff;
  --cyan: #00a5b5;
  --green: #1c8f61;
  --orange: #d76c1f;
  --red: #b63845;
  --shadow: 0 18px 55px rgba(21, 23, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(21, 23, 23, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 23, 23, 0.045) 1px, transparent 1px), var(--paper);
  background-size: 44px 44px;
  font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
}

.shell {
  width: min(1460px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar {
  min-height: 96px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

.eyebrow,
th {
  margin: 0;
  font-family: 'Azeret Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-family: 'Azeret Mono', monospace;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 0.95;
}

h2 {
  font-size: 20px;
  line-height: 1.15;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  background: var(--panel);
  font-family: 'Azeret Mono', monospace;
  font-size: 12px;
}

.dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
}

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

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 112px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 5px solid var(--ink);
}

.metric span {
  color: var(--muted);
  font-family: 'Azeret Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  font-family: 'Azeret Mono', monospace;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.7fr);
  gap: 12px;
}

.table-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
  margin-top: 12px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.chart-frame {
  position: relative;
  min-height: 390px;
}

.averages-panel .table-wrap {
  margin-top: 8px;
}

.delta-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.delta {
  border-left: 5px solid var(--cyan);
  background: #f2f7f6;
  padding: 14px;
}

.delta strong {
  display: block;
  font-family: 'Azeret Mono', monospace;
  font-size: 22px;
  margin-top: 10px;
}

.delta small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.delta.negative {
  border-color: var(--green);
}

.delta.positive {
  border-color: var(--orange);
}

.delta.pending {
  border-color: var(--line);
  background: #f6f7f7;
}

.delta.baseline {
  border-color: var(--cyan);
  background: #eef8f9;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 9px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

td {
  font-family: 'Azeret Mono', monospace;
  font-size: 12px;
}

.feed-cell {
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 960px) {
  .metrics-grid,
  .main-grid,
  .table-grid {
    grid-template-columns: 1fr;
  }

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