@font-face { font-family: "Inter"; src: url(/assets/fonts/inter.3100e775e8.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/assets/fonts/inter-ext.34b9c504ca.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+1E00-1EFF, U+0100-024F; }
@font-face { font-family: "JetBrains Mono"; src: url(/assets/fonts/mono.18be452724.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: dark;
  --black: #050506;
  --well: rgba(0, 0, 0, 0.38);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f5f5f7;
  --text-2: #b0b0b6;
  --text-3: #8e8e95;
  --gold: #e9c063;
  --gold-soft: rgba(233, 192, 99, 0.13);
  --on-gold: #1c1503;
  --bull: #19aa8e;
  --bear: #c04448;
  --bull-text: #5fd9be;
  --bear-text: #f59a9c;
  --blue-text: #8dbdf0;
  --radius: 22px;
  --radius-sm: 14px;
  --top-h: 56px;
  --tab-h: 62px;
  --float: 10px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --glass-fill: linear-gradient(155deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.03) 42%, rgba(255, 255, 255, 0.045) 100%);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), inset 0 -1px 0 rgba(255, 255, 255, 0.03), 0 14px 40px rgba(0, 0, 0, 0.5);
  --chrome-fill: rgba(26, 26, 29, 0.68);
  --chrome-blur: blur(26px) saturate(180%);
  --chrome-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 16px 44px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--black); scroll-padding-top: calc(var(--top-h) + 28px); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.side, .search, .table-wrap { scrollbar-width: thin; }
body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  overflow-wrap: break-word;
  hyphens: auto;
  padding-bottom: calc(var(--tab-h) + 30px + env(safe-area-inset-bottom));
}
/* Glass needs something to catch: a very faint light behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70vw 55vh at 12% -8%, rgba(255, 255, 255, 0.075), transparent 62%),
    radial-gradient(60vw 50vh at 96% 18%, rgba(233, 192, 99, 0.05), transparent 60%),
    radial-gradient(80vw 60vh at 50% 112%, rgba(255, 255, 255, 0.05), transparent 62%),
    var(--black);
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #f5d78d; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
::selection { background: rgba(233, 192, 99, 0.3); }
.i { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -0.125em; }
.mono { font-family: var(--mono); font-size: 0.8125rem; }
.muted { color: var(--text-3); }
.tone-bull { color: var(--bull-text); }
.tone-bear { color: var(--bear-text); }
.tone-gold { color: var(--gold); }

/* Shared glass. Cards fake it with light and edge, because real blur on every card would stutter on phones. */
.callout, .card, .sec-card, .toc, .lc, .quiz, .pattern, .pg-card, .calc, .clock, .trainer, .replay,
.journal-form, .tv-gate, .stat, .pn, .table-wrap, .check-item label {
  background: var(--glass-fill);
  border: 1px solid var(--line);
  box-shadow: var(--glass-shadow);
}
.card, .sec-card, .pg-card, .pn { transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease; }

.skip { position: fixed; left: 12px; top: -70px; z-index: 100; background: var(--gold); color: var(--on-gold); padding: 8px 14px; border-radius: 999px; }
.skip:focus { top: 12px; }
.read-bar { position: fixed; inset: 0 0 auto; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; z-index: 60; }

/* Floating top bar */
.top {
  position: sticky; top: var(--float); z-index: 40;
  display: flex; align-items: center; gap: 6px;
  height: var(--top-h); margin: var(--float) 12px 0; padding: 0 8px 0 10px;
  background: var(--chrome-fill);
  border-radius: 999px;
  box-shadow: var(--chrome-shadow);
  -webkit-backdrop-filter: var(--chrome-blur); backdrop-filter: var(--chrome-blur);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-height: 44px; }
.brand:hover { color: var(--text); }
.brand-mark { display: inline-flex; align-items: center; gap: 3px; height: 26px; }
.brand-mark i { display: block; width: 6px; border-radius: 2px; background: var(--bear); height: 12px; }
.brand-mark i:nth-child(2) { background: var(--gold); height: 24px; }
.brand-mark i:nth-child(3) { background: var(--bull); height: 16px; }
.brand-text { display: flex; flex-direction: column; font-weight: 650; font-size: 1rem; line-height: 1.1; letter-spacing: -0.015em; hyphens: none; }
.brand-text small { font: 450 0.6875rem/1.3 var(--sans); color: var(--text-3); letter-spacing: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: none; border: 0; border-radius: 50%; color: var(--text-2); cursor: pointer; font-size: 1.125rem;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.search-open {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px; background: var(--surface-2); border: 0;
  border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--text-2); cursor: pointer; font-size: 0.875rem;
}
.search-open:hover { background: rgba(255, 255, 255, 0.13); color: var(--text); }

/* Shell and navigation */
.side {
  position: fixed; inset: var(--float) auto var(--float) var(--float); z-index: 70;
  width: min(84vw, 330px); padding: 8px 8px 32px;
  background: rgba(22, 22, 25, 0.72);
  border-radius: 26px;
  box-shadow: var(--chrome-shadow);
  -webkit-backdrop-filter: var(--chrome-blur); backdrop-filter: var(--chrome-blur);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-110%); transition: transform 0.28s cubic-bezier(0.22, 0.8, 0.28, 1); visibility: hidden;
}
.nav-open .side { transform: none; visibility: visible; }
.nav-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.22s ease; }
.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
.nav-open { overflow: hidden; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 4px 14px; }
.nav-sec summary {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 12px;
  border-radius: var(--radius-sm); cursor: pointer; list-style: none; font-weight: 550; font-size: 0.9375rem;
}
.nav-sec summary::-webkit-details-marker { display: none; }
.nav-sec summary:hover { background: var(--surface); }
.nav-sec summary .i:first-child { color: var(--text-2); width: 1.1em; }
.nav-sec[open] summary .i:first-child { color: var(--gold); }
.nav-caret { margin-left: auto; font-size: 0.75rem; color: var(--text-3); transition: transform 0.15s ease; }
.nav-sec[open] .nav-caret { transform: rotate(180deg); }
.nav-sec ul { list-style: none; margin: 0 0 8px; padding: 0 0 0 18px; }
.nav-sec li a {
  display: flex; align-items: center; min-height: 38px; padding: 6px 12px;
  border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: 0.9rem; line-height: 1.3; hyphens: none;
}
.nav-sec li a:hover { color: var(--text); background: var(--surface); }
.nav-sec li a[aria-current] { color: var(--text); background: var(--surface-2); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.nav-sec li a.is-read::after { content: ""; flex: none; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--bull); }

main { padding: 24px 16px 32px; min-width: 0; }

/* Lesson header */
.doc-head { max-width: 44rem; margin-bottom: 24px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; color: var(--text-3); font: 450 0.8125rem/1.5 var(--sans); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .mono { margin-left: auto; color: var(--text-2); font-size: 0.75rem; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { margin: 10px 0 10px; font-size: clamp(2rem, 7.5vw, 2.75rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.032em; }
.lede { margin: 0; color: var(--text-2); font-size: 1.125rem; line-height: 1.5; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; color: var(--text-3); font-size: 0.8125rem; }
.doc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ticks { display: flex; align-items: center; gap: 3px; height: 14px; margin-top: 16px; }
.tick { display: block; flex: 1 1 0; max-width: 22px; height: 4px; border-radius: 999px; background: var(--line-strong); }
.tick.is-read { background: var(--bull); }
.tick.is-current { height: 8px; background: var(--gold); }
.tick:hover { background: var(--gold); opacity: 0.8; }

/* Prose */
.prose { min-width: 0; }
.prose > * { margin-top: 0; margin-bottom: 1.1em; }
.prose h2 { margin-top: 2.1em; margin-bottom: 0.6em; font-size: 1.5rem; font-weight: 650; display: flex; gap: 10px; align-items: baseline; }
.prose h3 { margin-top: 1.6em; margin-bottom: 0.4em; font-size: 1.1875rem; font-weight: 620; }
.prose h2 .i { color: var(--gold); font-size: 0.875em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.35em; }
.prose li::marker { color: var(--text-3); }
.prose strong { font-weight: 620; color: #fff; }
.prose code { font: 0.875em var(--mono); background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 6px; }
.h-sm { font-size: 1rem !important; margin-top: 0 !important; }
.term { color: inherit; text-decoration: underline dotted var(--text-3); text-underline-offset: 4px; }

.toc { border-radius: var(--radius-sm); font-size: 0.9rem; }
.toc summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; cursor: pointer; font-weight: 550; color: var(--text-2); list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary .i { color: var(--text-3); }
.toc ul { list-style: none; margin: 0; padding: 0 14px 10px; }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 0; color: var(--text-2); text-decoration: none; line-height: 1.35; hyphens: none; }
.toc a:hover { color: var(--text); }

/* Callouts */
.callout { padding: 16px 18px; border-radius: var(--radius); font-size: 1rem; }
.callout > :last-child { margin-bottom: 0; }
.callout-title { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; font-weight: 620; color: var(--text); }
.callout-title .i { color: var(--text-2); }
.callout-tip .callout-title .i, .callout-summary .callout-title .i { color: var(--gold); }
.callout-info .callout-title .i, .callout-phone .callout-title .i, .callout-example .callout-title .i { color: var(--blue-text); }
.callout-warn .callout-title .i, .callout-risk .callout-title .i { color: var(--bear-text); }
.callout-fact .callout-title .i { color: var(--bull-text); }

/* Steps */
.steps { list-style: none; padding: 0 !important; counter-reset: step; }
.step { position: relative; padding: 0 0 18px 46px; margin: 0; counter-increment: step; }
.step::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 1px var(--line);
  color: var(--text); font: 600 0.8125rem var(--sans);
}
.step:not(:last-child)::after { content: ""; position: absolute; left: 15.5px; top: 38px; bottom: 6px; width: 1px; background: var(--line); }
.step-title { margin: 3px 0 4px; font-weight: 620; }
.step-body > :last-child { margin-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; hyphens: none; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface); font-weight: 550; font-size: 0.8125rem; color: var(--text-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; background: var(--surface-2); color: var(--text);
  border: 0; border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 0 0 1px var(--line);
  cursor: pointer; font-weight: 580; font-size: 0.9375rem; text-decoration: none; hyphens: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.13); color: var(--text); }
.btn-gold {
  background: linear-gradient(180deg, #f3d382 0%, #e4b94e 100%); color: var(--on-gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 8px 24px rgba(233, 192, 99, 0.18);
}
.btn-gold:hover { background: linear-gradient(180deg, #f8dd97 0%, #ecc35c 100%); color: var(--on-gold); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; font-weight: 550; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; background: var(--well);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: 400 1rem var(--sans); color: var(--text);
}
.field select option { background: #161618; }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
.field small { font-weight: 400; color: var(--text-3); }
.read-toggle { width: 100%; margin-top: 16px; }
.read-toggle.is-read { color: var(--bull-text); }

/* Cards */
.cards { display: grid; gap: 10px; }
.card {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px;
  border-radius: var(--radius); color: var(--text); text-decoration: none;
}
.card:hover, .sec-card:hover, .pg-card:hover, .pn:hover { border-color: var(--line-strong); color: var(--text); }
.card-icon {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 14px;
  background: var(--surface-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); color: var(--gold);
}
.card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-body strong { font-weight: 620; }
.card-body span { color: var(--text-2); font-size: 0.875rem; line-height: 1.4; }
.card-state { margin-left: auto; color: var(--line-strong); }
.card.is-read .card-state { color: var(--bull-text); }
.sec-cards { display: grid; gap: 10px; }
.sec-card {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; padding: 14px;
  border-radius: var(--radius); color: var(--text); text-decoration: none;
}
.sec-card .card-icon { grid-row: span 3; }
.sec-card strong { font-weight: 620; }
.sec-card > span:not(.card-icon) { color: var(--text-2); font-size: 0.875rem; line-height: 1.4; }
.sec-card small { color: var(--text-3); font-size: 0.75rem; }

/* Pattern and phone figures */
figure { margin-left: 0; margin-right: 0; }
.pattern { border-radius: var(--radius); overflow: hidden; }
.pattern img { width: 100%; max-width: 480px; margin: 0 auto; }
.pattern-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pattern-grid .pattern { margin: 0; }
.pattern-grid figcaption { padding: 8px 12px 12px; font-size: 0.8125rem; }
.pattern-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.pattern-top .pattern { margin: 0; }
.pg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pg-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.pg-card img { width: 100%; }
.pg-name { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 6px 12px 12px; font-size: 0.875rem; line-height: 1.25; }
.pg-name strong { font-weight: 620; }
.pg-name .bias { margin-left: 0; }
.bias { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; font: 600 0.6875rem/1.5 var(--sans); vertical-align: 1px; hyphens: none; white-space: nowrap; }
.pattern-grid .bias { display: table; margin: 3px 0 4px; }
.bias-bullish { color: var(--bull-text); background: rgba(25, 170, 142, 0.16); }
.bias-bearish { color: var(--bear-text); background: rgba(192, 68, 72, 0.22); }
.bias-neutral { color: var(--text-2); background: var(--surface-2); }
figcaption { padding: 10px 16px 14px; color: var(--text-2); font-size: 0.875rem; line-height: 1.45; }
.phone { display: flex; flex-direction: column; align-items: center; }
.ph-frame { width: min(100%, 300px); background: #000; border-radius: 34px; padding: 10px 8px 12px; box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 18px 44px rgba(0, 0, 0, 0.6); }
.ph-status { display: flex; align-items: center; justify-content: space-between; padding: 2px 16px 6px; font: 600 0.6875rem var(--sans); color: var(--text-2); }
.ph-notch { width: 62px; height: 16px; border-radius: 10px; background: #000; box-shadow: inset 0 0 0 1px var(--line); }
.ph-bar { padding: 9px 12px; background: var(--surface-2); border-radius: 18px 18px 0 0; font-weight: 620; font-size: 0.875rem; text-align: center; }
.ph-screen { display: flex; flex-direction: column; gap: 6px; min-height: 180px; padding: 8px; background: var(--surface); border-radius: 0 0 18px 18px; font-size: 0.8125rem; hyphens: none; }
.ph-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.ph-val { font-family: var(--mono); color: var(--text); }
.ph-val.tone-bull { color: var(--bull-text); }
.ph-val.tone-bear { color: var(--bear-text); }
.ph-quote { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); font-family: var(--mono); }
.ph-sym { font-family: var(--sans); font-weight: 620; }
.ph-bid { color: var(--bear-text); }
.ph-ask { color: var(--bull-text); }
.ph-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.ph-btn { display: block; padding: 10px 6px; border-radius: 12px; text-align: center; font-weight: 620; color: #fff; }
.ph-btn.tone-bull { background: #127a66; color: #fff; }
.ph-btn.tone-bear { background: #a2363a; color: #fff; }
.ph-btn.tone-gold { background: var(--gold); color: var(--on-gold); }
.ph-text { margin: 4px 6px; color: var(--text-2); line-height: 1.4; }
.ph-tabs { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.ph-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-3); }
.ph-tab small { font-size: 0.5625rem; }
.ph-tab.is-active { color: var(--gold); }

/* Lesson charts */
.lc { border-radius: var(--radius); overflow: hidden; }
.lc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 0; }
.lc-sym { font: 620 0.875rem var(--sans); letter-spacing: -0.005em; }
.lc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; background: var(--surface-2); border-radius: 999px; color: var(--text-2); font-size: 0.6875rem; font-weight: 550; hyphens: none; }
.lc-badge .i { color: var(--gold); }
.lc-readout { min-height: 1.5em; margin: 2px 16px 4px; color: var(--text-3); font: 400 0.6875rem/1.5 var(--mono); font-variant-numeric: tabular-nums; }
.lc-canvas { position: relative; height: 270px; min-width: 0; }
.lc-tall .lc-canvas { height: 400px; }
.lc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 8px 16px 0; font-size: 0.75rem; color: var(--text-2); }
.lc-legend li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.lc-key { width: 14px; height: 2px; border-radius: 1px; background: currentColor; }
.lc-steps { padding: 14px 16px; border-top: 1px solid var(--line); margin-top: 8px; }
.lc-step-text { min-height: 4.2em; margin: 0 0 12px; font-size: 0.9375rem; line-height: 1.5; }
.lc-ctrl { display: flex; align-items: center; gap: 8px; }
.lc-ctrl .btn { min-height: 44px; flex: 1; }
.lc-count { font: 500 0.75rem var(--sans); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lc-table { padding: 0 16px 8px; font-size: 0.8125rem; }
.lc-table summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; color: var(--text-2); }
.lc .table-wrap { max-height: 240px; overflow: auto; background: var(--well); box-shadow: none; }
.lc figcaption a { white-space: nowrap; }

/* Quiz */
.quiz { padding: 18px; border-radius: var(--radius); }
.quiz h2 { margin-top: 0 !important; font-size: 1.25rem; }
.q { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.q legend { padding: 0; margin-bottom: 8px; font-weight: 580; line-height: 1.4; }
.q-opt { display: flex; align-items: flex-start; gap: 10px; min-height: 46px; padding: 11px 14px; margin-bottom: 6px; background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; line-height: 1.4; font-size: 0.9375rem; }
.q-opt:hover { border-color: var(--line-strong); }
.q-opt input { margin-top: 3px; accent-color: var(--gold); flex: none; }
.q-opt.is-right { border-color: var(--bull); }
.q-opt.is-wrong { border-color: var(--bear); }
.q-opt.is-right span::after { content: " (richtig)"; color: var(--bull-text); font-weight: 600; }
.q-opt.is-wrong span::after { content: " (falsch)"; color: var(--bear-text); font-weight: 600; }
.q-why { margin: 8px 0 0; color: var(--text-2); font-size: 0.9rem; }
.quiz-result { margin: 12px 0 0; font-weight: 620; min-height: 1.5em; }

/* Calculators */
.calc { padding: 18px; border-radius: var(--radius); }
.calc-fields { display: grid; gap: 12px; }
.calc-out { margin: 16px 0 0; background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.calc-out div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.calc-out div:last-child { border-bottom: 0; }
.calc-out dt { color: var(--text-2); font-size: 0.875rem; }
.calc-out dd { margin: 0; font-family: var(--mono); font-size: 0.9375rem; font-variant-numeric: tabular-nums; text-align: right; hyphens: none; white-space: nowrap; }
.calc-out .is-main { padding: 15px 14px; background: var(--surface); }
.calc-out .is-main dt { color: var(--text); font-weight: 580; }
.calc-out .is-main dd { color: var(--gold); font-family: var(--sans); font-size: 1.375rem; font-weight: 620; letter-spacing: -0.02em; white-space: nowrap; }
.calc-note { margin: 12px 0 0; color: var(--text-2); font-size: 0.875rem; line-height: 1.45; }
.calc-note.is-warn { color: var(--bear-text); }

/* Session clock */
.clock { padding: 18px; border-radius: var(--radius); }
.clock-now { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.clock-time { font: 600 1.75rem var(--sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.clock-zone { color: var(--text-3); font-size: 0.75rem; }
.clock-status { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 580; }
.clock-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); flex: none; }
.clock-dot.is-open { background: var(--bull); }
.clock-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 30px; font-size: 0.8125rem; color: var(--text-2); }
.clock-row.is-open { color: var(--text); font-weight: 580; }
.clock-track { position: relative; height: 12px; background: var(--well); border-radius: 999px; overflow: hidden; }
.clock-run { position: absolute; top: 0; bottom: 0; background: var(--line-strong); border-radius: 999px; }
.clock-row.is-open .clock-run { background: var(--gold); }
.clock-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); }
.clock-axis { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px; color: var(--text-3); font: 400 0.625rem var(--sans); }
.clock-axis div { display: flex; justify-content: space-between; }
.clock-note { margin: 12px 0 0; color: var(--text-2); font-size: 0.875rem; line-height: 1.45; }
.clock-note strong { color: var(--text); }

/* Checklist */
.check-list { list-style: none; padding: 0 !important; }
.check-item { margin: 0 0 6px; }
.check-item label { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 13px 14px; border-radius: var(--radius-sm); cursor: pointer; line-height: 1.4; font-size: 0.9375rem; }
.check-item input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gold); flex: none; }
.check-item input:checked + span { color: var(--text-3); text-decoration: line-through; }
.check-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; }

/* Trainer */
.trainer { padding: 18px; border-radius: var(--radius); }
.trainer-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--text-2); font: 500 0.8125rem var(--sans); }
.trainer-img { width: 100%; background: var(--well); border-radius: var(--radius-sm); }
.trainer-options { display: grid; gap: 8px; margin-top: 12px; }
.trainer-options .btn { justify-content: flex-start; text-align: left; line-height: 1.3; }
.trainer-options .btn.is-right { color: var(--bull-text); box-shadow: inset 0 0 0 1px var(--bull); }
.trainer-options .btn.is-wrong { color: var(--bear-text); box-shadow: inset 0 0 0 1px var(--bear); }
.trainer-feedback { min-height: 3em; margin: 12px 0; color: var(--text-2); font-size: 0.9375rem; line-height: 1.45; }
.trainer-feedback strong { color: var(--text); }

/* Replay */
.replay { border-radius: var(--radius); overflow: hidden; }
.replay-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.replay-stat { padding: 10px 12px; min-width: 0; border-right: 1px solid var(--line); }
.replay-stat:last-child { border-right: 0; }
.replay-stat small { display: block; color: var(--text-3); font-size: 0.6875rem; }
.replay-stat span { font: 600 0.875rem var(--mono); font-variant-numeric: tabular-nums; hyphens: none; }
.replay-chart { height: 280px; min-width: 0; }
.replay-panel { display: grid; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.replay-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.replay-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.btn-bull { background: linear-gradient(180deg, #179a80 0%, #127a66 100%); color: #fff; }
.btn-bull:hover { background: linear-gradient(180deg, #1aab8e 0%, #148a73 100%); color: #fff; }
.btn-bear { background: linear-gradient(180deg, #bb4347 0%, #a2363a 100%); color: #fff; }
.btn-bear:hover { background: linear-gradient(180deg, #c84c50 0%, #b03c40 100%); color: #fff; }
.replay-msg { min-height: 2.8em; margin: 0; color: var(--text-2); font-size: 0.875rem; line-height: 1.4; }

/* Journal */
.journal-form { display: grid; gap: 12px; padding: 18px; border-radius: var(--radius); }
.journal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.journal-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.stat { padding: 13px 14px; border-radius: var(--radius-sm); }
.stat small { display: block; color: var(--text-3); font-size: 0.75rem; }
.stat strong { font-size: 1.25rem; font-weight: 620; letter-spacing: -0.01em; }
.journal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.journal-file { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* Live widgets */
.tv-gate { padding: 20px 18px; border-radius: var(--radius); }
.tv-gate h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.0625rem; }
.tv-gate h3 .i { color: var(--gold); }
.tv-gate p { margin: 0 0 12px; color: var(--text-2); font-size: 0.9375rem; line-height: 1.45; }
.tv-actions { display: grid; gap: 8px; }
.tv-frame { display: block; width: 100%; height: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: #0a0a0b; }
.tv-frame.is-tape { height: 78px; }
.tv-frame.is-calendar { height: 620px; }

/* Glossary */
.gl-group h2 { margin-top: 1.4em !important; color: var(--text-3); font: 600 0.9375rem var(--sans); }
.gl-group dl { margin: 0; }
.gl-item { padding: 11px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + 28px); }
.gl-item:target { background: var(--gold-soft); padding-left: 10px; padding-right: 10px; border-radius: 12px; }
.gl-item dt { font-weight: 620; }
.gl-item dd { margin: 2px 0 0; color: var(--text-2); font-size: 0.9375rem; line-height: 1.5; }

/* Prev and next */
.related ul { margin: 0; }
.prevnext { display: grid; gap: 10px; margin-top: 16px; }
.pn { display: flex; flex-direction: column; padding: 13px 16px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.pn small { color: var(--text-3); font: 500 0.75rem var(--sans); }
.pn span { font-weight: 580; font-size: 0.9375rem; line-height: 1.3; }
.pn-next { text-align: right; }

/* Footer */
.foot { padding: 28px 16px 28px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 0.8125rem; line-height: 1.5; }
.foot-risk { display: flex; gap: 10px; max-width: 60rem; margin: 0 0 14px; color: var(--text-2); }
.foot-risk .i { color: var(--gold); margin-top: 3px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 10px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 36px; color: var(--text-2); }
.foot-made { margin: 0; font-size: 0.75rem; }

/* Floating tab bar */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--float) + env(safe-area-inset-bottom)); z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: var(--tab-h); padding: 0 6px;
  background: var(--chrome-fill);
  border-radius: 28px;
  box-shadow: var(--chrome-shadow);
  -webkit-backdrop-filter: var(--chrome-blur); backdrop-filter: var(--chrome-blur);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; border-radius: 22px; color: var(--text-2); text-decoration: none; font-size: 0.6875rem; font-weight: 500; cursor: pointer;
}
.tabbar .i { font-size: 1.125rem; }
.tabbar a:hover, .tabbar button:hover { color: var(--text); }

/* Search */
.search {
  width: min(100vw, 640px); max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0 auto; padding: 0;
  background: rgba(20, 20, 23, 0.78); color: var(--text); border: 0;
  -webkit-backdrop-filter: var(--chrome-blur); backdrop-filter: var(--chrome-blur);
}
.search::backdrop { background: rgba(0, 0, 0, 0.6); }
.search-head { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--line); }
.search-head > .i { color: var(--text-3); }
.search-head input { flex: 1; min-width: 0; height: 44px; background: none; border: 0; outline: 0; font-size: 1rem; }
.search-state { margin: 12px 18px; color: var(--text-3); font-size: 0.875rem; }
.search-results { list-style: none; margin: 0; padding: 0 8px 24px; }
.search-results a { display: block; padding: 11px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.search-results a:hover, .search-results a:focus { background: var(--surface-2); color: var(--text); }
.search-results small { display: block; color: var(--text-3); font: 500 0.75rem var(--sans); }
.search-results span { display: block; color: var(--text-2); font-size: 0.8125rem; line-height: 1.4; }

/* Home */
.hero { padding: 16px 0 8px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 5px 12px; background: var(--surface-2); border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); color: var(--text-2); font: 500 0.75rem var(--sans); }
.hero-kicker .i { color: var(--gold); }
.hero h1 { margin: 0 0 14px; font-size: clamp(2.5rem, 11vw, 4rem); line-height: 1.02; letter-spacing: -0.04em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-lede { margin: 0 0 20px; color: var(--text-2); font-size: 1.125rem; line-height: 1.5; max-width: 34rem; }
.hero-cta { display: grid; gap: 10px; margin-bottom: 24px; }
.home-block { margin-top: 40px; }
.home-block > h2 { margin: 0 0 4px; font-size: 1.5rem; font-weight: 650; }
.home-block > p { margin: 0 0 14px; color: var(--text-2); }
.home-grid > div > h2 { margin: 0 0 4px; font-size: 1.5rem; font-weight: 650; }
.home-grid > div > p { margin: 0 0 14px; color: var(--text-2); }
.route { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: route; }
.route li { position: relative; margin: 0; counter-increment: route; }
.route a { display: flex; align-items: baseline; gap: 12px; min-height: 52px; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 580; }
.route a::before { content: counter(route); color: var(--text-3); font: 500 0.8125rem var(--sans); font-variant-numeric: tabular-nums; }
.route a small { margin-left: auto; color: var(--text-3); font-weight: 400; font-size: 0.8125rem; text-align: right; }
.route a:hover { color: var(--gold); }
.home-grid { display: grid; gap: 28px; }

/* Accounts, news, journal, admin */
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gem { display: inline-flex; color: var(--gold); font-size: 0.75em; }
.gem .i { width: 1em; height: 1em; }
.nav-sec li a .gem { margin-left: auto; padding-left: 8px; }
.nav-sec summary .gem { margin-left: 8px; }
.sec-card .gem { margin-left: 6px; font-size: 0.85em; }
.card-state .gem { font-size: 1em; }
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
.top-left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.top-right { display: flex; align-items: center; justify-content: flex-end; min-width: 0; }
.icon-btn.is-active { color: var(--gold); }
.ticker {
  display: flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 999px;
  background: var(--surface-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--text); text-decoration: none; line-height: 1.15; white-space: nowrap;
}
.ticker:hover { background: rgba(255, 255, 255, 0.13); color: var(--text); }
.ticker-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--text-3); }
.ticker-dot.is-open { background: var(--bull); }
.ticker-body { display: flex; flex-direction: column; }
.ticker strong { font-size: 0.9375rem; font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.ticker small { font-size: 0.625rem; color: var(--text-3); }
.nav-quick { display: grid; gap: 2px; padding: 4px 0 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.nav-quick a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 550; font-size: 0.9375rem; }
.nav-quick a:hover { background: var(--surface); }
.nav-quick a .i { color: var(--gold); width: 1.1em; }
.nav-quick a[aria-current] { background: var(--surface-2); }
.auth, .news-card, .admin-row, .cal-entry, .cal-grid, .premium-list li { background: var(--glass-fill); border: 1px solid var(--line); box-shadow: var(--glass-shadow); }
.auth { display: grid; gap: 12px; padding: 18px; border-radius: var(--radius); }
.auth > :last-child { margin-bottom: 0; }
.auth > p { margin: 0; }
.auth-sub { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--well); border-radius: 999px; }
.tab { flex: 1; min-height: 40px; background: none; border: 0; border-radius: 999px; color: var(--text-2); font-weight: 550; font-size: 0.9rem; cursor: pointer; }
.tab.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.auth .calc-out { margin: 0; }
.auth .calc-out dd { white-space: normal; overflow-wrap: anywhere; }
.auth .calc-out .is-main dd { font-size: 1.125rem; }
.check-line { display: flex; align-items: flex-start; gap: 12px; color: var(--text-2); font-size: 0.9rem; line-height: 1.4; cursor: pointer; }
.check-line input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--gold); }
.premium-list { list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.premium-list li { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); }
.premium-list .i { color: var(--gold); }
.news-filter { margin-bottom: 12px; }
.news-list { display: grid; gap: 10px; }
.news-card { padding: 16px 18px; border-radius: var(--radius); }
.news-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.news-head .bias { margin-left: 0; }
.news-topic { color: var(--text-3); font-size: 0.75rem; }
.prose .news-title { display: block; margin: 9px 0 6px; font-size: 1.0625rem; font-weight: 620; letter-spacing: -0.01em; line-height: 1.3; hyphens: none; }
.news-title a { color: var(--text); text-decoration: none; }
.news-title a:hover { color: var(--gold); }
.news-impact { margin: 0 0 6px; color: var(--text-2); font-size: 0.9375rem; line-height: 1.5; }
.news-meta { margin: 0; color: var(--text-3); font-size: 0.75rem; }
.journal-notice:empty { display: none; }
.journal-notice { margin-bottom: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-size: 1.125rem; font-weight: 620; letter-spacing: -0.01em; }
.cal-head .icon-btn { font-size: 1.5rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 10px; border-radius: var(--radius); }
.cal-wd { padding-bottom: 4px; color: var(--text-3); font-size: 0.6875rem; text-align: center; }
.cal-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 50px; padding: 2px; background: var(--surface); border: 1px solid transparent; border-radius: 12px; color: var(--text); font-size: 0.875rem; cursor: pointer; }
.cal-cell:hover { border-color: var(--line-strong); }
.cal-cell small { color: var(--text-2); font-size: 0.5625rem; line-height: 1; font-variant-numeric: tabular-nums; }
.cal-cell.is-up { background: rgba(25, 170, 142, 0.16); }
.cal-cell.is-up small { color: var(--bull-text); }
.cal-cell.is-down { background: rgba(192, 68, 72, 0.2); }
.cal-cell.is-down small { color: var(--bear-text); }
.cal-cell.is-today .cal-num { color: var(--gold); font-weight: 700; }
.cal-cell.is-selected { border-color: var(--gold); }
.cal-day { display: grid; gap: 10px; margin-top: 14px; }
.cal-list { display: grid; gap: 8px; }
.cal-entry { padding: 12px 14px; border-radius: var(--radius-sm); }
.cal-entry-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cal-note { margin: 4px 0 6px; color: var(--text-2); font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; }
.link-btn { padding: 4px 0; background: none; border: 0; color: var(--text-3); font-size: 0.8125rem; text-decoration: underline; cursor: pointer; }
.cal-trade summary { display: flex; align-items: center; min-height: 36px; color: var(--text-2); font-size: 0.9rem; cursor: pointer; }
.cal-trade[open] summary { margin-bottom: 8px; }
.admin-stats { margin-top: 0; }
.admin-block { display: grid; gap: 10px; margin-top: 28px; }
.prose .admin-block h2 { margin: 0; }
.admin-list { display: grid; gap: 8px; }
.admin-row { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius-sm); min-width: 0; }
.admin-row > select, .admin-row > textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--well); border: 1px solid var(--line); border-radius: 12px; color: var(--text); font: 400 0.9375rem var(--sans); }
.admin-row .journal-actions { margin-top: 0; }
.admin-row .news-meta { margin: 0; }
.search-state, .search-results { hyphens: none; }

@media (max-width: 619px) {
  .brand-text { display: none; }
  .top { padding-left: 4px; padding-right: 4px; }
}
@media (min-width: 620px) {
  .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-cell { min-height: 62px; }
  .cal-cell small { font-size: 0.6875rem; }
}

@media (hover: hover) {
  .card:hover, .sec-card:hover, .pg-card:hover, .pn:hover { transform: translateY(-2px); }
}

@media (min-width: 620px) {
  .cards, .sec-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prevnext { grid-template-columns: 1fr 1fr; }
  .pn-next:only-child { grid-column: 2; }
  .hero-cta { display: flex; flex-wrap: wrap; }
  main { padding: 32px 28px 44px; }
  .foot { padding-left: 28px; padding-right: 28px; }
}

@media (min-width: 940px) {
  body { padding-bottom: 0; }
  .only-narrow { display: none; }
  .tabbar { display: none; }
  .top { margin: 12px 16px 0; top: 12px; padding: 0 8px 0 18px; }
  .shell { display: grid; grid-template-columns: 296px minmax(0, 1fr); }
  .side {
    position: sticky; inset: auto; top: calc(var(--top-h) + 24px); z-index: 1; width: auto;
    height: calc(100dvh - var(--top-h) - 36px); margin: 12px 0 12px 16px;
    background: var(--glass-fill); border: 1px solid var(--line); box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: none; backdrop-filter: none;
    transform: none; visibility: visible; transition: none;
  }
  .nav-scrim { display: none; }
  .layout-home .shell { display: block; }
  .layout-home .side { display: none; }
  .layout-home main { max-width: 1160px; margin: 0 auto; }
  .hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 44px; align-items: center; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .sec-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search { height: min(70dvh, 640px); margin-top: 10vh; border-radius: 26px; box-shadow: var(--chrome-shadow); }
}

@media (min-width: 1280px) {
  .pg { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .layout-doc .prose { display: grid; grid-template-columns: minmax(0, 44rem) 240px; column-gap: 48px; align-items: start; }
  .layout-doc .prose > * { grid-column: 1; }
  .layout-doc .prose > .toc { grid-column: 2; grid-row: 1 / span 400; position: sticky; top: calc(var(--top-h) + 28px); background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  .toc summary { pointer-events: none; }
}

@media (max-width: 1279px) {
  .layout-doc .prose, .layout-tool .prose, .layout-section .prose { max-width: 44rem; }
}

/* Floating bars stay readable where blur is missing or switched off. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .top, .tabbar, .side, .search { background: #161618; }
}
@media (prefers-reduced-transparency: reduce) {
  .top, .tabbar, .search { background: #161618; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 939px) and (prefers-reduced-transparency: reduce) {
  .side { background: #161618; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .card:hover, .sec-card:hover, .pg-card:hover, .pn:hover { transform: none; }
}

@media print {
  .top, .side, .tabbar, .foot, .toc, .prevnext, .read-toggle, .read-bar, .nav-scrim, .search { display: none !important; }
  html, body { background: #fff; }
  body::before { display: none; }
  body { color: #000; padding: 0; font-size: 11pt; }
  .prose strong, h1, h2, h3 { color: #000; }
  .callout, .table-wrap, .card, .pattern, .lc { border-color: #999; background: none; box-shadow: none; }
  a { color: #000; }
}
