/* ───────────────────────── Economillion Library & Labs ─────────────────────────
   A research-note design language: flat ink surfaces, 1px rules, small radii,
   small-caps labels, tabular figures. Color is reserved for data and for
   state (right/wrong, gain/loss). No gradients, glows, lifts or entrance
   animations. Tokens come from styles.css; the tower scene is put away here. */

:root {
  --lx-ink: #070a11;
  --lx-sheet: #0b0e16;
  --lx-sheet-2: #0e121b;
  --lx-rule: rgba(236, 229, 213, 0.075);
  --lx-rule-2: rgba(236, 229, 213, 0.14);
  --lx-body: #cdc9be;
  --lx-good: #58b98d;
  --lx-bad: #e07c6c;
  --lx-r: 4px;
  --lx-hl: rgba(217, 182, 106, 0.06);
}

body[data-view="learn"] { background: var(--lx-ink); }
body[data-view="learn"] .scene,
body[data-view="learn"] .ladder,
body[data-view="learn"] .lift-ind { display: none !important; }
body[data-view="learn"] .shell { max-width: 1180px; }

.lx-page { padding-bottom: 48px; }
.lx-page a { text-decoration-color: rgba(239, 227, 196, 0.3); text-underline-offset: 3px; }
.lx-page p a, .lx-insight a, .lx-assume a, .lx-example a, .cx-note a { color: var(--accent); }
.lx-eyebrow { display: inline-block; font-size: 12.5px; letter-spacing: 0.005em; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.lx-eyebrow i { font-family: var(--font-display); font-size: 14px; letter-spacing: .01em; text-transform: none; color: var(--t-hedge_fund); font-weight: 400; }
.lx-h-sm, .lib-k, .cx-k { display: block; font-size: 12.5px; font-weight: 500; letter-spacing: 0.005em; color: var(--muted); margin: 0 0 10px; }
.lx-ok { color: var(--lx-good); font-weight: 600; }
.lx-no { color: var(--lx-bad); font-weight: 600; }
.lx-foot { margin: 40px 0 0; padding-top: 14px; border-top: 1px solid var(--lx-rule); font-size: 12px; color: var(--faint); }

/* ───────── Controls ───────── */
.btn-sm { padding: 7px 12px; font-size: 13px; }
.lx-page .btn { border-radius: var(--lx-r); }
.lx-chip { font: inherit; font-size: 12.5px; padding: 5px 10px; border-radius: 3px; border: 1px solid var(--lx-rule-2); background: transparent; color: var(--text-2); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.lx-chip:hover { color: var(--text); border-color: rgba(255,255,255,.28); background: var(--lx-hl); }
.lx-chip:disabled { opacity: .35; cursor: default; }
.lx-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 4px; }
.lx-presets-k { font-size: 12.5px; letter-spacing: 0.005em; color: var(--faint); font-weight: 600; margin-right: 4px; }
.lx-seg { display: inline-flex; border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); overflow: hidden; }
.lx-seg button { border: 0; border-left: 1px solid var(--lx-rule-2); background: transparent; padding: 6px 11px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.lx-seg button:first-child { border-left: 0; }
.lx-seg button:hover { color: var(--text); }
.lx-seg button.on { background: var(--surface-2); color: var(--text); }
.lx-ctl-block { display: grid; gap: 8px; }
.lx-inline-ctl { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.lx-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.lx-actions .btn.on { border-color: rgba(239,227,196,.5); color: var(--text); background: var(--lx-hl); }
.lx-note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

/* Sliders */
.lx-sl { display: grid; gap: 4px; }
.lx-sl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lx-sl-label { font-size: 13px; color: var(--text-2); }
.lx-sl-num { width: 9.5ch; text-align: right; background: transparent; border: 1px solid transparent; border-radius: 3px; padding: 2px 6px; margin-right: -6px; color: var(--text); font-size: 13.5px; }
.lx-sl-num:hover { border-color: var(--lx-rule-2); }
.lx-sl-num:focus { outline: none; border-color: rgba(239,227,196,.5); background: var(--lx-ink); }
.lx-sl-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); font-family: var(--font-mono); }
.lx-sl.compact { gap: 2px; }
.lx-range { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; cursor: pointer; --p: 50%; touch-action: pan-y; }
.lx-range::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--text-2) var(--p), rgba(255,255,255,.12) var(--p)); }
.lx-range::-moz-range-track { height: 2px; background: rgba(255,255,255,.12); }
.lx-range::-moz-range-progress { height: 2px; background: var(--text-2); }
.lx-range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border-radius: 50%; background: var(--accent); border: 2px solid var(--lx-sheet); box-shadow: 0 0 0 1px rgba(239,227,196,.7); }
.lx-range::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--lx-sheet); }
.lx-range:focus-visible { outline: none; }
.lx-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent); }
.lx-row-ctl { max-width: 440px; margin: 4px 0 16px; }
.lx-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 28px; margin: 6px 0 18px; }

/* ───────── Tables, stats, notes ───────── */
.lx-table-wrap { overflow-x: auto; border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); }
.lx-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lx-table th { text-align: left; font-size: 12.5px; letter-spacing: 0.005em; color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--lx-rule-2); white-space: nowrap; background: var(--lx-sheet-2); }
.lx-table td { padding: 8px 12px; border-top: 1px solid var(--lx-rule); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lx-table th:not(:first-child), .lx-table td:not(:first-child) { text-align: right; }
.lx-table .lx-strong { color: var(--text); }
.lx-table tr.tot td { color: var(--text); font-weight: 600; border-top: 1px solid var(--lx-rule-2); }
.lx-table tr.same td:not(:first-child) { color: var(--muted); }
.lx-table tr.chg td:last-child { color: var(--text); }

.lx-q-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); }
.lx-q-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lx-q-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; }
.lx-q-grid > div { padding: 10px 12px; display: grid; gap: 2px; align-content: start; min-width: 0; border-left: 1px solid var(--lx-rule); }
.lx-q-grid > div:first-child { border-left: 0; }
.lx-q-grid .k { font-size: 11px; color: var(--muted); }
.lx-q-grid b { font-family: var(--font-mono); font-size: 18px; font-weight: 500; letter-spacing: -0.02em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.lx-q-grid em { font-style: normal; font-size: 11px; color: var(--faint); }
.lx-q-grid em .up { color: var(--lx-good); }
.lx-q-grid em .down { color: var(--lx-bad); }

.lx-insight, .cx-note { margin: 0; padding: 10px 0 0; border-top: 1px solid var(--lx-rule); font-size: 14px; line-height: 1.6; color: var(--lx-body); }
.lx-page .lx-insight { max-width: none; }
.lx-insight b, .cx-note b { color: var(--text); font-weight: 600; }
.lx-page .lx-assume { display: block; max-width: 78ch; margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.lx-page .lx-assume > span:first-child { display: inline-block; margin-right: 8px; font-size: 12.5px; letter-spacing: 0.005em; font-weight: 500; color: var(--text-2); }
.lx-example { margin: 20px 0 0; max-width: 72ch; padding: 2px 0 2px 14px; border-left: 2px solid var(--brass); font-size: 14.5px; line-height: 1.65; color: var(--lx-body); }
.lx-ex-k { display: block; font-size: 12.5px; letter-spacing: 0.005em; color: var(--brass); font-weight: 600; margin-bottom: 2px; }
.lx-more { margin-top: 14px; max-width: 72ch; border-top: 1px solid var(--lx-rule); padding-top: 10px; }
.lx-more summary { cursor: pointer; font-size: 13.5px; color: var(--text-2); list-style: none; display: inline-flex; gap: 8px; align-items: center; }
.lx-more summary::-webkit-details-marker { display: none; }
.lx-more summary::before { content: '+'; font-family: var(--font-mono); color: var(--muted); width: 10px; }
.lx-more[open] summary::before { content: '−'; }
.lx-more p { color: var(--lx-body); font-size: 14.5px; line-height: 1.65; margin: 8px 0 0; }
.lx-formula { font-size: 13.5px !important; padding: 10px 12px; border-radius: var(--lx-r); background: var(--lx-ink); border: 1px solid var(--lx-rule-2); overflow-x: auto; white-space: nowrap; }

/* ───────── Charts ───────── */
.lx-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.lx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lx-legend i { width: 9px; height: 9px; border-radius: 1px; background: var(--c); }
.lx-legend i.ln { width: 14px; height: 2px; border-radius: 0; }
.lx-legend i.ln.dash { background: repeating-linear-gradient(90deg, var(--c) 0 3px, transparent 3px 6px); }
.lx-chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.lx-chart { position: relative; width: 100%; user-select: none; -webkit-user-select: none; }
.lx-chart svg { display: block; overflow: visible; touch-action: pan-y; }
.lx-axis { font-family: var(--font-mono); font-size: 10.5px; fill: var(--faint); }
.lx-grid { stroke: rgba(255,255,255,.05); stroke-width: 1; }
.lx-grid.zero { stroke: rgba(255,255,255,.22); }
.lx-edge { fill: none; stroke: rgba(255,255,255,.5); stroke-width: 1.25; }
.lx-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lx-line.thick { stroke-width: 2.5; }
.lx-ghost { fill: none; stroke: var(--text-2); stroke-width: 1.25; stroke-dasharray: 4 4; opacity: .7; }
.lx-guide { fill: none; stroke: rgba(255,255,255,.3); stroke-width: 1; stroke-dasharray: 2 3; }
.lx-mark { stroke: rgba(255,255,255,.26); stroke-width: 1; stroke-dasharray: 2 3; }
.lx-pin { fill: var(--text); stroke: var(--lx-sheet); stroke-width: 2; }
.lx-pin.eq { fill: var(--text); }
.lx-anno { font-family: var(--font-ui); font-size: 11px; fill: var(--text-2); paint-order: stroke; stroke: var(--lx-sheet); stroke-width: 4px; stroke-linejoin: round; }
.lx-anno.strong { fill: var(--text); font-weight: 600; }
.lx-cross { stroke: rgba(255,255,255,.35); stroke-width: 1; }
.lx-dot { stroke: var(--lx-sheet); stroke-width: 2; }
.lx-hit { fill: transparent; cursor: crosshair; }
.lx-ctl-line { stroke: var(--lx-bad); stroke-width: 1.25; stroke-dasharray: 5 4; }
.lx-gap-line { stroke: var(--lx-bad); stroke-width: 4; opacity: .5; }
.lx-conn { stroke: rgba(255,255,255,.22); stroke-width: 1; stroke-dasharray: 2 3; }
.lx-bar-v { font-family: var(--font-mono); font-size: 10.5px; fill: var(--text-2); }
.lx-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 170px; padding: 8px 10px; border-radius: 3px; background: #0a0d14; border: 1px solid var(--lx-rule-2); font-size: 12px; display: grid; gap: 3px; }
.lx-tip[hidden] { display: none; }
.lx-tip b { font-weight: 600; font-size: 11.5px; color: var(--text); padding-bottom: 4px; margin-bottom: 2px; border-bottom: 1px solid var(--lx-rule); }
.lx-tip span { display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: center; color: var(--muted); }
.lx-tip i { width: 8px; height: 2px; background: var(--c); }
.lx-tip em { font-style: normal; font-family: var(--font-mono); color: var(--text); text-align: right; }

/* ───────── Knowledge checks & definitions ───────── */
.lx-check { padding: 4px 0; max-width: 760px; }
.lx-check + .lx-check { border-top: 1px solid var(--lx-rule); margin-top: 16px; padding-top: 18px; }
.lx-check-q { font-size: 16px; line-height: 1.5; color: var(--text); margin: 0 0 12px; font-weight: 500; }
.lx-opts { display: grid; border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); }
.lx-opt { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: center; text-align: left; padding: 11px 14px; border: 0; border-top: 1px solid var(--lx-rule); background: transparent; cursor: pointer; font-size: 14.5px; color: var(--text-2); }
.lx-opt:first-child { border-top: 0; }
.lx-opt:hover:not(:disabled) { color: var(--text); background: var(--lx-hl); }
.lx-opt:disabled { cursor: default; }
.lx-opt-k { width: 22px; height: 22px; border-radius: 3px; display: grid; place-items: center; font-size: 11px; border: 1px solid var(--lx-rule-2); color: var(--muted); }
.lx-check.answered .lx-opt:not(.right):not(.picked) { color: var(--faint); }
.lx-opt.right { color: var(--text); background: rgba(88,185,141,.06); }
.lx-opt.right .lx-opt-k { background: var(--lx-good); border-color: var(--lx-good); color: var(--lx-ink); }
.lx-opt.wrong { color: var(--text); background: rgba(224,124,108,.06); }
.lx-opt.wrong .lx-opt-k { background: var(--lx-bad); border-color: var(--lx-bad); color: var(--lx-ink); }
.lx-why { margin: 0; padding: 0 14px 12px 48px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.lx-why.ok { color: var(--lx-body); }
.lx-term { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help; text-decoration: underline dotted; text-decoration-color: rgba(239,227,196,.5); text-underline-offset: 4px; }
.lx-term:hover, .lx-term[aria-expanded="true"] { color: var(--accent); }
.lx-pop { position: absolute; z-index: 60; padding: 12px 14px 10px; border-radius: var(--lx-r); background: #0d111a; border: 1px solid var(--lx-rule-2); }
.lx-pop b { font-size: 14px; font-weight: 600; }
.lx-pop p { margin: 4px 0 10px; font-size: 13.5px; line-height: 1.55; color: var(--lx-body); }
.lx-pop-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--lx-rule); padding-top: 8px; font-size: 12.5px; }
.lx-pop-f a { color: var(--accent); text-decoration: none; }
.lx-pop-save { display: inline-flex; gap: 6px; align-items: center; background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.lx-pop-save:hover, .lx-pop-save[aria-pressed="true"] { color: var(--accent); }
.lx-save { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 3px; border: 1px solid var(--lx-rule-2); background: transparent; color: var(--text-2); cursor: pointer; font-size: 12.5px; }
.lx-save:hover { color: var(--text); border-color: rgba(255,255,255,.28); }
.lx-save[aria-pressed="true"] { color: var(--accent); border-color: rgba(239,227,196,.4); }
.lx-crumbs { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--faint); padding-top: 22px; }
.lx-crumbs a { color: var(--muted); text-decoration: none; }
.lx-crumbs a:hover { color: var(--text); }

/* ═════════════════════════ The Library ═════════════════════════ */
.lib-mast { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 48px; align-items: start; padding: 34px 0 30px; border-bottom: 1px solid var(--lx-rule-2); }
.lib-intro h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(44px, 5.4vw, 64px); line-height: 1; letter-spacing: -0.02em; margin: 0 0 14px; }
.lib-intro p { color: var(--text-2); font-size: 16px; line-height: 1.6; max-width: 56ch; margin: 0; }
.lib-card { display: grid; gap: 14px; }
.lib-prog, .lib-cat-prog { width: 100%; border-collapse: collapse; font-size: 13px; }
.lib-prog th, .lib-cat-prog th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 0; }
.lib-prog td { text-align: right; padding: 6px 0; color: var(--text); }
.lib-prog tr { border-bottom: 1px solid var(--lx-rule); }
.lib-prog tr:first-child { border-top: 1px solid var(--lx-rule-2); }
.lib-prog td .mono { color: var(--muted); }
.lib-rank { display: inline-flex; align-items: center; gap: 6px; color: var(--c); }
.lib-rank b { font-weight: 600; }
.lib-cat-prog th { width: 88px; font-size: 12px; padding: 3px 0; }
.lib-cat-prog td { padding: 3px 0; }
.lib-cat-prog td.mono { width: 44px; text-align: right; font-size: 11.5px; color: var(--muted); }
.lib-cat-prog .bar i { display: block; height: 3px; background: rgba(255,255,255,.07); }
.lib-cat-prog .bar b { display: block; height: 100%; background: var(--cc); }

.lib-feature { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); gap: 32px; padding: 26px 0 28px; border-bottom: 1px solid var(--lx-rule-2); }
.lib-discover { display: grid; gap: 10px; align-content: start; }
.lib-discover p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.lib-discover .btn { justify-self: start; }
.lib-remaining { font-size: 11.5px; color: var(--faint); }

.lib-browse { padding-top: 22px; scroll-margin-top: 80px; }
.lib-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 6px; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-chip { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; padding: 5px 10px; border-radius: 3px; border: 1px solid var(--lx-rule-2); background: transparent; color: var(--text-2); cursor: pointer; }
.lib-chip i { width: 7px; height: 7px; border-radius: 1px; background: var(--cc); }
.lib-chip:hover { color: var(--text); border-color: rgba(255,255,255,.28); }
.lib-chip.on { color: var(--text); background: var(--surface-2); border-color: rgba(255,255,255,.3); }
.lib-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lib-row > * { min-width: 0; max-width: 100%; }
.lib-row .lx-seg { overflow-x: auto; scrollbar-width: none; }
.lib-row .lx-seg button { white-space: nowrap; }
.lib-search { width: auto; flex: 1 1 200px; max-width: 300px; padding: 6px 10px; font-size: 13px; border-radius: var(--lx-r); margin-left: auto; }
.lib-gh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 28px 0 8px; border-bottom: 1px solid var(--lx-rule-2); margin-bottom: 0; }
.lib-gh h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 26px; letter-spacing: -0.01em; }
.lib-gh h2::before { content: ''; width: 8px; height: 8px; border-radius: 1px; background: var(--cc); }
.lib-gh span { font-size: 11.5px; color: var(--muted); }
.lib-empty { padding: 44px 0; text-align: center; color: var(--muted); }

/* Index entries: a ruled grid, not floating cards */
.cc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-left: 1px solid var(--lx-rule); }
.cc-grid.small { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); border-top: 1px solid var(--lx-rule); }
.cc { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; padding: 14px 16px 12px; text-decoration: none; color: inherit; border-right: 1px solid var(--lx-rule); border-bottom: 1px solid var(--lx-rule); transition: background .15s; }
a.cc:hover { background: var(--lx-hl); }
a.cc:hover .cc-title { color: var(--accent); }
a.cc:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cc-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; letter-spacing: 0.005em; font-weight: 500; color: var(--muted); }
.cc-cat::before { content: ''; width: 6px; height: 6px; border-radius: 1px; background: var(--cc); }
.cc-no { font-size: 10.5px; color: var(--faint); font-family: var(--font-mono); }
.cc-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 21px; line-height: 1.15; letter-spacing: -0.005em; }
.cc-hook { align-self: start; margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; font-size: 11px; }
.cc-st { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); }
.cc-st.seen { color: var(--muted); }
.cc-st.mastered { color: var(--lx-good); font-weight: 600; }
.cc-lv { display: inline-flex; align-items: center; gap: 4px; color: var(--c); font-size: 12.5px; letter-spacing: 0.005em; font-weight: 500; white-space: nowrap; }
.cc.locked { cursor: not-allowed; }
.cc.locked .cc-title, .cc.locked .cc-hook { color: var(--faint); }
.cc.locked .cc-st { color: var(--muted); }
.cc.big { border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); padding: 20px 22px 16px; min-height: 0; }
.cc.big .cc-title { font-size: clamp(30px, 3.2vw, 38px); }
.cc.big .cc-hook { font-size: 15.5px; -webkit-line-clamp: 4; color: var(--lx-body); }

/* Labs strip */
.lib-labs { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--lx-rule-2); }
.lib-labs-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; }
.lib-labs-h h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 26px; }
.lib-labs-h p { margin: 0; color: var(--muted); font-size: 13.5px; }
.lib-lab-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); border-top: 1px solid var(--lx-rule); border-left: 1px solid var(--lx-rule); }
.lib-lab-list a { display: grid; gap: 2px; padding: 10px 14px; text-decoration: none; border-right: 1px solid var(--lx-rule); border-bottom: 1px solid var(--lx-rule); }
.lib-lab-list a:hover { background: var(--lx-hl); }
.lib-lab-list .k { font-size: 12.5px; letter-spacing: 0.005em; color: var(--muted); }
.lib-lab-list b { font-size: 14.5px; font-weight: 600; }
.lib-lab-list .m { font-size: 11px; color: var(--faint); }

/* ═════════════════════════ Concept page: a report layout ═════════════════════════ */
.cpt { max-width: 980px; margin: 0 auto; }
.cpt-head { padding: 16px 0 26px; border-bottom: 1px solid var(--lx-rule-2); }
.cpt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--faint); }
.cpt-meta .cc-cat { color: var(--text-2); }
.cpt-deep { font-size: 12.5px; letter-spacing: 0.005em; font-weight: 500; color: var(--t-hedge_fund); }
.cpt-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(42px, 5.6vw, 64px); line-height: 1.02; letter-spacing: -0.02em; margin: 14px 0 14px; }
.cpt-hook { margin: 0; font-family: var(--font-display); font-size: clamp(21px, 2.3vw, 26px); line-height: 1.35; color: var(--text-2); max-width: 36em; }
.cpt-sec { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 0 32px; padding: 26px 0; border-bottom: 1px solid var(--lx-rule); }
.cpt-sec h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.15; letter-spacing: 0; color: var(--text); }
.cpt-sec h2 .mono { font-family: var(--font-display); font-style: italic; font-size: 18px; color: var(--gold); letter-spacing: 0; }
.cpt-body { min-width: 0; }
.cpt-body > p { margin: 0; max-width: 66ch; font-size: 16.5px; line-height: 1.7; color: var(--lx-body); }
.cpt-sec.twist .cpt-body > p { padding-left: 16px; border-left: 2px solid var(--brass); color: var(--text); }
.cpt-formula { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--lx-r); background: var(--lx-ink); border: 1px solid var(--lx-rule-2); font-size: 13.5px; line-height: 1.8; color: var(--text); white-space: pre-wrap; overflow-x: auto; }
.cpt-dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; }
.cpt-dl dt { font-size: 12.5px; letter-spacing: 0.005em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.cpt-dl dd { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--lx-body); }
.cpt-lab { display: inline-grid; grid-template-columns: auto auto; gap: 0 12px; align-items: baseline; margin-top: 14px; padding: 8px 12px; border-radius: var(--lx-r); border: 1px solid var(--lx-rule-2); text-decoration: none; }
.cpt-lab .k { grid-row: span 2; font-size: 12.5px; letter-spacing: 0.005em; color: var(--muted); font-weight: 600; }
.cpt-lab b { font-weight: 600; font-size: 14px; }
.cpt-lab span:last-child { font-size: 12px; color: var(--muted); }
.cpt-lab:hover { background: var(--lx-hl); }
.cpt-check-f { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; font-size: 13.5px; }
.cpt-mastered { display: inline-flex; align-items: center; gap: 6px; color: var(--lx-good); font-weight: 600; font-size: 13px; }
.cpt-mastered.quiet { color: var(--muted); font-weight: 400; }
.cpt-unlock { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--lx-r); border: 1px solid rgba(233,196,106,.35); color: var(--t-hedge_fund); font-size: 13.5px; }
.cpt-unlock span { color: var(--text); }
.cpt-unlock a { color: var(--accent); text-decoration: none; margin-left: auto; }
.cpt-next { padding-top: 28px; }
.cpt-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; font-size: 13.5px; }
.cpt-nav a { color: var(--text-2); text-decoration: none; max-width: 32%; }
.cpt-nav a:hover { color: var(--accent); }
.cpt-locked { display: grid; place-items: center; min-height: 56vh; }
.cpt-lock-box { max-width: 540px; text-align: center; display: grid; justify-items: center; gap: 10px; padding: 32px 26px; border-radius: var(--lx-r); border: 1px solid var(--lx-rule-2); color: var(--muted); }
.cpt-lock-box h1 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 40px; color: var(--text); }
.cpt-lock-box .cpt-hook { text-align: center; font-size: 19px; }
.cpt-lock-box p { margin: 0 0 6px; }

/* ═════════════════════════ Exhibits (widgets) ═════════════════════════ */
.cpt-widget { border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); background: var(--lx-sheet); }
.cx { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
.cx-in { padding: 16px; display: grid; gap: 14px; align-content: start; background: var(--lx-sheet-2); border-right: 1px solid var(--lx-rule-2); min-width: 0; }
.cx-in .cx-k { margin-bottom: -4px; }
.cx-out { padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; min-width: 0; }
.cx-stats { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.cx-chart-t { font-size: 12px; font-weight: 600; color: var(--text-2); }
.cx-work { display: grid; gap: 4px; padding: 8px 10px; border-radius: 3px; background: var(--lx-ink); border: 1px solid var(--lx-rule); }
.cx-work .cx-k { margin: 0; font-size: 10px; }
.cx-work code { font-size: 12.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.cx-tag { margin: 0; padding: 8px 16px; font-size: 11.5px; line-height: 1.5; color: var(--faint); border-top: 1px solid var(--lx-rule); }
.cx-bars { display: grid; gap: 6px; }
.cx-bar { display: grid; grid-template-columns: minmax(90px, 190px) minmax(0, 1fr) 84px; gap: 12px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.cx-bar .t { position: relative; height: 12px; background: rgba(255,255,255,.035); }
.cx-bar .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; border-left: 1px solid rgba(255,255,255,.3); }
.cx-bar .f { position: absolute; top: 0; bottom: 0; background: var(--c); }
.cx-ref { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); }
.cx-bar .v { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.cx-pay td:first-child { color: var(--text); }
/* study */
.cx-study { padding: 18px; display: grid; gap: 12px; }
.cx-step { font-size: 11px; color: var(--muted); }
.cx-q { margin: 0; font-size: 16.5px; line-height: 1.55; color: var(--text); max-width: 62ch; }
.cx-choices { display: grid; border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); }
.cx-choices.row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.cx-choice { text-align: left; font: inherit; font-size: 14.5px; padding: 11px 14px; border: 0; border-top: 1px solid var(--lx-rule); background: transparent; color: var(--text); cursor: pointer; }
.cx-choice:first-child { border-top: 0; }
.cx-choices.row .cx-choice { border-top: 0; border-left: 1px solid var(--lx-rule); }
.cx-choices.row .cx-choice:first-child { border-left: 0; }
.cx-choice:hover { background: var(--lx-hl); }
.cx-hint { margin: 0; font-size: 12px; color: var(--faint); }
.cx-reveal p { margin: 0 0 8px; font-size: 15px; line-height: 1.65; color: var(--lx-body); }
.cx-reveal b { color: var(--text); }
.cx-study.done { justify-items: start; }
/* timeline */
.cx-tl { padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.cx-track { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: relative; }
.cx-track::before { content: ''; position: absolute; left: 0; right: 0; top: 5px; height: 1px; background: var(--lx-rule-2); }
.cx-track button { position: relative; display: grid; justify-items: center; gap: 6px; width: 100%; padding: 0 2px; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; }
.cx-track i { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--lx-rule-2); background: var(--lx-sheet); }
.cx-track span { font-size: 10.5px; text-align: center; line-height: 1.3; font-family: var(--font-mono); }
.cx-track button.past i { background: var(--text-2); border-color: var(--text-2); }
.cx-track button.on i { background: var(--accent); border-color: var(--accent); }
.cx-track button.on span { color: var(--text); }
.cx-event { min-height: 96px; padding: 12px 14px; border-left: 2px solid var(--accent); background: var(--lx-sheet-2); display: grid; gap: 3px; align-content: start; }
.cx-event .d { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.cx-event b { font-size: 16px; font-weight: 600; }
.cx-event p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--lx-body); }
.cx-nav { display: flex; justify-content: space-between; align-items: center; }
.cx-count { font-size: 11.5px; color: var(--faint); }
/* histogram */
.cx-hist { display: flex; align-items: flex-end; gap: 1px; height: 120px; border-bottom: 1px solid var(--lx-rule-2); }
.cx-hist span { flex: 1; height: var(--h); background: var(--c); min-height: 1px; }
.cx-hist-x { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--faint); }
/* anchoring */
.cx-anchor { padding: 18px; display: grid; gap: 12px; justify-items: start; }
.cx-anchor .lx-sl { width: min(420px, 100%); }
.cx-refnum { display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); min-width: 180px; }
.cx-refnum .k { font-size: 11px; color: var(--muted); }
.cx-refnum b { font-size: 30px; font-weight: 500; color: var(--text); }
.cx-scale { position: relative; width: 100%; height: 64px; margin-top: 24px; }
.cx-scale .bar { position: absolute; left: 0; right: 0; top: 30px; height: 1px; background: var(--lx-rule-2); }
.cx-scale i { position: absolute; top: 22px; width: 2px; height: 18px; margin-left: -1px; }
.cx-scale i em { position: absolute; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; white-space: nowrap; font-family: var(--font-mono); }
.cx-scale i.a { background: var(--text-2); } .cx-scale i.a em { top: -18px; color: var(--text-2); }
.cx-scale i.e { background: var(--accent); } .cx-scale i.e em { top: 22px; color: var(--accent); }
.cx-scale i.t { background: var(--lx-good); } .cx-scale i.t em { top: -18px; color: var(--lx-good); }
/* auction */
.cx-auction { position: relative; height: 68px; }
.cx-auction .axis { position: absolute; left: 0; right: 0; top: 34px; height: 1px; background: var(--lx-rule-2); }
.cx-auction .truth { position: absolute; top: 14px; bottom: 14px; border-left: 1px dashed var(--lx-good); }
.cx-auction .truth em { position: absolute; top: -14px; left: 0; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--lx-good); white-space: nowrap; }
.cx-auction b { position: absolute; top: 30px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #6577e6; }
.cx-auction b.win { background: var(--lx-bad); width: 11px; height: 11px; top: 29px; margin-left: -5.5px; z-index: 1; }
.cx-auction .wl { position: absolute; top: 48px; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--lx-bad); white-space: nowrap; }

/* ═════════════════════════ Labs ═════════════════════════ */
.lx-t-head { padding: 14px 0 26px; border-bottom: 1px solid var(--lx-rule-2); }
.lx-t-subj { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; letter-spacing: 0.005em; font-weight: 500; color: var(--text-2); }
.lx-t-subj::before { content: ''; width: 7px; height: 7px; border-radius: 1px; background: var(--sc); }
.lx-t-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 5.4vw, 60px); letter-spacing: -0.02em; line-height: 1.02; margin: 12px 0 10px; }
.lx-t-hook { font-size: 17px; color: var(--text-2); margin: 0 0 16px; max-width: 60ch; }
.lx-t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.lx-t-meta > .mono { margin-right: 6px; }
.lx-cover { padding: 2px 8px; border-radius: 3px; border: 1px solid var(--lx-rule-2); color: var(--text-2); }
.lx-t-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 44px; }
.lx-rail-in { position: sticky; top: 88px; padding-top: 30px; display: grid; gap: 12px; }
.lx-rail-k { font-size: 12.5px; letter-spacing: 0.005em; color: var(--faint); font-weight: 600; }
.lx-outline { list-style: none; margin: 0; padding: 0; display: grid; border-left: 1px solid var(--lx-rule-2); }
.lx-outline a { display: flex; gap: 10px; padding: 6px 0 6px 12px; margin-left: -1px; border-left: 1px solid transparent; font-size: 13px; color: var(--muted); text-decoration: none; line-height: 1.35; }
.lx-outline a .mono { font-size: 10.5px; color: var(--faint); padding-top: 2px; }
.lx-outline a:hover { color: var(--text); }
.lx-outline a.on { color: var(--text); border-left-color: var(--text); }
.lx-rail-status { margin-top: 6px; padding: 10px 12px; border: 1px solid var(--lx-rule); border-radius: var(--lx-r); display: grid; gap: 4px; font-size: 12.5px; }
.lx-st-row { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.lx-st-sub { font-size: 11.5px; color: var(--muted); }
.lx-st-btn { justify-self: start; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11.5px; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; cursor: pointer; }
.lx-st-btn:hover { color: var(--text); }
.lx-ring { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--lx-rule-2); display: inline-grid; place-items: center; flex: none; color: var(--lx-ink); }
.lx-ring.started { border-color: var(--text-2); background: conic-gradient(var(--text-2) 0 50%, transparent 50%); }
.lx-ring.done { border-color: var(--lx-good); background: var(--lx-good); }
.lx-go { color: var(--muted); }

.lx-body { min-width: 0; }
.lx-beat { padding: 34px 0 38px; border-bottom: 1px solid var(--lx-rule); scroll-margin-top: 80px; }
.lx-beat:last-child { border-bottom: 0; }
.lx-beat h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 3vw, 34px); letter-spacing: -0.01em; line-height: 1.1; margin: 0 0 12px; display: flex; gap: 12px; align-items: baseline; }
.lx-n { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.lx-beat > p { max-width: 68ch; color: var(--lx-body); font-size: 15.5px; line-height: 1.7; margin: 0 0 16px; }
.lx-beat > p b { color: var(--text); font-weight: 600; }
.lx-beat > p.lx-lede { font-size: 16.5px; color: var(--text-2); }
.lx-sub { font-size: 12.5px; font-weight: 500; letter-spacing: 0.005em; color: var(--text-2); margin: 22px 0 10px; }

.lx-lab { display: grid; grid-template-columns: minmax(250px, 310px) minmax(0, 1fr); margin: 18px 0 14px; border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); background: var(--lx-sheet); }
.lx-controls { padding: 16px; background: var(--lx-sheet-2); border-right: 1px solid var(--lx-rule-2); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.lx-stage { padding: 16px 18px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }

.lx-readout { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding-bottom: 12px; border-bottom: 1px solid var(--lx-rule); }
.lx-hero-num { display: grid; gap: 2px; }
.lx-hero-num .k { font-size: 12px; color: var(--muted); }
.lx-hero-num .k b { color: var(--text-2); font-weight: 600; }
.lx-hero-num .v { font-size: clamp(30px, 3.6vw, 40px); line-height: 1; letter-spacing: -0.03em; color: var(--text); }
.lx-split { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.lx-split > div { display: grid; grid-template-columns: 9px auto; column-gap: 8px; align-items: center; }
.lx-split .sw { width: 9px; height: 9px; border-radius: 1px; background: var(--c); grid-row: span 2; align-self: start; margin-top: 4px; }
.lx-split .k { font-size: 11.5px; color: var(--muted); }
.lx-split b { font-size: 16px; font-weight: 500; }

/* Compound lab */
.lx-guess { margin: 16px 0 8px; padding: 18px; border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); background: var(--lx-sheet-2); }
.lx-guess-q { margin: 0 0 12px; font-size: 17px; font-weight: 500; }
.lx-guess-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lx-race, #t-reveal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 10px; }
.lx-race[hidden], #t-reveal[hidden] { display: none; }
.lx-verdict { margin: 0; font-size: 15.5px; line-height: 1.5; }
.lx-race .lx-row-ctl { margin: 0; }
.lx-vs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); margin: 4px 0 14px; }
.lx-vs-col { padding: 12px 14px; display: grid; gap: 2px; font-size: 12.5px; color: var(--muted); border-left: 1px solid var(--lx-rule); }
.lx-vs-col:first-child { border-left: 0; }
.lx-vs-col .k { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.lx-vs-col .k::before { content: ''; width: 9px; height: 2px; background: var(--c); }
.lx-vs-col span b { font-size: inherit; letter-spacing: 0; color: inherit; }
.lx-vs-col > b { font-family: var(--font-mono); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; color: var(--text); }
.lx-doubles { margin: 4px 0 14px; }
.lx-dtrack { position: relative; height: 70px; border-bottom: 1px solid var(--lx-rule-2); margin: 0 30px 0 0; }
.lx-dstep, .lx-dstart { position: absolute; bottom: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 1px; padding-bottom: 9px; }
.lx-dstart { left: 0; transform: none; justify-items: start; }
.lx-dstep::after, .lx-dstart::after { content: ''; position: absolute; bottom: -3px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); }
.lx-dstart::after { left: 0; }
.lx-dstep b, .lx-dstart b { font-size: 12.5px; font-weight: 500; color: var(--text); }
.lx-dstep em, .lx-dstart em { font-style: normal; font-size: 10px; color: var(--faint); font-family: var(--font-mono); }
.lx-dstep:nth-child(even) { bottom: 30px; }
.lx-dscale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); margin: 6px 30px 0 0; }

/* Budget lab */
.lx-budget { margin: 18px 0 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 18px; border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); background: var(--lx-sheet); }
.lx-bud-income { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 14px 28px; align-items: end; }
.lx-bud-income .lx-presets { margin: 0 0 4px; }
.lx-band-wrap { position: relative; }
.lx-band-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.lx-band-head .k { letter-spacing: 0.005em; font-size: 11px; font-weight: 600; }
.lx-band-head .mono { color: var(--text); }
.lx-band { position: relative; display: flex; gap: 1px; height: 34px; background: var(--lx-ink); }
.lx-band .seg { position: relative; min-width: 2px; background: var(--c); display: flex; align-items: center; overflow: hidden; }
.lx-band .seg:nth-child(odd) { filter: brightness(1.1); }
.lx-band .seg em { font-style: normal; font-size: 10.5px; color: rgba(255,255,255,.92); padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-band.over { outline: 1px solid var(--lx-bad); }
.lx-income-line { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--lx-bad); z-index: 2; }
.lx-income-line em { position: absolute; top: -15px; left: 4px; font-style: normal; font-size: 10.5px; color: var(--lx-bad); white-space: nowrap; }
.lx-band-guides { position: relative; height: 14px; }
.lx-band-guides span { position: absolute; top: 2px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 10px; color: var(--faint); }
.lx-band-guides span::before { content: ''; position: absolute; left: 50%; top: -40px; height: 38px; border-left: 1px dashed rgba(255,255,255,.3); }
.lx-groups { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 6px; }
.lx-grp { display: grid; grid-template-columns: 9px auto auto; column-gap: 8px; align-items: baseline; }
.lx-grp i { width: 9px; height: 9px; border-radius: 1px; background: var(--c); align-self: center; }
.lx-grp .n { font-size: 13px; color: var(--text-2); }
.lx-grp b { font-family: var(--font-mono); font-size: 15px; font-weight: 500; }
.lx-grp .t { grid-column: 2 / -1; font-size: 11px; color: var(--faint); }
.lx-bud-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); }
.lx-stat { padding: 10px 12px; display: grid; gap: 2px; align-content: start; border-left: 1px solid var(--lx-rule); }
.lx-stat:first-child { border-left: 0; }
.lx-stat .k { font-size: 11.5px; color: var(--muted); }
.lx-stat b { font-family: var(--font-mono); font-size: 19px; font-weight: 500; letter-spacing: -0.02em; }
.lx-stat .s { font-size: 11px; color: var(--faint); }
.lx-bud-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 36px; }
.lx-cat-col { display: grid; gap: 10px; align-content: start; }
.lx-col-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; letter-spacing: 0.005em; color: var(--text-2); font-weight: 600; padding-bottom: 6px; border-bottom: 1px solid var(--lx-rule); }
.lx-col-h i { width: 9px; height: 9px; border-radius: 1px; background: var(--c); }
.lx-col-h .mono { margin-left: auto; color: var(--text); letter-spacing: 0; font-weight: 500; font-size: 13px; }
.lx-runway { margin: 22px 0 28px; max-width: 640px; }
.lx-rw-track { position: relative; height: 10px; background: rgba(255,255,255,.06); }
.lx-rw-fill { position: absolute; inset: 0 auto 0 0; background: #0e98a6; }
.lx-rw-tick { position: absolute; top: -4px; bottom: -4px; border-left: 1px dashed rgba(255,255,255,.4); }
.lx-rw-tick em { position: absolute; top: 20px; transform: translateX(-50%); font-style: normal; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.lx-rw-tick:last-child em { transform: translateX(-100%); }

/* Debt lab: interest share of each year's payments (a stacked column, not decoration) */
.lx-split-strip { display: grid; gap: 5px; }
.lx-split-strip .k { font-size: 11.5px; color: var(--muted); }
.lx-cols { position: relative; display: flex; gap: 1px; height: 34px; align-items: flex-end; }
.lx-cols span { flex: 1; height: 100%; background: linear-gradient(to top, #b58f37 var(--h), rgba(101,119,230,.5) var(--h)); min-width: 1px; }

/* Inflation lab */
.lx-pp { display: grid; gap: 6px; }
.lx-pp-h { font-size: 12px; font-weight: 600; color: var(--text-2); }
.lx-pp-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 90px; gap: 12px; align-items: center; font-size: 13px; color: var(--text-2); }
.lx-pp-row .t { height: 14px; background: rgba(255,255,255,.035); }
.lx-pp-row .t i { display: block; height: 100%; background: #6577e6; }
.lx-pp-row.later .t i { background: #b58f37; }
.lx-pp-row b { text-align: right; font-weight: 500; color: var(--text); }
.lx-pp-f { font-size: 11.5px; color: var(--muted); }
.lx-tags { margin-top: 4px; }
.lx-tag-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); }
.lx-tag { padding: 10px 12px; display: grid; gap: 2px; border-left: 1px solid var(--lx-rule); }
.lx-tag:first-child { border-left: 0; }
.lx-tag .n { font-size: 12px; color: var(--muted); }
.lx-tag .now { font-size: 12px; color: var(--faint); }
.lx-tag .now::before { content: 'today '; font-family: var(--font-ui); }
.lx-tag .then { font-size: 17px; color: var(--text); letter-spacing: -0.02em; }
.lx-wl-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--lx-rule-2); border-radius: var(--lx-r); }
.lx-wl-list li { padding: 12px; display: grid; gap: 3px; align-content: start; font-size: 13px; color: var(--muted); line-height: 1.5; border-left: 1px solid var(--lx-rule); }
.lx-wl-list li:first-child { border-left: 0; }
.lx-wl-list b { color: var(--text); font-weight: 600; font-size: 13.5px; }
.lx-wl-list .tag { font-size: 12.5px; letter-spacing: 0.005em; font-weight: 500; }
.lx-wl-list li.win .tag { color: var(--lx-good); }
.lx-wl-list li.lose .tag { color: var(--lx-bad); }

/* Stocks lab */
.lx-co-blurb { margin: 2px 0 0 !important; font-size: 13.5px !important; color: var(--muted) !important; }
.lx-quote { display: grid; gap: 10px; }
.lx-q-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.lx-q-head > .k { font-size: 12.5px; letter-spacing: 0.005em; color: var(--muted); font-weight: 600; }
.lx-q-cap { display: grid; justify-items: end; }
.lx-q-cap .k { font-size: 11.5px; color: var(--muted); }
.lx-q-cap b { font-family: var(--font-mono); font-size: clamp(26px, 3.4vw, 34px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.lx-q-cap em { font-style: normal; font-size: 11px; color: var(--faint); }
.lx-pe-meter { padding: 2px 0 0; }
.lx-pm-bar { position: relative; height: 2px; background: var(--lx-rule-2); margin: 20px 0 6px; }
.lx-pm-bar span { position: absolute; top: -17px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 10px; color: var(--faint); }
.lx-pm-bar span::after { content: ''; position: absolute; left: 50%; top: 14px; height: 7px; border-left: 1px solid var(--lx-rule-2); }
.lx-pm-bar span:first-child { transform: none; }
.lx-pm-bar span:first-child::after { left: 0; }
.lx-pm-bar span:last-of-type { transform: translateX(-100%); }
.lx-pm-bar span:last-of-type::after { left: 100%; }
.lx-pm-bar i { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--text); border: 2px solid var(--lx-sheet); transform: translate(-50%, -50%); }
.lx-pm-k { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); }
.lx-own-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lx-own-grid > div { display: grid; gap: 1px; }
.lx-own-grid b { font-family: var(--font-mono); font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.lx-own-grid span { font-size: 11px; color: var(--muted); }
.lx-own .lx-sub { margin-top: 2px; }
.lx-diff { margin: 0 0 12px; display: grid; gap: 10px; }
.lx-diff .lx-sub { margin: 0; }
.lx-pe-track { margin: 4px 0 16px; max-width: 720px; }
.lx-pt-bars { position: relative; display: flex; gap: 3px; height: 140px; align-items: flex-end; border-bottom: 1px solid var(--lx-rule-2); }
.lx-pt-bars span { flex: 1; height: var(--h); background: #9466e8; position: relative; }
.lx-pt-bars span.met { background: #0e98a6; }
.lx-pt-bars span em { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; color: var(--text-2); white-space: nowrap; font-family: var(--font-mono); }
.lx-pt-line { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255,255,255,.45); }
.lx-pt-line em { position: absolute; right: 0; top: -16px; font-style: normal; font-size: 10.5px; color: var(--text-2); background: var(--lx-ink); padding: 0 4px; }
.lx-pt-x { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); margin-top: 5px; }

/* Portfolio lab */
.lx-alloc { display: flex; gap: 1px; height: 26px; }
.lx-alloc span { background: var(--c); display: flex; align-items: center; min-width: 2px; overflow: hidden; }
.lx-alloc em { font-style: normal; font-size: 11px; font-weight: 600; color: rgba(255,255,255,.95); padding: 0 8px; white-space: nowrap; }
.lx-bars { display: grid; gap: 6px; max-width: 760px; margin: 10px 0 4px; }
.lx-bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 70px 80px; gap: 12px; align-items: center; font-size: 13px; color: var(--text-2); }
.lx-bar-row.mine { color: var(--text); font-weight: 600; }
.lx-bar-row .track { position: relative; height: 12px; }
.lx-bar-row .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; border-left: 1px solid rgba(255,255,255,.3); }
.lx-bar-row .b { position: absolute; top: 0; bottom: 0; background: var(--c); }
.lx-bar-row .b.pos { left: 50%; }
.lx-bar-row .b.neg { right: 50%; }
.lx-bar-row .v, .lx-bar-row .d { text-align: right; font-family: var(--font-mono); }
.lx-bar-row .d { color: var(--muted); font-weight: 400; }

/* Explore next (labs) */
.lx-next { padding: 34px 0 0; margin-top: 8px; border-top: 1px solid var(--lx-rule-2); }
.lx-next-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--lx-rule); border-left: 1px solid var(--lx-rule); }
.lx-next-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; text-decoration: none; border-right: 1px solid var(--lx-rule); border-bottom: 1px solid var(--lx-rule); }
.lx-next-row:hover { background: var(--lx-hl); }
.lx-next-row .lx-ring { margin-top: 3px; }
.lx-next-row > span:nth-child(2) { display: grid; gap: 2px; }
.lx-next-row .k { font-size: 12.5px; letter-spacing: 0.005em; color: var(--muted); font-weight: 600; }
.lx-next-row b { font-size: 15px; font-weight: 600; }
.lx-next-row .h { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.lx-next-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 13.5px; }
.lx-next-foot a { color: var(--text-2); text-decoration: none; }
.lx-next-foot a:hover { color: var(--accent); }

/* ───────── Responsive ───────── */
@media (max-width: 1020px) {
  .lx-t-grid { grid-template-columns: 1fr; gap: 0; }
  .lx-rail-in { position: static; padding-top: 14px; grid-template-columns: 1fr auto; align-items: start; }
  .lx-rail-k { display: none; }
  .lx-outline { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; border-left: 0; border-bottom: 1px solid var(--lx-rule); scrollbar-width: none; }
  .lx-outline a { border-left: 0; border-bottom: 1px solid transparent; padding: 7px 12px 8px; margin: 0 0 -1px; white-space: nowrap; }
  .lx-outline a.on { border-bottom-color: var(--text); }
  .lx-rail-status { margin: 0; padding: 6px 10px; grid-template-columns: auto auto; column-gap: 12px; align-items: center; }
  .lx-rail-status .lx-st-btn { grid-column: 1 / -1; }
}
@media (max-width: 920px) {
  .lib-mast, .lib-feature { grid-template-columns: 1fr; gap: 22px; }
  .cpt-sec { grid-template-columns: 1fr; }
  .lx-lab, .cx { grid-template-columns: 1fr; }
  .lx-controls, .cx-in { border-right: 0; border-bottom: 1px solid var(--lx-rule-2); }
  .lx-q-grid.four, .lx-bud-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lx-q-grid.four > div:nth-child(3), .lx-bud-stats > div:nth-child(3) { border-left: 0; }
  .lx-q-grid.four > div:nth-child(n+3), .lx-bud-stats > div:nth-child(n+3) { border-top: 1px solid var(--lx-rule); }
  .lx-tag-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lx-wl-list, .lx-next-list { grid-template-columns: 1fr; }
  .lx-wl-list li { border-left: 0; border-top: 1px solid var(--lx-rule); }
  .lx-wl-list li:first-child { border-top: 0; }
  .lx-bud-income { grid-template-columns: 1fr; }
  .lx-own-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cpt-dl { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .lib-intro h1 { font-size: 42px; }
  .lib-intro p { font-size: 15px; }
  .lib-search { max-width: none; margin-left: 0; }
  .cc-grid, .cc-grid.small { grid-template-columns: 1fr; }
  .cpt-head h1 { font-size: 40px; }
  .cpt-hook { font-size: 20px; }
  .cpt-body > p { font-size: 15.5px; }
  .cx-in, .cx-out, .cx-tl, .cx-study, .cx-anchor { padding: 14px; }
  .cx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-stats > div:nth-child(3) { border-left: 0; }
  .cx-stats > div:nth-child(n+3) { border-top: 1px solid var(--lx-rule); }
  .cx-bar { grid-template-columns: 96px minmax(0, 1fr) 68px; gap: 8px; font-size: 12px; }
  .cx-track span { font-size: 9px; }
  .cpt-nav { flex-wrap: wrap; }
  .cpt-nav a { max-width: 45%; }
  .cpt-nav .btn { order: 3; flex-basis: 100%; }
  .lx-t-head h1 { font-size: 40px; }
  .lx-t-hook { font-size: 15.5px; }
  .lx-save { margin-left: 0; }
  .lx-rail-in { grid-template-columns: 1fr; }
  .lx-beat { padding: 26px 0 30px; }
  .lx-beat h2 { font-size: 27px; gap: 10px; }
  .lx-beat > p, .lx-beat > p.lx-lede { font-size: 15px; }
  .lx-controls, .lx-stage, .lx-budget { padding: 14px; }
  .lx-bud-cats { grid-template-columns: 1fr; }
  .lx-q-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lx-q-grid > div:nth-child(3) { border-left: 0; }
  .lx-q-grid > div:nth-child(n+3) { border-top: 1px solid var(--lx-rule); }
  .lx-q-grid.three { grid-template-columns: 1fr; }
  .lx-q-grid.three > div { border-left: 0; border-top: 1px solid var(--lx-rule); }
  .lx-q-grid.three > div:first-child { border-top: 0; }
  .lx-vs { grid-template-columns: 1fr; }
  .lx-vs-col { border-left: 0; border-top: 1px solid var(--lx-rule); }
  .lx-vs-col:first-child { border-top: 0; }
  .lx-tag-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lx-tag { border-top: 1px solid var(--lx-rule); }
  .lx-pp-row { grid-template-columns: 74px minmax(0, 1fr) 76px; }
  .lx-bar-row { grid-template-columns: 78px minmax(0, 1fr) 58px; gap: 8px; font-size: 12px; }
  .lx-bar-row .d { display: none; }
  .lx-dstep em { display: none; }
  .lx-table { font-size: 12.5px; }
  .lx-table th, .lx-table td { padding: 7px 9px; }
  .lx-check-q { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .lx-page *, .lx-pop { transition: none !important; }
}
/* Exhibits take the full measure; their label sits above. */
.cpt-sec.try { grid-template-columns: minmax(0, 1fr); }
/* Stat grids that wrap to a second row keep their ruling. */
@media (min-width: 601px) {
  .lx-q-grid:not(.four):not(.cx-stats) > div:nth-child(3n+1) { border-left: 0; }
  .lx-q-grid:not(.four):not(.cx-stats) > div:nth-child(n+4) { border-top: 1px solid var(--lx-rule); }
}
@media (min-width: 921px) {
  .lx-q-grid.four > div:nth-child(4n+1) { border-left: 0; }
  .lx-q-grid.four > div:nth-child(n+5) { border-top: 1px solid var(--lx-rule); }
}

/* The Library shares the game's engraved rosette at the corner of its masthead. */
.lib-mast::after { content: ''; position: absolute; z-index: -1; top: -420px; right: -520px; width: 820px; height: 820px;
  background: var(--rosette) center / contain no-repeat; opacity: .06; pointer-events: none; }
.lx-page { overflow-x: clip; }
.cc-title, .lib-gh h2, .lib-labs-h h2 { text-wrap: balance; }
