:root {
  color-scheme: dark;
  --bg: #090b08;
  --fg: #e7f0d8;
  --muted: #8d9a7c;
  --card: #10150e;
  --primary: #d6ff4a;
  --primary-fg: #12160c;
  --border: #24301c;
  --input: #2c3a22;
  --sample: #e2b340;
  --down: #7dffb3;
  --up: #ff6b6b;
  --danger: #ff6b6b;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  background-image:
    linear-gradient(to right, rgb(214 255 74 / 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(214 255 74 / 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.75rem; }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.kicker.primary { color: var(--primary); }
h1 { font-size: 1.875rem; line-height: 1.15; font-weight: 500; margin: 0.5rem 0 0; }
h2 { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500; margin: 2rem 0 0; }
h3 { font-size: 1rem; font-weight: 500; margin: 0; }
p { margin: 0.75rem 0 0; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 2rem 1rem; }
.narrow { max-width: 48rem; }
.lede { max-width: 42rem; }
.site-header, .site-footer { border-color: var(--border); }
.site-header { border-bottom: 1px solid var(--border); background: rgb(9 11 8 / 0.95); }
.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; }
.bar { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.bar-top, .split-head, .links, .nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.bar-top { justify-content: space-between; }
.brand { font-family: var(--mono); letter-spacing: 0.22em; color: var(--primary); font-size: 0.875rem; }
.nav-link, .tap, .btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.nav-link {
  padding: 0 0.75rem;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-link.on { background: var(--primary); color: var(--primary-fg); }
.nav-link.on:hover { color: var(--primary-fg); }
.page { display: flex; flex-direction: column; min-height: 100vh; }
.page main { flex: 1; }
.cols { display: flex; flex-direction: column; gap: 2rem; margin-top: 2rem; }
.stack { list-style: none; margin: 0.75rem 0 0; padding: 0; border: 1px solid var(--border); }
.stack > li, .gap { padding: 0.75rem; border-top: 1px solid var(--border); }
.stack > li:first-child, .gap:first-child { border-top: 0; }
.card, .panel, .sample-note, .chart { border: 1px solid var(--border); background: var(--card); }
.card { padding: 0.75rem; }
.between { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.price { font-size: 1rem; margin: 0; }
.desk { display: block; overflow-x: auto; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.875rem; }
th, td { padding: 0.5rem 0.75rem; border-top: 1px solid var(--border); vertical-align: top; }
thead th { border-top: 0; background: rgb(22 28 19 / 0.6); font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.right { text-align: right; }
.badge { display: inline-block; margin-left: 0.5rem; border: 1px solid var(--primary); color: var(--primary); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 0 0.25rem; vertical-align: middle; }
.badge.sample { border-color: var(--sample); color: var(--sample); }
.sample-note { border-color: rgb(226 179 64 / 0.4); background: rgb(226 179 64 / 0.1); color: var(--sample); padding: 0.5rem 0.75rem; font-size: 0.875rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0.75rem 0 0; }
.chip-row a { min-height: 44px; display: inline-flex; align-items: center; border: 1px solid var(--border); padding: 0 0.75rem; font-size: 0.875rem; }
.chip-row a:hover { border-color: var(--primary); color: var(--primary); }
.primary { color: var(--primary); }
.down { color: var(--down); }
.up { color: var(--up); }
.ticker { overflow: hidden; border-bottom: 1px solid var(--border); background: var(--card); }
.marquee { display: flex; width: max-content; animation: marquee 70s linear infinite; }
.marquee:hover { animation-play-state: paused; }
.marquee a { display: flex; align-items: center; gap: 0.75rem; border-right: 1px solid var(--border); padding: 0.5rem 1rem; font-size: 0.875rem; min-height: 44px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee { animation: none; } }
.chart figcaption, .chart-x, .chart-y, .chart-legend { font-family: var(--mono); font-size: 0.875rem; color: var(--fg); }
.chart figcaption { border-bottom: 1px solid var(--border); padding: 0.5rem 0.75rem; }
.chart-body { display: flex; gap: 0.75rem; padding: 0.75rem; }
.chart-y { width: 5rem; flex: none; display: flex; flex-direction: column; justify-content: space-between; text-align: right; padding: 0.25rem 0; }
.chart svg { height: 14rem; width: 100%; min-width: 0; }
.chart-x { display: flex; justify-content: space-between; padding: 0 0.75rem 0.5rem; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0; padding: 0.5rem 0.75rem; border-top: 1px solid var(--border); }
.chart-legend li { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.swatch { width: 0.5rem; height: 0.5rem; display: inline-block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.form { display: flex; flex-direction: column; gap: 1rem; border: 1px solid var(--border); background: var(--card); padding: 1rem; }
label { display: block; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
input, select {
  margin-top: 0.25rem;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--input);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.875rem;
  padding: 0 0.5rem;
}
.btn { border: 1px solid var(--border); background: transparent; color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; padding: 0 0.75rem; cursor: pointer; }
.btn:hover { color: var(--fg); }
.btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.error { color: var(--danger); font-size: 0.75rem; text-transform: none; letter-spacing: 0; margin: 0.25rem 0 0; }
.calc { display: grid; gap: 1.5rem; }
.bar { height: 0.375rem; background: #161c13; margin-top: 0.5rem; }
.bar > span { display: block; height: 100%; background: var(--primary); }
.total { font-size: 1.125rem; margin: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; border: 1px solid var(--border); padding: 1rem; margin-top: 1.5rem; font-size: 0.875rem; }
.prose { font-size: 0.875rem; line-height: 1.75; }
.prose h2 { padding-top: 1rem; }
@media (max-width: 767px) {
  .desk table, .desk thead, .desk tbody, .desk tr, .desk td { display: block; }
  .desk thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .desk { border: 0; }
  .desk tr { border: 1px solid var(--border); background: var(--card); margin-bottom: 0.5rem; padding: 0.35rem 0; }
  .desk td { border: 0; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
  .desk td::before { content: attr(data-label); color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
  .desk td.right { text-align: right; }
}
@media (min-width: 768px) {
  h1 { font-size: 3rem; }
  .wrap { padding-left: 1.5rem; padding-right: 1.5rem; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .calc { grid-template-columns: 280px 1fr; }
}
@media (min-width: 1280px) {
  .cols { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
