:root {
  --bg: #000;
  --ink: #f3f3ef;
  --ink2: rgba(243, 243, 239, 0.68);
  --ink3: rgba(243, 243, 239, 0.44);
  --ink4: rgba(243, 243, 239, 0.22);
  --line: rgba(255, 255, 255, 0.09);
  --line2: rgba(255, 255, 255, 0.17);
  --panel: rgba(4, 4, 4, 0.78);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --top: 64px;
  --bottom: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  overflow: hidden;
  height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }

/* -- layers ------------------------------------------------------------------------------- */
#stage { position: fixed; inset: 0; z-index: 0; }
#veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; transition: background 0.6s ease; }
body[data-route='network'] #veil {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 30%, transparent 52%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, transparent 22%);
}
body[data-route='story'] #veil { background: linear-gradient(270deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.3) 38%, transparent 60%); }
body[data-route='stem'] #veil { background: linear-gradient(90deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 36%, transparent 58%); }
body[data-route='plant'] #veil, body[data-route='portfolio'] #veil { background: rgba(0, 0, 0, 0.58); }
body[data-route='docs'] #veil { background: rgba(0, 0, 0, 0.9); }
body.no-webgl #stage { background: url('../img/texture.webp') center / 640px; opacity: 0.18; }

#labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; transition: opacity 0.4s ease; }
body[data-route='docs'] #labels, body[data-route='plant'] #labels, body[data-route='portfolio'] #labels { opacity: 0; }
body[data-route='docs'] #labels a, body[data-route='plant'] #labels a, body[data-route='portfolio'] #labels a { pointer-events: none; }

.lbl { position: absolute; left: 0; top: 0; pointer-events: auto; text-decoration: none; will-change: transform; }
.lbl .in { display: flex; flex-direction: column; align-items: center; gap: 1px; white-space: nowrap; transition: opacity 0.25s ease; }
.lbl b { font-weight: 500; }
.lbl .p { font: 400 11px/1.2 var(--mono); color: var(--ink3); }
.lbl.stem .in { transform: translate(-50%, 14px); }
.lbl.stem b { font: 500 11px/1.2 var(--mono); letter-spacing: 0.14em; color: var(--ink); }
.lbl.core .in { transform: translate(-50%, 26px); }
.lbl.core b { font: 400 13px/1.2 var(--serif); font-style: italic; letter-spacing: 0.02em; color: var(--ink2); }
.lbl.core .p { font-size: 10px; }
.lbl.story .in { transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 999px; }
.lbl.story b { font: 400 16px/1.1 var(--serif); font-style: italic; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.lbl.story:hover .in, .lbl.story.active .in { background: rgba(0, 0, 0, 0.55); box-shadow: 0 0 0 1px var(--line2); }
.lbl:hover .p { color: var(--ink); }
body[data-route='story'] .lbl.story:not(.active) .in, body[data-route='stem'] .lbl.story .in { opacity: 0.45; }

/* -- top ---------------------------------------------------------------------------------- */
header.top {
  position: fixed; z-index: 5; top: 0; left: 0; right: 0; height: var(--top);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
header.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 24px; height: 24px; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5)); }
.brand span { font: 400 22px/1 var(--serif); letter-spacing: 0.01em; }
.mode {
  display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px;
  border: 1px solid var(--line2); border-radius: 999px; background: rgba(0, 0, 0, 0.5);
  font: 400 11px/1 var(--mono); letter-spacing: 0.04em; color: var(--ink2); cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.mode i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--ink2); }
.mode.live i { background: #fff; border-color: #fff; box-shadow: 0 0 8px #fff; }
.mode .short { display: none; }
.top .right { display: flex; align-items: center; gap: 12px; }
.top .x { font: 400 12px/1 var(--mono); color: var(--ink3); text-decoration: none; }
.top .x:hover { color: var(--ink); }
.chain { display: inline-flex; align-items: center; gap: 7px; font: 400 11px/1 var(--mono); color: var(--ink3); letter-spacing: 0.04em; }
.chain i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.35; } }

/* -- bottom bar --------------------------------------------------------------------------- */
footer.bar {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; height: var(--bottom);
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px;
  padding: 0 max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
footer.bar > * { pointer-events: auto; }
.ticker { display: flex; gap: 14px; overflow: hidden; min-width: 0; -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent); mask-image: linear-gradient(90deg, #000 80%, transparent); }
.ticker a { display: inline-flex; gap: 6px; align-items: baseline; text-decoration: none; font: 400 11px/1 var(--mono); color: var(--ink3); white-space: nowrap; }
.ticker a b { font-weight: 500; color: var(--ink2); letter-spacing: 0.08em; }
.ticker a:hover, .ticker a:hover b { color: var(--ink); }
.dock {
  display: flex; gap: 2px; padding: 4px; border-radius: 999px; border: 1px solid var(--line2);
  background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.dock a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 999px; text-decoration: none; font: 500 13px/1 var(--sans); color: var(--ink2); }
.dock a:hover { color: var(--ink); }
.dock a.on { background: var(--ink); color: #000; }
.fresh { justify-self: end; font: 400 11px/1 var(--mono); color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

#toasts { position: fixed; z-index: 9; right: 16px; bottom: calc(var(--bottom) + 8px); display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(8, 8, 8, 0.92); font-size: 13px; }
.toast.err { border-color: rgba(255, 255, 255, 0.5); }
.toast.ok { box-shadow: 0 0 0 1px #fff inset; }

/* -- view host ---------------------------------------------------------------------------- */
#view { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
#view > * { pointer-events: auto; }

/* -- common ------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.04);
  font: 500 13px/1 var(--sans); color: var(--ink); text-decoration: none; cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); }
.btn.primary { background: var(--ink); color: #000; border-color: var(--ink); }
.btn.primary:hover { background: #fff; box-shadow: 0 0 24px rgba(255, 255, 255, 0.25); }
.btn.small { min-height: 32px; padding: 0 14px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.36; cursor: not-allowed; box-shadow: none; }
.mini { min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; font: 400 11px/1 var(--mono); color: var(--ink2); cursor: pointer; }
.mini:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.4); }
.mini:disabled { opacity: 0.35; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line2); font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-decoration: none; }
.chip.ghost { color: var(--ink3); letter-spacing: 0.02em; font-weight: 400; }
a.chip:hover { border-color: #fff; }
.close { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); text-decoration: none; font-size: 18px; color: var(--ink2); }
.close:hover { color: var(--ink); border-color: #fff; }
.eyebrow { margin: 0 0 10px; font: 400 11px/1.2 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink3); }
.fine { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink3); }
.fine:empty { display: none; }
.note { margin: 12px 0 0; padding: 10px 12px; border-left: 1px solid var(--ink2); font-size: 12px; color: var(--ink2); background: rgba(255, 255, 255, 0.03); }
.addr { font: 400 12px/1.3 var(--mono); color: var(--ink2); text-decoration: none; border-bottom: 1px dotted var(--ink4); word-break: break-all; }
.addr:hover { color: var(--ink); }
.k { font: 400 11px/1.3 var(--mono); letter-spacing: 0.06em; color: var(--ink3); text-transform: uppercase; }
.v { font: 400 14px/1.35 var(--mono); color: var(--ink); }
.sub { font-size: 11px; color: var(--ink3); line-height: 1.35; }
.cd { font: 400 12px/1.3 var(--mono); color: var(--ink2); white-space: nowrap; }

/* -- sheets ------------------------------------------------------------------------------- */
.sheet {
  position: absolute; top: var(--top); bottom: calc(var(--bottom) + 4px); overflow-y: auto; overscroll-behavior: contain;
  width: min(460px, calc(100% - 24px)); padding: 20px 22px 28px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  backdrop-filter: blur(18px) saturate(0.6); -webkit-backdrop-filter: blur(18px) saturate(0.6);
  isolation: isolate; scrollbar-width: thin; scrollbar-color: var(--ink4) transparent;
}
.sheet::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: url('../img/texture.webp') center top / 560px; opacity: 0.05; mix-blend-mode: screen;
}
.sheet.right { right: 12px; }
.sheet.left { left: 12px; }
.sheet.wide-left { width: min(560px, calc(100% - 24px)); }
.sheet.wide { left: 12px; width: min(980px, calc(100% - 24px)); }
.sheet-head .crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sheet-head .title { margin: 0; font: 400 34px/1.05 var(--serif); letter-spacing: -0.005em; overflow-wrap: anywhere; }
.sym-title { margin: 0; font: 400 72px/0.95 var(--serif); letter-spacing: -0.01em; text-shadow: 0 0 30px rgba(255, 255, 255, 0.25); }
.expiry { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 10px 0 0; font-size: 12px; color: var(--ink2); }

.blk { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.blk > h3 { margin: 0 0 12px; font: 400 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink3); }

.kv { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kv .v, .kv .addr { overflow-wrap: anywhere; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 14px 18px; }
.kv-grid.big { margin-top: 18px; }
.kv-grid.big .v { font: 400 26px/1.1 var(--serif); }
.quote { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 14px 0; }
.quote .kv:last-child { grid-column: 1 / -1; }
.quote .v { font-size: 13px; }

/* the ladder */
.ladder { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.band {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 6px 12px; align-items: center;
  min-height: 74px; padding: 12px 14px; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--line); cursor: pointer;
}
.band:first-child { border-top: 0; }
.band:hover { background: rgba(255, 255, 255, 0.035); }
.band-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.band-label { font: 400 20px/1.1 var(--serif); overflow-wrap: anywhere; }
.band-range { font: 400 11px/1.2 var(--mono); color: var(--ink3); }
.prob { font: 400 18px/1 var(--mono); color: var(--ink2); }
.track { grid-column: 1 / -1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--ink2); transition: width 0.6s ease; }
.band.sel { background: rgba(255, 255, 255, 0.07); box-shadow: inset 2px 0 0 #fff; }
.band.sel .prob, .band.lead .prob { color: var(--ink); }
.band.sel .track i { background: #fff; box-shadow: 0 0 10px #fff; }
.band.lost { opacity: 0.35; }
.band.won .band-label { text-shadow: 0 0 18px rgba(255, 255, 255, 0.7); }
.marker { position: absolute; left: 0; width: 26px; height: 0; border-top: 1px solid #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.9); pointer-events: none; }
.marker em { position: absolute; left: -3px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; }

.tabs { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line2); border-radius: 999px; width: max-content; margin-bottom: 12px; }
.tab { min-height: 32px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink2); cursor: pointer; font-weight: 500; font-size: 13px; }
.tab.on { background: var(--ink); color: #000; }
.amt-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 0 8px 0 14px; min-height: 52px; border: 1px solid var(--line2); border-radius: 14px; background: rgba(255, 255, 255, 0.02); }
.amt-row:focus-within { border-color: rgba(255, 255, 255, 0.5); }
.amt { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; color: var(--ink); font: 400 22px/1 var(--mono); outline: none; }
.unit { font: 400 12px/1 var(--mono); color: var(--ink3); }
.row2, .row3 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.row3 { grid-template-columns: repeat(3, 1fr); }
.row3 .btn { padding: 0 8px; }
.pool-rows { display: flex; flex-direction: column; margin-bottom: 12px; }
.pool-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pool-row .ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pool-row .sub { text-align: right; }

.plate { position: relative; margin: 18px 0 0; overflow: hidden; }
.plate img { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent); mask-composite: intersect; }
.plate img { width: 100%; height: auto; aspect-ratio: 3 / 2; mix-blend-mode: screen; }
.plate figcaption { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 0 5%; width: 38%; }
.plate.hero figcaption { left: 0; }
.plate.expiry figcaption { right: 0; text-align: left; }
.story-sheet .plate figcaption { width: 34%; }
.plate figcaption strong { font: 400 22px/1.1 var(--serif); }
.plate figcaption span { font-size: 11px; color: var(--ink3); }

/* -- network ------------------------------------------------------------------------------ */
.network { position: absolute; inset: var(--top) 0 var(--bottom) 0; pointer-events: none !important; }
.network > * { pointer-events: auto; }
.intro { position: absolute; left: max(24px, 3vw); top: 3vh; width: min(460px, 42vw); }
.intro h1 { margin: 0; font: 400 clamp(40px, 4.6vw, 68px)/0.98 var(--serif); letter-spacing: -0.01em; text-shadow: 0 0 40px rgba(0, 0, 0, 0.8); }
.lede { margin: 16px 0 0; max-width: 42ch; color: var(--ink2); font-size: 14px; line-height: 1.6; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.index { position: absolute; left: max(24px, 3vw); bottom: 12px; width: min(500px, 36vw); }
.index header { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line2); }
.count { font: 400 11px/1.3 var(--mono); color: var(--ink3); }
.story-index { list-style: none; margin: 0; padding: 0; }
.story-index li a {
  display: grid; grid-template-columns: 26px 44px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px;
  align-items: baseline; padding: 9px 4px; border-bottom: 1px solid var(--line); text-decoration: none;
}
.story-index li a:hover { background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent); }
.story-index .num { font: 400 11px/1 var(--mono); color: var(--ink4); grid-row: 1 / 3; }
.story-index .sym { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; color: var(--ink2); grid-row: 1 / 3; }
.story-index .ttl { font: 400 18px/1.15 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-index .lead { grid-column: 3; font-size: 12px; color: var(--ink3); }
.story-index .cd { grid-column: 4; grid-row: 1; text-align: right; }
.story-index .empty, .mini-list .empty { padding: 10px 4px; color: var(--ink3); font-size: 13px; }

/* -- stem --------------------------------------------------------------------------------- */
.chart-host { min-height: 110px; }
.spark { margin: 0; }
.spark svg { width: 100%; height: 96px; display: block; filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5)); }
.spark figcaption { display: flex; justify-content: space-between; font: 400 11px/1 var(--mono); color: var(--ink3); margin-top: 6px; }
.mini-list { list-style: none; margin: 0 0 12px; padding: 0; }
.mini-list a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.mini-list .ttl { font: 400 17px/1.2 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -- plant -------------------------------------------------------------------------------- */
.plant-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 28px; }
.plant-side { position: sticky; top: 0; align-self: start; padding-top: 22px; }
.plant-side .k { display: block; margin-bottom: 10px; }
.ttl-prev { margin: 0 0 12px; font: 400 26px/1.1 var(--serif); overflow-wrap: anywhere; }
.plant-side .band { cursor: default; }
.stem-picks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.stem-pick { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 10px; min-height: 58px; border: 1px solid var(--line2); border-radius: 12px; background: transparent; cursor: pointer; }
.stem-pick b { font: 500 12px/1 var(--mono); letter-spacing: 0.08em; }
.stem-pick .p { font: 400 11px/1 var(--mono); color: var(--ink3); }
.stem-pick.on { border-color: #fff; background: rgba(255, 255, 255, 0.08); box-shadow: 0 0 20px rgba(255, 255, 255, 0.08); }
.field { display: flex; flex-direction: column; gap: 6px; }
.txt { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 12px; background: rgba(255, 255, 255, 0.02); color: var(--ink); font: 400 14px/1 var(--sans); outline: none; }
.txt:focus { border-color: rgba(255, 255, 255, 0.5); }
input[type='datetime-local'].txt { font-family: var(--mono); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.segs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.segs .k { margin-right: 6px; }
.seg { width: 40px; min-height: 36px; border: 1px solid var(--line2); border-radius: 10px; background: transparent; cursor: pointer; font-family: var(--mono); }
.seg.on { background: var(--ink); color: #000; border-color: var(--ink); }
.band-head, .band-edit { display: grid; grid-template-columns: 22px minmax(0, 1fr) 76px minmax(0, 150px); gap: 8px; align-items: center; }
.band-head { margin-bottom: 6px; }
.band-edit { padding: 6px 0; }
.band-edit .num { font: 400 11px/1 var(--mono); color: var(--ink4); }
.band-edit .range { font-family: var(--mono); }
.txt.odds { font-family: var(--mono); padding: 0 8px; }
.strike-edit { display: flex; align-items: center; gap: 8px; padding: 2px 0 2px 30px; }
.strike-edit .dollar { font: 400 13px/1 var(--mono); color: var(--ink3); }
.strike-edit .txt { max-width: 140px; min-height: 36px; font-family: var(--mono); border-style: dashed; }
.errors { margin: 12px 0; padding: 0 0 0 16px; color: var(--ink2); font-size: 12px; }
.errors:empty { display: none; }

/* -- portfolio ---------------------------------------------------------------------------- */
.holding { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.holding > .ttl { display: block; font: 400 18px/1.2 var(--serif); }

/* -- docs --------------------------------------------------------------------------------- */
.reader { position: absolute; inset: var(--top) 0 var(--bottom) 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ink4) transparent; }
.chapters { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; overflow-x: auto; padding: 8px max(16px, calc((100% - 880px) / 2)); background: linear-gradient(180deg, #000 60%, transparent); scrollbar-width: none; }
.chapters button { display: inline-flex; gap: 6px; align-items: baseline; white-space: nowrap; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: var(--ink2); cursor: pointer; font-size: 12px; }
.chapters button:hover { color: var(--ink); border-color: var(--line2); }
.chapters .num { font: 400 10px/1 var(--mono); color: var(--ink4); }
.reader-inner { max-width: 880px; margin: 0 auto; padding: 8px 16px 60px; }
.reader .plate.hero { margin-top: 8px; }
.reader .plate.hero figcaption { width: 40%; }
.reader .plate h1 { margin: 0; font: 400 clamp(26px, 4vw, 48px)/1 var(--serif); }
.reader .plate h3 { margin: 0; font: 400 clamp(22px, 3vw, 34px)/1.05 var(--serif); }
.reader .plate p { margin: 6px 0 0; font-size: 13px; color: var(--ink2); }
.reader .plate .eyebrow { margin: 0 0 6px; }
.chapter { padding: 46px 0 8px; scroll-margin-top: 56px; }
.chapter > h2 { margin: 0 0 16px; font: 400 clamp(30px, 4vw, 44px)/1.05 var(--serif); }
.chapter p { max-width: 68ch; color: var(--ink2); font-size: 15px; line-height: 1.7; }
.chapter .kv-grid { margin: 18px 0; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 14px 0 14px 48px; border-top: 1px solid var(--line); color: var(--ink2); line-height: 1.65; counter-increment: s; max-width: 72ch; }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 16px; font: 400 12px/1 var(--mono); color: var(--ink3); }
.steps b { color: var(--ink); font-weight: 500; }
.plain { padding-left: 18px; color: var(--ink2); line-height: 1.7; max-width: 70ch; }
.plain li { margin: 8px 0; }
.plain b { color: var(--ink); font-weight: 500; }
.formula { margin: 16px 0; padding: 16px; border: 1px solid var(--line2); border-radius: 12px; font: 400 14px/1.5 var(--mono); overflow-x: auto; background: rgba(255, 255, 255, 0.02); }
.table-wrap { overflow-x: auto; margin: 16px 0; }
.tbl { width: 100%; border-collapse: collapse; font: 400 12px/1.4 var(--mono); }
.tbl th { text-align: left; font-weight: 400; color: var(--ink3); padding: 8px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }

/* -- responsive --------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .ticker { display: none; }
  footer.bar { grid-template-columns: 1fr auto 1fr; }
  .top .x { display: none; }
}
@media (max-width: 900px) {
  .plant-grid { grid-template-columns: minmax(0, 1fr); }
  .plant-side { position: static; padding-top: 12px; }
  .stem-picks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mode .long { display: none; }
  .mode .short { display: inline; }
}
@media (max-width: 760px) {
  :root { --top: 56px; --bottom: 60px; }
  footer.bar { grid-template-columns: minmax(0, 1fr); padding-bottom: env(safe-area-inset-bottom); }
  .fresh { display: none; }
  .dock { justify-self: stretch; justify-content: space-between; }
  .dock a { flex: 1; justify-content: center; padding: 0 6px; }
  .chain { display: none; }
  .brand span { font-size: 20px; }
  .sheet, .sheet.right, .sheet.left, .sheet.wide, .sheet.wide-left {
    left: 0; right: 0; width: auto; top: 34dvh; bottom: var(--bottom);
    border-radius: 20px 20px 0 0; border-bottom: 0; padding: 18px 16px 28px;
  }
  body[data-route='plant'] .sheet, body[data-route='portfolio'] .sheet { top: var(--top); border-radius: 20px 20px 0 0; }
  body[data-route='story'] #veil, body[data-route='stem'] #veil { background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, transparent 70%); }
  .sheet-head .title { font-size: 28px; }
  .sym-title { font-size: 56px; }
  .intro { left: 16px; right: 16px; width: auto; top: 8px; }
  .intro h1 { font-size: 36px; }
  body[data-route='network'] .lede { display: none; }
  body[data-route='network'] .lbl.story, body[data-route='story'] .lbl.story:not(.active) { display: none; }
  .cta .btn { min-height: 38px; }
  .index { left: 0; right: 0; bottom: 0; width: auto; padding: 0 16px 6px; background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 60%, transparent); }
  .index header { border-bottom: 0; }
  .story-index { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .story-index li { flex: 0 0 min(78vw, 300px); scroll-snap-align: start; }
  .story-index li a { grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto auto; border: 1px solid var(--line2); border-radius: 14px; padding: 10px 12px; background: rgba(0, 0, 0, 0.6); min-height: 84px; }
  .story-index .num { display: none; }
  .story-index .sym { grid-row: 1; grid-column: 1; }
  .story-index .ttl { grid-column: 2; grid-row: 1; }
  .story-index .lead { grid-column: 2; grid-row: 2; }
  .story-index .cd { grid-column: 2; grid-row: 3; text-align: left; font-size: 11px; color: var(--ink3); }
  .lbl.story b { font-size: 13px; max-width: 130px; }
  .lbl.core { display: none; }
  .quote { grid-template-columns: 1fr; }
  .band-head, .band-edit { grid-template-columns: 18px minmax(0, 1fr) 64px; }
  .band-head span:last-child, .band-edit .range { display: none; }
  .plate figcaption { position: static; width: auto !important; padding: 12px 2px 0; }
  .reader .plate.hero img, .reader .plate.expiry img { aspect-ratio: 3 / 2; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 .btn:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .lede { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Portfolio: a primary action directly under an explanatory line needs air. */
.fine + .btn.wide { margin-top: 16px; }
