@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f4f1ea;
  --ink: #1c1b19;
  --graphite: #6b675f;
  --rule: #d9d3c7;
  --track: #e3ded3;
  --faint: #a8a297;
  --carbon: #2e4a7d;
  --stamp: #c23b22;
  --pencil: #8a847a;
  --mix-cache-read: #cfc8ba;
}

* { box-sizing: border-box; margin: 0; }

html { background: var(--paper); }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 72px 0 96px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}
@media (max-width: 1100px) { .page { padding: 48px 24px 72px; } }
@media (max-width: 640px) { .page { padding: 24px 20px 40px; gap: 40px; } }

.sr-only {
  position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--graphite);
}
.muted { color: var(--graphite); }
.small { font-size: 12px; }

/* Masthead */
.masthead { display: flex; flex-direction: column; gap: 44px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink); min-height: 44px;
}
.site { font-weight: 700; text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 20px; }

.status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--graphite); white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--stamp); }
.status-label { font-weight: 700; letter-spacing: 0.07em; color: var(--ink); }
.status.is-offline .status-dot { background: transparent; border: 1px solid var(--graphite); }
.status.is-offline .status-label { color: var(--graphite); }

.switch { display: inline-flex; border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; }
.switch button {
  font: inherit; font-size: 12px; color: var(--ink); background: none;
  border: 0; padding: 5px 10px; cursor: pointer;
}
.switch button:hover { background: var(--track); }
.switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 700; }
.switch button:focus-visible { outline-offset: -3px; outline-color: var(--carbon); }

.headline { display: flex; flex-direction: column; gap: 12px; }
.headline-figure { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 16px; }
.big {
  font-size: 96px; font-weight: 700; letter-spacing: -0.036em; line-height: 1;
}
.big.is-zero { color: var(--faint); }
.big-unit { font-size: 20px; }
.lede { font-size: 16px; color: var(--graphite); line-height: 1.5; }
.lede a { color: var(--ink); font-weight: 700; }

.figures {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule); padding-top: 20px;
}
.figure { display: flex; flex-direction: column; gap: 6px; padding: 0 24px; min-height: 72px; }
.figure:first-child { padding-left: 0; }
.figure + .figure { border-left: 1px solid var(--rule); }
.figure-label { font-size: 12px; color: var(--graphite); }
.figure-value { font-size: 28px; font-weight: 700; line-height: 1.15; }
.figure-note { font-size: 12px; color: var(--graphite); }

.notice {
  display: flex; gap: 12px; padding: 12px 14px;
  border: 1px dashed var(--graphite); border-radius: 4px; font-size: 12px; line-height: 1.5;
}
.notice strong { min-width: 44px; }

@media (max-width: 640px) {
  .masthead { gap: 24px; }
  .topbar { flex-wrap: wrap; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .big { font-size: 64px; }
  .big-unit { font-size: 16px; }
  .lede { font-size: 14px; }
  .figures { grid-template-columns: 1fr 1fr; padding-top: 0; }
  .figure { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .figure + .figure { border-left: 0; }
  .figure-value { font-size: 22px; }
  .figure-note { display: none; }
}

/* Sections */
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--ink);
}
.section-title { font-size: 20px; font-weight: 700; display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.section-title h2 { font-size: inherit; }
.legend { display: flex; gap: 16px; font-size: 12px; font-weight: 400; padding-bottom: 3px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-item.is-zero { color: var(--graphite); }
.swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }

/* Chart */
.chart { position: relative; padding-top: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.chart text { font-family: inherit; font-size: 11px; fill: var(--graphite); }
.chart .tick-strong { fill: var(--ink); font-weight: 700; }
.chart .bar-group { cursor: default; }
.chart.has-active .bar-group:not(.is-active) { opacity: 0.3; }
.chart-note { font-size: 12px; color: var(--graphite); padding-top: 10px; }

.tooltip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--ink); color: var(--paper); border-radius: 4px; padding: 12px;
  font-size: 12px; min-width: 180px; display: flex; flex-direction: column; gap: 6px;
}
.tooltip[hidden] { display: none; }
.tooltip-row { display: flex; justify-content: space-between; gap: 16px; }
.tooltip-row span:first-child { color: var(--rule); }
.tooltip-total { border-top: 1px solid #4e4a44; padding-top: 6px; font-weight: 700; }
.tooltip-total span:first-child { color: var(--paper); }

/* Breakdown */
.breakdown { display: grid; grid-template-columns: 624fr 360fr; gap: 56px; align-items: start; }
@media (max-width: 900px) { .breakdown { grid-template-columns: 1fr; gap: 40px; } }

.ledger { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ledger th {
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--graphite); text-align: left; padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.ledger td { padding: 14px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ledger .num { text-align: right; }
.ledger th.num { padding-right: 0; }
.ledger .col-model { width: auto; }
.ledger .col-tokens { width: 84px; }
.ledger .col-share { width: 136px; padding-left: 16px; }
.ledger .col-cached { width: 72px; }
.ledger .col-cost { width: 80px; }
.ledger tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); padding-top: 12px; font-weight: 700; }

.model { display: flex; gap: 10px; align-items: center; min-width: 0; }
.model .swatch { width: 8px; height: 8px; }
.model-name { font-weight: 700; overflow-wrap: anywhere; }
.model-sub { font-size: 12px; color: var(--graphite); }
.model-sub .cached-inline { display: none; }

.share { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--graphite); }
.share-track { width: 80px; height: 6px; background: var(--track); flex: none; }
.share-fill { height: 100%; min-width: 2px; }
.cost { font-weight: 700; }

@media (max-width: 640px) {
  .ledger .col-share, .ledger .col-cached { display: none; }
  .model-sub .cached-inline { display: inline; }
  .ledger .col-tokens { width: 76px; }
}

.mix-bar { display: flex; gap: 2px; height: 28px; margin: 20px 0 28px; }
.mix-seg { min-width: 4px; }
.mix-list { list-style: none; padding: 0; }
.mix-list li {
  display: grid; grid-template-columns: 8px 1fr 80px 52px; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.mix-list li:last-child { border-bottom: 0; }
.mix-list .swatch { width: 8px; height: 8px; }
.mix-list .value { text-align: right; font-weight: 700; }
.mix-list .pct { text-align: right; font-size: 12px; color: var(--graphite); }

.errors { display: flex; flex-direction: column; border-top: 1px solid var(--rule); margin-bottom: 24px; }
.error-row { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 12px; }
.error-row .provider { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; }
.error-row .provider .swatch { width: 8px; height: 8px; }
.error-title { font-weight: 700; }

/* Footer */
.footer {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap;
  border-top: 2px solid var(--ink); padding-top: 16px; font-size: 12px;
}
.footer p { max-width: 560px; line-height: 1.5; }
.footer-links { display: flex; gap: 20px; font-weight: 700; }

/* Empty / skeleton */
.empty-actions { font-size: 14px; font-weight: 700; }
.skel { display: block; background: var(--track); border-radius: 2px; height: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .skel { animation: pulse 1.6s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.55; } }
}
