/* Poker Math Academy — plain, readable, theme-aware styles. */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --text: #1d2330;
  --muted: #5d6677;
  --border: #d9dee6;
  --accent: #2563eb;
  --accent-weak: #e3ecff;
  --good: #15803d;
  --good-weak: #dcfce7;
  --bad: #b91c1c;
  --bad-weak: #fee2e2;
  --warn: #a16207;
  --warn-weak: #fef3c7;
  --gto: #7c3aed;
  --gto-weak: #ede9fe;
  --felt: #1f6f4a;
  --felt-edge: #14532d;
  --card-bg: #ffffff;
  --card-border: #c7ccd6;
  --suit-s: #111827;
  --suit-h: #dc2626;
  --suit-d: #2563eb;
  --suit-c: #15803d;
  --act-fold: #64748b;
  --act-check: #16a34a;
  --act-call: #16a34a;
  --act-bet: #dc2626;
  --act-raise: #b91c1c;
  --act-allin: #7f1d1d;
  /* Role tokens. Every one is defined here (light) and again in BOTH dark blocks below; tests/tokens.test.js checks
   * the WCAG ratios. A filled control (--*-fill) carries its text in the paired --on-* colour (≥ 4.5:1 in both themes);
   * --on-accent also reads on every --grade-* and --series-* colour. --accent-text / --warn-text are the accent / warn
   * colours for text on their -weak tints. --border-strong outlines controls (inputs, answer options; ≥ 3:1 on
   * --panel), plain --border stays for decorative dividers. --focus-ring is the keyboard focus outline. */
  --accent-fill: #2563eb;
  --on-accent: #ffffff;
  --good-fill: #15803d;
  --on-good: #ffffff;
  --bad-fill: #b91c1c;
  --on-bad: #ffffff;
  --accent-text: #1d4ed8;
  --warn-text: #854d0e;
  --border-strong: #8590a2;
  --focus-ring: #2563eb;
  /* Semantic palettes: decision grades (text on --panel ≥ 4.5:1), task stars (≥ 4.5:1), the highlight outline of
   * cards and range cells, and the default chart series (same order as the components' chart palette). */
  --grade-best: #15803d;
  --grade-good: #4d7c0f;
  --grade-inaccuracy: #a16207;
  --grade-mistake: #c2410c;
  --grade-blunder: #dc2626;
  --star: #b45309;
  --hl: #f59e0b;
  --series-1: #2563eb;
  --series-2: #15803d;
  --series-3: #b91c1c;
  --series-4: #a16207;
  --series-5: #7c3aed;
  --series-6: #5d6677;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.05);
  --radius: 10px;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'SF Mono', Menlo, 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Hiragino Sans GB', sans-serif;
  /* Round 6 glass material (SPEC §2.4; values are ours, tuned for legibility and cost, not Apple's). Every material and
   * symbol token is defined here (light) and again in BOTH dark blocks below; tests/tokens.test.js checks the values
   * against the SPEC and the contrast model (GL2.23, GL2.25). The class API that uses them is the glass section at the
   * end of this file. --glass-a-rt / --glass-a-lg-rt are the 磨砂 look under the OS's Reduce Transparency. */
  --glass-rgb: 255 255 255;
  --glass-a: .62;
  --glass-a-lg: .82;
  --glass-a-frosted: .78;
  --glass-a-lg-frosted: .90;
  --glass-a-rt: .92;
  --glass-a-lg-rt: .96;
  --glass-blur: 16px;
  --glass-blur-lg: 24px;
  --glass-sat: 160%;
  --glass-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) contrast(.9) brightness(1.05);
  --glass-filter-lg: blur(var(--glass-blur-lg)) saturate(var(--glass-sat)) contrast(.9) brightness(1.05);
  --glass-rim: inset 0 1px 0 rgb(255 255 255 / .70), inset 0 -1px 0 rgb(255 255 255 / .14), inset 0 0 0 1px rgb(255 255 255 / .26);
  --glass-edge: 0 0 0 1px rgb(0 0 0 / .08);
  --rim-w: 1.5px;
  --rim-fill: linear-gradient(135deg, rgb(255 255 255 / .85), transparent 25% 75%, rgb(255 255 255 / .45));
  --rim-a: .6;
  --rim-a-active: 1;
  --rim-band: inset 0 0 6px rgb(255 255 255 / .25);
  --glass-shadow: 0 4px 16px rgb(0 0 0 / .08);
  --glass-shadow-raised: 0 8px 28px rgb(0 0 0 / .14);
  --glass-shadow-lg: 0 12px 40px rgb(0 0 0 / .16);
  --glass-spec-a: .35;
  --glass-glow-touch: .30;
  --glass-glow-mouse: .12;
  --glass-thumb: rgb(0 0 0 / .07);
  --glass-thumb-rim: inset 0 0 0 1px rgb(0 0 0 / .06);
  --glass-thumb-line: rgb(0 0 0 / .06);
  --seg-thumb-shadow: none;
  --glass-focus-halo: #ffffff;
  --glass-focus-edge: #0b1220;
  --band-rgb: 246 247 249;
  --band-a: .97;
  --band-line: rgb(0 0 0 / .08);
  --scrim: rgb(0 0 0 / .35);
  --clear-a: .18;
  --clear-dim: rgb(0 0 0 / .40);
  --lens-bezel-max: 14px;
  --lens-k: 1.4;
  --lens-blur: 10px;
  --lens-tone: saturate(160%) contrast(.9) brightness(1.05);
  --page-wash: radial-gradient(1200px 640px at 8% -10%, rgb(37 99 235 / .07), transparent 70%), radial-gradient(900px 520px at 100% 0%, rgb(124 58 237 / .05), transparent 70%);
  /* Symbol colours (SPEC GL3.6, signalling): one colour per symbol everywhere — P / P₀, C, e, B / R, α / MDF / f* —
   * each ≥ 4.5:1 on --panel in its theme; bar fills use the matching --series-*. */
  --sym-pot: #92400e;
  --sym-call: #1d4ed8;
  --sym-eq: #15803d;
  --sym-bet: #b91c1c;
  --sym-alpha: #7c3aed;
  /* Theme-independent tokens (defined here only). Static top-bar geometry before any JS (js/ui/glass.js rewrites
   * --topbar-h on :root only in init(), its debounced resize handler and setAccessory(); phone default below). */
  --topbar-h: 56px;
  --topbar-min-h: 48px;
  /* Shape (SPEC GL3.1, concentric: inner radius = outer − padding, e.g. 24 = 18 + 6, 40 = 18 + 22) */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-panel: 14px;
  --r-pop: 18px;
  --r-bar: 28px;
  --r-bar-phone: 24px;
  --r-sheet: 40px;
  --r-capsule: 999px;
  /* .btn: half of the 44 px touch height, so every one-line button (28–44 px) is still a capsule, and a label that wraps
   * gets a 22 px rounded rectangle instead of a stadium (release REL-2) */
  --r-btn: 22px;
  /* Spacing on a 4 px grid, type scale, reading measure (SPEC GL3.5, GL3.6) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --fs-xs: 12px;
  --fs-sm: 13.5px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 21px;
  --fs-2xl: 26px;
  --lh-body: 1.8;
  --lh-ui: 1.4;
  --measure-prose: 40em;
  --measure-wide: 860px;
  /* Motion (SPEC GL4.5; mirrored exactly by PMA.ui.motion.T). Spring curves as linear() (W-37): the CSS duration is the
   * settle time and the visible motion is mostly over at ≈ 60 % of it, so nothing user-facing chains on transitionend.
   * --m-micro is the 120 ms ease-out of colour / background / border state changes, --m-reduced the 150 ms linear
   * cross-fade of reduced motion, --m-stagger-max a count of items. The enter offsets and press scales become 0px / 1
   * under reduced motion (the token overrides after the dark blocks). */
  --m-press-dur: 337ms;
  --m-press-ease: linear(0, 0.019 2.5%, 0.08 5.5%, 0.457 18.3%, 0.63 25.3%, 0.753 32%, 0.847 39.5%, 0.886 44%, 0.919 49%, 0.944 54.5%, 0.964 60.8%, 0.988 75.5%, 1);
  --m-ui-dur: 404ms;
  --m-ui-ease: linear(0, 0.019 2.5%, 0.08 5.5%, 0.457 18.3%, 0.63 25.3%, 0.753 32%, 0.847 39.5%, 0.886 44%, 0.919 49%, 0.944 54.5%, 0.964 60.8%, 0.988 75.5%, 1);
  --m-snappy-dur: 449ms;
  --m-snappy-ease: linear(0, 0.022 2.8%, 0.095 6.3%, 0.51 19.5%, 0.688 26.3%, 0.813 32.8%, 0.903 39.8%, 0.937 43.8%, 0.965 48.3%, 0.984 53.3%, 0.997 58.8%, 1.006 72.3%, 1);
  --m-morph-dur: 370ms;
  --m-morph-ease: linear(0, 0.018 3.5%, 0.073 7.5%, 0.586 31.8%, 0.715 39.8%, 0.817 48.3%, 0.896 58%, 0.95 69%, 0.981 81.8%, 1);
  --m-teach-dur: 674ms;
  --m-teach-ease: linear(0, 0.019 2.5%, 0.08 5.5%, 0.457 18.3%, 0.63 25.3%, 0.753 32%, 0.847 39.5%, 0.886 44%, 0.919 49%, 0.944 54.5%, 0.964 60.8%, 0.988 75.5%, 1);
  --m-bouncy-dur: 729ms;
  --m-bouncy-ease: linear(0, 0.006 1.3%, 0.028 2.8%, 0.116 6%, 0.584 17.8%, 0.776 23.5%, 0.91 29.3%, 0.994 35.3%, 1.033 41%, 1.046 47.8%, 1.004 77%, 1);
  --m-micro: 120ms;
  --m-reduced: 150ms;
  --m-stagger: 30ms;
  --m-stagger-max: 6;
  --m-shift: 8px;
  --m-scale-from: .96;
  --m-press-scale: .97;
  --m-press-scale-coarse: .95;
  --m-gel-fine: .98;
  --m-gel-coarse-x: .95;
  --m-gel-coarse-y: .93;
  --m-fps-cap: 60;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1218;
    --panel: #171b23;
    --panel-2: #1f2430;
    --text: #e6e9ef;
    --muted: #9aa3b2;
    --border: #2c3341;
    --accent: #6ea0ff;
    --accent-weak: #1c2a47;
    --good: #4ade80;
    --good-weak: #14301f;
    --bad: #f87171;
    --bad-weak: #3a1717;
    --warn: #fbbf24;
    --warn-weak: #3a2c0c;
    --gto: #b197fc;
    --gto-weak: #2a2147;
    --felt: #1a5a3d;
    --felt-edge: #0f3a27;
    --card-bg: #f8fafc;
    --card-border: #94a3b8;
    --accent-fill: #6ea0ff;
    --on-accent: #0b1220;
    --good-fill: #4ade80;
    --on-good: #0b1220;
    --bad-fill: #f87171;
    --on-bad: #0b1220;
    --accent-text: #6ea0ff;
    --warn-text: #fbbf24;
    --border-strong: #646e80;
    --focus-ring: #6ea0ff;
    --grade-best: #4ade80;
    --grade-good: #65a30d;
    --grade-inaccuracy: #fbbf24;
    --grade-mistake: #ea580c;
    --grade-blunder: #f87171;
    --star: #d97706;
    --hl: #f59e0b;
    --series-1: #6ea0ff;
    --series-2: #4ade80;
    --series-3: #f87171;
    --series-4: #fbbf24;
    --series-5: #b197fc;
    --series-6: #9aa3b2;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --glass-rgb: 23 27 35;
    --glass-a: .72;
    --glass-a-lg: .86;
    --glass-a-frosted: .84;
    --glass-a-lg-frosted: .92;
    --glass-a-rt: .94;
    --glass-a-lg-rt: .96;
    --glass-blur: 16px;
    --glass-blur-lg: 24px;
    --glass-sat: 140%;
    --glass-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) contrast(.9) brightness(.9);
    --glass-filter-lg: blur(var(--glass-blur-lg)) saturate(var(--glass-sat)) contrast(.9) brightness(.9);
    --glass-rim: inset 0 1px 0 rgb(255 255 255 / .20), inset 0 -1px 0 rgb(255 255 255 / .05), inset 0 0 0 1px rgb(255 255 255 / .09);
    --glass-edge: 0 0 0 1px rgb(0 0 0 / .45);
    --rim-w: 1.5px;
    --rim-fill: linear-gradient(135deg, rgb(255 255 255 / .40), transparent 25% 75%, rgb(255 255 255 / .20));
    --rim-a: .6;
    --rim-a-active: 1;
    --rim-band: inset 0 0 6px rgb(255 255 255 / .08);
    --glass-shadow: 0 6px 20px rgb(0 0 0 / .40);
    --glass-shadow-raised: 0 10px 32px rgb(0 0 0 / .55);
    --glass-shadow-lg: 0 16px 48px rgb(0 0 0 / .55);
    --glass-spec-a: .16;
    --glass-glow-touch: .22;
    --glass-glow-mouse: .08;
    --glass-thumb: rgb(255 255 255 / .12);
    --glass-thumb-rim: inset 0 0 0 1px rgb(255 255 255 / .10);
    --glass-thumb-line: rgb(255 255 255 / .10);
    --seg-thumb-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .5));
    --glass-focus-halo: #0b1220;
    --glass-focus-edge: #ffffff;
    --band-rgb: 15 18 24;
    --band-a: .98;
    --band-line: rgb(255 255 255 / .06);
    --scrim: rgb(0 0 0 / .50);
    --clear-a: .18;
    --clear-dim: rgb(0 0 0 / .40);
    --lens-bezel-max: 14px;
    --lens-k: 1.4;
    --lens-blur: 10px;
    --lens-tone: saturate(140%) contrast(.9) brightness(.9);
    --page-wash: radial-gradient(1200px 640px at 8% -10%, rgb(37 99 235 / .12), transparent 70%), radial-gradient(900px 520px at 100% 0%, rgb(124 58 237 / .09), transparent 70%);
    --sym-pot: #fbbf24;
    --sym-call: #6ea0ff;
    --sym-eq: #4ade80;
    --sym-bet: #f87171;
    --sym-alpha: #b197fc;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f1218;
  --panel: #171b23;
  --panel-2: #1f2430;
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --border: #2c3341;
  --accent: #6ea0ff;
  --accent-weak: #1c2a47;
  --good: #4ade80;
  --good-weak: #14301f;
  --bad: #f87171;
  --bad-weak: #3a1717;
  --warn: #fbbf24;
  --warn-weak: #3a2c0c;
  --gto: #b197fc;
  --gto-weak: #2a2147;
  --felt: #1a5a3d;
  --felt-edge: #0f3a27;
  --card-bg: #f8fafc;
  --card-border: #94a3b8;
  --accent-fill: #6ea0ff;
  --on-accent: #0b1220;
  --good-fill: #4ade80;
  --on-good: #0b1220;
  --bad-fill: #f87171;
  --on-bad: #0b1220;
  --accent-text: #6ea0ff;
  --warn-text: #fbbf24;
  --border-strong: #646e80;
  --focus-ring: #6ea0ff;
  --grade-best: #4ade80;
  --grade-good: #65a30d;
  --grade-inaccuracy: #fbbf24;
  --grade-mistake: #ea580c;
  --grade-blunder: #f87171;
  --star: #d97706;
  --hl: #f59e0b;
  --series-1: #6ea0ff;
  --series-2: #4ade80;
  --series-3: #f87171;
  --series-4: #fbbf24;
  --series-5: #b197fc;
  --series-6: #9aa3b2;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --glass-rgb: 23 27 35;
  --glass-a: .72;
  --glass-a-lg: .86;
  --glass-a-frosted: .84;
  --glass-a-lg-frosted: .92;
  --glass-a-rt: .94;
  --glass-a-lg-rt: .96;
  --glass-blur: 16px;
  --glass-blur-lg: 24px;
  --glass-sat: 140%;
  --glass-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) contrast(.9) brightness(.9);
  --glass-filter-lg: blur(var(--glass-blur-lg)) saturate(var(--glass-sat)) contrast(.9) brightness(.9);
  --glass-rim: inset 0 1px 0 rgb(255 255 255 / .20), inset 0 -1px 0 rgb(255 255 255 / .05), inset 0 0 0 1px rgb(255 255 255 / .09);
  --glass-edge: 0 0 0 1px rgb(0 0 0 / .45);
  --rim-w: 1.5px;
  --rim-fill: linear-gradient(135deg, rgb(255 255 255 / .40), transparent 25% 75%, rgb(255 255 255 / .20));
  --rim-a: .6;
  --rim-a-active: 1;
  --rim-band: inset 0 0 6px rgb(255 255 255 / .08);
  --glass-shadow: 0 6px 20px rgb(0 0 0 / .40);
  --glass-shadow-raised: 0 10px 32px rgb(0 0 0 / .55);
  --glass-shadow-lg: 0 16px 48px rgb(0 0 0 / .55);
  --glass-spec-a: .16;
  --glass-glow-touch: .22;
  --glass-glow-mouse: .08;
  --glass-thumb: rgb(255 255 255 / .12);
  --glass-thumb-rim: inset 0 0 0 1px rgb(255 255 255 / .10);
  --glass-thumb-line: rgb(255 255 255 / .10);
  --seg-thumb-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .5));
  --glass-focus-halo: #0b1220;
  --glass-focus-edge: #ffffff;
  --band-rgb: 15 18 24;
  --band-a: .98;
  --band-line: rgb(255 255 255 / .06);
  --scrim: rgb(0 0 0 / .50);
  --clear-a: .18;
  --clear-dim: rgb(0 0 0 / .40);
  --lens-bezel-max: 14px;
  --lens-k: 1.4;
  --lens-blur: 10px;
  --lens-tone: saturate(140%) contrast(.9) brightness(.9);
  --page-wash: radial-gradient(1200px 640px at 8% -10%, rgb(37 99 235 / .12), transparent 70%), radial-gradient(900px 520px at 100% 0%, rgb(124 58 237 / .09), transparent 70%);
  --sym-pot: #fbbf24;
  --sym-call: #6ea0ff;
  --sym-eq: #4ade80;
  --sym-bet: #f87171;
  --sym-alpha: #b197fc;
  color-scheme: dark;
}

/* Token overrides that are not themes. The 磨砂 look (GL2.20) only raises the tint alpha; html:root (0,2,1) outranks
 * both dark blocks (0,2,0), and the glass section's Reduce Transparency block raises it further (lead override O-2:
 * Reduce Transparency changes only the 磨砂 look). The phone top bar's static height (SPEC §2.4). Reduced motion
 * (SPEC GL4.19; motion.js is the only writer of html[data-motion]): the enter offsets and press scales go to 0px / 1,
 * so an enter rule like translateY(var(--m-shift)) scale(var(--m-scale-from)) degrades to opacity only. */
html:root[data-look='frosted'] { --glass-a: var(--glass-a-frosted); --glass-a-lg: var(--glass-a-lg-frosted); }
@media (max-width: 640px) {
  :root { --topbar-h: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --m-shift: 0px; --m-scale-from: 1; --m-press-scale: 1; --m-press-scale-coarse: 1; --m-gel-fine: 1; --m-gel-coarse-x: 1; --m-gel-coarse-y: 1; }
}
html[data-motion='reduce'] { --m-shift: 0px; --m-scale-from: 1; --m-press-scale: 1; --m-press-scale-coarse: 1; --m-gel-fine: 1; --m-gel-coarse-x: 1; --m-gel-coarse-y: 1; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* The page wash lives in the root background (SPEC GL2.14: no composited layer; a fixed body::before doubled the layer
 * memory). Each wash layer is one viewport tall at the top of the page and scrolls with it; html stays opaque (the
 * --bg colour layer; WebKit bug 271340); body is transparent so the wash shows through. It never animates. */
html {
  background-color: var(--bg);
  background-image: var(--page-wash);
  background-position: 0 0;
  background-size: 100% 100vh;
  background-repeat: no-repeat;
  scroll-padding-top: calc(var(--topbar-h) + 8px);
}
/* D3: the body is --fs-md (16 px); headings and secondary sizes map onto the type scale (12 px floor) */
body {
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; margin: 1.2em 0 0.5em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0.6em 0; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
table { border-collapse: collapse; }
th, td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }
th { background: var(--panel-2); }
hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }
/* one visible keyboard focus ring for everything focusable (mouse clicks on buttons do not match :focus-visible) */
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- layout ---------- */
/* The top bar (SPEC GL2.15, GL2.26, GL3.8; the DOM is built once by js/app.js, RUNTIME R16b; js/ui/glass.js drives it).
 * Transparent at rest; the scroll-edge band (.scroll-band: a near-opaque uniform tint, no backdrop filter, H-46) fades
 * in over the first 16 px of scroll (a scroll timeline, else the sentinel's data-scrolled). The brand sits on the band;
 * the navigation capsule nav.nav.glass is the one persistent glass layer (GL8.1). Desktop: one 56 px row (8 + the 40 px
 * capsule + 8); an accessory row adds 40 px. Phone (≤ 640 px): 80 px = a 36 px brand row + a 44 px row holding a
 * full-width capsule of six equal tabs (two-character labels from data-short; the full name stays in aria-label; no
 * inner scroll, no mask). glass.js minimizes the bar on scroll with .is-min (a transform; nothing is written per frame),
 * on phones and on a desktop bar with an accessory row, never under reduced motion. */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; flex-wrap: wrap; column-gap: 16px; row-gap: 0;
  padding: 8px 16px;
  background: transparent;
  transition: transform var(--m-snappy-dur) var(--m-snappy-ease);
}
.topbar.is-min { transform: translateY(calc(-1 * var(--topbar-collapse, 0px))); }
.topbar.has-accessory { --topbar-collapse: 48px; } /* minimized: the accessory row only (96 − 48) */
.topbar > .scroll-band {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgb(var(--band-rgb) / var(--band-a)); box-shadow: 0 1px 0 var(--band-line);
  opacity: 0; transition: opacity 200ms linear;
}
.topbar[data-scrolled] > .scroll-band { opacity: 1; }
@supports (animation-timeline: scroll()) {
  /* compositor-driven; a permanent scroll-timeline animation that settle checks ignore (GL4.20 rule 8) */
  .topbar > .scroll-band { transition: none; animation: pma-band linear both; animation-timeline: scroll(root block); animation-range: 0px 16px; }
}
@keyframes pma-band { from { opacity: 0; } to { opacity: 1; } }
/* glass.js observes it: data-scrolled (the raised capsule shadow, GL1.N13; the band where scroll timelines are missing) */
.topbar-sentinel { height: 16px; margin-bottom: -16px; pointer-events: none; visibility: hidden; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; color: var(--text); font-weight: 700; font-size: var(--fs-lg); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand small { font-weight: 400; font-size: var(--fs-sm); color: var(--muted); }
.topbar .spacer { flex: 1; }
/* the navigation capsule: the links and the trailing ◐ are neutral fills on the glass with primary text only (GL2.22,
 * H-48: no accent tint); the active link is a sliding three-span thumb (glass.js), its own fill until the thumb is placed */
/* z-index 1: the capsule paints after the accessory row, so the row (it sits under the material's shadow outset)
 * never needs a composited layer of its own (GL8.3: desktop with an accessory measured Δ 3 against the glass-off
 * control, 2 with this); the capsule's soft shadow then falls on the row, as on any floating bar */
.topbar .nav { position: relative; z-index: 1; display: flex; align-items: center; gap: 2px; flex: none; height: 40px; padding: 4px; border-radius: var(--r-capsule); color: var(--text); }
.topbar .nav > a {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px; border-radius: var(--r-capsule);
  color: var(--text); font-size: var(--fs-md); font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background-color var(--m-micro) ease-out, transform var(--m-press-dur) var(--m-press-ease);
}
.topbar .nav > a:hover { text-decoration: none; }
.topbar .nav > a.active { font-weight: 600; background: var(--glass-thumb); }
.topbar .nav.has-thumb > a.active { background: transparent; }
/* ◐ is positioned on the links' layer (z-index 1, after the thumb): an in-flow child would paint in the capsule's
 * foreground, which Chrome composites as one more layer over the material (GL8.3: Δ layers ≤ 2 per glass surface
 * against the glass-off control; desktop measured 3 with ◐ in flow, 2 positioned) */
.topbar .nav > .theme {
  position: relative; z-index: 1; width: 32px; height: 32px; min-height: 0; padding: 0; margin-left: 2px; border: 0; border-radius: var(--r-capsule);
  background: transparent; color: var(--text); font-size: var(--fs-md); font-weight: 500;
}
/* the hover fill only where a pointer can hover: a touch screen keeps no fill on the last tapped tab (review R-12) */
@media (hover: hover) {
  .topbar .nav > a:hover, .topbar .nav > .theme:hover { background: var(--glass-thumb); }
}
/* the accessory row (SPEC GL2.32): a view's step bar / filter, fills on the band, never a second glass layer */
.topbar-accessory {
  order: 4; flex: 1 0 100%; display: flex; align-items: center; gap: 8px; height: 40px; min-width: 0;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.topbar-accessory::-webkit-scrollbar { display: none; }
.topbar-accessory:empty { display: none; }
/* the skip link 「跳到正文」 (RUNTIME R7): the first tab stop, off-screen until it is focused (D13) */
.skip-link {
  position: fixed; left: 8px; top: 8px; z-index: 30; padding: 8px 16px; border-radius: var(--r-capsule);
  background: var(--panel); color: var(--text); font-weight: 600; box-shadow: var(--shadow); transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
@media (max-width: 900px) {
  .brand small { display: none; }
}
@media (max-width: 760px) {
  .topbar { column-gap: 8px; padding-inline: 12px; }
  .brand { font-size: var(--fs-md); }
  .topbar .nav > a { padding: 0 10px; }
}
@media (max-width: 640px) {
  /* minimized: the nav row (and the accessory) with 4 px of the band above it — the capsule keeps the air it has to its
   * own thumb and never touches the screen's top edge (lead, release GLASS-SHELL R-10) */
  .topbar, .topbar.has-accessory { --topbar-collapse: 32px; }
  .topbar { padding: 0 8px; column-gap: 8px; }
  .topbar .spacer { display: none; }
  .brand { height: 36px; align-items: center; padding: 0 6px; }
  .topbar .nav { order: 3; flex: 1 0 100%; width: 100%; height: 44px; gap: 0; }
  .topbar .nav > a { flex: 1 1 0; min-width: 0; height: 36px; padding: 0 2px; font-size: 0; }
  .topbar .nav > a[data-short]::before { content: attr(data-short); font-size: var(--fs-md); }
  .topbar .nav > .theme { display: none; } /* the theme cycle only > 640 px (GL1.N14); phones: the home settings */
}
/* touch: 44 px targets; the capsule has no padding and each link is its own 44 px hit area with the visible fill and
 * thumb inset to 36 px (a transparent border, GL3.3). The end links also carry a 4 px transparent border on their outer
 * side, so the 36 px fill / thumb (radius 18) keeps 4 px of air to the 44 px capsule's round ends — concentric, 22 − 18 = 4
 * all round (GL3.1, review R-2) — while the hit area still reaches the capsule edge. Above 640 px the ◐ (a 44 px circle,
 * concentric by itself) ends the capsule, so the last link's side border is phone-only. */
@media (pointer: coarse) {
  .topbar { padding-block: 6px; }
  .topbar .nav { height: 44px; padding: 0; }
  .topbar .nav > a { height: 44px; border-block: 4px solid transparent; background-clip: padding-box; }
  .topbar .nav > a:first-of-type { border-left: 4px solid transparent; }
  .topbar .nav > .theme { width: 44px; height: 44px; }
}
@media (pointer: coarse) and (max-width: 640px) {
  .topbar { padding-block: 0; }
  .topbar .nav > a:last-of-type { border-right: 4px solid transparent; }
}
/* minimized above 640 px (only with an accessory row: the row stays, the capsule sits off-screen above it): the capsule's
 * own shadow, edge line and raised shadow would hang into the row from nothing, so they go while minimized (custom
 * properties toggled with the class: a repaint, never an animated box-shadow; review R-5). The phone keeps its capsule
 * on screen when minimized, with its shadows. */
@media (min-width: 641px) {
  .topbar.is-min > .nav.glass { --glass-shadow: 0 0 0 transparent; --glass-edge: 0 0 0 transparent; --shadow: 0 0 0 transparent; }
  .topbar.is-min > .nav.glass > .glass-lift { opacity: 0; }
}
.main { max-width: 1240px; margin: 0 auto; padding: 16px; }
.main.wide { max-width: 1500px; }
/* round 7, R4: the 存储已满 banner js/app.js puts above #pma-main (persistent; a plain callout: no glass, no motion) */
.callout.storage-banner { max-width: 1208px; margin: 12px auto 0; box-sizing: border-box; width: calc(100% - 32px); }
.storage-banner .storage-banner-text { margin: 0 0 8px; }
/* round 7, R6: the error banner js/app.js puts right above #pma-main (the storage banner's look: a plain callout, no
 * glass, no motion), and the 技术细节 disclosure that holds the raw error text there and in the router's 页面出错 callout */
.callout.error-banner { max-width: 1208px; margin: 12px auto 0; box-sizing: border-box; width: calc(100% - 32px); }
.error-banner .error-banner-text { margin: 0 0 8px; }
.error-details { margin-top: 8px; }
.error-details > summary { cursor: pointer; }
.error-details .error-log { margin: 6px 0 0; max-height: 12em; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: var(--fs-xs); }

/* content panels: radius 14 (SPEC GL3.1) */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  padding: 16px;
  box-shadow: var(--shadow);
  margin: 12px 0;
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.big { font-size: 1.25em; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- controls ---------- */
/* capsule buttons (SPEC GL3.2): padding 8 / 16, label weight 500 (600 on the filled ones); the press response (GL4.14):
 * scale to --m-press-scale (--m-press-scale-coarse on touch), spring back on --m-press; colour changes on --m-micro */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-btn);
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; line-height: 1.2;
  transition: transform var(--m-press-dur) var(--m-press-ease), background-color var(--m-micro) ease-out,
    border-color var(--m-micro) ease-out, color var(--m-micro) ease-out;
}
.btn:hover { background: var(--panel-2); }
.btn:active:not(:disabled) { transform: scale(var(--m-press-scale)); transition-duration: var(--m-micro); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.good { background: var(--good-fill); border-color: var(--good-fill); color: var(--on-good); font-weight: 600; }
.btn.danger { background: var(--bad-fill); border-color: var(--bad-fill); color: var(--on-bad); font-weight: 600; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 5px 12px; font-size: var(--fs-sm); }
/* (0,2,0) as before D1, so the segment overrides (.pmt-tabs .btn.selected{outline:none} and the like) win by
 * specificity, not by source order; a browser without :focus-visible keeps the selected outline */
.btn.selected { outline: 2px solid var(--accent); }
.btn.selected:focus-visible { outline: 3px solid var(--focus-ring); }
/* answer options are targets, not decoration: the strong outline (the picked / right / wrong states override it) */
.pma-opt, .pmc-opts .btn { border-color: var(--border-strong); }
input[type='number'], input[type='text'], select, textarea {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 5px 8px;
}
input[type='number'] { width: 7em; }
input[type='range'] { width: 100%; accent-color: var(--accent); }
label.field { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); color: var(--muted); }
label.field > span.value { color: var(--text); font-weight: 600; }
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); font-size: var(--fs-sm);
}
.chip.good { background: var(--good-weak); color: var(--good); border-color: transparent; }
.chip.bad { background: var(--bad-weak); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-weak); color: var(--warn-text); border-color: transparent; }
.chip.gto { background: var(--gto-weak); color: var(--gto); border-color: transparent; }
.chip.accent { background: var(--accent-weak); color: var(--accent-text); border-color: transparent; }

/* ---------- learning blocks ---------- */
.formula {
  font-family: var(--mono);
  background: var(--panel-2); border-left: 4px solid var(--accent);
  padding: 10px 14px; border-radius: 6px; margin: 10px 0; overflow-x: auto;
}
.formula .title { font-family: var(--sans); font-weight: 600; margin-bottom: 4px; }
.formula .expr { font-size: 1.08em; }
.formula .explain { font-family: var(--sans); color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.callout { border-radius: 8px; padding: 10px 14px; margin: 12px 0; border: 1px solid var(--border); background: var(--panel-2); }
.callout .callout-title { font-weight: 700; margin-bottom: 4px; }
.callout.tip { background: var(--accent-weak); border-color: transparent; }
.callout.warning { background: var(--warn-weak); border-color: transparent; }
.callout.mindset { background: var(--good-weak); border-color: transparent; }
.callout.gto { background: var(--gto-weak); border-color: transparent; }
.callout.exploit { background: var(--bad-weak); border-color: transparent; }
.example { border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px; margin: 12px 0; }
.example ol { margin: 6px 0; padding-left: 1.4em; }
.cite { font-size: var(--fs-sm); color: var(--muted); }
.cite a { color: var(--muted); text-decoration: underline dotted; }
.term { border-bottom: 1px dotted var(--accent); cursor: help; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }
.progress-bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--accent); }

/* ---------- playing cards ---------- */
.pcard {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 38px; height: 54px; border-radius: 6px;
  background: var(--card-bg); border: 1px solid var(--card-border);
  font-weight: 700; font-family: var(--sans); line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  margin: 1px; user-select: none; vertical-align: middle;
}
.pcard .r { font-size: 18px; }
.pcard .s { font-size: 16px; margin-top: 2px; }
.pcard.sm { width: 28px; height: 40px; border-radius: 5px; }
.pcard.sm .r { font-size: 14px; }
.pcard.sm .s { font-size: 12px; }
.pcard.lg { width: 54px; height: 76px; }
.pcard.lg .r { font-size: 24px; }
.pcard.lg .s { font-size: 22px; }
.pcard.back {
  background: repeating-linear-gradient(45deg, #2b4c8c, #2b4c8c 4px, #3a5fa8 4px, #3a5fa8 8px);
  border-color: #1e3a6e;
}
.pcard.empty { background: transparent; border-style: dashed; box-shadow: none; }
.pcard.hl { outline: 3px solid var(--hl); outline-offset: -1px; }
.pcard.dim { opacity: 0.35; }
.suit-s { color: var(--suit-s); }
.suit-h { color: var(--suit-h); }
.suit-d { color: var(--suit-d); }
.suit-c { color: var(--suit-c); }
.two-color .suit-d { color: var(--suit-h); }
.two-color .suit-c { color: var(--suit-s); }
/* inline cards are small card chips everywhere, so every suit colour (incl. black spades) stays readable on dark panels */
.inline-card { font-weight: 700; white-space: nowrap; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 4px; padding: 0 3px; margin: 0 1px; }

/* ---------- range grid ---------- */
.range-grid {
  display: grid; grid-template-columns: repeat(13, 1fr); gap: 1px;
  width: 100%; max-width: 560px; aspect-ratio: 1 / 1;
  background: var(--border); border: 1px solid var(--border); user-select: none;
}
.range-grid .cell {
  position: relative; display: flex; align-items: center; justify-content: center;
  font-size: clamp(8px, 1.6vw, 12px); font-family: var(--mono);
  background: var(--panel); color: var(--text); overflow: hidden; cursor: default;
}
.range-grid.editable .cell { cursor: pointer; }
.range-grid .cell .lbl { position: relative; z-index: 1; }
.range-grid .cell .fill { position: absolute; left: 0; bottom: 0; top: 0; }

/* ---------- poker table ---------- */
.table-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; align-items: start; }
@media (max-width: 1000px) { .table-wrap { grid-template-columns: 1fr; } }
.felt {
  position: relative; border-radius: 160px / 110px;
  background: radial-gradient(ellipse at center, #2b8a5c 0%, var(--felt) 60%, var(--felt-edge) 100%);
  border: 10px solid #5b3a1e; min-height: 420px; color: #fff;
}
.seat {
  position: absolute; transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.55); border-radius: 10px; padding: 6px 10px; min-width: 120px;
  text-align: center; font-size: var(--fs-sm); line-height: 1.35;
}
.seat.to-act { box-shadow: 0 0 0 3px #facc15; }
.seat.folded { opacity: 0.45; }
.seat.hero { background: rgba(37, 99, 235, 0.6); }
.seat .bet { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 999px; background: #facc15; color: #111; font-weight: 700; }
.dealer-btn { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #111; font-weight: 800; font-size: var(--fs-xs); line-height: 18px; text-align: center; }
.board-area { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); text-align: center; }
.pot-label { font-weight: 700; margin-bottom: 6px; }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.log { font-size: var(--fs-sm); max-height: 220px; overflow: auto; font-family: var(--mono); }
/* (the old .coach rules are gone: no view emits .coach. The table's sticky coach column is aside.pmt-coach.sticky,
 * styled in table-coach.js — COACH; review R-7) */
.ev-pos { color: var(--good); font-weight: 700; }
.ev-neg { color: var(--bad); font-weight: 700; }

/* ---------- lesson layout ---------- */
.lesson { max-width: 860px; margin: 0 auto; }
.lesson-nav { display: flex; justify-content: space-between; gap: 8px; margin: 24px 0; }
.level-card { cursor: pointer; }
.level-card:hover { border-color: var(--accent); }
.lesson-list a { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 6px; color: var(--text); }
.lesson-list a:hover { background: var(--panel-2); text-decoration: none; }
.done-mark { color: var(--good); font-weight: 700; }

/* ---------- toast & modal ---------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 8px 16px; border-radius: 8px; z-index: 100;
  box-shadow: var(--shadow); max-width: 90vw;
}
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--panel); color: var(--text); border-radius: 12px; max-width: 760px; width: 100%; max-height: 88vh; overflow: auto; padding: 18px; }
.modal h3 { margin-top: 0; }

/* ---------- charts ---------- */
svg.chart { width: 100%; height: auto; font-family: var(--sans); }
svg.chart .axis { stroke: var(--muted); stroke-width: 1; }
svg.chart .grid-line { stroke: var(--border); stroke-width: 1; }
svg.chart text { fill: var(--muted); font-size: var(--fs-xs); }

@media (max-width: 640px) {
  /* the phone top bar is in the layout section above (six equal tabs, no inner scroll) */
  .main { padding: 10px 12px; }
  .panel { padding: 12px; }
  .felt { min-height: 360px; border-width: 6px; }
  .seat { min-width: 92px; font-size: var(--fs-xs); padding: 4px 6px; }
}

/* ===================================================================================================================
 * GLASS — the class API (SPEC GL2.5, GL2.11, GL2.17, GL2.21, GL9.2; owner GLASS-SHELL). Begin of the glass section.
 * The material (.glass::before) in this section is the ONLY place in the app where a backdrop filter may be written:
 * lanes put .glass / .glass-lg on a surface's root element and never write backdrop-filter themselves (a lane whose
 * component sets a background on that element adds `.x.glass { background: transparent }` in its own block). The rim
 * ring (::after) is the edge optic every glass tier draws. Glass is the control / navigation layer only (SPEC GL2.1);
 * glass surfaces are never nested, and no ancestor of one may have opacity < 1, filter, mask, clip-path,
 * mix-blend-mode, its own backdrop-filter or will-change: opacity (GL2.6). Within a surface: .glass-lift −2, the
 * material −1, content, the rim ring 2 (GL3.14) — except a sheet's ring, −1 after its material and under its content
 * (js/ui/overlays.js, round 7 K-09: one composited layer fewer on a phone; a recorded deviation from GL3.14).
 * Tiers on <html> (js/ui/glass.js decides; this CSS works before any JS): data-glass = liquid | frost | solid,
 * data-glass-bars = the persistent bars' tier, data-look = standard | frosted, data-sheet-open while a sheet is open.
 * Solid is the fallback everywhere; Frost is the default behind @supports.
 * ===================================================================================================================*/
:where(.glass) { position: relative; border-radius: var(--r-bar); } /* zero specificity: never un-sticks a sticky / fixed host */
.glass { isolation: isolate; background: transparent; }
/* Solid (no backdrop-filter support): --panel, a 1 px --border, --shadow, no rim ring */
.glass::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--panel); box-shadow: 0 0 0 1px var(--border), var(--shadow);
}
.glass::after {
  content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; display: none;
}
/* Frost (the CSS default): tint + blur + saturate + compression filter, inset bevel, inner edge band, darkened edge */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass::before {
    background: rgb(var(--glass-rgb) / var(--glass-a));
    -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
    box-shadow: var(--glass-rim), var(--rim-band), var(--glass-edge), var(--glass-shadow);
  }
  .glass.glass-lg::before {
    background: rgb(var(--glass-rgb) / var(--glass-a-lg));
    -webkit-backdrop-filter: var(--glass-filter-lg); backdrop-filter: var(--glass-filter-lg);
    box-shadow: var(--glass-rim), var(--rim-band), var(--glass-edge), var(--glass-shadow-lg);
  }
  /* the specular rim ring: a static ring-masked paint with two opposite lit edges (apple F1): --rim-fill is a 135°
   * gradient, the top-left end bright, the bottom-right end dimmer, whatever the surface's aspect (the conic lobes it
   * replaced drew a short bright dash at the top centre of the wide desktop capsule; lead, release GLASS-SHELL R-10).
   * Where mask-composite is missing the ring is omitted and the inset bevel lines of --glass-rim remain. Only its
   * opacity ever changes. */
  @supports (mask-composite: exclude) or (-webkit-mask-composite: xor) {
    .glass::after {
      display: block; padding: var(--rim-w); background: var(--rim-fill); opacity: var(--rim-a);
      -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
      mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
      transition: opacity var(--m-micro) ease-out;
    }
  }
}
/* Solid on top of Frost: the Solid tier; the persistent bars (the nav capsule, the phone action bar) where their tier is
 * Solid (data-glass-bars, GL2.18 rule 8); every glass surface but the open sheet and the glass inside it while a sheet
 * is open (GL2.7; the sizing sheet's slider knob lifts into glass inside its sheet while dragged, GL2.4 / surface 10);
 * a floating bar while the learner scrolls (data-scroll-solid from PMA.ui.glass.trackFloat, gone once the scroll
 * settles: review K-01, the tier switches straight, the material never fades).
 * Specificity (0,2,2) on purpose: above .glass.glass-lg::before, below the !important accessibility blocks. */
html[data-glass='solid'] .glass::before,
html[data-glass-bars='solid'] :where(.topbar .nav, .pmt-actions).glass::before,
html[data-sheet-open] .glass:not(:where(.sheet, .sheet .glass))::before,
html .glass[data-scroll-solid]::before {
  background: var(--panel); -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 0 0 1px var(--border), var(--shadow);
}
html[data-glass='solid'] .glass::after,
html[data-glass-bars='solid'] :where(.topbar .nav, .pmt-actions).glass::after,
html[data-sheet-open] .glass:not(:where(.sheet, .sheet .glass))::after,
html .glass[data-scroll-solid]::after { display: none; }
/* the pre-rendered raised shadow (GL1.N13): a child layer whose opacity alone changes, never box-shadow */
.glass > .glass-lift {
  position: absolute; inset: 0; z-index: -2; border-radius: inherit; pointer-events: none;
  box-shadow: var(--glass-shadow-raised); opacity: 0; transition: opacity var(--m-ui-dur) var(--m-ui-ease);
}
.topbar[data-scrolled] .glass-lift, .glass[data-stuck] > .glass-lift { opacity: 1; }
/* fills and text on glass: a selection / action fill (never glass itself, GL2.4) and primary text only (GL2.22) */
.glass-thumb { background: var(--glass-thumb); box-shadow: var(--glass-thumb-rim); }
.on-glass { color: var(--text); }
/* keyboard focus on glass: three rings (GL9.2 erratum) — a 2 px halo, the 3 px --focus-ring, a 1 px outer edge; the
 * best of the three keeps ≥ 3:1 against any backdrop in both themes (tests/tokens.test.js). A state rule above with
 * more specificity than (0,2,0) that sets the focus outline (.btn.selected:focus-visible, (0,3,0)) is listed again
 * under .glass, so the stack wins on glass (GL2.24; tokens.test checks every such rule). */
.glass :focus-visible, .glass:focus-visible, .glass .btn.selected:focus-visible, .glass :is(.wb-seg, .rk-tabs, .wta-seg, .pmt-tabs) .btn.selected:focus-visible {
  outline: 1px solid var(--glass-focus-edge); outline-offset: 5px;
  box-shadow: 0 0 0 2px var(--glass-focus-halo), 0 0 0 5px var(--focus-ring);
}
/* Frost press response and rim ramp (lead override O-10; SPEC GL2.13, GL4.13, GL4.14): js/ui/glass.js toggles
 * .rim-active on the glass host while a control on it is pressed (pointer handlers, not :has(:active) over a large
 * subtree) and while the nav thumb slides; the rim ring rises from --rim-a to --rim-a-active over --m-micro. Off under
 * Solid, bars-solid and sheet-open (no ring there: display none above), under reduced motion and while a teaching
 * segment plays (html[data-decor='paused'], PMA.ui.glass.pauseDecor). */
.glass.rim-active::after { opacity: var(--rim-a-active); }
html[data-motion='reduce'] .glass.rim-active::after, html[data-decor='paused'] .glass.rim-active::after { opacity: var(--rim-a); }
/* controls on glass: the gel press (GL4.14) — a mouse --m-gel-fine, touch / pen the anisotropic gel; the tokens are 1
 * under reduced motion, where the pressed control darkens instead */
.glass :is(a, .btn:not(:disabled)):active { transform: scale(var(--m-gel-fine)); }
/* tone flip (GL2.16): a floating bar (PMA.ui.glass.trackFloat) over a [data-tone='dark'] region takes the dark glass
 * tokens and light primary text, in both themes and looks. The nav capsule never flips: whenever content lies under it
 * the near-opaque scroll-edge band (α .97 / .98) lies between them. */
.glass.tone-dark {
  --glass-rgb: 23 27 35; --glass-a: .72; --glass-sat: 140%;
  --glass-filter: blur(var(--glass-blur)) saturate(140%) contrast(.9) brightness(.9);
  --glass-rim: inset 0 1px 0 rgb(255 255 255 / .20), inset 0 -1px 0 rgb(255 255 255 / .05), inset 0 0 0 1px rgb(255 255 255 / .09);
  --glass-edge: 0 0 0 1px rgb(0 0 0 / .45);
  --rim-fill: linear-gradient(135deg, rgb(255 255 255 / .40), transparent 25% 75%, rgb(255 255 255 / .20));
  --rim-band: inset 0 0 6px rgb(255 255 255 / .08);
  --glass-shadow: 0 6px 20px rgb(0 0 0 / .40); --glass-shadow-raised: 0 10px 32px rgb(0 0 0 / .55);
  --glass-thumb: rgb(255 255 255 / .12); --glass-thumb-rim: inset 0 0 0 1px rgb(255 255 255 / .10); --glass-thumb-line: rgb(255 255 255 / .10);
  --glass-focus-halo: #0b1220; --glass-focus-edge: #ffffff; --focus-ring: #6ea0ff;
  --text: #e6e9ef; --panel: #171b23; --panel-2: #1f2430; --border: #2c3341; --border-strong: #646e80;
  color: var(--text);
}
html[data-look='frosted'] .glass.tone-dark { --glass-a: .84; }
/* the sliding three-span thumbs (GL2.31, GL4.13): two end caps that translate and a 1 px middle that scales, so the
 * round ends never squash; glass.js writes the spans' transforms and the leaf property --thumb-h (rects read in a rAF
 * or a ResizeObserver callback, never in boot). The nav thumb is a fill on the glass, never glass and never lensed. */
.nav-thumb, .seg-thumb { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 0; pointer-events: none; display: none; }
.has-thumb > .nav-thumb, .has-thumb > .seg-thumb { display: block; }
:is(.nav-thumb, .seg-thumb) > span { position: absolute; left: 0; top: 0; height: var(--thumb-h, 0px); transform-origin: 0 0; background: var(--glass-thumb); }
:is(.nav-thumb, .seg-thumb) > span:first-child {
  width: calc(var(--thumb-h, 0px) / 2); border-radius: var(--r-capsule) 0 0 var(--r-capsule);
  box-shadow: inset 1px 0 0 var(--glass-thumb-line), inset 0 1px 0 var(--glass-thumb-line), inset 0 -1px 0 var(--glass-thumb-line);
}
:is(.nav-thumb, .seg-thumb) > span:nth-child(2) { width: 1px; box-shadow: inset 0 1px 0 var(--glass-thumb-line), inset 0 -1px 0 var(--glass-thumb-line); }
:is(.nav-thumb, .seg-thumb) > span:last-child {
  width: calc(var(--thumb-h, 0px) / 2); border-radius: 0 var(--r-capsule) var(--r-capsule) 0;
  box-shadow: inset -1px 0 0 var(--glass-thumb-line), inset 0 1px 0 var(--glass-thumb-line), inset 0 -1px 0 var(--glass-thumb-line);
}
/* .seg — the one segmented control (SPEC GL3.7): a capsule track, capsule segments, one sliding thumb
 * (PMA.ui.glass.segThumb(el); without it the selected segment carries its own fill). Solid in content; on the band and
 * on glass the track is a fill. Selection also changes the weight (600) and the aria state, never colour alone; a
 * focused selected segment keeps its focus ring (D11). Owners adopt it for their families (GL3.7). */
.seg {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 2px; padding: 3px; max-width: 100%;
  border-radius: var(--r-capsule); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--border);
}
.seg > :where(button, a, .btn, [role='tab']) {
  position: relative; z-index: 1; min-height: 32px; padding: 4px 14px; border: 0; border-radius: var(--r-capsule);
  background: transparent; color: var(--text); font-weight: 500; box-shadow: none;
}
.seg > :is(.selected, [aria-selected='true'], [aria-current], [aria-pressed='true']) { font-weight: 600; background: var(--panel); box-shadow: inset 0 0 0 1px var(--border); }
.seg.has-thumb > :is(.selected, [aria-selected='true'], [aria-current], [aria-pressed='true']) { background: transparent; box-shadow: none; }
.seg > .btn.selected:not(:focus-visible) { outline: none; }
/* the thumb against its track (review K-10: --panel on --panel-2 is 1.12:1 light, 1.11:1 dark): a --border-strong line
 * (2.88:1 light / 3.02:1 dark against the track, 3.23 / 3.35 against the thumb) and, in dark, where the thumb is darker
 * than its track, a soft shadow under the whole three-span shape (--seg-thumb-shadow: none in light) */
.seg > .seg-thumb > span { background: var(--panel); --glass-thumb-line: var(--border-strong); }
.seg > .seg-thumb { filter: var(--seg-thumb-shadow); }
:is(.topbar-accessory, .glass) .seg { background: var(--glass-thumb); box-shadow: none; }
/* in the 40 px accessory row a .seg is at most 38 px (32 px segments + its 3 px track); on touch its segments keep 32 px
 * and reach 44 px through a transparent pseudo-element (GL3.3, review R-3) */
.topbar-accessory .seg { max-height: 38px; }
/* interim D11 safety net (review R-6): four families still remove the ring of a FOCUSED selected segment in their own
 * injected styles (.wb-seg / .rk-tabs / .wta-seg / .pmt-tabs .btn.selected { outline: none }, (0,3,0));
 * this (0,4,0) rule gives it back. Drop it when those families adopt .seg (GL3.7: WIDGETS-A / -B, COMP, SHELL). */
:is(.wb-seg, .rk-tabs, .wta-seg, .pmt-tabs) .btn.selected:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
/* Accessibility safety nets (GL2.21; they work before any JS). Reduce Transparency — SPEC Revision 2.1 / lead override
 * O-2, the user's decision ① 「强制显示玻璃」 (2026-11-01): the default 标准 look keeps its glass (a deliberate
 * deviation from Apple's H-33 / D-40); only the 磨砂 look reacts, as the near-opaque RT frost without specular or glow.
 * 关闭 is Solid through data-glass. There is no Reduce Transparency → Solid rule for the default look. */
@media (prefers-reduced-transparency: reduce) {
  html:root[data-look='frosted'] { --glass-a: var(--glass-a-rt); --glass-a-lg: var(--glass-a-lg-rt); }
  html[data-look='frosted'] :is(.glass-spec, .glass-glow) { display: none; }
  html[data-look='frosted'] .glass.tone-dark { --glass-a: .94; }
}
/* Increase Contrast and forced colours still win over everything: Solid, no rim ring */
@media (prefers-contrast: more) {
  .glass::before {
    background: var(--panel) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    box-shadow: 0 0 0 1px var(--border-strong), var(--shadow) !important;
  }
  .glass::after { display: none !important; }
  .topbar > .scroll-band { background: var(--panel); box-shadow: 0 1px 0 var(--border-strong); }
  /* !important: a component's own state border (table.js .pmt-actions .btn.allin, (0,3,0)) must not undo it (review R-6) */
  .glass .btn, .glass .chip, .pmt-actions .btn, .pmt-actions input[type='text'], .topbar .nav > .theme { border: 1px solid var(--border-strong) !important; }
  /* a native range slider on a bar (the table's bet slider) draws no boundary of its own (glass-probe --contrast-more
   * measured 1:1 light, 1.54:1 dark): the same 1 px ring as every other control */
  .glass input[type='range'], .pmt-actions input[type='range'] { border: 1px solid var(--border-strong) !important; border-radius: var(--r-sm); }
  .topbar .nav > a.active, .topbar .nav.has-thumb > a.active, .seg > :is(.selected, [aria-selected='true'], [aria-current], [aria-pressed='true']), .seg.has-thumb > :is(.selected, [aria-selected='true'], [aria-current], [aria-pressed='true']) {
    background: var(--text); color: var(--panel); box-shadow: none;
  }
  .nav-thumb, .seg-thumb { display: none !important; }
}
/* forced colours: explicit, because Chrome keeps the author's alpha and the filter otherwise (W-30); box-shadows are
 * dropped in this mode, so the focus stack falls back to one 3 px system-colour ring */
@media (forced-colors: active) {
  .glass { color: CanvasText; }
  .glass::before {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    background: Canvas !important; border: 1px solid CanvasText; forced-color-adjust: auto;
  }
  .glass::after { display: none !important; }
  .glass :focus-visible, .glass:focus-visible, .glass .btn.selected:focus-visible, .glass :is(.wb-seg, .rk-tabs, .wta-seg, .pmt-tabs) .btn.selected:focus-visible { outline: 3px solid Highlight; outline-offset: 2px; }
  .topbar > .scroll-band { background: Canvas; border-bottom: 1px solid CanvasText; }
  .topbar .nav > a[aria-current], .seg > :is(.selected, [aria-selected='true'], [aria-current], [aria-pressed='true']) { forced-color-adjust: none; background: SelectedItem !important; color: SelectedItemText; }
  .nav-thumb, .seg-thumb { display: none !important; }
}
/* Reduced motion (GL4.19, GL2.21; the token overrides are with the tokens above; MOTION writes html[data-motion]): no
 * minimize-on-scroll, no rim ramp, no press scale — the pressed control darkens instead; the band keeps its opacity fade */
@media (prefers-reduced-motion: reduce) {
  .topbar { transition: none; }
  .topbar.is-min { transform: none; }
  .glass.rim-active::after { opacity: var(--rim-a); }
  :is(.btn, .glass a):active:not(:disabled) { filter: brightness(.94); }
}
html[data-motion='reduce'] .topbar { transition: none; }
html[data-motion='reduce'] .topbar.is-min { transform: none; }
html[data-motion='reduce'] :is(.btn, .glass a):active:not(:disabled) { filter: brightness(.94); }
/* touch targets (D9, GL3.3): 44 px on a coarse pointer (.btn.small 36 px); the touch press scale; the anisotropic gel
 * on glass (GL4.14). The nav links have their own 44 px rule in the layout section. */
@media (pointer: coarse) {
  .btn, .pma-opt, .pmc-opts .btn, select, input[type='text'], input[type='number'] { min-height: 44px; }
  .btn.small { min-height: 36px; padding: 6px 12px; }
  .term { padding: 4px 0; }
  .btn:active:not(:disabled) { transform: scale(var(--m-press-scale-coarse)); }
  .glass :is(a, .btn:not(:disabled)):active { transform: scale(var(--m-gel-coarse-x), var(--m-gel-coarse-y)); }
  /* a .seg in the 40 px accessory row: 32 px segments (the 44 px rule above would make it 50 px and clip it), each with
   * a 44 px hit area through a transparent ::after (GL3.3; the row's own 40 px bounds what lies outside it; review R-3) */
  .topbar-accessory .seg > :not(.seg-thumb) { min-height: 32px; line-height: 1.2; position: relative; }
  .topbar-accessory .seg > :not(.seg-thumb)::after { content: ''; position: absolute; inset: -6px 0; }
}
/* End of the glass section. */

/* ---------- print (D13) ---------- */
/* Paper is light whatever the screen theme: the light colour tokens, no top bar, no glass, no band, no buttons or
 * inputs; folded step cards (.pmc-step[hidden], FLOW-COURSE) and closed <details> print in full; panels are flat. The
 * interactive parts of a lesson stay on screen: the widget panels, the predict / mission / mastery / gate cards and the
 * folded formula overview (the review at the end prints the same formulas). Lesson b09 prints on ≤ 6 A4 pages. */
@media print {
  :root:not([data-theme='__print']) {
    --bg: #ffffff; --panel: #ffffff; --panel-2: #f0f2f5; --text: #1d2330; --muted: #5d6677; --border: #d9dee6;
    --accent: #2563eb; --accent-weak: #e3ecff; --good: #15803d; --good-weak: #dcfce7; --bad: #b91c1c; --bad-weak: #fee2e2;
    --warn: #a16207; --warn-weak: #fef3c7; --gto: #7c3aed; --gto-weak: #ede9fe; --card-bg: #ffffff; --card-border: #c7ccd6;
    --accent-fill: #2563eb; --on-accent: #ffffff; --good-fill: #15803d; --on-good: #ffffff; --bad-fill: #b91c1c; --on-bad: #ffffff;
    --accent-text: #1d4ed8; --warn-text: #854d0e; --border-strong: #8590a2; --focus-ring: #2563eb;
    --grade-best: #15803d; --grade-good: #4d7c0f; --grade-inaccuracy: #a16207; --grade-mistake: #c2410c; --grade-blunder: #dc2626;
    --star: #b45309; --series-1: #2563eb; --series-2: #15803d; --series-3: #b91c1c; --series-4: #a16207; --series-5: #7c3aed; --series-6: #5d6677;
    --sym-pot: #92400e; --sym-call: #1d4ed8; --sym-eq: #15803d; --sym-bet: #b91c1c; --sym-alpha: #7c3aed;
    --shadow: none; --page-wash: none; --seg-thumb-shadow: none;
    color-scheme: light;
  }
  @page { size: A4; margin: 12mm 12mm 14mm; }
  body { font-size: 10pt; line-height: 1.45; }
  .topbar, .topbar-sentinel, .skip-link, .scroll-band, .topbar-accessory, .glass, .glass-lift, .toast, .modal-backdrop, .popover,
  .btn:not(.pma-opt), .pmt-actions, .pmc-gate, input, select, textarea, .lesson-nav, .pmc-nav, .pmc-head-actions,
  .panel:has(> .pmc-widget-box), .pmc-widget-box, .pmc-predict, .pmc-mission, .pmc-mastery, .pmc-keyf-fold { display: none !important; }
  /* a quiz prints its answer options (button.btn.pma-opt) as plain outlined rows, never as hidden buttons (review R-8) */
  .pma-opt { display: block !important; width: 100%; min-height: 0; margin: 3px 0; padding: 3px 8px; border: 1px solid #999; border-radius: 4px; text-align: left; background: none; color: var(--text); }
  .main, .main.wide { max-width: none; margin: 0; padding: 0; }
  .lesson { max-width: none; }
  .pmc-step[hidden] { display: block !important; }
  details { display: block; }
  details > * { display: block; }
  details::details-content { content-visibility: visible; display: block; }
  .panel { break-inside: avoid; box-shadow: none; border: 1px solid #999; margin: 6px 0; padding: 8px 10px; }
  h1, h2, h3 { break-after: avoid; margin: .6em 0 .3em; }
}

/* ===== VIZ-A (round 7, L-02) ===== */
/* PMA.ui.viz (js/ui/viz.js, lane VIZ-A): the StepPlayer and the price / EV primitives. Content, never glass: no backdrop
 * filter, no glass class. Colours, sizes, radii and durations are tokens. Positions are transforms viz.js writes from the
 * caller's numbers (a full-width layer: translateX(f × 100 %), scaleX from its left edge); no rule here transitions a
 * transform, so under reduced motion nothing moves (PMA.ui.motion drops transforms; a step is a 150 ms cross-fade).
 * Flat fills only (GL4.4 rule 2). .vz-fig clips the full-width layers (no page overflow). */
.vz { --vz-lh: 1.45em; position: relative; margin: var(--sp-3) 0; font-size: var(--fs-sm); line-height: var(--lh-ui); }
.vz[hidden], :where(.vz, .vz-sp, .vz-gallery) [hidden] { display: none !important; }
.vz-fig { position: relative; padding: 0 var(--sp-1); overflow: hidden; overflow: clip; }
.vz-bar { position: relative; height: 16px; }
.vz-bar-lg { height: 28px; }
.vz-bar-rail { height: 18px; }
.vz-track { position: absolute; inset: 0; border-radius: var(--r-xs); background: var(--panel-2); overflow: hidden; }
.vz-bar-rail .vz-track { border-radius: var(--r-capsule); }
.vz-span, .vz-pin { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; pointer-events: none; }
.vz-span { transform-origin: 0 50%; }
.vz-pin::before { content: ''; position: absolute; left: -1px; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--text); }
/* label rows: lane 0 sits next to the axis; .vz-up rows grow upwards */
.vz-labs, .vz-axis-labs { position: relative; height: var(--vz-lh); }
.vz-labs[data-lanes='2'] { height: calc(2 * var(--vz-lh)); }
.vz-labs[data-lanes='3'] { height: calc(3 * var(--vz-lh)); }
.vz-lab { position: absolute; left: 0; top: 0; width: 100%; line-height: var(--vz-lh); white-space: nowrap; pointer-events: none; }
.vz-lab.vz-lane1 { top: var(--vz-lh); }
.vz-lab.vz-lane2 { top: calc(2 * var(--vz-lh)); }
.vz-up > .vz-lab { top: auto; bottom: 0; }
.vz-up > .vz-lab.vz-lane1 { bottom: var(--vz-lh); }
.vz-up > .vz-lab.vz-lane2 { bottom: calc(2 * var(--vz-lh)); }
.vz-lab > span { display: inline-block; transform: translateX(-50%); }
.vz-lab.start > span { transform: none; }
.vz-lab.end > span { transform: translateX(-100%); }
.vz-axis-labs { font-size: var(--fs-xs); color: var(--muted); }
/* symbol colours (SPEC GL3.6): fills on the matching series, text on the --sym-* colour */
.vz-k-pot { background: var(--series-4); }
.vz-k-bet { background: var(--series-3); }
.vz-k-call { background: var(--series-1); }
.vz-k-eq { background: var(--series-2); }
.vz-k-alpha { background: var(--series-5); }
.vz-k-pos { background: var(--series-2); }
.vz-k-neg { background: var(--series-3); }
.vz-k-net { background: var(--series-1); }
.vz-t-pot { color: var(--sym-pot); }
.vz-t-bet { color: var(--sym-bet); }
.vz-t-call { color: var(--sym-call); }
.vz-t-eq { color: var(--sym-eq); }
.vz-t-alpha { color: var(--sym-alpha); }
.vz-tick-call::before { background: var(--sym-call); }
.vz-tick-alpha::before { background: var(--sym-alpha); }
.vz-split::before { left: -1.5px; width: 3px; }
.vz-dot::before { top: 50%; bottom: auto; left: -7px; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; box-shadow: 0 0 0 2px var(--panel); }
.vz-dot-good::before { background: var(--good); }
.vz-dot-bad::before { background: var(--bad); }
.vz-dot-even::before { background: var(--muted); }
.vz-dim { opacity: .4; }
.vz-verdict { margin: var(--sp-2) 0 0; font-weight: 600; }
/* V-2 PriceBar: 「需要 25% ▕██░▏ 你有 19.6%」 */
.vz-price-row { display: grid; grid-template-columns: max-content minmax(5em, 1fr) max-content; column-gap: var(--sp-2); row-gap: 2px; align-items: center; }
.vz-price-need, .vz-price-have { font-weight: 600; white-space: nowrap; }
/* V-3 PotOddsMeter: P₀ · B · C on one bar, the C share braced under C */
.vz-meter .vz-labs { font-weight: 600; }
.vz-brace-row { position: relative; height: 7px; margin-top: 3px; }
.vz-brace { bottom: auto; height: 3px; border-radius: 2px; }
/* rows around a zero line: V-4 EVBars, V-15b OptionBars, V-16 Waterfall (one grid, so every row shares the columns) */
.vz-rows { display: grid; grid-template-columns: minmax(3.5em, 9em) minmax(6em, 1fr) max-content; column-gap: var(--sp-2); row-gap: 3px; align-items: center; }
.vz-r { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; }
@supports not (grid-template-columns: subgrid) {
  .vz-r { grid-template-columns: 7em minmax(0, 1fr) 7.5em; }
}
.vz-r-head .vz-labs { color: var(--muted); font-size: var(--fs-xs); }
.vz-rl { display: flex; flex-direction: column; min-width: 0; }
.vz-marks { font-size: var(--fs-xs); font-weight: 600; color: var(--good); }
.vz-rv { font-family: var(--mono); text-align: right; white-space: nowrap; }
.vz-zero::before { left: 0; width: 1px; top: -2px; bottom: -2px; background: var(--muted); }
.vz-whisker { top: calc(50% - 1px); bottom: auto; height: 2px; background: var(--text); opacity: .7; }
.vz-fill-prov { background: var(--series-6); }
.vz-tieband { background: var(--accent-weak); }
.vz-prov { font-size: var(--fs-xs); }
.vz-r.vz-picked .vz-track { box-shadow: 0 0 0 2px var(--accent); }
.vz-r.vz-best .vz-marks { color: var(--good); }
.vz-r.vz-total .vz-rl-t, .vz-r.vz-total .vz-rv { font-weight: 700; }
.vz-r.vz-pending { opacity: .35; }
/* V-5 ThresholdRail: green / red sides of the split, ticks above, opponent dots below */
.vz-zone-good { background: var(--good-weak); }
.vz-zone-bad { background: var(--bad-weak); }
/* V-15 GapAxis: the guess light, the truth bold, the gap between them */
.vz-gap-axis { position: relative; height: 22px; }
.vz-gap-line { position: absolute; left: 0; right: 0; top: calc(50% - 1px); height: 2px; border-radius: 1px; background: var(--border-strong); }
.vz-gap-fill { top: calc(50% - 3px); bottom: auto; height: 6px; background: var(--series-4); }
.vz-gap-zone { top: 3px; bottom: 3px; background: var(--accent-weak); }
.vz-dot-guess::before { background: var(--panel); box-shadow: inset 0 0 0 3px var(--muted), 0 0 0 2px var(--panel); }
.vz-dot-truth::before { background: var(--text); }
.vz-gap-glab { color: var(--muted); }
.vz-gap-tlab { font-weight: 700; }
.vz-gap-dlab { color: var(--warn-text); font-weight: 600; }
/* the GapAxis reveal's live announcement: read, not shown (the figure shows the same numbers) */
.vz-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* V-14 FormulaAnatomy: colour-linked symbol chips; the meaning of the tapped one; assumptions folded */
.vz-fa-expr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; font-family: var(--mono); font-size: var(--fs-md); }
.vz-sym { position: relative; font: inherit; font-weight: 700; line-height: 1.5; padding: 0 var(--sp-2); border: 1px solid currentColor; border-radius: var(--r-capsule); background: var(--panel); cursor: pointer; }
.vz-sym.on { background: var(--panel-2); }
.vz-fa-op { white-space: pre; }
.vz-fa-def { margin: var(--sp-1) 0 0; }
.vz-fa-pre { margin-top: var(--sp-1); }
.vz-fa-pre > summary, .vz-data > summary, .vz-sp-text > summary { cursor: pointer; color: var(--muted); }
.vz-fa-pre ul { margin: var(--sp-1) 0 0; padding-left: 1.4em; }
/* the 数据表 disclosure (GL9.3) */
.vz-data { margin-top: var(--sp-1); }
.vz-table { border-collapse: collapse; margin-top: var(--sp-1); }
.vz-table th, .vz-table td { padding: 2px var(--sp-2); text-align: left; border-bottom: 1px solid var(--border); font-weight: 400; }
.vz-table thead th { font-weight: 600; }
/* the paint pre-warm box (GL4.4 rule 2): rendered once, inert, nearly transparent, removed after a few frames */
.vz-prewarm { position: absolute; inset: 0; opacity: .01; pointer-events: none; overflow: hidden; contain: strict; }
/* V-1 StepPlayer (SPEC §5.2): stage, caption (aria-live), guess, controls ← ↺ ●●○○ → [连续播放], 文字版 */
.vz-sp { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--border); }
.vz-sp.worked .vz-sp-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12em, 18em); gap: var(--sp-4); align-items: start; }
.vz-sp-cap { display: flex; gap: var(--sp-2); align-items: baseline; min-height: 1.6em; margin: var(--sp-2) 0; font-size: var(--fs-md); font-weight: 600; }
.vz-sp-num { flex: none; font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
/* worked mode: the step list beside the visual shows the step, so the live caption is read, not shown (one statement);
   while 自己试 is unlocked the player drops vz-sr: no step is current, the sandbox's caption is shown */
.vz-sp-cap.vz-sr { min-height: 0; margin: -1px; }
.vz-sp-guess { margin: 0 0 var(--sp-2); }
.vz-sp-q { margin: 0 0 var(--sp-1); font-weight: 600; }
.vz-sp-opts, .vz-sp-num-guess, .vz-sp-ctl, .vz-gal-ctl { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.vz-sp-opts .btn[aria-checked='true'] { border-color: var(--accent); background: var(--accent-weak); color: var(--accent-text); }
.vz-sp-guess.done .vz-sp-opts .btn:disabled { opacity: 1; }
.vz-sp-guess.done .vz-sp-opts .btn:disabled:not([aria-checked='true']) { opacity: .45; }
.vz-sp-range { flex: 1; min-width: 10em; max-width: 22em; }
.vz-sp-out, .vz-gal-out { font-family: var(--mono); font-weight: 600; min-width: 4em; }
.vz-sp-next { font-weight: 600; border-color: var(--border-strong); }
.vz-sp-dots { display: inline-flex; gap: 6px; margin: 0 var(--sp-1); }
.vz-sp-dots > i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); opacity: .45; }
.vz-sp-dots > i.done { opacity: .8; }
.vz-sp-dots > i.on { background: var(--text); opacity: 1; }
.vz-sp-steps { margin: 0; padding-left: 1.4em; }
.vz-sp-steps > li { margin: 0 0 var(--sp-1); }
.vz-sp-steps > li.cur { font-weight: 600; }
.vz-sp-text { margin-top: var(--sp-2); font-size: var(--fs-sm); }
.vz-sp-text ol { margin: var(--sp-1) 0 0; padding-left: 1.4em; }
.vz-sp-tq { color: var(--muted); }
@media (max-width: 640px) {
  .vz-sp.worked .vz-sp-body { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse) {
  .vz-sp-ctl .btn, .vz-sp-opts .btn, .vz-sp-commit, .vz-gal-ctl .btn { min-height: 44px; min-width: 44px; }
  .vz-sym::after { content: ''; position: absolute; inset: -10px -4px; }
}
@media (prefers-contrast: more) {
  .vz-track { box-shadow: inset 0 0 0 1px var(--border-strong); }
  .vz-gap-line { background: var(--text); }
  .vz-pin::before { box-shadow: 0 0 0 1px var(--panel); }
}
@media (forced-colors: active) {
  .vz-track, .vz-gap-line { outline: 1px solid CanvasText; }
  .vz-span, .vz-pin, .vz-sp-dots > i { forced-color-adjust: none; }
  .vz-fill, .vz-seg, .vz-brace, .vz-gap-fill, .vz-zone-good, .vz-fill-prov { background: Highlight; }
  .vz-zone-bad, .vz-tieband, .vz-gap-zone { background: Canvas; }
  .vz-pin::before, .vz-sp-dots > i.on { background: CanvasText; }
  .vz-r.vz-picked .vz-track { outline: 2px solid Highlight; }
}
/* the dev-only gallery (vizGallery, hidden in the lab index) */
.vz-gallery { position: relative; display: grid; gap: var(--sp-5); }
.vz-gal-sec > h3 { margin: 0 0 var(--sp-2); }
.vz-gal-stage { min-width: 0; }
.vz-gal-ctl { margin: var(--sp-2) 0 0; }
.vz-gal-range { width: 12em; }
/* ===== end VIZ-A ===== */
