@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;
  --bg: #0b0e13;
  --surface: #10141b;
  --surface-2: #161b24;
  --line: #222a35;
  --line-strong: #323c4a;
  --text: #e9ecf1;
  --text-2: #aab3c0;
  --text-3: #87919f;
  --gold: #e6b84d;
  --gold-soft: rgba(230, 184, 77, 0.12);
  --on-gold: #1a1405;
  --bull: #19aa8e;
  --bear: #c04448;
  --bull-text: #4fd1b5;
  --bear-text: #f08a8d;
  --blue-text: #7fb4ea;
  --radius: 12px;
  --radius-sm: 8px;
  --top-h: 56px;
  --tab-h: 60px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  overflow-wrap: break-word;
  hyphens: auto;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
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: #f3cf7a; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(230, 184, 77, 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); }

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

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  height: var(--top-h); padding: 0 12px;
  background: rgba(11, 14, 19, 0.92);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.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: 1.5px; 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: 700; font-size: 1rem; line-height: 1.1; letter-spacing: -0.01em; hyphens: none; }
.brand-text small { font: 500 0.625rem/1.3 var(--mono); color: var(--text-3); letter-spacing: 0.02em; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: none; border: 0; border-radius: var(--radius-sm); 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 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; color: var(--text-2); cursor: pointer; font-size: 0.875rem;
}
.search-open:hover { border-color: var(--line-strong); color: var(--text); }

/* Shell and navigation */
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 70;
  width: min(86vw, 340px); padding: 8px 8px 32px;
  background: var(--surface); border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-102%); transition: transform 0.22s ease; visibility: hidden;
}
.nav-open .side { transform: none; visibility: visible; }
.nav-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, 0.6); 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 12px; }
.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: 600; font-size: 0.9375rem;
}
.nav-sec summary::-webkit-details-marker { display: none; }
.nav-sec summary:hover { background: var(--surface-2); }
.nav-sec summary .i:first-child { color: var(--gold); width: 1.1em; }
.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 22px; }
.nav-sec li a {
  display: flex; align-items: center; min-height: 40px; padding: 6px 12px;
  border-left: 1px solid var(--line); 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); border-left-color: var(--line-strong); }
.nav-sec li a[aria-current] { color: var(--gold); border-left-color: var(--gold); font-weight: 600; }
.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: 20px 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: 500 0.75rem/1.5 var(--mono); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.crumbs .mono { margin-left: auto; color: var(--gold); font-size: 0.75rem; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }
h1 { margin: 12px 0 10px; font-size: clamp(1.875rem, 7vw, 2.5rem); font-weight: 750; line-height: 1.12; letter-spacing: -0.025em; }
.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: flex-end; gap: 3px; height: 22px; margin-top: 16px; }
.tick { display: block; flex: 1 1 0; max-width: 18px; height: 10px; border-radius: 2px; background: var(--line-strong); }
.tick.is-read { background: var(--bull); }
.tick.is-current { height: 20px; background: var(--gold); }
.tick:hover { background: var(--gold); opacity: 0.8; }

/* Prose */
.prose { min-width: 0; }
.prose > * { margin-top: 0; margin-bottom: 1.05em; }
.prose h2 { margin-top: 2em; margin-bottom: 0.6em; font-size: 1.5rem; font-weight: 700; display: flex; gap: 10px; align-items: baseline; }
.prose h3 { margin-top: 1.6em; margin-bottom: 0.4em; font-size: 1.1875rem; font-weight: 650; }
.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(--gold); }
.prose strong { font-weight: 650; color: #f5f6f8; }
.prose code { font: 0.875em var(--mono); background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }
.h-sm { font-size: 1rem !important; margin-top: 0 !important; }
.term { color: inherit; text-decoration: underline dotted var(--gold); text-underline-offset: 4px; }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.9rem; }
.toc summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; cursor: pointer; font-weight: 600; color: var(--text-2); list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary .i { color: var(--gold); }
.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(--gold); }

/* Callouts */
.callout { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--text-3); border-radius: var(--radius-sm); font-size: 1rem; }
.callout > :last-child { margin-bottom: 0; }
.callout-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 650; color: var(--text); }
.callout-title .i { color: var(--text-2); }
.callout-tip, .callout-summary { border-left-color: var(--gold); }
.callout-tip .callout-title .i, .callout-summary .callout-title .i { color: var(--gold); }
.callout-info, .callout-phone, .callout-example { border-left-color: #3578b8; }
.callout-info .callout-title .i, .callout-phone .callout-title .i, .callout-example .callout-title .i { color: var(--blue-text); }
.callout-warn, .callout-risk { border-left-color: var(--bear); }
.callout-warn .callout-title .i, .callout-risk .callout-title .i { color: var(--bear-text); }
.callout-fact { border-left-color: var(--bull); }
.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 44px; margin: 0; counter-increment: step; }
.step::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--gold-soft); border: 1px solid var(--gold);
  color: var(--gold); font: 600 0.8125rem var(--mono);
}
.step:not(:last-child)::after { content: ""; position: absolute; left: 14.5px; top: 34px; bottom: 4px; width: 1px; background: var(--line-strong); }
.step-title { margin: 2px 0 4px; font-weight: 650; }
.step-body > :last-child { margin-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; hyphens: none; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; 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 18px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600; font-size: 0.9375rem; text-decoration: none; hyphens: none;
}
.btn:hover { border-color: var(--gold); color: var(--text); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: #f0c964; border-color: #f0c964; color: var(--on-gold); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; border-color: var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: 400 1rem var(--sans); color: var(--text);
}
.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 { border-color: var(--bull); color: var(--bull-text); }

/* Cards */
.cards { display: grid; gap: 10px; }
.card {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none;
}
.card:hover { border-color: var(--gold); color: var(--text); }
.card-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); }
.card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-body strong { font-weight: 650; }
.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: 40px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none;
}
.sec-card:hover { border-color: var(--gold); color: var(--text); }
.sec-card .card-icon { grid-row: span 3; }
.sec-card strong { font-weight: 650; }
.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 { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pattern img { width: 100%; max-width: 480px; margin: 0 auto; }
figcaption { padding: 10px 14px 12px; 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: #05070a; border: 1px solid var(--line-strong); border-radius: 30px; padding: 10px 8px 12px; }
.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; border: 1px solid var(--line); }
.ph-bar { padding: 8px 12px; background: var(--surface-2); border-radius: 14px 14px 0 0; font-weight: 650; 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 14px 14px; 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: 650; }
.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: 8px; text-align: center; font-weight: 650; 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 { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 0; }
.lc-sym { font: 600 0.8125rem var(--mono); }
.lc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text-2); font-size: 0.6875rem; font-weight: 600; hyphens: none; }
.lc-badge .i { color: var(--gold); }
.lc-readout { min-height: 1.5em; margin: 2px 14px 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 14px 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: 12px 14px; border-top: 1px solid var(--line); margin-top: 8px; }
.lc-step-text { min-height: 4.2em; margin: 0 0 10px; 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(--mono); color: var(--text-3); white-space: nowrap; }
.lc-table { padding: 0 14px 10px; 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; }
.lc figcaption a { white-space: nowrap; }

/* Quiz */
.quiz { padding: 16px; background: var(--surface); border: 1px solid var(--line); 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: 600; line-height: 1.4; }
.q-opt { display: flex; align-items: flex-start; gap: 10px; min-height: 46px; padding: 10px 12px; margin-bottom: 6px; background: var(--bg); 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: 650; min-height: 1.5em; }

/* Calculators */
.calc { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.calc-fields { display: grid; gap: 12px; }
.calc-out { display: grid; gap: 1px; margin: 16px 0 0; background: var(--line); 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: 10px 12px; background: var(--bg); }
.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; }
.calc-out .is-main { padding: 14px 12px; background: var(--surface-2); }
.calc-out .is-main dt { color: var(--text); font-weight: 600; }
.calc-out .is-main dd { color: var(--gold); font-size: 1.375rem; font-weight: 600; }
.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: 16px; background: var(--surface); border: 1px solid var(--line); 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.625rem var(--mono); 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: 600; }
.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: 600; }
.clock-track { position: relative; height: 12px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.clock-run { position: absolute; top: 0; bottom: 0; background: var(--line-strong); border-radius: 2px; }
.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(--mono); }
.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: 12px; background: var(--surface); border: 1px solid var(--line); 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: 16px; background: var(--surface); border: 1px solid var(--line); 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(--mono); }
.trainer-img { width: 100%; background: var(--bg); 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 { border-color: var(--bull); color: var(--bull-text); }
.trainer-options .btn.is-wrong { border-color: var(--bear); color: var(--bear-text); }
.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 { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.replay-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.replay-stat { padding: 8px 10px; background: var(--surface); min-width: 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: 12px 14px 14px; 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: #127a66; border-color: #127a66; color: #fff; }
.btn-bull:hover { background: #159079; border-color: #159079; color: #fff; }
.btn-bear { background: #a2363a; border-color: #a2363a; color: #fff; }
.btn-bear:hover { background: #b83f44; border-color: #b83f44; 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: 16px; background: var(--surface); border: 1px solid var(--line); 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: 12px; background: var(--surface); border: 1px solid var(--line); 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: 650; }
.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: 18px 16px; background: var(--surface); border: 1px solid var(--line); 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: 0; border-radius: var(--radius); background: var(--surface); }
.tv-frame.is-tape { height: 78px; }
.tv-frame.is-calendar { height: 620px; }

/* Glossary */
.gl-group h2 { margin-top: 1.4em !important; color: var(--gold); font: 600 1rem var(--mono); }
.gl-group dl { margin: 0; }
.gl-item { padding: 10px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + 12px); }
.gl-item:target { background: var(--gold-soft); padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.gl-item dt { font-weight: 650; }
.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: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.pn:hover { border-color: var(--gold); color: var(--text); }
.pn small { color: var(--text-3); font: 500 0.6875rem var(--mono); }
.pn span { font-weight: 600; font-size: 0.9375rem; line-height: 1.3; }
.pn-next { text-align: right; }

/* Footer */
.foot { padding: 24px 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-family: var(--mono); font-size: 0.6875rem; }

/* Tab bar */
.tabbar {
  position: fixed; inset: auto 0 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(16, 20, 27, 0.96); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; 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(--gold); }

/* Search */
.search { width: min(100vw, 640px); max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0 auto; padding: 0; background: var(--surface); color: var(--text); border: 0; }
.search::backdrop { background: rgba(0, 0, 0, 0.7); }
.search-head { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.search-head > .i { color: var(--gold); }
.search-head input { flex: 1; min-width: 0; height: 44px; background: none; border: 0; outline: 0; font-size: 1rem; }
.search-state { margin: 12px 16px; 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: 10px; 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(--gold); font: 500 0.6875rem var(--mono); }
.search-results span { display: block; color: var(--text-2); font-size: 0.8125rem; line-height: 1.4; }

/* Home */
.hero { padding: 12px 0 8px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--gold); font: 500 0.75rem var(--mono); }
.hero h1 { margin: 0 0 12px; font-size: clamp(2.25rem, 10vw, 3.5rem); line-height: 1.04; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-lede { margin: 0 0 18px; color: var(--text-2); font-size: 1.125rem; line-height: 1.5; max-width: 34rem; }
.hero-cta { display: grid; gap: 10px; margin-bottom: 20px; }
.home-block { margin-top: 36px; }
.home-block > h2 { margin: 0 0 4px; font-size: 1.5rem; font-weight: 700; }
.home-block > 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: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; }
.route a::before { content: counter(route, decimal-leading-zero); color: var(--gold); font: 500 0.8125rem var(--mono); }
.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: 16px; }

@media (min-width: 620px) {
  .cards, .sec-cards { grid-template-columns: repeat(2, 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: 28px 28px 40px; }
  .foot { padding-left: 28px; padding-right: 28px; }
}

@media (min-width: 940px) {
  body { padding-bottom: 0; }
  .only-narrow { display: none; }
  .tabbar { display: none; }
  .top { padding: 0 20px; }
  .shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); }
  .side {
    position: sticky; top: var(--top-h); z-index: 1; width: auto; height: calc(100dvh - var(--top-h));
    transform: none; visibility: visible; border-right: 1px solid var(--line); background: none; transition: none;
  }
  .nav-scrim { display: none; }
  .layout-home .shell { display: block; }
  .layout-home .side { display: none; }
  .layout-home main { max-width: 1120px; margin: 0 auto; }
  .hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; 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: var(--radius); border: 1px solid var(--line); }
}

@media (min-width: 1280px) {
  .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) + 20px); background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; }
  .toc summary { pointer-events: none; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

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