@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;700&family=Libre+Baskerville:wght@700&display=swap');

:root {
  color-scheme: light;
  --paper: #f4f1e8;
  --ink: #12110f;
  --muted: #6f6b62;
  --line: #211f1b;
  --panel: #fffdf6;
  --wash: #e8e1d3;
  --red: #c83232;
  --teal: #137f81;
  --acid: #c8e22b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(18, 17, 15, 0.045) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(0deg, rgba(18, 17, 15, 0.035) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

.shell {
  width: min(1520px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}

.mast {
  min-height: 160px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  gap: 22px;
  align-items: end;
  border-bottom: 3px solid var(--line);
  padding-bottom: 20px;
}

.eyebrow,
.stamp span,
.kpi span,
.panel-head span,
small,
footer {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 960px;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: clamp(42px, 8vw, 116px);
  line-height: 0.88;
  letter-spacing: 0;
}

p {
  margin: 0;
}

.stamp {
  display: grid;
  gap: 7px;
  justify-items: end;
  text-align: right;
}

.stamp strong {
  font-size: 13px;
}

.refresh-button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  padding: 0 12px;
  text-transform: uppercase;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.stamp em {
  max-width: 260px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 2px solid var(--line);
}

.kpi {
  min-height: 128px;
  padding: 15px 14px 13px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.kpi:last-child {
  border-right: 0;
}

.kpi strong {
  font-size: clamp(26px, 3.6vw, 54px);
  line-height: 0.9;
  white-space: nowrap;
}

.kpi em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.tabs button,
.seg button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 0 13px;
}

.tabs button.active,
.seg button.active {
  background: var(--ink);
  color: var(--paper);
}

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

.panel {
  background: rgba(255, 253, 246, 0.78);
  border: 1px solid var(--line);
}

.table-panel {
  max-width: 100%;
  overflow-x: auto;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(33, 31, 27, 0.24);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
}

td b,
td small {
  display: block;
}

.rank {
  color: var(--red);
  width: 42px;
}

.bar {
  display: block;
  height: 7px;
  margin-top: 8px;
  background: var(--wash);
  border: 1px solid rgba(33, 31, 27, 0.2);
}

.bar i {
  display: block;
  height: 100%;
  background: var(--ink);
}

.bar i.red {
  background: var(--red);
}

.bar i.teal {
  background: var(--teal);
}

.bar i.black {
  background: var(--ink);
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

input[type='search'] {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.count {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.pool-panel {
  margin-top: 18px;
}

.pill {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 4px 7px;
  background: var(--acid);
  white-space: nowrap;
}

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

.exposure article {
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px;
}

.exposure span {
  color: var(--red);
  font-size: 12px;
}

.exposure strong {
  font-size: clamp(20px, 2vw, 32px);
  line-height: 0.95;
}

.exposure em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-transform: uppercase;
}

footer {
  padding-top: 18px;
  text-align: right;
}

@media (max-width: 980px) {
  .mast,
  .kpis,
  .overview-grid,
  .exposure,
  .controls {
    grid-template-columns: 1fr;
  }

  .stamp {
    justify-items: start;
    text-align: left;
  }

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

  .kpi:last-child {
    border-bottom: 0;
  }

  .controls {
    align-items: stretch;
  }

  table {
    min-width: 760px;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100vw - 18px, 1520px);
  }

  .mast {
    min-height: 132px;
  }

  h1 {
    font-size: 38px;
  }

  .kpi strong {
    font-size: 34px;
  }
}
