/* Layout: a pinned 3-D stage and a scrolling notebook beside it (desktop) or under it (phone).
   Instrument screens stay dark like avionics displays; the paper around them stays quiet. */
:root {
  --bg: #f3f4f6; --surface: #ffffff; --sunk: #eceef2; --hair: #dfe2e8; --hair-2: #cdd2da;
  --ink: #10131a; --ink-2: #4d5464; --ink-3: #7b8292;
  --accent: #c9406a; --accent-soft: #f7e3ea; --on-accent: #ffffff;
  --wet: #2f7fd8; --dry: #b8862c; --ok: #1f8a5b; --warn: #b7791f; --bad: #c2413b;
  --stage-bg: #10121b;
  --f-ui: "IBM Plex Sans Hebrew", "Segoe UI", Arial, sans-serif;
  --f-data: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 14px; --r-sm: 10px; --tap: 44px;
  --shadow: 0 1px 2px rgb(16 19 26 / 0.05), 0 8px 24px rgb(16 19 26 / 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f14; --surface: #151821; --sunk: #1b1f2a; --hair: #262b38; --hair-2: #343a4a;
    --ink: #eef0f5; --ink-2: #aab1c2; --ink-3: #7d8598;
    --accent: #f0789c; --accent-soft: #3a1d29; --on-accent: #1a0d12;
    --wet: #6fb2ff; --dry: #e0b062; --ok: #5fd39c; --warn: #f0be62; --bad: #ff8a80;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f14; --surface: #151821; --sunk: #1b1f2a; --hair: #262b38; --hair-2: #343a4a;
  --ink: #eef0f5; --ink-2: #aab1c2; --ink-3: #7d8598;
  --accent: #f0789c; --accent-soft: #3a1d29; --on-accent: #1a0d12;
  --wet: #6fb2ff; --dry: #e0b062; --ok: #5fd39c; --warn: #f0be62; --bad: #ff8a80;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--f-ui); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-weight: 300; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
.muted { color: var(--ink-2); }
.eyebrow { font: 500 0.75rem/1.2 var(--f-data); letter-spacing: 0.06em; color: var(--accent); margin: 0 0 0.75rem; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }

/* ---------- top bar */
.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; height: 56px;
  padding-inline: max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--hair); }
.brand { white-space: nowrap; flex: none; display: flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font-weight: 500; min-height: var(--tap); }
.brand svg { width: 26px; height: 26px; color: var(--accent); }
.bar nav { display: flex; gap: 0.25rem; margin-inline-start: auto; overflow-x: auto; scrollbar-width: none; }
.bar nav a { color: var(--ink-2); text-decoration: none; padding: 0 0.7rem; min-height: var(--tap); display: flex; align-items: center; border-radius: 999px; white-space: nowrap; font-size: 0.92rem; }
.bar nav a:hover, .bar nav a[aria-current="true"] { color: var(--ink); background: var(--sunk); }
.stamp { font: 0.75rem var(--f-data); color: var(--ink-3); display: none; }

/* ---------- split: stage + notebook (phone: stage pinned on top) */
.split { position: relative; }
.stage { position: sticky; top: 56px; z-index: 12; height: 46svh; min-height: 300px; background: var(--stage-bg); overflow: hidden; touch-action: none; }
.stage canvas { display: block; }
.labels { position: absolute; inset: 0; }
.lbl { font: 500 12px var(--f-ui); color: #fff; text-shadow: 0 1px 3px #000, 0 0 10px #0009; white-space: nowrap; pointer-events: none; }
.lbl-major { font-size: 14px; }
.lbl-n { font-family: var(--f-data); color: #ffb3c7; }
.stage-ui { position: absolute; z-index: 2; }
.stage-ui button { -webkit-tap-highlight-color: transparent; }
.stage-views button, .stage-layers button, .stage-time, .busy, .rail button { background: rgb(14 16 24 / 0.62); backdrop-filter: blur(10px); border: 1px solid rgb(255 255 255 / 0.1); color: #eef0f5; }

.stage-views { top: 10px; inset-inline: 10px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.stage-views button { flex: none; min-height: 36px; padding: 0 0.85rem; border-radius: 999px; font-size: 0.85rem; }
.stage-views button[aria-pressed="true"] { background: #fff; color: #10131a; border-color: #fff; }
.stage-layers { inset-inline-end: 10px; top: 56px; display: flex; flex-direction: column; gap: 4px; }
.stage-layers button { width: var(--tap); height: var(--tap); border-radius: 12px; display: grid; place-items: center; position: relative; }
.stage-layers button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.stage-layers button span { position: absolute; inset-inline-end: calc(100% + 6px); white-space: nowrap; font-size: 0.75rem; padding: 2px 8px; border-radius: 6px; background: rgb(14 16 24 / 0.8); opacity: 0; pointer-events: none; transition: opacity .15s; }
.stage-layers button:hover span, .stage-layers button:focus-visible span { opacity: 1; }
.stage-layers button[aria-pressed="false"] { color: rgb(238 240 245 / 0.42); }
.stage-time { inset-inline: 10px; bottom: 10px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; gap: 0 10px; padding: 8px 12px 6px; border-radius: 14px; }
.time-label { font-size: 0.78rem; color: rgb(238 240 245 / 0.75); }
.time-label output { font-family: var(--f-data); color: #fff; margin-inline-start: 0.4rem; }
.stage-time input { grid-column: 1; accent-color: #ff9ab6; width: 100%; min-height: 28px; direction: ltr; }
.stage-time .ticks { grid-column: 1; display: flex; justify-content: space-between; font-size: 0.68rem; color: rgb(238 240 245 / 0.55); direction: ltr; }
.stage-time .ticks span { direction: rtl; }
.icon-btn { grid-column: 2; grid-row: 1 / 4; align-self: center; width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid rgb(255 255 255 / 0.18); background: transparent; color: #fff; display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.stage-legend { display: none; }
.busy { inset-inline-start: 10px; top: 54px; font: 0.75rem var(--f-data); padding: 4px 10px; border-radius: 999px; }
.rail { display: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 5px; vertical-align: middle; }
.dot.dry { background: #e0b062; } .dot.wet { background: #6fb2ff; } .dot.cloud { background: #fff; }

.notebook { min-width: 0; position: relative; z-index: 11; background: var(--bg); padding-inline: max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-left, 0px)); padding-block: 2rem 4rem; }
.intro { padding-block: 1rem 2rem; }
.intro h1 { font-size: clamp(2.1rem, 7vw, 3.4rem); line-height: 1.08; margin-bottom: 1rem; }
.lede { font-size: 1.08rem; color: var(--ink-2); max-width: 38rem; margin: 0 0 1.5rem; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; margin: 0 0 1.5rem; }
.facts div { background: var(--surface); padding: 0.8rem 0.9rem; }
.facts dt { font-size: 0.75rem; color: var(--ink-3); }
.facts dd { margin: 0; font-size: 0.9rem; color: var(--ink-2); }
.facts b { font: 400 1.5rem var(--f-data); color: var(--ink); }
.cta { display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tap); padding: 0 1.2rem; border-radius: 999px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 500; }

/* ---------- chapters */
.chap { min-height: 72svh; padding-block: 2.5rem; border-top: 1px solid var(--hair); display: flex; flex-direction: column; justify-content: center; gap: 0.9rem; opacity: 0.45; transition: opacity .35s; }
.chap.on { opacity: 1; }
.chap .num { font: 500 0.8rem var(--f-data); color: var(--accent); }
.chap h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.15; }
.chap p { margin: 0; max-width: 36rem; font-size: 1.04rem; }
.chap details { border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--surface); max-width: 36rem; }
.chap summary { min-height: var(--tap); display: flex; align-items: center; padding: 0 1rem; color: var(--ink-2); font-size: 0.92rem; list-style: none; }
.chap summary::before { content: "+"; font-family: var(--f-data); color: var(--accent); margin-inline-end: 0.6rem; }
.chap details[open] summary::before { content: "−"; }
.chap details p { padding: 0 1rem 1rem; font-size: 0.95rem; color: var(--ink-2); }
.chap .try { align-self: flex-start; min-height: 40px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--hair-2); background: var(--surface); font-size: 0.88rem; }
.chap .try:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- lab */
.lab { padding-top: 3rem; border-top: 1px solid var(--hair); display: flex; flex-direction: column; gap: 1rem; }
.lab h2 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.lab-head { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.btn { min-height: var(--tap); padding: 0 1.1rem; border-radius: 999px; border: 1px solid var(--hair-2); background: var(--surface); display: inline-flex; align-items: center; gap: 0.45rem; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 500; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.card-h { display: flex; align-items: baseline; gap: 0.5rem; justify-content: space-between; flex-wrap: wrap; }
.card-h h3 { font-size: 1.15rem; font-weight: 400; }
.card-h small { color: var(--ink-3); font-size: 0.8rem; }
.grp { font-size: 0.78rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0.04em; margin-top: 0.4rem; }

.scenarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; }
.scn { text-align: start; min-height: 64px; padding: 0.7rem 0.85rem; border-radius: var(--r-sm); border: 1px solid var(--hair); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.scn b { font-weight: 500; font-size: 0.94rem; }
.scn span { font-size: 0.8rem; color: var(--ink-3); line-height: 1.35; }
.scn:hover { border-color: var(--hair-2); }
.scn[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.scn-note { font-size: 0.9rem; color: var(--ink-2); margin: 0; }

/* real data */
.when { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.when label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--ink-3); }
.when input, .when select { min-height: var(--tap); border: 1px solid var(--hair-2); border-radius: var(--r-sm); background: var(--surface); padding: 0 0.7rem; color: var(--ink); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { min-height: 38px; padding: 0 0.9rem; border-radius: 999px; border: 1px solid var(--hair); background: var(--sunk); font-size: 0.85rem; }
.quick button:hover { border-color: var(--accent); }
.src { font-size: 0.8rem; color: var(--ink-3); margin: 0; }
.src b { color: var(--ink-2); font-weight: 500; }
.timeline { position: relative; width: 100%; max-width: 100%; display: flex; align-items: flex-end; gap: 1px; height: 84px; direction: ltr; overflow-x: auto; padding-bottom: 18px; scrollbar-width: thin; }
.timeline button { flex: 1 0 7px; min-width: 7px; height: 100%; border: 0; padding: 0; background: transparent; position: relative; }
.timeline button i { position: absolute; inset-inline: 0; bottom: 0; border-radius: 3px 3px 0 0; background: var(--hair-2); }
.timeline button.hi i { background: var(--accent); }
.timeline button[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 1px; border-radius: 3px; }
.timeline button.day::after { content: attr(data-day); position: absolute; bottom: -17px; inset-inline-start: 0; font: 0.62rem var(--f-data); color: var(--ink-3); white-space: nowrap; }
.timeline button.now { box-shadow: inset 0 0 0 1px var(--ink-3); }

/* sliders */
.ctl { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.1rem 0.5rem; padding-block: 0.3rem; }
.ctl label { font-size: 0.95rem; }
.ctl output { font: 0.85rem var(--f-data); color: var(--accent); min-width: 4.5ch; text-align: end; direction: ltr; }
.ctl input[type=range] { grid-column: 1 / -1; width: 100%; direction: ltr; -webkit-appearance: none; appearance: none; height: var(--tap); background: transparent; margin: 0; }
.ctl input[type=range]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--accent) var(--p, 50%), var(--hair-2) var(--p, 50%)); }
.ctl input[type=range]::-moz-range-track { height: 2px; background: var(--hair-2); }
.ctl input[type=range]::-moz-range-progress { height: 2px; background: var(--accent); }
.ctl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow); }
.ctl input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.info { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--hair-2); background: transparent; color: var(--ink-3); font: 500 0.8rem var(--f-data); display: grid; place-items: center; }
.info[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.explain { grid-column: 1 / -1; font-size: 0.88rem; color: var(--ink-2); background: var(--sunk); border-radius: var(--r-sm); padding: 0.7rem 0.85rem; margin: 0.2rem 0 0.4rem; line-height: 1.55; }
.explain b { color: var(--ink); font-weight: 500; }

/* compass */
.compass-row { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; }
.compass { width: 132px; height: 132px; touch-action: none; cursor: grab; }
.compass .ring { fill: var(--sunk); stroke: var(--hair-2); }
.compass .tick { stroke: var(--ink-3); }
.compass text { font: 500 11px var(--f-ui); fill: var(--ink-2); }
.compass .arrow { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; fill: none; }
.compass .head { fill: var(--accent); }
.compass .ridge { stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 3 3; }
.compass-txt { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.9rem; color: var(--ink-2); }
.compass-txt b { font: 400 1.4rem var(--f-data); color: var(--ink); }

.seg { display: flex; border: 1px solid var(--hair-2); border-radius: 999px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 0.86rem; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* readouts */
.readouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; }
.ro { background: var(--surface); padding: 0.6rem 0.75rem; display: flex; flex-direction: column; gap: 2px; min-height: 68px; }
.ro span { font-size: 0.72rem; color: var(--ink-3); }
.ro b { font: 400 1.02rem var(--f-data); direction: ltr; unicode-bidi: isolate; text-align: start; }
.ro b.he { font-family: var(--f-ui); direction: rtl; }
.ro i { font-style: normal; font-size: 0.74rem; display: inline-flex; align-items: center; gap: 5px; }
.ro i::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ro i.ok { color: var(--ok); } .ro i.warn { color: var(--warn); } .ro i.bad { color: var(--bad); }
.verdict { border-radius: var(--r); padding: 1rem; background: var(--ink); color: var(--bg); display: flex; flex-direction: column; gap: 0.3rem; }
.verdict small { font: 0.72rem var(--f-data); opacity: 0.7; }
.verdict strong { font-size: 1.25rem; font-weight: 400; }
.verdict p { margin: 0; font-size: 0.92rem; opacity: 0.85; }

/* instrument screens (always dark) */
.screen { margin: 0; border-radius: var(--r); overflow: hidden; background: #0f121a; border: 1px solid #22283a; color: #e8ebf2;
  --fg: #e8ebf2; --fg-dim: #8a93a8; --grid: rgba(138, 147, 168, 0.16); --accent: #ff8fb0; --ice: #9fd8ff;
  --temp: #ff7a6b; --dew: #6fc3ff; --wind: #ffd39a; --stab: #b9a2ff;
  --moist-band: rgba(111, 195, 255, 0.11); --inv-band: rgba(224, 176, 98, 0.18); --moist-band-solid: #3f7f9a; --inv-band-solid: #8a6a32;
  --need: rgba(138, 147, 168, 0.3); --cloud-solid: #fff1ea; --rock-hi: #6d625c; --rock-lo: #29242f; }
.screen figcaption { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem; font-size: 0.86rem; flex-wrap: wrap; border-bottom: 1px solid #22283a; }
.screen figcaption small { color: #8a93a8; font-size: 0.75rem; }
.screen-body { position: relative; height: 240px; }
.screen-body.tall { height: 300px; }
.screen canvas { width: 100%; height: 100%; display: block; direction: ltr; }
.screen-note { margin: 0; padding: 0.4rem 0.8rem 0.6rem; font-size: 0.75rem; color: #8a93a8; }
.tabs { display: flex; gap: 2px; margin-inline-start: auto; }
.tabs button { min-height: 34px; padding: 0 0.65rem; border: 0; border-radius: 8px; background: transparent; color: #8a93a8; font-size: 0.8rem; }
.tabs button[aria-selected="true"] { background: #1e2433; color: #ff8fb0; }
.tip { position: absolute; pointer-events: none; background: #000d; border: 1px solid #333; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; white-space: nowrap; }
.ghost { align-self: flex-start; min-height: 40px; padding: 0 1rem; border-radius: 999px; border: 1px dashed var(--hair-2); background: transparent; color: var(--ink-2); }

/* lab tour (coach marks) */
.coach-ring { position: fixed; z-index: 60; border-radius: 14px; box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgb(10 12 18 / 0.55); pointer-events: none; transition: all .35s cubic-bezier(.2,.8,.2,1); }
.coach { position: fixed; z-index: 61; width: min(340px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); border-radius: var(--r); padding: 1rem; box-shadow: 0 20px 50px rgb(0 0 0 / 0.3); display: flex; flex-direction: column; gap: 0.6rem; }
.coach small { font: 0.72rem var(--f-data); color: var(--accent); }
.coach h4 { margin: 0; font-weight: 500; font-size: 1.05rem; }
.coach p { margin: 0; font-size: 0.92rem; color: var(--ink-2); }
.coach .row { display: flex; gap: 0.5rem; justify-content: space-between; align-items: center; }

/* wide sections */
.wide { border-top: 1px solid var(--hair); padding-block: 3.5rem; background: var(--surface); }
#method { background: var(--bg); }
.wide-in { max-width: 72rem; margin-inline: auto; padding-inline: max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 1.2rem; }
.wide h2 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.wide p { max-width: 42rem; margin: 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--hair); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.92rem; }
th, td { text-align: start; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
th { font-weight: 500; font-size: 0.78rem; color: var(--ink-3); background: var(--sunk); }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--f-data); white-space: nowrap; direction: rtl; }
.sources { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; font-size: 0.9rem; color: var(--ink-2); }
.sources b { color: var(--ink); font-weight: 500; }
.cols { display: grid; gap: 2rem; }
.gallery { display: grid; gap: 1rem; }
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--r); }
.gallery figcaption { font: 0.75rem var(--f-data); color: var(--ink-3); margin-top: 0.4rem; }
.foot { border-top: 1px solid var(--hair); padding-block: 2rem calc(2rem + env(safe-area-inset-bottom, 0px)); font-size: 0.85rem; color: var(--ink-3); }

/* ---------- tablet / desktop: stage pinned beside the notebook */
@media (min-width: 900px) {
  .stamp { display: block; }
  .split { display: grid; grid-template-columns: minmax(380px, 40%) minmax(0, 1fr); }
  .notebook { grid-column: 1; grid-row: 1; padding-inline: clamp(24px, 3.5vw, 56px); }
  .stage { grid-column: 2; grid-row: 1; height: calc(100svh - 56px); border-radius: 0; }
  .stage-legend { display: flex; gap: 0.9rem; inset-inline-start: 14px; bottom: 112px; font-size: 0.75rem; color: rgb(238 240 245 / 0.8); }
  .stage-time { inset-inline: auto 14px; inset-inline-start: 14px; inset-inline-end: 72px; bottom: 14px; }
  .rail { display: flex; flex-direction: column; gap: 6px; list-style: none; margin: 0; padding: 0; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); }
  .rail button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgb(255 255 255 / 0.25); background: rgb(14 16 24 / 0.5); color: #cfd4df; font: 0.68rem var(--f-data); }
  .rail button[aria-current="true"] { background: #fff; color: #10131a; }
  .chap { min-height: 82vh; }
  .cols { grid-template-columns: 1.1fr 1fr; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chap, .coach-ring { transition: none; }
}

.adv > summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; color: var(--ink-2); font-size: 0.95rem; }
.lab > * { min-width: 0; }

/* anchors and tour targets land below the pinned stage */
.lab > *, .lab [id], .chap, #lab, #story { scroll-margin-top: calc(56px + max(46svh, 300px) + 12px); }
@media (min-width: 900px) { .lab > *, .lab [id], .chap, #lab, #story { scroll-margin-top: 72px; } }
@media (max-width: 420px) { .brand span { font-size: 0.95rem; } .bar nav a { padding: 0 0.5rem; font-size: 0.85rem; } }
@media (max-width: 899px) {
  .coach { padding: 0.75rem 0.9rem; gap: 0.4rem; }
  .coach p { font-size: 0.86rem; line-height: 1.45; }
  .coach .btn { min-height: 40px; }
}
