:root {
  --bg: #0b0d10;
  --panel: #12151a;
  --panel-2: #171b21;
  --border: #232935;
  --border-soft: #1b2028;
  --text: #e6e8eb;
  --text-2: #a8b0bb;
  --text-3: #6f7885;
  --accent: #4c8dff;
  --teal: #35b8a8;
  --amber: #d9a13b;
  --red: #e56d6d;
  --grid: #1c222c;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* ---------- typography ---------- */

h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
}

p {
  margin: 0 0 12px;
}

p:last-child {
  margin-bottom: 0;
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 5px;
}

.lede {
  color: var(--text-2);
  font-size: 16px;
  max-width: 76ch;
}

.muted {
  color: var(--text-2);
  max-width: 82ch;
}

.caption {
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 10px 0 0;
  max-width: 96ch;
}

/* ---------- header ---------- */

header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 28px;
  margin-bottom: 32px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 14px;
}

/* ---------- explainer ---------- */

.explainer {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 20px;
  margin: 0 0 40px;
}

.explainer h2 {
  margin-bottom: 10px;
}

.explainer dl {
  margin: 16px 0 0;
  display: grid;
  gap: 14px;
}

.explainer dt {
  font-weight: 600;
  font-size: 14.5px;
}

.explainer dd {
  margin: 2px 0 0;
  color: var(--text-2);
  max-width: 82ch;
}

/* ---------- sections ---------- */

section.block {
  padding: 34px 0;
  border-top: 1px solid var(--border-soft);
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

/* ---------- controls ---------- */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  appearance: none;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.pill:hover {
  color: var(--text);
  border-color: #303845;
}

.pill[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.market-bar {
  margin-bottom: 8px;
}

.market-bar .label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

select {
  appearance: none;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 30px 5px 10px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ---------- stats ---------- */

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin: 18px 0 0;
}

.stat .value {
  font-family: var(--mono);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.stat .value.accent {
  color: var(--accent);
}

.stat .value.warn {
  color: var(--amber);
}

.stat .value.bad {
  color: var(--red);
}

.stat .label {
  color: var(--text-3);
  font-size: 12.5px;
  margin-top: 2px;
  max-width: 30ch;
}

/* ---------- panel ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel-2);
  font-size: 13px;
}

.panel-head .tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

.panel-body {
  padding: 18px 16px;
}

/* ---------- progress ---------- */

.progress {
  margin: 4px 0 20px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
}

/* ---------- charts ---------- */

.chart {
  position: relative;
  margin-top: 16px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.axis-line {
  stroke: var(--border);
  stroke-width: 1;
}

.grid-line {
  stroke: var(--grid);
  stroke-width: 1;
}

.tick {
  fill: var(--text-3);
  font-size: 11px;
  font-family: var(--mono);
}

.axis-title {
  fill: var(--text-3);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ref-line {
  stroke-dasharray: 4 4;
  stroke-width: 1.5;
}

.ref-label {
  font-size: 11px;
  font-family: var(--mono);
}

.hover-guide {
  stroke: var(--text-3);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
}

.legend-key {
  width: 11px;
  height: 3px;
  border-radius: 2px;
  flex: none;
}

.legend-key.box {
  height: 10px;
  border-radius: 2px;
}

.tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: #0e1116;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12.5px;
  min-width: 132px;
  opacity: 0;
  transition: opacity 0.1s;
}

.tooltip.on {
  opacity: 1;
}

.tooltip .tt-head {
  font-family: var(--mono);
  color: var(--text-3);
  font-size: 11.5px;
  margin-bottom: 5px;
}

.tooltip .tt-row {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.tooltip .tt-val {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

/* ---------- tables ---------- */

.table-wrap {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 9px 14px;
  white-space: nowrap;
}

th {
  background: var(--panel-2);
  color: var(--text-2);
  font-weight: 500;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}

td {
  border-bottom: 1px solid var(--border-soft);
  font-variant-numeric: tabular-nums;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.014);
}

.num {
  text-align: right;
  font-family: var(--mono);
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 1px;
}

.dot.ok {
  background: var(--teal);
}

.dot.warn {
  background: var(--amber);
}

.dot.bad {
  background: var(--red);
}

.dot.off {
  background: #39404d;
}

.dot.info {
  background: var(--accent);
}

/* ---------- callout ---------- */

.callout {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--amber);
  border-radius: 0 8px 8px 0;
  background: var(--panel);
  padding: 14px 16px;
}

.callout h3 {
  color: var(--amber);
}

.callout p {
  color: var(--text-2);
  margin: 0;
  max-width: 84ch;
}

/* ---------- footer ---------- */

footer {
  margin-top: 46px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13px;
}

footer p {
  max-width: 88ch;
}

.loading,
.failed {
  color: var(--text-3);
  padding: 40px 0;
}

@media (max-width: 640px) {
  .wrap {
    padding: 32px 16px 64px;
  }
  h1 {
    font-size: 24px;
  }
  .stats {
    gap: 22px;
  }
}
