/* AI Behavioral Profile — site styles (paper & ink, serif headings, dot + bar + whisker ranges). */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --paper: #fbfaf7; --surface: #fffefb; --soft: #f2efe7; --soft-2: #ebe7dd;
  --ink: #22201c; --ink-2: #4b463e; --muted: #686157;
  --rule: #e0dbd0; --grid: #ebe7de; --grid-strong: #d6d0c3;
  --whisker: #837b6f; --bar: #34302b; --dot-ring: #22201c;
  --dim-bar: #cbc5b9; --dim-whisk: #d9d4ca;
  --accent: #a3432e; --focus: #2a5bc0;
  --hl: #f4d983; --hl-ink: #2b2513; --hl-row: #fff1c1;
  --ok: #2f6b3f; --warn: #8a5a12;
  --cat-A: #a3432e; --cat-B: #3b5f8e; --cat-C: #3c6c60; --cat-D: #7f611f; --cat-E: #924766; --cat-F: #6c5788;
  --shadow: 0 1px 2px rgba(34,32,28,.05), 0 10px 30px -18px rgba(34,32,28,.28);
  --serif: Newsreader, "Sitka Text", Georgia, "Times New Roman", serif;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --radius: 10px;
  --wrap: 1240px;
}
:root[lang="zh-CN"] {
  --serif: Newsreader, "Sitka Text", Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;   /* Latin before CJK: without web fonts the site name stays a Latin serif */
  --sans: Inter, "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111a27; --surface: #162233; --soft: #1a2738; --soft-2: #213044;
  --ink: #eceee9; --ink-2: #c6ccd4; --muted: #a2acb8;
  --rule: #2e3b4b; --grid: #243142; --grid-strong: #3a4a5d;
  --whisker: #8d9fb6; --bar: #e0e6ee; --dot-ring: #eceee9;
  --dim-bar: #4a5a6e; --dim-whisk: #3a495b;
  --accent: #e9a584; --focus: #8fb3ff;
  --hl: #7c6533; --hl-ink: #fff4d6; --hl-row: #353120;
  --ok: #8fd09e; --warn: #e8c07a;
  --cat-A: #e9a584; --cat-B: #9fbde6; --cat-C: #8fc6b6; --cat-D: #dcc184; --cat-E: #e2a3bf; --cat-F: #bda9dc;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111a27; --surface: #162233; --soft: #1a2738; --soft-2: #213044;
    --ink: #eceee9; --ink-2: #c6ccd4; --muted: #a2acb8;
    --rule: #2e3b4b; --grid: #243142; --grid-strong: #3a4a5d;
    --whisker: #8d9fb6; --bar: #e0e6ee; --dot-ring: #eceee9;
    --dim-bar: #4a5a6e; --dim-whisk: #3a495b;
    --accent: #e9a584; --focus: #8fb3ff;
    --hl: #7c6533; --hl-ink: #fff4d6; --hl-row: #353120;
    --ok: #8fd09e; --warn: #e8c07a;
    --cat-A: #e9a584; --cat-B: #9fbde6; --cat-C: #8fc6b6; --cat-D: #dcc184; --cat-E: #e2a3bf; --cat-F: #bda9dc;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.6);
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:root[lang="zh-CN"] body { line-height: 1.75; }
h1, h2, h3, h4, h5, h6, p, figure, dl, dd, ol, ul { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
/* controls that need the page script are hidden when it does not run (the head script marks <html class="js">) */
html:not(.js) [data-js-only] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); font-size: .92em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--ink); color: var(--paper); border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }
main { display: block; min-height: 60vh; }
main:focus { outline: none; }
/* body text never ends on one lone character (e.g. "件。" on a phone); balance on intros and legends still wins */
main p, main li, main dd, main figcaption, footer p { text-wrap: pretty; }
/* the same for measure titles and questions (spans in a summary), axis ends and table cells; headings break evenly */
.measure .title, .measure .question, .x-measure-head .title, .ends span, .prose td, .prose th, .m-table > summary { text-wrap: pretty; }
main h2, main h3 { text-wrap: balance; }
.fine { font-size: 13px; line-height: 1.55; color: var(--muted); }
.kicker { font: 600 12px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
:root[lang="zh-CN"] .kicker { letter-spacing: .06em; }

/* ---------------------------------------------------------------- header & footer */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 92%, transparent); -webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--rule); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 19px/1.1 var(--serif); letter-spacing: -.005em; white-space: nowrap; }
.brand-mark { color: var(--ink); flex: none; }
.brand-dot { fill: var(--paper); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; }
.site-nav a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--ink); background: var(--soft); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); border-radius: 8px 8px 0 0; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.tool { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 11px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--ink-2); }
.tool:hover { border-color: var(--whisker); color: var(--ink); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i-sun { display: inline; } :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; } }
.lang-switch { display: inline-flex; padding: 3px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); }
.lang-switch a { min-height: 30px; display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--ink-2); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.site-footer { margin-top: 80px; border-top: 1px solid var(--rule); background: var(--soft); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px; padding-top: 30px; padding-bottom: 44px; }
.footer-brand { font: 600 18px/1.2 var(--serif); }
.footer-slogan { margin-top: 4px; font: italic 400 16px/1.4 var(--serif); color: var(--ink-2); }
:root[lang="zh-CN"] .footer-slogan { font-style: normal; }
.footer-meta { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- shared controls */
.btn-text { min-height: 36px; padding: 6px 4px; border: 0; background: none; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--grid-strong); text-underline-offset: 4px; font-size: 14px; }
.btn-text:hover { color: var(--ink); text-decoration-color: currentColor; }
.btn-pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.btn-pill:hover { border-color: var(--whisker); }
.btn-strong { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-strong:hover { background: color-mix(in srgb, var(--ink) 88%, var(--paper)); }
.btn-quiet { color: var(--ink-2); }
.btn-quiet[aria-pressed="true"] { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.btn-quiet .when-on, .btn-quiet[aria-pressed="true"] .when-off { display: none; }
.btn-quiet[aria-pressed="true"] .when-on { display: inline; }
.ctl { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.ctl select, .search input { min-height: 38px; padding: 7px 34px 7px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px; max-width: 100%; }
.ctl select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.search input { padding-right: 12px; min-width: min(360px, 100%); }
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.3; background: var(--soft-2); color: var(--ink); }
.pill-e { background: color-mix(in srgb, var(--cat-E) 16%, var(--surface)); }
.pill-f { background: color-mix(in srgb, var(--cat-F) 16%, var(--surface)); }
.pill-status { background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); font-weight: 500; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; line-height: 1.6; background: var(--soft-2); color: var(--ink-2); white-space: nowrap; }
.tag-core { background: var(--soft-2); }
.tag-secondary { background: transparent; box-shadow: inset 0 0 0 1px var(--grid-strong); color: var(--muted); }
.notice { padding: 14px 16px; border-radius: var(--radius); background: var(--soft); color: var(--ink-2); }
.status { min-height: 1.4em; font-size: 13px; color: var(--muted); }
.card { padding: 20px 22px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.card-quiet { background: var(--soft); border-color: transparent; }
.card-title { font: 600 16px/1.35 var(--sans); margin-bottom: 8px; }
.card p + p { margin-top: 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 1px; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--rule); }
.facts > div { flex: 1 1 180px; padding: 12px 16px; background: var(--surface); }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin-top: 2px; font-weight: 500; overflow-wrap: anywhere; }
.facts > .fact-wide { flex-basis: 100%; }
.facts dd.hash { font-size: 12.5px; font-weight: 400; word-break: break-all; }

/* ---------------------------------------------------------------- range symbols */
.k-dot, .k-in, .k-out, .k-ci { display: inline-block; flex: none; vertical-align: middle; position: relative; }
.k-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 2px var(--dot-ring); margin: 0 3px; }
.k-in { width: 16px; height: 7px; border-radius: 4px; background: var(--bar); }
.k-out { width: 16px; height: 11px; background: linear-gradient(var(--whisker), var(--whisker)) center / 100% 2px no-repeat; border-left: 2px solid var(--whisker); border-right: 2px solid var(--whisker); }
.k-ci { width: 18px; height: 11px; background: linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat; }
.k-ci::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: var(--accent); transform: rotate(45deg); }
.key-item { display: inline-flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- page heads */
.page-narrow { max-width: 1080px; }
.page-head { padding: 52px 0 28px; }
.page-head h1 { font: 500 clamp(2.2rem, 4.6vw, 3.2rem)/1.06 var(--serif); letter-spacing: -.02em; margin: 6px 0 14px; text-wrap: balance; }
:root[lang="zh-CN"] .page-head h1 { font-weight: 600; letter-spacing: 0; line-height: 1.2; }
/* page intros are a line or three: balance the lines so the last one is never a lone word ("比较。") */
.page-intro { max-width: 46em; font: 400 19px/1.55 var(--serif); color: var(--ink-2); text-wrap: balance; }
/* Chinese on wider screens: break only at punctuation, so balanced lines end at a pause, not inside a word ("方/法") */
@media (min-width: 641px) { :root[lang="zh-CN"] .page-intro { word-break: keep-all; } }
:root[lang="zh-CN"] .page-intro { font-family: var(--sans); font-size: 17px; line-height: 1.85; }
.page-intro + .page-intro { margin-top: 10px; }
.lead { font-size: 18px; line-height: 1.6; }

/* ---------------------------------------------------------------- home layout */
.home-layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 44px; align-items: start; }
.toc { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto; padding: 28px 4px 24px 4px; margin-left: -4px; scrollbar-width: thin; }   /* 4px: room for focus rings */
.toc-title { font: 600 12px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
:root[lang="zh-CN"] .toc-title { letter-spacing: .04em; }
.toc-group { display: flex; align-items: baseline; gap: 7px; margin: 16px 0 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.toc-group a { display: flex; gap: 7px; text-decoration: none; }
.g-code { display: inline-grid; place-items: center; flex: none; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; background: color-mix(in srgb, var(--cat, var(--accent)) 16%, var(--surface)); color: var(--cat, var(--accent)); font: 700 11.5px/1 var(--sans); }
.toc ul a { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 4px; padding: 5px 6px; border-radius: 6px; font-size: 13px; line-height: 1.35; text-decoration: none; color: var(--ink-2); }
.toc ul a.toc-plain { display: block; }
.toc ul a:hover { background: var(--soft); color: var(--ink); }
.toc ul a[aria-current="true"] { background: var(--soft-2); color: var(--ink); font-weight: 600; }
.toc-code { color: var(--muted); font-size: 11.5px; padding-top: 1px; font-variant-numeric: tabular-nums; }
.toc-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); font: italic 400 14px/1.4 var(--serif); }
:root[lang="zh-CN"] .toc-foot { font-style: normal; font-family: var(--sans); font-size: 13px; }
.cat-A { --cat: var(--cat-A); } .cat-B { --cat: var(--cat-B); } .cat-C { --cat: var(--cat-C); }
.cat-D { --cat: var(--cat-D); } .cat-E { --cat: var(--cat-E); } .cat-F { --cat: var(--cat-F); }
.home-main { min-width: 0; }
.hero { padding: 48px 0 26px; }
.hero h1 { font: 500 clamp(2.4rem, 5.4vw, 4rem)/1.02 var(--serif); letter-spacing: -.028em; max-width: 14em; text-wrap: balance; }
:root[lang="zh-CN"] .hero h1 { font-weight: 600; letter-spacing: .01em; line-height: 1.18; font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
.hero-intro { margin-top: 16px; max-width: 40em; font: 400 20px/1.5 var(--serif); color: var(--ink-2); text-wrap: pretty; }
:root[lang="zh-CN"] .hero-intro { font: 400 18px/1.8 var(--sans); }
.hero-full .hero-intro + .hero-intro { margin-top: 12px; }   /* the three opening paragraphs share one size */
.hero-intro a { color: var(--ink); }
.hero-short { display: none; }
.hero-count { margin-top: 14px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.jump { display: none; }
.jump > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* legend */
.legend { padding: 18px 0 20px; border-top: 2px solid var(--ink); }
.legend-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 14px; }
.legend-head h2 { font: 600 13px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
:root[lang="zh-CN"] .legend-head h2 { letter-spacing: .04em; font-size: 14px; }
.legend-hint { font: italic 400 16px/1.4 var(--serif); color: var(--ink-2); }
:root[lang="zh-CN"] .legend-hint { font: 400 14px/1.6 var(--sans); }
.legend > summary { list-style: none; cursor: default; }
.legend > summary::-webkit-details-marker { display: none; }
.legend-mini, .legend-chev { display: none; }
.legend-mini > span { display: inline-flex; align-items: center; gap: 7px; }
.legend-key { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 26px; }
.legend-key li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.legend-key li > i { margin-top: 5px; justify-self: center; }
.legend-key b { color: var(--ink); font-weight: 600; }
.legend-note { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.legend-note a { color: var(--ink-2); font-weight: 500; white-space: nowrap; }
/* the key texts run two or three short lines: balance them so none ends with a lone word (“果。”, “范围。”) */
.legend-key p, .legend-note { text-wrap: balance; }
.demo { margin-top: 14px; border-top: 1px solid var(--rule); }
.demo > summary, .explain > summary, .dist > summary, .m-table > summary { display: flex; align-items: center; gap: 8px; min-height: 42px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.demo > summary::-webkit-details-marker, .explain > summary::-webkit-details-marker, .dist > summary::-webkit-details-marker, .m-table > summary::-webkit-details-marker, .measure > summary::-webkit-details-marker { display: none; }
details[open] > summary .chev-i { transform: rotate(180deg); }
.chev-i { transition: transform .2s ease; }
.demo-body { display: grid; gap: 14px; padding: 4px 0 8px; max-width: 760px; font-size: 15px; color: var(--ink-2); }
.demo-fig { padding: 34px 10px 8px; border-radius: 12px; background: var(--soft); }
.demo-plot { position: relative; height: 28px; margin: 0 12px; }
.demo-base { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--grid-strong); }
.demo-plot .g-in { height: 14px; margin-top: -7px; border-radius: 7px; }
.demo-plot .g-out::before, .demo-plot .g-out::after { top: -9px; height: 20px; }
.demo-plot .g-dot { width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px; }
.demo-val { position: absolute; bottom: calc(100% + 4px); transform: translateX(-50%); font-weight: 700; font-size: 13px; color: var(--ink); }
.demo-ticks { position: relative; height: 18px; margin: 8px 12px 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-ticks span { position: absolute; transform: translateX(-50%); }
.demo-fig figcaption { margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: center; }
.demo-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border-radius: 10px; overflow: hidden; background: var(--rule); border: 1px solid var(--rule); }
.demo-values > div { padding: 10px 14px; background: var(--surface); }
.demo-values dt { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.demo-values dd { margin-top: 3px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }

/* controls */
.controls { position: sticky; top: 64px; z-index: 12; margin: 0 -12px; padding: 12px 12px 10px; background: color-mix(in srgb, var(--paper) 94%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.controls-title { font: 500 26px/1.15 var(--serif); letter-spacing: -.01em; margin-bottom: 10px; }
:root[lang="zh-CN"] .controls-title { font-weight: 600; font-size: 22px; letter-spacing: 0; }
.controls-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ctl-buttons { display: flex; gap: 10px; }
.ctl-links { display: flex; gap: 8px; margin-left: auto; }
.controls .status { margin-top: 4px; }

/* groups & measures */
.group { padding-top: 34px; }
.group-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 20px; padding: 14px 0 6px; border-top: 3px solid var(--ink); }
.group-head :is(h2, h3) { display: flex; align-items: center; gap: 10px; font: 600 15px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
:root[lang="zh-CN"] .group-head :is(h2, h3) { letter-spacing: .02em; font-size: 17px; }
.group-head p { max-width: 36em; font: italic 400 16px/1.45 var(--serif); color: var(--ink-2); }
:root[lang="zh-CN"] .group-head p { font: 400 14.5px/1.7 var(--sans); }
.block-title { margin: 26px 0 0; padding: 8px 0 6px; font: 600 12.5px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--cat); border-bottom: 1px solid var(--rule); }
:root[lang="zh-CN"] .block-title { letter-spacing: .03em; font-size: 14px; }
.measure { border-bottom: 1px solid var(--rule); scroll-margin-top: 150px; }
.has-sticky-pad .measure { scroll-margin-top: 0; }
.measure > summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 36px; gap: 16px; align-items: center; padding: 22px 0 18px; cursor: pointer; list-style: none; }
.measure > summary:hover .title { text-decoration: underline; text-decoration-color: var(--grid-strong); text-underline-offset: 5px; }
.measure > summary .code { align-self: start; padding-top: 25px; font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.measure .head { display: grid; gap: 4px; min-width: 0; }
.measure .kicker { color: var(--cat); font-size: 11.5px; }
.measure .title { font: 500 32px/1.08 var(--serif); letter-spacing: -.015em; }
:root[lang="zh-CN"] .measure .title { font-weight: 600; font-size: 26px; letter-spacing: 0; line-height: 1.3; }
.measure .question { font: italic 400 18px/1.4 var(--serif); color: var(--ink-2); }
:root[lang="zh-CN"] .measure .question { font: 400 16px/1.7 var(--sans); }
.peek { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.measure[open] .peek { display: none; }
.peek-fig { display: grid; gap: 3px; }
.peek-ax { display: flex; justify-content: space-between; padding: 0 3px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.peek-ax i { font-style: normal; }
.mini { display: block; }
.mini-bg { fill: var(--soft); }
.mini-grid { fill: var(--grid-strong); opacity: .7; }
.mini-hl { fill: transparent; }
.mini-o { fill: var(--whisker); }
.mini-i { fill: var(--bar); }
.mini-c { fill: var(--soft); }
.is-highlighting .mini-line:not(.is-hl) .mini-i { fill: var(--dim-bar); }
.is-highlighting .mini-line:not(.is-hl) .mini-o { fill: var(--dim-whisk); }
.is-highlighting .mini-line:not(.is-hl) .mini-c { fill: var(--soft); }
.mini-line.is-hl .mini-hl { fill: var(--hl); }
.chev { grid-column: 4; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--ink-2); }
.measure[open] > summary .chev .chev-i { transform: rotate(180deg); }
.measure-body { padding: 0 0 30px 56px; }
.measure-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -4px 0 14px; }
.axis-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.evidence { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--muted); }
.evidence-help { color: var(--ink-2); }

/* chart rows */
.chart { margin-left: -56px; }
.axis-head, .row { display: grid; grid-template-columns: minmax(140px, 184px) minmax(0, 1fr) 76px 168px; grid-template-areas: "m p c r"; column-gap: 20px; align-items: center; }
.axis-head { padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 11.5px; color: var(--muted); }
.axis-head .h-m { grid-area: m; align-self: end; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.axis-head .h-c { grid-area: c; align-self: end; text-align: right; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.axis-head .h-r { grid-area: r; align-self: end; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
:root[lang="zh-CN"] .axis-head .h-m, :root[lang="zh-CN"] .axis-head .h-c, :root[lang="zh-CN"] .axis-head .h-r { letter-spacing: 0; font-size: 12.5px; }
.h-plot { grid-area: p; margin: 0 9px; min-width: 0; }
.ends { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 8px; font: italic 400 14.5px/1.3 var(--serif); color: var(--ink-2); }
:root[lang="zh-CN"] .ends { font: 400 13px/1.5 var(--sans); }
.ends span:last-child { text-align: right; }
.ticks { position: relative; height: 14px; font-variant-numeric: tabular-nums; }
.ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }
.rows { counter-reset: none; }
.row { position: relative; min-height: 54px; border-top: 1px solid var(--grid); }
.row:first-child { border-top: 0; }
.row:last-child { border-bottom: 1px solid var(--rule); }
.m { grid-area: m; min-width: 0; padding: 6px 0; }
.m-name { display: inline; font-size: 15px; font-weight: 500; line-height: 1.3; text-decoration: none; }
.m-name:hover { text-decoration: underline; }
.m-prov { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.note-mark { margin-left: 2px; color: var(--accent); font-weight: 700; }
.plot { grid-area: p; position: relative; align-self: stretch; min-height: 34px; margin: 0 9px; background-image: linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 25% 100%; box-shadow: inset -1px 0 0 var(--grid); }
.plot .ref { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: var(--grid-strong); }
.plot.is-signed .ref { width: 2px; margin-left: -1px; background: var(--whisker); opacity: .55; }
.g-out, .g-in, .g-dot { position: absolute; top: 50%; display: block; }
.g-out { height: 2px; margin-top: -1px; background: var(--whisker); }
.g-out::before, .g-out::after { content: ""; position: absolute; top: -6px; width: 2px; height: 14px; background: var(--whisker); }
.g-out::before { left: -1px; } .g-out::after { right: -1px; }
.g-in { height: 10px; margin-top: -5px; border-radius: 5px; background: var(--bar); }
.g-in.is-zero { width: 3px !important; margin-left: -1.5px; height: 26px; margin-top: -13px; border-radius: 2px; }   /* taller than the dot, so no variation stays visible */
.g-out.is-zero::before, .g-out.is-zero::after { top: -14px; height: 30px; }
.g-dot { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 2.5px var(--dot-ring); }
.missing-text { position: absolute; left: 0; top: 50%; transform: translateY(-50%); font-size: 13px; font-style: italic; color: var(--muted); }
.c { grid-area: c; text-align: right; font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c small { margin-left: 1px; font-size: 12px; font-weight: 500; color: var(--muted); }
.type-letter { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 7px; padding: 0 4px; border-radius: 6px; background: color-mix(in srgb, var(--cat-E) 15%, var(--surface)); font-size: 13px; font-weight: 700; vertical-align: 2px; }
.type-letter sup { font-size: 10px; color: var(--accent); }
.r { grid-area: r; display: grid; gap: 3px; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.r span { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.r .is-unavailable { white-space: normal; font-style: italic; color: var(--muted); }
.row.is-hl { background: var(--hl-row); }
.row.is-hl .m-name { font-weight: 700; }
.is-highlighting .row:not(.is-hl) .g-in { background: var(--dim-bar); }
.is-highlighting .row:not(.is-hl) .g-out, .is-highlighting .row:not(.is-hl) .g-out::before, .is-highlighting .row:not(.is-hl) .g-out::after { background: var(--dim-whisk); }
.is-highlighting .row:not(.is-hl) .g-dot { box-shadow: 0 0 0 2.5px var(--dim-bar); }
.is-highlighting .row:not(.is-hl) .c, .is-highlighting .row:not(.is-hl) .r { color: var(--muted); }
.measure-foot { display: grid; gap: 4px; margin-top: 12px; font-size: 13px; color: var(--muted); max-width: 60em; }
.deploy-note span { color: var(--accent); font-weight: 700; }
.explain { margin-top: 12px; border-top: 1px solid var(--rule); }
.explain .when-open, .explain[open] .when-closed { display: none; }
.explain[open] .when-open { display: inline; }
.explain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; padding: 8px 0 6px; }
.explain-grid section { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
/* no one-word or one-character last line (“tests.”, “系。”) in the explanation paragraphs */
.explain p { text-wrap: pretty; }
.explain-grid :is(h4, h5) { margin-bottom: 4px; font: 600 13px/1.3 var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
:root[lang="zh-CN"] .explain-grid :is(h4, h5) { letter-spacing: 0; font-size: 14px; }
.explain-grid .ex { padding: 14px 16px; border-radius: 10px; background: var(--soft); }
.explain-grid .note { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.illustration-note { margin: 4px 0 10px; font-size: 12.5px; color: var(--muted); }
.measure-links { margin-top: 10px; }
.measure-end { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 24px; margin-top: 12px; border-top: 1px solid var(--rule); }
.measure-end .explain { flex: 1 1 320px; margin-top: 0; border-top: 0; }
.measure-end .measure-links { margin-top: 0; min-height: 42px; display: flex; align-items: center; }
.methods-link { font-size: 14px; font-weight: 600; color: var(--ink); }
.sources { margin-top: 56px; padding-top: 16px; border-top: 3px solid var(--ink); }
.sources h2 { font: 600 15px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
:root[lang="zh-CN"] .sources h2 { letter-spacing: .02em; font-size: 17px; }
.sources-links { margin-top: 14px; font-size: 14px; }

/* ---------------------------------------------------------------- explore */
.explore .page-head { padding-bottom: 20px; }
.chooser { padding: 22px 24px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.chooser-head h2 { font: 500 26px/1.2 var(--serif); letter-spacing: -.01em; }
:root[lang="zh-CN"] .chooser-head h2 { font-weight: 600; font-size: 22px; letter-spacing: 0; }
.chooser-head p { margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.chooser-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin: 16px 0 12px; }
.chooser-grid > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-top: 10px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chooser-grid > summary::-webkit-details-marker { display: none; }
.chooser-grid[open] > summary { display: none; }
.search { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.search-empty { padding: 10px 0; color: var(--ink-2); }
.model-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.model-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); }
.model-card.is-selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.mc-name { display: grid; gap: 1px; }
.mc-title { font-weight: 600; font-size: 15.5px; }
.mc-prov { font-size: 12.5px; color: var(--muted); }
.mc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mc-actions .btn-pill { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.selection { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.selection-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--soft-2); font-size: 13.5px; font-weight: 500; }
.chip button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); }
.chip button:hover { background: var(--surface); color: var(--ink); }
.chip .ord { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.selection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.view { margin-top: 30px; }
.loading { padding: 24px 0; color: var(--muted); }
.x-head { padding: 12px 0 8px; }
.x-head h2 { font: 500 clamp(1.9rem, 3.6vw, 2.6rem)/1.1 var(--serif); letter-spacing: -.02em; }
:root[lang="zh-CN"] .x-head h2 { font-weight: 600; letter-spacing: 0; line-height: 1.3; }
.x-head .x-intro { margin-top: 10px; max-width: 46em; color: var(--ink-2); font-size: 16px; }
.x-meta { margin-top: 16px; }
.x-notes { display: grid; gap: 8px; margin-top: 14px; }
.x-note { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--soft); font-size: 14px; color: var(--ink-2); border-radius: 0 8px 8px 0; }
.x-type { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.x-type b { font: 600 22px/1 var(--serif); letter-spacing: .06em; color: var(--ink); }
.x-version { margin-top: 16px; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; }
.x-version h3 { font-size: 15px; font-weight: 600; }
.x-version p { font-size: 14px; color: var(--ink-2); }
.x-hints { display: grid; gap: 4px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.x-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; }
.x-toolbar .fine { flex: 1 1 220px; margin-left: 4px; }
.x-head .x-count { margin-top: 10px; }
.x-settings { margin-top: 4px; }
.x-settings b { font-weight: 600; color: var(--ink-2); }
.selection-note { margin-top: 10px; }
.x-group { padding-top: 30px; }
.x-measure { padding: 18px 0 22px; border-bottom: 1px solid var(--rule); scroll-margin-top: 90px; }
.x-measure-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; margin-bottom: 12px; }
.x-measure-head .code { padding-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.x-measure-head .title { font: 500 26px/1.15 var(--serif); letter-spacing: -.01em; }
:root[lang="zh-CN"] .x-measure-head .title { font-weight: 600; font-size: 22px; letter-spacing: 0; line-height: 1.35; }
.x-measure-head .question { margin-top: 2px; font: italic 400 16.5px/1.45 var(--serif); color: var(--ink-2); }
:root[lang="zh-CN"] .x-measure-head .question { font: 400 15px/1.7 var(--sans); }
.x-measure .measure-meta { margin: 0 0 12px 56px; }
.x-measure .chart { margin-left: 0; }
.x-measure .measure-foot, .x-measure .explain, .x-measure .measure-links { margin-left: 56px; }
.delta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--soft); font-size: 14px; color: var(--ink-2); }
.delta b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.row.is-missing .m-name { color: var(--muted); }
.x-missing { padding: 10px 14px; border-radius: 8px; background: var(--soft); color: var(--ink-2); font-size: 14px; }

/* ---------------------------------------------------------------- robustness */
/* one question, two ways to answer */
.gr-how { max-width: 860px; margin: 0 0 30px; font-size: 15.5px; color: var(--ink-2); }
.gr-how h2 { margin-bottom: 8px; font: 600 18px/1.35 var(--sans); color: var(--ink); }
.gr-how p + p { margin-top: 10px; }
.gr-how .fine { margin-top: 14px; }
.gr-ways { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 12px 0 14px; }
.gr-ways > div { padding: 14px 16px; border-radius: 12px; background: var(--soft); }
.gr-ways dt { font-size: 15px; font-weight: 600; color: var(--ink); }
.gr-ways dd { margin: 4px 0 0; font-size: 14.5px; }

/* worked example */
.gr-example-label { margin-bottom: 4px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.gr-example { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; padding: 22px 24px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.gr-example h2 { font: 600 17px/1.35 var(--sans); margin-bottom: 8px; }
.gr-example-copy p + p { margin-top: 10px; }
.gr-example-fig { margin: 0; padding: 16px 18px; border-radius: 12px; background: var(--soft); }
.gr-example-fig figcaption { margin-bottom: 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
:root[lang="zh-CN"] .gr-example-fig figcaption { letter-spacing: .02em; }
.gr-example-fig figcaption .as-is { text-transform: none; letter-spacing: 0; }
:root[lang="zh-CN"] .gr-mname, :root[lang="zh-CN"] .dist-table thead th { word-break: keep-all; overflow-wrap: anywhere; }   /* "美元" breaks as a unit, never "美 / 元" */
.dist-table th { text-wrap: balance; }
.gr-example-result { margin-top: 12px; font-size: 14.5px; color: var(--ink-2); }

/* original → changed: 30 answer cells (filled = chose an even split) or a $0–$10 bar */
.gc-compare { display: grid; gap: 8px; }
.gc-side { display: grid; grid-template-columns: minmax(96px, 124px) minmax(0, 1fr); align-items: center; gap: 4px 14px; }
.gc-read { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-width: 0; }
.gc-when { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.gc-val { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.strip { --cell: 6px; --gap: 2px; display: block; height: 14px; width: calc(var(--n) * (var(--cell) + var(--gap)) - var(--gap)); border-radius: 1px;
  background: linear-gradient(90deg, var(--bar) calc(var(--on) * (var(--cell) + var(--gap))), var(--dim-bar) 0);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 var(--cell), transparent var(--cell) calc(var(--cell) + var(--gap)));
  mask: repeating-linear-gradient(90deg, #000 0 var(--cell), transparent var(--cell) calc(var(--cell) + var(--gap))); }
.abar { display: block; width: 158px; height: 10px; border-radius: 5px; background: var(--dim-bar); overflow: hidden; }
.abar i { display: block; height: 100%; border-radius: 5px; background: var(--bar); }

/* eight-model overview: one disclosure row per model */
.gr-overview { margin-top: 44px; }
.gr-overview-head h2 { font: 500 30px/1.15 var(--serif); letter-spacing: -.01em; }
:root[lang="zh-CN"] .gr-overview-head h2 { font-size: 26px; font-weight: 600; letter-spacing: 0; }
:root[lang="zh-CN"] .page-head h1 { word-break: keep-all; overflow-wrap: anywhere; }   /* break Chinese titles at punctuation */
.gr-key { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); max-width: 760px; }
.gr-key-ci { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.gr-key-ci b { color: var(--ink-2); }
.gm-head, .gm > summary { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1.2fr) minmax(0, 1.45fr) 84px; gap: 18px; align-items: center; }
.gm-head { margin-top: 22px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 12px; font-weight: 600; color: var(--muted); }
.gm-head small { display: block; font-size: 11.5px; font-weight: 400; }
.gm { border-bottom: 1px solid var(--rule); }
.gm > summary { padding: 14px 0; cursor: pointer; list-style: none; }
.gm > summary::-webkit-details-marker, .gm-list > summary::-webkit-details-marker, .gc-more > summary::-webkit-details-marker,
.gl-item > details > summary::-webkit-details-marker, .gr-records > summary::-webkit-details-marker { display: none; }
.gm > summary:hover .gm-name b { text-decoration: underline; text-underline-offset: 3px; }
.gm-name { display: grid; }
.gm-name b { font-size: 15.5px; font-weight: 600; }
.gm-prov { font-size: 12.5px; color: var(--muted); }
.gm-cell { display: grid; gap: 6px; }
.gm-label { display: none; }
.sq-row { display: flex; flex-wrap: wrap; gap: 3px; }
.sq { width: 11px; height: 11px; border-radius: 2px; background: var(--dim-bar); }
.sq.is-different { background: var(--accent); }
.sq.is-missing { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.gm-text { font-size: 13.5px; color: var(--ink-2); }
.gm-more-hint { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 13px; color: var(--muted); }
.gm-body { padding: 2px 0 24px; }
.gm-h { margin: 6px 0 2px; font: 600 16px/1.4 var(--sans); }
.gm-branch { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.gm-group { margin: 14px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.gm-group::before { content: ""; display: inline-block; width: 14px; height: 1px; margin-right: 8px; vertical-align: middle; background: var(--muted); }
.gm-summary { margin-top: 16px; font-size: 15px; color: var(--ink-2); }
.gm-list { margin-top: 6px; }
.gm-list > summary, .gc-more > summary, .gl-item > details > summary { display: flex; align-items: center; gap: 8px; min-height: 38px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 500; color: var(--ink-2); }

/* a check whose answers changed */
.gc { padding: 14px 16px 8px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.gc + .gc { margin-top: 10px; }
.gc-title { margin-bottom: 10px; font: 600 15px/1.35 var(--sans); }
.gc-more { border-top: 1px solid var(--grid); margin-top: 10px; }
.gc-more:first-of-type { margin-top: 12px; }
.gc-more + .gc-more { margin-top: 0; }
.gc-change { display: grid; gap: 12px; padding: 4px 0 10px; }
.gc-share { font-size: 14px; }
.gr-metric { max-width: 440px; }
.gr-mname { margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.gr-val { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-variant-numeric: tabular-nums; }
.gr-val .v { font-size: 16px; font-weight: 600; }
.ci-text { font-size: 12.5px; color: var(--muted); }
.ci { position: relative; height: 16px; margin-top: 4px; background: linear-gradient(var(--grid), var(--grid)) center / 100% 1px no-repeat; }
.ci-zero { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--whisker); }
.ci-line { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--accent); }
.ci-line::before, .ci-line::after { content: ""; position: absolute; top: -4px; width: 2px; height: 10px; background: var(--accent); }
.ci-line::before { left: -1px; } .ci-line::after { right: -1px; }
.ci-line.is-zero { width: 2px !important; margin-left: -1px; }
.ci-dot { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--accent); transform: rotate(45deg); }
/* the strip's own scale: its two ends and, when it spans both signs, zero */
.ci-ticks { position: relative; height: 15px; margin-top: 2px; font-size: 11px; line-height: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ci-ticks span { position: absolute; top: 0; white-space: nowrap; }
.ci-ticks .t-lo { left: 0; } .ci-ticks .t-hi { right: 0; } .ci-ticks .t-0 { transform: translateX(-50%); }

/* matching checks, grouped */
.gl { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--grid); }
.gl-item { border-bottom: 1px solid var(--grid); }
.gl-body { display: grid; gap: 12px; padding: 4px 0 16px; }

/* answer counts */
.dist-table { border-collapse: collapse; margin: 2px 0 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dist-table caption { padding-bottom: 6px; text-align: left; color: var(--muted); }
.dist-table th, .dist-table td { padding: 4px 6px; text-align: center; border-bottom: 1px solid var(--grid); }
.dist-table th[scope="row"] { text-align: left; white-space: nowrap; font-weight: 500; color: var(--ink-2); }
.dist-table td { position: relative; min-width: 34px; height: 56px; vertical-align: bottom; }
.dist-table .bar { display: block; width: 14px; margin: 0 auto 2px; background: var(--dim-bar); border-radius: 3px 3px 0 0; }
.dist-table .bar.is-variant { background: var(--bar); }
.dist-table .n { display: block; font-size: 11.5px; color: var(--ink-2); }

/* one shared record: format, coverage, settings, dates */
.gr-records { margin-top: 48px; border-top: 3px solid var(--ink); }
.gr-records > summary { display: flex; align-items: center; gap: 10px; padding: 16px 0; cursor: pointer; list-style: none; }
.gr-records > summary h2 { font: 500 24px/1.2 var(--serif); letter-spacing: -.01em; }
:root[lang="zh-CN"] .gr-records > summary h2 { font-size: 22px; font-weight: 600; letter-spacing: 0; }
.gr-records-body { display: grid; gap: 12px; padding: 0 0 12px; color: var(--ink-2); font-size: 14.5px; }
.gr-rec { width: 100%; border-collapse: collapse; font-size: 13.5px; color: var(--ink); }
.gr-rec th, .gr-rec td { padding: 9px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--grid); }
.gr-rec thead th { font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--ink); }
.gr-rec tbody th { font-weight: 600; white-space: nowrap; }
.fmt-count { font-weight: 600; font-variant-numeric: tabular-nums; }
/* answer format: one row per model (share bar + count), opening to its two question types; replies shown character for character */
.gr-format { --fm-cols: minmax(150px, 1fr) minmax(0, 2fr) 10.5em 11.5em; margin-top: 56px; }
:root[lang="zh-CN"] .gr-format { --fm-cols: minmax(150px, 1fr) minmax(0, 2fr) 10.5em 8.5em; }
.gr-format-intro { max-width: 46em; margin-top: 10px; color: var(--ink-2); }
.fm-head, .fm > summary, .fm-plain, .fm-type { display: grid; grid-template-columns: var(--fm-cols); gap: 18px; align-items: center; }
.fm-head { margin-top: 22px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 12px; font-weight: 600; color: var(--muted); }
.fm { border-bottom: 1px solid var(--rule); }
.fm > summary, .fm-plain { padding: 14px 0; }
.fm > summary { cursor: pointer; list-style: none; }
.fm > summary::-webkit-details-marker, .fm-examples > summary::-webkit-details-marker { display: none; }
.fm > summary:hover .gm-name b { text-decoration: underline; text-underline-offset: 3px; }
.fm-bar { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.fm-bar > i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; background: var(--ink-2); }
.fm-count { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; color: var(--ink); }
.fm-text { grid-column: 2 / -1; font-size: 13.5px; color: var(--muted); }
.fm-body { display: grid; gap: 14px; padding: 0 0 20px; }
.fm-type-name { display: grid; gap: 2px; font-size: 13.5px; color: var(--ink); }
.fm-type-name span { font-size: 12.5px; color: var(--muted); }
.fm-type .fm-bar { height: 6px; }
.fm-denominators { margin-top: 12px; }
.fm-note { max-width: 46em; margin-top: 10px; color: var(--ink-2); }
.fm-examples { margin-top: 16px; border-top: 1px solid var(--rule); }
.fm-examples > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.fm-ex-body { display: grid; gap: 14px; padding: 2px 0 18px; color: var(--ink-2); }
.fm-ex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fm-ex { display: grid; gap: 10px; align-content: start; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.fm-ex h3 { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.fm-ex-who { margin-top: -6px; font-size: 13px; color: var(--muted); }
.fm-ex dl { display: grid; gap: 10px; }
.fm-ex dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.fm-ex dd { margin-top: 4px; color: var(--ink); }
.fm-literal { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--soft); font: 400 13.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }

/* ---------------------------------------------------------------- methods */
.methods-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc-methods ul { margin-top: 2px; }
.toc-methods .toc-group { margin: 14px 0 2px; }
.methods-body { min-width: 0; max-width: 820px; }
/* anchors land just below the sticky header through html's scroll-padding-top; no extra scroll-margin here */
.m-section { padding: 30px 0 10px; border-top: 1px solid var(--rule); }
.m-section > h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font: 500 30px/1.15 var(--serif); letter-spacing: -.01em; }
:root[lang="zh-CN"] .m-section > h2 { font-weight: 600; font-size: 25px; letter-spacing: 0; line-height: 1.35; }
.m-section h3 { margin: 26px 0 10px; font: 600 19px/1.3 var(--sans); }
.m-category { border-top: 3px solid var(--ink); margin-top: 26px; }
.m-measure { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--rule); }
.m-measure h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font: 500 24px/1.2 var(--serif); letter-spacing: -.01em; }
:root[lang="zh-CN"] .m-measure h3 { font-weight: 600; font-size: 21px; letter-spacing: 0; }
.m-code { font: 600 13px/1 var(--sans); color: var(--cat, var(--accent)); font-variant-numeric: tabular-nums; }
.m-shared, .m-part { margin-top: 24px; }
.m-shared > h3, .m-part > h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.m-measure:target, .m-section:target { animation: target-flash 1.6s ease-out 1; }
@keyframes target-flash { 0% { background: var(--hl-row); } 100% { background: transparent; } }
.prose { font-size: 16px; line-height: 1.7; color: var(--ink); overflow-wrap: break-word; }   /* long URLs (DOIs) wrap on phones */
:root[lang="zh-CN"] .prose { line-height: 1.85; }
.prose > * + *, .prose + .prose { margin-top: 12px; }
.prose td:first-child, .prose th:first-child { min-width: 5.5em; }
.prose p { max-width: 46em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose li + li { margin-top: 4px; }
.prose a { color: var(--ink); text-decoration-color: var(--grid-strong); }
.prose a:hover { text-decoration-color: currentColor; }
.prose code { font-family: var(--mono); font-size: .88em; padding: 1px 5px; border-radius: 4px; background: var(--soft); overflow-wrap: anywhere; }
.prose .md-sub { margin-top: 22px; font: 600 16px/1.4 var(--sans); }
.prose h3.md-sub { font-size: 17px; }
/* worked examples: easy to spot, same measure of text */
.prose .m-example { max-width: 46em; margin: 16px 0; padding: 12px 16px 12px 18px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--soft); }
.prose .m-example > * + * { margin-top: 8px; }
.prose .m-example .table-wrap { margin-top: 12px; }
.prose .m-example table { background: var(--surface); }   /* a table inside an example stays legible on the tinted block */
/* a paragraph opening with a bold lead-in ("Task 1: …", "How it is scored.") starts a new step: a little more air above */
.prose > * + p.m-lead { margin-top: 22px; }
.m-example-label { color: var(--accent); }
/* reached through a link ("A1's example"): a brief ring shows which block the link meant */
.prose .m-example:target { animation: example-flash 2s ease-out 1; }
@keyframes example-flash { 0%, 35% { box-shadow: 0 0 0 3px var(--hl); } 100% { box-shadow: 0 0 0 3px transparent; } }
.prose .math-display { margin: 10px 0; }
/* A formula wider than the column scrolls sideways; soft shadows at the clipped edge show there is more
   (the paper-coloured covers scroll with the formula and hide each shadow once that end is reached). */
.math-display {
  --math-bg: var(--paper);
  overflow-x: auto; overflow-y: hidden; padding: 6px 0; max-width: 100%;
  background:
    linear-gradient(to right, var(--math-bg) 40%, transparent) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--math-bg) 40%, transparent) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--ink) 22%, transparent), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--ink) 22%, transparent), transparent) right center / 12px 100% no-repeat scroll;
}
.m-example .math-display { --math-bg: var(--soft); }
.m-table .math-display { --math-bg: var(--surface); }
.math-inline { white-space: nowrap; }
/* a formula still shown as its source text (not typeset yet, or KaTeX did not load) wraps anywhere rather than
   widening the page on a phone; the page script marks each typeset formula .is-set */
.math-inline:not(.is-set), .math-display:not(.is-set) { white-space: normal; overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; overflow-x: auto; }
/* a table wider than its box fades at the clipped edge(s), whatever the background behind it */
.table-wrap.is-clipped-end { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.table-wrap.is-clipped-start { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
.table-wrap.is-clipped-start.is-clipped-end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.cell-label { display: none; } /* column heading repeated in each cell; shown when rows stack on phones */
/* number-only columns (e.g. low / middle / high values) take just the width they need */
.prose th.num, .prose td.num { width: 1%; white-space: nowrap; padding-left: 18px; }
/* two-column tables keyed by a short value (rubric ratings 0-4): the key column takes only the room it needs */
.prose table.compact:not(.grid) td:first-child, .prose table.compact:not(.grid) th:first-child { width: 1%; min-width: 0; white-space: nowrap; }
/* a small grid (e.g. a game's payoff matrix) stays a grid on phones; its row labels may wrap like any other cell */
.prose table.grid td:first-child, .prose table.grid th:first-child { min-width: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.5; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose thead th { border-bottom: 1.5px solid var(--ink); font-size: 12.5px; letter-spacing: .03em; color: var(--ink-2); }
.prose tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--soft) 55%, transparent); }
.m-table { margin-top: 14px; border: 1px solid var(--rule); border-radius: 12px; padding: 0 14px; background: var(--surface); }
.m-table > summary { font-weight: 600; color: var(--ink); }
.m-table[open] { padding-bottom: 14px; }
.back-row { margin-top: 14px; }
.back-link { display: inline-flex; align-items: center; min-height: 36px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.back-link:hover { color: var(--ink); text-decoration: underline; }
.materials-list { display: grid; gap: 1px; margin: 12px 0; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--rule); }
.materials-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 10px 14px; background: var(--surface); font-size: 14.5px; }
.mat-status { font-size: 13px; color: var(--muted); }
/* R03 references: no bullets, hanging indent, one entry per block */
#references .prose ul { list-style: none; padding-left: 0; }
#references .prose li { padding-left: 1.6em; text-indent: -1.6em; font-size: 14.5px; line-height: 1.6; }
#references .prose li + li { margin-top: 9px; }

/* ---------------------------------------------------------------- about & ratings */
.about .slogan { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.about-story { max-width: 40em; margin: 4px 0 44px; font: 400 19px/1.75 var(--serif); color: var(--ink-2); }
:root[lang="zh-CN"] .about-story { font: 400 17px/1.95 var(--sans); }
.about-story p + p, .about-story p + ul, .about-story ul + p { margin-top: 14px; }
.about-story ul { margin: 12px 0 0; padding-left: 1.3em; list-style: disc; }
.about-story li + li { margin-top: 6px; }
.about-story blockquote { margin: 24px 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--accent); }
.about-story blockquote p { font: 500 25px/1.45 var(--serif); color: var(--ink); }
:root[lang="zh-CN"] .about-story blockquote p { font: 600 21px/1.65 var(--serif); }
.about-story blockquote:last-child { margin-bottom: 0; }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 10px; }
.about-item h2, .about-updates h2 { font: 600 17px/1.35 var(--sans); margin-bottom: 8px; }
.about-item p, .about-updates p { color: var(--ink-2); }
.about-item p + p { margin-top: 10px; }
.contact-email { overflow-wrap: anywhere; }
/* the card's one-line takeaway: same face and size as the explanation, only a little darker and heavier
   (a different face or size in the middle of a card reads as a rendering fault) */
.about-item p.about-lead { color: var(--ink); font-weight: 500; }
.about-grid .about-item { padding: 18px 20px; border-top: 3px solid var(--ink); background: var(--surface); border-radius: 0 0 12px 12px; }
.about-updates, .about > .about-item { margin-top: 36px; }
.timeline li { padding-left: 16px; border-left: 3px solid var(--accent); }
/* earlier results versions: same text, a quieter rule so the current one leads */
.timeline li + li { margin-top: 14px; }
.timeline li.earlier { border-left-color: var(--rule); color: var(--muted); }
.citation { margin-top: 8px; font-family: var(--mono); font-size: 13px; }
.about > .about-item .facts { margin-top: 12px; max-width: 520px; }
.status-card { max-width: 760px; padding: 26px 28px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--soft-2); font-weight: 600; font-size: 14px; }
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.status-card .lead { margin-top: 14px; }
.plain-list { margin-top: 14px; padding-left: 1.2em; list-style: disc; color: var(--ink-2); }
.plain-list li + li { margin-top: 6px; }
/* visitor experiences and questions: one column, the form opening under its button; the rating card stays below */
.ideas { max-width: 760px; margin-bottom: 44px; }
.ideas h2 { font: 500 28px/1.2 var(--serif); letter-spacing: -.01em; }
:root[lang="zh-CN"] .ideas h2 { font-size: 24px; font-weight: 600; letter-spacing: 0; }
.ideas > p { margin-top: 12px; color: var(--ink-2); }
.ideas > p.ideas-question { margin-top: 14px; color: var(--ink); }
.ideas > .actions { margin-top: 20px; }
.ideas-closed { margin-top: 20px; padding: 16px 18px; border-radius: var(--radius); background: var(--soft); color: var(--ink-2); }
.ideas-closed-title { font-weight: 600; color: var(--ink); }
.idea-panel { margin-top: 22px; padding: 24px 26px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); scroll-margin-top: 96px; }
.idea-panel h3 { font: 600 18px/1.35 var(--sans); color: var(--ink); }
.idea-intro { margin-top: 6px; color: var(--ink-2); }
.idea-preview { margin-top: 16px; }
.idea-form { display: grid; gap: 22px; margin-top: 20px; }
.field label { display: block; font-weight: 600; color: var(--ink); }
.field-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--soft-2); font-size: 12px; font-weight: 500; color: var(--ink-2); vertical-align: 1px; }
.field-hint { margin-top: 4px; font-size: 14px; color: var(--muted); }
.field textarea { display: block; width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; line-height: 1.6; resize: vertical; }
.field textarea::placeholder { color: var(--muted); }
.field textarea[aria-invalid="true"] { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.field-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 13px; }
.field-error { font-weight: 600; color: var(--ink); }
.field-count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.idea-notes { font-size: 14px; color: var(--ink-2); }
.idea-submit .btn-pill[disabled] { cursor: not-allowed; opacity: .75; }
/* empty live regions stay in the page (collapsed) so screen readers already know them when text arrives */
.idea-status:empty, .idea-alert:empty { padding: 0; border: 0; margin: 0; }
.idea-status { font-size: 14px; color: var(--ink-2); }
.idea-alert { padding: 10px 12px; border-left: 3px solid var(--warn); border-radius: 8px; background: var(--soft); color: var(--ink); }
.idea-done { margin-top: 18px; }
.idea-done h3:focus { outline: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .site-nav a { padding: 8px 7px; font-size: 13.5px; }
  .theme-toggle [data-theme-text] { display: none; }
}
@media (max-width: 1080px) {
  .home-layout, .methods-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .jump { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 13px; color: var(--muted); }
  .jump select { flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 15px; }
  .m-jump { margin: 18px 0 0; }
  .header-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand tools" "nav nav"; align-items: center; gap: 6px 12px; min-height: 0; padding-top: 10px; }
  .brand { grid-area: brand; min-width: 0; }
  .header-tools { grid-area: tools; }
  .site-nav { grid-area: nav; width: auto; margin: 0 -8px; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { width: max-content; padding: 5px 30px 6px 4px; }   /* the end padding lets the last tab scroll clear of the fade; 4-5px keep focus rings whole */
  .site-nav.is-scrolled { -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 30px), transparent); }
  .controls { top: 104px; }
  html { scroll-padding-top: 128px; }
  .measure { scroll-margin-top: 190px; }
}
@media (max-width: 860px) {
  .legend-key, .demo-values { grid-template-columns: minmax(0, 1fr); }
  .explain-grid { grid-template-columns: minmax(0, 1fr); }
  .axis-head, .row { grid-template-columns: minmax(120px, 150px) minmax(0, 1fr) 64px 150px; column-gap: 12px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  body { font-size: 15.5px; }
  .brand { font-size: 17px; }
  .brand span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
  .tool { padding: 6px 9px; }
  .lang-switch a { padding: 4px 8px; }
  .page-head { padding: 34px 0 20px; }
  .hero { padding: 32px 0 20px; }
  .hero-full { display: none; }
  .hero-short { display: block; }
  .legend > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title chev" "mini mini" "hint hint"; align-items: center; gap: 10px 12px; margin-bottom: 0; cursor: pointer; }
  .legend[open] > summary { margin-bottom: 14px; }
  .legend-head h2 { grid-area: title; }
  .legend-chev { display: block; grid-area: chev; }
  .legend-hint { grid-area: hint; }
  .legend:not([open]) .legend-hint { display: none; }
  .legend:not([open]) .legend-mini { display: flex; grid-area: mini; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
  .hero-intro { font-size: 18px; }
  .controls { margin: 0 -16px; padding: 10px 16px; position: static; }
  .measure { scroll-margin-top: 0; }   /* the controls bar no longer sticks, so no room is kept for it */
  .controls-row { gap: 8px 12px; }
  .ctl { width: 100%; justify-content: space-between; }
  .ctl select { flex: 1; min-width: 0; }
  .ctl-links { margin-left: 0; flex-wrap: wrap; }
  /* a pill whose label is longer than the screen wraps inside the pill instead of widening the page */
  .btn-pill { max-width: 100%; white-space: normal; border-radius: 20px; text-align: center; }
  .measure > summary { grid-template-columns: minmax(0, 1fr) 36px; gap: 12px; padding: 18px 0 14px; }
  .measure > summary .code { display: none; }
  .measure .head { grid-column: 1; grid-row: 1; }
  .chev { grid-column: 2; grid-row: 1; }
  .peek { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .measure .title { font-size: 27px; }
  :root[lang="zh-CN"] .measure .title { font-size: 23px; }
  .measure-body { padding-left: 0; }
  .chart { margin-left: 0; }
  .axis-head, .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "m c" "p p" "r r"; row-gap: 6px; }
  .axis-head { grid-template-areas: "p p"; }
  .axis-head .h-m, .axis-head .h-c, .axis-head .h-r { display: none; }
  .row { padding: 10px 0; }
  .m-prov { display: inline; margin: 0 0 0 6px; }
  .plot { min-height: 30px; margin: 0 8px; }
  .h-plot { margin: 0 8px; }
  .r { grid-auto-flow: column; justify-content: start; gap: 16px; font-size: 12px; }
  .r span { white-space: nowrap; }
  .ticks .minor { display: none; }
  .x-measure .measure-meta, .x-measure .measure-foot, .x-measure .explain, .x-measure .measure-links { margin-left: 0; }
  .x-measure-head { grid-template-columns: minmax(0, 1fr); }
  .x-measure-head .code { padding-top: 0; }
  .gr-example { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 18px 16px; }
  .gr-ways { grid-template-columns: minmax(0, 1fr); }
  .gm-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 18px; }
  .gm-head > span:first-child { display: none; }
  .gm > summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "name hint" "open bin"; gap: 8px 12px; }
  .gm-name { grid-area: name; }
  .gm-cell[data-branch="open_ended"] { grid-area: open; }
  .gm-cell[data-branch="binary"] { grid-area: bin; }
  .gm-more-hint { grid-area: hint; }
  .gm-text { font-size: 13px; }
  .gc-side { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .gc-side + .gc-side { margin-top: 6px; }
  .gc { padding: 12px 12px 6px; }
  .gr-rec thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fm-head { display: none; }
  .fm > summary, .fm-plain { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name hint" "bar count"; gap: 8px 12px; }
  .fm-plain { grid-template-areas: "name name" "bar count"; }
  .fm .gm-name { grid-area: name; }
  .fm .gm-more-hint { grid-area: hint; }
  .fm > summary > .fm-bar, .fm-plain > .fm-bar { grid-area: bar; }
  .fm > summary > .fm-count, .fm-plain > .fm-count { grid-area: count; }
  .fm-text { grid-column: 1 / -1; }
  .fm-type { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name name" "bar count"; gap: 6px 12px; }
  .fm-type-name { grid-area: name; }
  .fm-type .fm-bar { grid-area: bar; }
  .fm-type .fm-count { grid-area: count; }
  .fm-ex-grid { grid-template-columns: minmax(0, 1fr); }
  .gr-rec, .gr-rec tbody, .gr-rec tr, .gr-rec th, .gr-rec td { display: block; width: 100%; }
  .gr-rec tr { padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .gr-rec th, .gr-rec td { padding: 3px 0; border: 0; }
  .gr-rec td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
  .facts > div { flex-basis: 140px; padding: 10px 12px; }
  .prose table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose table.stack, .prose table.stack tbody, .prose table.stack tr, .prose table.stack td { display: block; width: 100%; }
  .prose table.stack tr { padding: 8px 0; border-bottom: 1px solid var(--rule); }
  .prose table.stack td { padding: 3px 0; border: 0; background: none !important; text-align: left !important; } /* overrides Markdown's right-aligned number columns */
  .prose table.stack .cell-label { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.45; color: var(--muted); }
  /* the first cell titles the card on one line, keeping its column name ("Question version BASE", "Gap in days 30") */
  .prose table.stack td:first-child { padding-bottom: 5px; font-weight: 600; color: var(--ink); }
  .prose table.stack td:first-child .cell-label { display: inline; margin-right: 8px; }
  .math-display .katex { font-size: 1.1em; }
  .prose table.grid th, .prose table.grid td { padding: 7px 6px; }
  .dist-table th[scope="row"] { white-space: normal; max-width: 4.6em; line-height: 1.3; text-wrap: balance; }
  .dist-table th, .dist-table td { padding-left: 1px; padding-right: 1px; }
  .dist-table td { min-width: 0; padding-top: 3px; padding-bottom: 3px; }
  .dist-table .bar { width: 11px; }
  .ctl select, .search input, .jump select, .field textarea { font-size: 16px; }   /* below 16px iOS Safari zooms in on focus */
  .footer-row { padding-top: 22px; }
}
@media (max-width: 440px) {
  .brand { gap: 7px; font-size: 15px; }
  .brand-mark { width: 24px; }
  .brand span { max-width: none; }
  .header-tools { gap: 5px; }
  .tool { min-height: 34px; padding: 5px 8px; }
  .lang-switch a { padding: 4px 7px; font-size: 12.5px; }
}
@media (max-width: 360px) {
  .sq-row { gap: 2px; }
  .sq { width: 9px; height: 9px; }
  /* 14px lets the whole name fit on 360px phones; narrower screens wrap it (below) */
  .brand { font-size: 14px; }
  /* the narrowest phones: a long inline calculation may break after = or + (KaTeX's own break points) instead of widening the page */
  .math-inline { white-space: normal; }
}
@media (max-width: 340px) {
  .brand { white-space: normal; line-height: 1.1; }
  .brand span { overflow: visible; text-overflow: clip; }
}

@media (max-height: 600px) and (min-width: 641px) {
  .controls { position: static; }
  .measure { scroll-margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header, .controls { background: var(--paper); }
  .pill-e, .pill-f, .g-code, .type-letter { background: var(--soft-2); }
  .btn-strong:hover { background: var(--ink); }
  .prose tbody tr:nth-child(even) td { background: var(--soft); }
}
@media (forced-colors: active) {
  .g-in, .g-out, .g-out::before, .g-out::after, .mini-i, .mini-o { background: CanvasText; fill: CanvasText; }
  .g-dot { background: Canvas; box-shadow: 0 0 0 2px CanvasText; }
  .row.is-hl { outline: 2px solid Highlight; }
  /* box-shadow rings and tinted backgrounds are dropped in forced colours: use borders and system colours */
  .g-dot, .k-dot { background: Canvas; border: 2px solid CanvasText; box-shadow: none; }
  .k-in, .plot .ref, .ci-zero, .ci-line, .ci-line::before, .ci-line::after, .ci-dot, .dist-table .bar, .abar i, .sq.is-different, .fm-bar > i, .demo-base { background: CanvasText; }
  .is-highlighting .row:not(.is-hl) .g-in, .is-highlighting .row:not(.is-hl) .g-out, .is-highlighting .row:not(.is-hl) .g-out::before, .is-highlighting .row:not(.is-hl) .g-out::after { background: GrayText; }
  .strip, .sq, .abar, .fm-bar { forced-color-adjust: none; border: 1px solid CanvasText; }
  .lang-switch a[aria-current] { outline: 2px solid Highlight; }
}
@media print {
  .site-header, .controls, .toc, .jump, .site-footer, .explain > summary, .demo > summary { display: none !important; }
  .measure:not([open]) .measure-body { display: block; }
  /* the marks are painted as backgrounds: print them even when "background graphics" is off
     (site.js opens folded results before printing and uses the light colours) */
  .g-in, .g-out, .g-out::before, .g-out::after, .g-dot, .plot, .plot .ref, .k-dot, .k-in, .k-out, .k-ci, .k-ci::after, .mini,
  .ci, .ci-zero, .ci-line, .ci-line::before, .ci-line::after, .ci-dot, .dist-table .bar, .strip, .abar, .abar i, .sq, .fm-bar, .fm-bar > i, .demo-base, .type-letter, .g-code {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .row, .x-measure-head, .chart .axis-head, figure, .gc, .gm > summary { break-inside: avoid; }
  .measure > summary, .measure-meta, .axis-head, .x-measure-head, .group-head { break-after: avoid; }   /* a heading never ends a page */
  .chooser { display: none; }
}
