/* Practice v2 (/practice.html) and the research desk page (/practice/desk.html).
   The stage, where every problem runs, is the drill engine's (src/drills/drills.css): a flat sheet to read and an
   instrument to answer on. Around it, flat sheets: where you stand (bars and words), the speed runs, the desk card.
   Keycaps only where you press. Phone first; uses the study.css variables, so light and dark both work. */

.pr { display: grid; gap: 22px; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 0 40px; }
.pr [hidden] { display: none !important; }

/* ---------- head: the heading and its line, with the subject switch beside them ---------- */
.pr-head { padding: 0 4px; }
.pr-headrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "h switch" "sub switch"; align-items: end; column-gap: 24px; }
.pr-headrow .pr-h1 { grid-area: h; }
.pr-headrow .pr-sub { grid-area: sub; }
.pr-h1 { margin: 0; font: 380 clamp(40px, 5vw, 60px)/1.02 var(--serif); font-variation-settings: "opsz" 144; letter-spacing: -.02em; }
.pr-h1 i, .pr-h2 i { font-style: italic; }
.pr-sub { margin: 12px 0 0; max-width: 62ch; font-size: 17px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

/* the subject switch: two quiet text tabs, the current one underlined in ink */
.pr-switch { grid-area: switch; display: flex; gap: 4px; margin-bottom: 2px; }
.pr-tab { position: relative; min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; background: none; cursor: pointer; font: 500 16px var(--sans); color: var(--ink-3); transition: color .16s var(--ease); }
.pr-tab:hover { color: var(--ink-2); }
.pr-tab[aria-selected="true"] { color: var(--ink); }
.pr-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--ink); }

/* ---------- the stage ---------- */
.pr-stage { scroll-margin-top: 12px; min-height: 120px; }
.pr-backrow { margin: -8px 4px -10px; scroll-margin-top: 12px; }
.pr-linkbtn { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer; font: 500 14.5px var(--sans); color: var(--ink-2);
  text-decoration: underline; text-decoration-color: var(--rule-2); text-decoration-thickness: 1px; text-underline-offset: 5px; transition: color .16s var(--ease); }
.pr-linkbtn:hover { color: var(--ink); text-decoration-color: var(--ink-3); }

/* ---------- the sheets under the stage ---------- */
.pr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 24px; align-items: start; }
.pr-col { display: grid; gap: 24px; min-width: 0; }
.pr-h2 { margin: 0; font: 380 30px/1.08 var(--serif); font-variation-settings: "opsz" 144; letter-spacing: -.02em; }
.pr-lede { margin: 10px 0 0; max-width: 62ch; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.pr-stand, .pr-runs, .pr-desk { padding: 32px 36px 30px; min-width: 0; }

/* where you stand: the engine's bars and words, with a way into each module's problems */
.pr-standlist { margin-top: 14px; }
.pr-standlist li { padding: 6px 0 14px; }
.pr-modbtn { justify-self: start; min-height: 40px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink);
  text-decoration: underline; text-decoration-style: dotted; text-decoration-color: var(--ink-3); text-decoration-thickness: 1.5px; text-underline-offset: 5px; transition: text-decoration-color .16s var(--ease); }
.pr-modbtn:hover { text-decoration-style: solid; text-decoration-color: var(--ink); }
.pr-standacts { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-3); }
.pr-inlink { color: var(--ink-2); border-bottom: 1px solid var(--rule-2); }
.pr-inlink:hover { color: var(--ink); border-color: var(--ink-3); }
.pr-redo { margin: 6px 0 0; }

/* get quick: one row per run, a hairline between, a keycap to start */
.pr-runlist { list-style: none; margin: 16px 0 0; padding: 0; }
.pr-run { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.pr-run:last-child { border-bottom: 0; padding-bottom: 4px; }
.pr-run-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.pr-run-body b { font-size: 15.5px; font-weight: 500; }
.pr-run-body span { font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.pr-run-body small { font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pr-runkey { flex: none; min-height: 48px; padding: 0 18px; font-size: 14.5px; }

/* ---------- the research desk, beside the runs: a flat sheet, one row per case ---------- */
.pr-cases { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.pr-case {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 14px 14px 18px;
  border: 1px solid var(--rule-2); border-radius: 14px; color: var(--ink); text-decoration: none;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.pr-case:hover { border-color: var(--ink-3); box-shadow: var(--lift-1); }
.pr-case-body, .dk-case-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pr-case-body b, .dk-case-body b { font-weight: 500; font-size: 15.5px; }
.pr-case-body span, .dk-case-body span { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.pr-case-go { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--dark); color: var(--on-dark); transition: transform .16s var(--ease); }
.pr-case-go svg { width: 15px; height: 15px; }
.pr-case:hover .pr-case-go { transform: translateX(3px); }
/* your best result per case: the desk's three lamps, lit orange */
.pr-case-lamps { flex: none; display: flex; gap: 5px; }
.pr-case-lamps i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule-2); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .2); }
.pr-case-lamps i.on { background: #FF6A2B; box-shadow: 0 0 8px rgba(255, 90, 31, .7); }
.pr-desk-note { margin: 16px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }

/* ---------- the desk page: two case keys, then the desk ---------- */
.dk { max-width: 1120px; }
.dk-cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 760px; }
.dk-case {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px;
  border: 1px solid var(--rule-2); border-radius: 14px; color: var(--ink); text-decoration: none;
  transition: border-color .16s var(--ease), background-color .16s var(--ease), box-shadow .16s var(--ease);
}
.dk-case:hover { border-color: var(--ink-3); }
.dk-case[aria-current] { background: var(--card); border-color: var(--ink); box-shadow: var(--lift-1); }
.dk-case:focus-visible, .pr-case:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.dk-desk.rdx { width: 100%; margin: 0; scroll-margin-top: 12px; } /* the desk centres itself with auto margins, which would shrink it to nothing in this grid */

/* ---------- narrower ---------- */
@media (max-width: 1100px) {
  .pr-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .pr-stand, .pr-runs, .pr-desk { padding: 26px 22px 28px; }
}
@media (max-width: 620px) {
  .pr { padding-top: 12px; gap: 18px; }
  .pr-headrow { grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "sub" "switch"; }
  .pr-switch { margin: 10px 0 -6px -12px; }
  .pr-h1 { font-size: 44px; }
  .pr-sub { font-size: 16.5px; line-height: 1.5; }
  .pr-stand, .pr-runs, .pr-desk { padding: 24px 18px 24px; border-radius: 18px; }
  .pr-h2 { font-size: 28px; }
  .pr-run { gap: 12px; }
  .pr-runkey { padding: 0 14px; }
  .dk-cases { gap: 8px; }
  .dk-case { min-height: 52px; padding: 10px 12px; }
  .dk-case-body span { display: none; }
}

/* ---------------------------------------------------------------- v3 (2026-11-03): a bench of gauges, stopwatches */
.pr-stand { margin-top: 24px; }
.pr-grid { display: block; margin-top: 24px; }
.pr-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.pr-meters { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 14px; }
.pr-meter-b { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 6px 4px; border: 0; border-radius: 14px; background: none; color: var(--ink); font: inherit; text-align: center; cursor: pointer; transition: transform .2s var(--ease); }
span.pr-meter-b { cursor: default; }
button.pr-meter-b:hover { transform: translateY(-2px); }
button.pr-meter-b:hover .pr-face { border-color: var(--orange); }
button.pr-meter-b:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.pr-face { display: grid; place-items: center; padding: 12px 16px 8px; border: 1.5px solid var(--ink); border-radius: 50% 50% 12px 12px / 70% 70% 12px 12px; background: var(--card); transition: border-color .2s var(--ease); }
.pr-gauge { width: 92px; height: 58px; overflow: visible; color: var(--ink); }
.pr-needle { stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; transform-box: view-box; transform-origin: 32px 34px; transform: rotate(calc(var(--v, 0) * 180deg - 90deg)); transition: transform .9s cubic-bezier(.2, .8, .2, 1.2); }
.pr-meter-k { font: 600 11px/1.35 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.pr-meter-w { font-size: 13px; color: var(--ink-2); }
.pr-meter.is-untried .pr-face { opacity: .55; } .pr-meter.is-untried .pr-needle { stroke: var(--ink-3); }
.pr-meter.is-untried .pr-meter-k, .pr-meter.is-untried .pr-meter-w { color: var(--ink-3); }
.pr-standacts { margin: 22px 0 0; font-size: 15px; color: var(--ink-2); }
.pr-run { display: grid !important; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.pr-watch { width: 56px; height: 62px; color: var(--ink); }
@media (max-width: 900px) { .pr-col { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .pr-needle { transition: none; } }
/* With the research desk hidden (the AI tab), the speed runs take the full width, two to a row. */
.pr-col:has(> .pr-desk[hidden]) { grid-template-columns: 1fr; }
.pr-col:has(> .pr-desk[hidden]) .pr-runlist { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 40px; }
.pr-col:has(> .pr-desk[hidden]) .pr-run { border-bottom: 0; }

/* ================================================================ v4 (2026-11-03): home and focus, drawn instruments
   (src/practice.js). Scoped to .pr4 so the research desk page keeps its own styles. */
.pr4 { --meter-face-1: #FCF8EF; --meter-face-2: #EEE7D7; --bridge-1: #ECE7DD; --bridge-2: #E1DBCF; }
[data-theme="dark"] .pr4 { --meter-face-1: #2B2925; --meter-face-2: #1F1E1B; --bridge-1: #1C1B19; --bridge-2: #161513; }
.pr4 .pr-headrow { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.pr4 .pr-switch { display: inline-flex; flex: none; gap: 0; padding: 4px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--rule); }
.pr4 .pr-tab { padding: 9px 20px; border: 0; border-radius: 999px; background: none; color: var(--ink-3); font: 500 15px var(--sans); cursor: pointer; }
.pr4 .pr-tab[aria-selected="true"] { background: var(--ink); color: var(--card); box-shadow: none; }
.pr4 .pr-tab::after { display: none; }
.pr4 .pr-home { display: grid; gap: 26px; }
.pr4 .pr-home[hidden], .pr4 .pr-focus[hidden] { display: none; }
.pr4 .pr-k { margin: 0; font: 600 11px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.pr4 .pr-h2 { font-size: clamp(30px, 3.4vw, 42px); }
/* Today */
.pr4 .pr-today { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 44px; padding: 42px 46px; border-radius: 28px; }
.pr4 .pr-today-h { margin: 10px 0 0; }
.pr4 .pr-today-sub { margin: 12px 0 0; max-width: 48ch; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); }
.pr4 .pr-topics { list-style: none; margin: 24px 0 28px; padding: 0; }
.pr4 .pr-topics li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--rule); font-size: 15.5px; }
.pr4 .pr-topics li:last-child { border-bottom: 1px solid var(--rule); }
.pr4 .pr-topics li.is-done .pr-ti { color: var(--ink-3); }
.pr4 .pr-ti { flex: 1; min-width: 0; }
.pr4 .pr-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink); }
.pr4 .pr-dot.is-hot { background: var(--orange); box-shadow: none; }
.pr4 .pr-dot.is-right { background: var(--ink); } .pr4 .pr-dot.is-miss { box-shadow: inset 0 0 0 1.5px var(--orange); }
.pr4 .pr-tag { flex: none; white-space: nowrap; } .pr4 .pr-tag.is-hot { color: var(--orange); }
.pr4 .pr-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 26px; }
.pr4 .pr-topics + .pr-cta { margin-top: 0; }
.pr4 .pr-go { height: 56px; padding: 0 26px; border-radius: 14px; font-size: 16px; }
.pr4 .pr-weekbox { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 26px 22px; border-radius: 22px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--rule); }
.pr4 .pr-week { width: 100%; max-width: 290px; color: var(--ink); }
.pr4 .pr-slot { fill: var(--card); stroke: var(--ink); stroke-width: 1.4; stroke-opacity: .5; }
.pr4 .pr-slot.is-done { fill: url(#pr-hatch); stroke-opacity: 1; }
.pr4 .pr-slot.is-today { stroke: var(--orange); stroke-width: 2.2; stroke-opacity: 1; }
.pr4 .pr-slot.is-future { stroke-opacity: .28; }
.pr4 .pr-now { fill: var(--orange); animation: pr-pulse 1.8s ease-in-out infinite; }
@keyframes pr-pulse { 50% { opacity: .3; } }
.pr4 .pr-wd { font: 600 12px var(--mono); fill: var(--ink-3); } .pr4 .pr-wd.is-today { fill: var(--orange); }
.pr4 .pr-weektext { text-align: center; }
.pr4 .pr-streak { margin: 0; font: italic 300 28px/1.15 var(--serif); }
.pr4 .pr-weektext small { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-3); }
/* Where you stand: the meter bridge */
.pr4 .pr-stand { padding: 40px 46px 34px; border-radius: 28px; }
.pr4 .pr-stand-head .pr-lede { margin-top: 8px; }
.pr4 .pr-bridge { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0; margin-top: 26px; padding: 26px 18px 20px; border-radius: 20px; background: linear-gradient(var(--bridge-1), var(--bridge-2)); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -1px 0 rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.06); }
.pr4 .pr-screw { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #bdb6aa 70%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.pr4 .pr-screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 4.4px; height: 1.2px; background: rgba(0,0,0,.35); transform: rotate(-38deg); }
.pr4 .pr-screw.tl { left: 10px; top: 10px; } .pr4 .pr-screw.tr { right: 10px; top: 10px; } .pr4 .pr-screw.bl { left: 10px; bottom: 10px; } .pr4 .pr-screw.br { right: 10px; bottom: 10px; }
.pr4 .pr-m { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 4px 10px 6px; border: 0; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; }
.pr4 span.pr-m { cursor: default; }
.pr4 .pr-m + .pr-m { box-shadow: -1px 0 0 rgba(0,0,0,.07), -2px 0 0 rgba(255,255,255,.45); }
.pr4 .pr-gauge { display: block; width: 100%; max-width: 168px; height: auto; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1), 0 0 0 3px rgba(0,0,0,.04), 0 2px 0 rgba(255,255,255,.7); transition: transform .25s var(--ease); }
.pr4 button.pr-m:hover .pr-gauge { transform: translateY(-2px); }
.pr4 button.pr-m:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; border-radius: 12px; }
.pr4 .pr-arc { fill: none; stroke: var(--ink); stroke-width: 1; stroke-opacity: .55; }
.pr4 .pr-red { fill: none; stroke: #C4512B; stroke-width: 5; stroke-opacity: .75; }
.pr4 .pr-tk { stroke: var(--ink); stroke-width: .9; } .pr4 .pr-tk-big { stroke: var(--ink); stroke-width: 1.5; }
.pr4 .pr-lvl { font: 600 7.5px var(--mono); letter-spacing: .3em; fill: var(--ink-3); }
.pr4 .pr-needle { stroke: #1D1C1A; stroke-width: 1.6; stroke-linecap: round; transform-box: view-box; transform-origin: 80px 96px; transform: rotate(calc(var(--v, 0) * 120deg - 60deg)); transition: transform 1.1s cubic-bezier(.25, 1.4, .4, 1); filter: drop-shadow(1px 1px .6px rgba(0,0,0,.18)); }
[data-theme="dark"] .pr4 .pr-needle { stroke: #F3ECDF; }
.pr4 .pr-cap { fill: #1D1C1A; } [data-theme="dark"] .pr4 .pr-cap { fill: #0E0D0C; }
.pr4 .pr-glass { pointer-events: none; opacity: .5; } [data-theme="dark"] .pr4 .pr-glass { opacity: .08; }
.pr4 .pr-rim { fill: none; stroke: rgba(0,0,0,.18); stroke-width: 1; }
.pr4 .pr-m.is-off .pr-scale, .pr4 .pr-m.is-off .pr-arc, .pr4 .pr-m.is-off .pr-red { opacity: .45; }
.pr4 .pr-m.is-off .pr-needle { stroke: var(--ink-3); }
.pr4 .pr-mn { margin-top: 4px; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.pr4 .pr-mw { font-size: 13px; color: var(--ink-2); }
.pr4 .pr-m.is-off .pr-mn, .pr4 .pr-m.is-off .pr-mw { color: var(--ink-3); }
.pr4 .pr-standacts { margin: 20px 4px 0; font-size: 15px; color: var(--ink-2); }
.pr4 .pr-redo { margin-top: 14px; }
/* Quick runs: stopwatch cards */
.pr4 .pr-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 26px; }
.pr4 .pr-quick:empty { display: none; }
.pr4 .pr-runcard { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 24px; align-items: center; padding: 30px 34px; border-radius: 28px; }
.pr4 .pr-watch { width: 92px; height: auto; }
.pr4 .pr-wl { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; } .pr4 .pr-wface { fill: var(--card); }
.pr4 .pr-wmin { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; } .pr4 .pr-wsec { stroke: var(--orange); stroke-width: 2.2; stroke-linecap: round; }
.pr4 .pr-hub { fill: var(--ink); }
.pr4 .pr-run-h { margin: 0; font: 300 27px/1.1 var(--serif); }
.pr4 .pr-runbody p { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }
.pr4 .pr-runrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.pr4 .pr-best { display: inline-flex; align-items: baseline; gap: 8px; padding: 7px 12px; border-radius: 8px; background: #161513; color: var(--orange); font: 800 17px var(--dots, monospace); text-shadow: 0 0 6px rgba(255, 90, 31, .45); }
.pr4 .pr-best small { font: 10.5px var(--mono); letter-spacing: .1em; color: rgba(255, 140, 90, .55); text-shadow: none; }
.pr4 .pr-runkey { height: 48px; padding: 0 22px; border-radius: 12px; }
.pr4 .pr-band { margin-top: 10px !important; font-size: 13.5px !important; color: var(--ink-3) !important; }
.pr4 .pr-desk { border-radius: 28px; }
/* Focus: one session, alone */
.pr4 .pr-focusbar { display: flex; justify-content: space-between; align-items: center; max-width: 800px; margin: 0 auto 18px; }
.pr4 .pr-back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none; color: var(--ink-2); font: 500 15px var(--sans); cursor: pointer; }
.pr4 .pr-back:hover { color: var(--ink); } .pr4 .pr-back svg { width: 16px; height: 16px; }
.pr4 .pr-focus-k { font: 500 14px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-3); } .pr4 .pr-focus-k b { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) {
  .pr4 .pr-headrow { flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 20px; }
  .pr4 .pr-home { gap: 16px; }
  .pr4 .pr-today { grid-template-columns: 1fr; gap: 20px; padding: 24px 20px 26px; border-radius: 24px; }
  .pr4 .pr-weekbox { order: -1; flex-direction: row; gap: 16px; padding: 14px 16px; border-radius: 16px; }
  .pr4 .pr-week { max-width: 160px; } .pr4 .pr-weektext { text-align: left; } .pr4 .pr-streak { font-size: 21px; } .pr4 .pr-weektext small { font-size: 13px; }
  .pr4 .pr-topics { margin: 18px 0 22px; } .pr4 .pr-topics li { font-size: 15px; padding: 11px 0; }
  .pr4 .pr-go { width: 100%; }
  .pr4 .pr-stand { padding: 26px 20px 24px; border-radius: 24px; }
  .pr4 .pr-bridge { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 20px -20px 0 0; padding: 22px 8px 16px; border-radius: 18px 0 0 18px; }
  .pr4 .pr-bridge::-webkit-scrollbar { display: none; }
  .pr4 .pr-m { flex: 0 0 44%; scroll-snap-align: start; }
  .pr4 .pr-screw.tr, .pr4 .pr-screw.br { display: none; }
  .pr4 .pr-quick { grid-template-columns: 1fr; gap: 16px; }
  .pr4 .pr-runcard { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 22px 20px; border-radius: 24px; } .pr4 .pr-watch { width: 64px; } .pr4 .pr-run-h { font-size: 22px; }
}

/* ---------------------------------------------------------------- v5: where you stand, as the curriculum's tiles */
.pr4 .pr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 24px; }
.pr4 .pr-tile { position: relative; align-items: center; width: 100%; min-height: 150px; border: 0; font: inherit; text-align: left; cursor: pointer; }
.pr4 div.pr-tile { cursor: default; }
.pr4 .pr-tile .st-folder { flex: none; height: 118px; }
.pr4 .pr-tile .st-tile-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pr4 .pr-tile .st-tile-k { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(29, 28, 26, .55); }
.pr4 .pr-tile.is-weak .st-tile-k { color: #B8431C; }
.pr4 .pr-tile .st-tile-t { font: 500 18px/1.25 var(--sans); letter-spacing: -.01em; color: #1D1C1A; }
.pr4 .pr-level { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.pr4 .pr-pips { display: inline-flex; gap: 4px; }
.pr4 .pr-pips i { width: 16px; height: 6px; border-radius: 3px; background: rgba(29, 28, 26, .14); }
.pr4 .pr-pips i.on { background: #1D1C1A; }
.pr4 .pr-tile.is-weak .pr-pips i.on { background: #FF5A1F; }
.pr4 .pr-level-w { font-size: 13.5px; color: rgba(29, 28, 26, .7); }
.pr4 .pr-tile-go { margin-top: 6px; font-size: 13.5px; font-weight: 500; color: #1D1C1A; opacity: 0; transform: translateX(-4px); transition: opacity .2s var(--ease), transform .2s var(--ease); }
.pr4 button.pr-tile:hover .pr-tile-go, .pr4 button.pr-tile:focus-visible .pr-tile-go { opacity: 1; transform: none; }
.pr4 button.pr-tile:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.pr4 .pr-tile.is-off .st-folder { filter: saturate(.55); opacity: .85; }
.pr4 .pr-tile.is-off .st-coversvg .pulse { animation: none; }
.pr4 .pr-tile.is-weak { box-shadow: inset 0 0 0 1.5px rgba(255, 90, 31, .6); }
@media (hover: none) { .pr4 .pr-tile-go { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .pr4 .pr-tiles { grid-template-columns: 1fr; gap: 12px; margin-top: 18px; }
  .pr4 .pr-tile { min-height: 124px; padding: 16px; gap: 18px; } .pr4 .pr-tile .st-folder { height: 96px; }
}
/* Focus: a session has the page to itself. */
.pr4.is-focus .pr-headrow { display: none; }
@media (max-width: 760px) {
  /* The answer row stays above the floating bottom bar. */
  .pr4 .dr4[data-mode] .dr-side { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .pr4.is-focus .pr-focusbar { margin-top: 4px; }
}

/* ---------------------------------------------------------------- v5: against the clock, as tiles */
.pr4 .pr-clock { padding: 40px 46px 36px; border-radius: 28px; }
.pr4 .pr-clock .pr-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; margin-top: 24px; }
.pr4 .pr-runtile { align-items: center; min-height: 160px; }
.pr4 .pr-runtile .st-folder { flex: none; height: 124px; }
.pr4 .pr-runtile .st-tile-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pr4 .pr-runtile .st-tile-t { font: 500 18px/1.25 var(--sans); color: #1D1C1A; }
.pr4 .pr-runtile .st-tile-s { font-size: 14px; line-height: 1.45; color: rgba(29, 28, 26, .7); }
.pr4 .pr-runtile .pr-runrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.pr4 .pr-runtile .pr-best { padding: 0; background: none; color: rgba(29, 28, 26, .65); font: 500 13.5px var(--sans); text-shadow: none; }
.pr4 .pr-runtile .pr-runkey { height: 44px; padding: 0 18px; border-radius: 12px; font-size: 14.5px; }
@media (max-width: 760px) {
  .pr4 .pr-clock { padding: 26px 20px 22px; border-radius: 24px; }
  .pr4 .pr-clock .pr-quick { grid-template-columns: 1fr; gap: 12px; margin-top: 18px; }
  .pr4 .pr-runtile { padding: 16px; gap: 16px; min-height: 0; } .pr4 .pr-runtile .st-folder { height: 100px; }
}

/* ---------------------------------------------------------------- v6: plain buttons, and phones done properly */
.pr4 .pr-go.dr-key, .pr4 .pr-runkey.dr-key { background: var(--ink); color: var(--card); box-shadow: none; border-radius: 14px; font: 500 15.5px var(--sans); }
.pr4 .pr-go.dr-key .led, .pr4 .pr-runkey.dr-key .led { display: none; }
.pr4 .pr-go.dr-key kbd { opacity: .5; }
@media (max-width: 760px) {
  .pr4 .pr-weekbox { order: 2; }
  .pr4 .pr-tag { display: none; }
  .pr4 .pr-topics li { padding: 12px 0; }
  .pr4 .pr-today-h { font-size: 34px; }
}
/* Phones: the AI / Quant switch sits in the middle (user, 2026-11-03). */
@media (max-width: 760px) {
  .pr4 .pr-switch { justify-self: center; align-self: center; margin: 8px auto 0; width: max-content; }
}

/* ---------------------------------------------------------------- v7: the week as a punch card (user, 2026-11-03:
   the pill strip looked bad). A tinted tile like the module tiles; on it, a paper card with a clipped corner, a
   perforation, and seven slots: punched (ink) for days practised, a waiting orange ring for today, faint for the rest.
   The tile and the card keep their light colours in dark mode, like every folder. */
.pr4 .pw-box { align-self: start; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 30px 26px 26px; border-radius: 22px; background: #E9E0CF; box-shadow: inset 0 0 0 1px rgba(29, 28, 26, .06); color: #1D1C1A; }
.pr4 .pw { width: 100%; max-width: 320px; overflow: visible; transform: rotate(-2deg); transition: transform .35s var(--ease); }
.pr4 .pw-box:hover .pw { transform: rotate(0deg) translateY(-2px); }
.pw-shadow { fill: rgba(60, 48, 30, .14); }
.pw-card { fill: #FCFBF8; stroke: #1D1C1A; stroke-width: 1.6; stroke-linejoin: round; }
.pw-k { font: 800 15px Doto, var(--mono); letter-spacing: .04em; fill: #1D1C1A; }
.pw-s { font: 8.5px "JetBrains Mono Variable", var(--mono); fill: #5E5B55; }
.pw-perf { stroke: #1D1C1A; stroke-width: 1.2; stroke-dasharray: 2 4; opacity: .5; }
.pw-wd { font: 600 10px var(--mono); letter-spacing: .08em; fill: #8E8A82; }
.pw-ring { fill: none; stroke: #1D1C1A; stroke-width: 1.3; stroke-dasharray: 2.5 3; opacity: .35; }
.pw-slot.is-missed .pw-ring { stroke-dasharray: none; opacity: .28; }
.pw-hole { fill: #1D1C1A; transform-box: fill-box; transform-origin: center; }
.pw-glint { fill: #fff; opacity: .16; }
.pw-slot.is-done .pw-wd { fill: #1D1C1A; }
.pw-due { fill: rgba(255, 90, 31, .1); stroke: #FF5A1F; stroke-width: 1.8; stroke-dasharray: 4 3.2; transform-box: fill-box; transform-origin: center; animation: pw-turn 14s linear infinite; }
.pw-dot { fill: #FF5A1F; animation: pw-pulse 1.8s ease-in-out infinite; }
.pw-slot.is-today .pw-wd { fill: #FF5A1F; }
@keyframes pw-turn { to { transform: rotate(360deg); } }
@keyframes pw-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pw-due, .pw-dot { animation: none; } }
.pr4 .pw-box .pr-weektext { text-align: center; }
.pr4 .pw-box .pr-streak { margin: 0; font: 380 30px/1.1 var(--serif); letter-spacing: -.02em; color: #1D1C1A; font-style: normal; }
.pr4 .pw-box .pr-streak i { font-style: italic; }
.pr4 .pw-box .pr-weektext small { display: block; margin-top: 6px; font-size: 14.5px; color: #5E5B55; }
@media (max-width: 760px) {
  .pr4 .pw-box { flex-direction: column; align-items: center; gap: 14px; padding: 24px 18px 20px; border-radius: 18px; }
  .pr4 .pw { max-width: 290px; }
  .pr4 .pw-box .pr-weektext { text-align: center; }
  .pr4 .pw-box .pr-streak { font-size: 24px; }
}

/* v7b: a punched hole shows the tile through it, with the cut edge drawn; the clipped corner is folded. */
.pw-hole { fill: #E9E0CF; stroke: #1D1C1A; stroke-width: 1.4; }
.pw-lip { fill: none; stroke: rgba(29, 28, 26, .28); stroke-width: 3; stroke-linecap: round; }
.pw-fold { fill: #EFEBE3; stroke: #1D1C1A; stroke-width: 1.4; stroke-linejoin: round; }
.pw-s { font-size: 9px; letter-spacing: .06em; }
.pw-wd { font-size: 10.5px; }
/* The research desk's best result per case (2026-11-04): small ink pips, like levels everywhere else, not lamps. */
.pr-case-lamps { gap: 4px !important; }
.pr-case-lamps i { width: 12px !important; height: 4px !important; border-radius: 3px !important; background: var(--rule-2, var(--rule)) !important; box-shadow: none !important; }
.pr-case-lamps i.on { background: var(--ink) !important; box-shadow: none !important; }
/* The research desk page: header, case picker and desk share one centred column (2026-11-04). */
.dk .pr-head, .dk-cases, .dk-desk { width: 100%; max-width: 920px; margin-left: auto; margin-right: auto; }
.dk-cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .dk-cases { grid-template-columns: minmax(0, 1fr); } }
/* ---------------------------------------------------------------- research desk page v4 (user, 2026-11-04: "make it look
   professional"): everything on one 920px column with one left edge; the case cards are tabs that say your best result
   in words (no unlabelled pips). */
.pr.dk { max-width: 920px; margin-left: auto; margin-right: auto; }
.dk .pr-head, .dk-cases { max-width: none; margin-left: 0; margin-right: 0; }
.dk-desk.rdx { max-width: none; margin: 0; }
.dk-cases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.dk-case { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "body word"; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; }
.dk-case .dk-case-body { grid-area: body; }
.dk-case .pr-case-lamps { display: none; }
.dk-case-word { grid-area: word; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.dk-case[aria-current] .dk-case-word { color: var(--ink-2); }
@media (max-width: 640px) { .dk-cases { grid-template-columns: minmax(0, 1fr); } .dk-case { padding: 14px 16px; } }

/* ---------------------------------------------------------------- v9 (user, 2026-11-05): pick a level, then any topic
   Three rows in the style of the drill's answer choices (a 1.5px rule, ink on hover), the level's name and one line. */
.pr4 .pr-levels { display: grid; gap: 10px; margin-top: 24px; max-width: 520px; }
.pr4 .pr-lv { position: relative; display: grid; gap: 3px; width: 100%; padding: 16px 52px 16px 20px; border: 0; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--rule-2, var(--rule)); color: var(--ink); text-align: left; cursor: pointer; transition: box-shadow .16s var(--ease), transform .16s var(--ease); }
.pr4 .pr-lv:hover, .pr4 .pr-lv:focus-visible { box-shadow: inset 0 0 0 1.5px var(--ink); outline: none; }
.pr4 .pr-lv:active { transform: translateY(1px); }
.pr4 .pr-lv-t { font: 500 17px/1.3 var(--sans); }
.pr4 .pr-lv-s { font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.pr4 .pr-lv-go { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--ink-3); transition: transform .16s var(--ease), color .16s var(--ease); }
.pr4 .pr-lv:hover .pr-lv-go { color: var(--ink); transform: translate(3px, -50%); }
.pr4 .pr-lvline { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 14.5px; color: var(--ink-3); }
.pr4 .pr-lvline b { font-weight: 500; color: var(--ink-2); }
.pr4 .pr-lvline .pr-linkbtn { min-height: 0; font-size: 14.5px; }
@media (prefers-reduced-motion: reduce) { .pr4 .pr-lv, .pr4 .pr-lv-go { transition: none; } }

/* ---------------------------------------------------------------- v10 Today panel (user, 2026-11-05: "looks vibe
   coded"): the set's progress as its own bars (the same ones a session shows) with one word, and the level as a quiet
   link beside the key. No date eyebrow, no list of problems, no tags. */
.pr4 .pr-setrow { display: flex; align-items: center; gap: 14px; margin-top: 22px; font-size: 14.5px; color: var(--ink-3); }
.pr4 .pr-setbar { display: flex; gap: 6px; }
.pr4 .pr-setbar i { width: 34px; height: 4px; border-radius: 4px; background: var(--rule-2, var(--rule)); }
.pr4 .pr-setbar i.on { background: var(--ink); }
.pr4 .pr-cta .pr-lvbtn { min-height: 0; font-size: 14.5px; color: var(--ink-3); }
.pr4 .pr-cta .pr-lvbtn:hover { color: var(--ink); }
