:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --ink: #101315;
  --muted: #475159;
  --panel: #ffffff;
  --panel-2: #f1f4f6;
  --line: #d6dde2;
  --line-strong: #101315;
  --accent: #0b5fff;
  --accent-2: #185183;
  --green: #127169;
  --warn: #8e6506;
  --red: #b00020;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Aptos", "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.4;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 12px 14px 24px;
}

.topbar {
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--line-strong);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  min-height: 132px;
  padding: 14px;
}

p,
h1,
h2 {
  margin: 0;
}

.topbar p,
.section-title span,
.thesis-copy span,
.pool-card > span,
.verdict-card > span,
.scenario span,
.source-band span:first-child {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(32px, 5vw, 76px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.05;
  max-width: 920px;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
}

.stamp,
small,
.stat span {
  color: var(--muted);
}

.stamp {
  font-size: 12px;
  text-align: right;
}

.stamp span {
  color: var(--red);
}

.top-actions {
  align-items: end;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.refresh-button {
  appearance: none;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  min-height: 34px;
  padding: 0 12px;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  background: var(--accent);
  color: #fff;
  outline: 0;
}

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

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

.lead {
  margin: 8px 0;
}

.stat,
.band,
.thesis,
.pool-card,
.verdict-card,
.scenario {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.stat {
  min-height: 78px;
  padding: 10px;
}

.stat strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.stat small {
  display: block;
  font-size: 12px;
  margin-top: 7px;
}

.thesis {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  margin: 8px 0;
  padding: 14px;
}

.thesis-copy h2 {
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1.08;
  max-width: 980px;
}

.thesis-copy p {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 12px;
  max-width: 840px;
}

.thesis-numbers {
  align-content: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 8px;
}

.thesis-numbers .mini {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  margin-top: 0;
  padding: 10px;
}

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

.mini strong {
  display: block;
  font-size: 21px;
  line-height: 1.05;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.mini small {
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.band {
  margin-top: 8px;
  padding: 12px;
}

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

.pool-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr 1.15fr;
}

.pool-card,
.verdict-card,
.scenario {
  padding: 12px;
}

.pool-card > strong,
.verdict-card > strong,
.scenario strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  margin: 6px 0;
  overflow-wrap: anywhere;
}

.status-pill {
  background: #eaf1ff;
  border: 1px solid #b8cfff;
  border-radius: 3px;
  color: var(--accent-2);
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
}

.verdict-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 16px 0 0;
}

.gauge-band .metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 8px;
}

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

.table-title {
  align-items: center;
}

.segmented {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  padding: 3px;
}

.seg {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--muted);
  cursor: pointer;
  min-height: 32px;
  padding: 0 9px;
}

.seg.active,
.seg:hover,
.seg:focus-visible {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--ink);
  outline: 0;
}

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

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

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

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 4px;
}

mark {
  background: #eef3ff;
  border: 1px solid #c9d8ff;
  border-radius: 3px;
  color: var(--ink);
  display: inline-block;
  padding: 4px 6px;
}

mark.good {
  background: #e9f8f3;
  border-color: #bbdfd5;
}

mark.warn {
  background: #fff6df;
  border-color: #e6d4a4;
}

.bar {
  background: #edf1f3;
  border: 1px solid var(--line);
  display: block;
  height: 7px;
  margin-top: 7px;
  overflow: hidden;
}

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

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

footer {
  color: var(--muted);
  font-size: 12px;
  padding: 14px 2px 0;
}

footer a {
  color: var(--accent);
}

.source-band {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
}

.source-band p {
  color: var(--muted);
  line-height: 1.5;
  margin: 7px 0 0;
}

.source-list {
  display: grid;
  gap: 6px;
  justify-items: end;
  overflow-wrap: anywhere;
}

.source-list span,
.source-list a {
  color: var(--muted);
  font-size: 12px;
}

.source-list a {
  color: var(--accent);
}

.loading {
  color: var(--muted);
  display: grid;
  min-height: 60vh;
  place-items: center;
}

.error {
  color: var(--red);
}

@media (max-width: 920px) {
  .app-shell {
    padding: 10px;
  }

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

  .stamp {
    text-align: left;
  }

  .top-actions {
    justify-items: start;
  }

  .metric-strip,
  .gauge-band .metric-strip,
  .thesis,
  .pool-grid,
  .scenario-grid,
  .source-band {
    grid-template-columns: 1fr;
  }

  .thesis-numbers {
    grid-template-columns: 1fr;
  }

  .source-list {
    justify-items: start;
  }

  .segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}
