/* Positioning site: one stylesheet for every page. No external fonts or assets. */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink2: #52514e;
  --muted: #6c6a65;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --long: #2a78d6;
  --short: #eb6834;
  --long-wash: rgba(42, 120, 214, 0.10);
  --short-wash: rgba(235, 104, 52, 0.10);
  --long-band: rgba(42, 120, 214, 0.05);
  --short-band: rgba(235, 104, 52, 0.05);
  --unseen: #c3c2b7;
  --warn: #8a5a00;
  --warn-bg: #fdf3dc;
  --link: #1c5cab;
  --hover: rgba(11, 11, 11, 0.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink2: #c3c2b7;
    --muted: #9a9890;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --long: #3987e5;
    --short: #d95926;
    --long-wash: rgba(57, 135, 229, 0.14);
    --short-wash: rgba(217, 89, 38, 0.14);
    --long-band: rgba(57, 135, 229, 0.06);
    --short-band: rgba(217, 89, 38, 0.06);
    --unseen: #4a4a47;
    --warn: #fab219;
    --warn-bg: #2b2412;
    --link: #86b6ef;
    --hover: rgba(255, 255, 255, 0.05);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 26px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; color: var(--ink2); }
p { margin: 0 0 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink2); }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.long { color: var(--ink); }
.nowrap { white-space: nowrap; }

/* header / footer */
.top { border-bottom: 1px solid var(--border); background: var(--surface); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 52px; flex-wrap: wrap; }
.brand { font-weight: 650; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 18px; height: 18px; display: inline-block; }
.venue { font-size: 12px; color: var(--ink2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.nav { display: flex; gap: 16px; font-size: 14px; }
.nav a { color: var(--ink2); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.fresh { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fresh .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--axis); }
.fresh.ok .dot { background: #0ca30c; }
.fresh.stale { color: var(--warn); }
.fresh.stale .dot { background: #fab219; }
footer { margin: 40px 0 32px; font-size: 13px; color: var(--muted); }
footer .wrap { border-top: 1px solid var(--border); padding-top: 16px; }

/* layout */
.hero { padding: 28px 0 8px; }
.hero p { color: var(--ink2); max-width: 720px; margin-top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 20px 0; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tile .label { font-size: 13px; color: var(--ink2); }
.tile .value { font-size: 22px; font-weight: 620; margin-top: 2px; }
.tile .sub { font-size: 12px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin: 16px 0; }
.card > header { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.card > header p { margin: 0; color: var(--ink2); font-size: 14px; flex-basis: 100%; }
.sub-h { margin: 22px 0 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 12px 0; }
.err { padding: 40px 0; color: var(--ink2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

/* controls */
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button {
  font: inherit; font-size: 13px; padding: 5px 12px; border: 0; background: transparent; color: var(--ink2);
  cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--hover); color: var(--ink); font-weight: 600; }
input[type="search"] {
  font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); width: 220px; max-width: 100%;
}

/* key (legend) */
.key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink2); }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.key i.line { width: 14px; height: 2px; border-radius: 1px; }
.bg-long { background: var(--long); }
.bg-short { background: var(--short); }
.bg-unseen { background: var(--unseen); }

/* the markets table */
.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th {
  font-size: 12px; font-weight: 600; color: var(--ink2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface);
  white-space: normal; vertical-align: bottom; line-height: 1.3;
}
#markets th, #markets td { padding: 9px 10px; }
thead th button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit;
}
thead th[aria-sort] button::after { content: " \2193"; }
thead th[aria-sort="ascending"] button::after { content: " \2191"; }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
td { font-variant-numeric: tabular-nums; }
td.sym a { font-weight: 600; color: var(--ink); }
.split { display: inline-flex; align-items: center; gap: 8px; }
.split .bar { width: 64px; height: 8px; display: flex; gap: 2px; }
.split .bar b { display: block; height: 100%; }
.split .bar b:first-child { background: var(--long); border-radius: 4px 0 0 4px; }
.split .bar b:last-child { background: var(--short); border-radius: 0 4px 4px 0; }
svg.spark { display: block; }
@media (max-width: 760px) { .opt { display: none; } }

/* tier butterfly */
.fly { margin-top: 10px; }
.fly-head, .fly-row { display: grid; grid-template-columns: 112px 1fr 1fr 84px; align-items: center; column-gap: 0; }
.fly-head { font-size: 12px; color: var(--ink2); padding-bottom: 4px; }
.fly-head .s { text-align: right; padding-right: 10px; }
.fly-head .l { padding-left: 10px; }
.fly-head .n, .fly-row .n { text-align: right; }
.fly-row { padding: 5px 0; border-top: 1px solid var(--border); }
.fly-row:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.fly-row:hover { background: var(--hover); }
.fly-row .t { font-size: 14px; }
.fly-row .t small { display: block; font-size: 12px; color: var(--muted); }
.half { display: flex; align-items: center; gap: 6px; min-width: 0; height: 22px; }
.half.s { flex-direction: row-reverse; border-right: 1px solid var(--axis); padding-right: 0; }
.half.l { padding-left: 0; }
.half .b { height: 14px; flex: none; }
.half.s .b { background: var(--short); border-radius: 4px 0 0 4px; }
.half.l .b { background: var(--long); border-radius: 0 4px 4px 0; }
.half .v { font-size: 12px; color: var(--ink2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fly-row.unseen .half .b { background: var(--unseen); }
@media (max-width: 520px) {
  .fly-head, .fly-row { grid-template-columns: 84px 1fr 1fr 64px; }
  .fly-row .t { font-size: 13px; }
}

/* charts */
.chart { position: relative; width: 100%; margin-top: 6px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart svg:focus { outline: none; }
.chart svg:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; border-radius: 4px; }
.chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart text.q { fill: var(--muted); font-size: 11px; }
.multi { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; }
.multi h3 { margin-top: 10px; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; display: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); padding: 8px 10px; font-size: 12px; min-width: 140px;
}
.tip .h { color: var(--ink2); margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip .r b { font-weight: 650; font-variant-numeric: tabular-nums; }
.tip .r span { color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; }
.tip .r i { display: inline-block; width: 12px; height: 2px; border-radius: 1px; }
details.tbl { margin-top: 6px; font-size: 13px; }
details.tbl summary { cursor: pointer; color: var(--ink2); }
details.tbl table { font-size: 13px; margin-top: 6px; }
details.tbl .tablewrap { max-height: 320px; overflow: auto; }

/* methodology */
.prose { max-width: 760px; }
.prose h2 { margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink2); }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); }
.note { margin-top: 10px; }
@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 14px; }
  .tile { padding: 10px 12px; }
  .tile .value { font-size: 19px; }
}
