/* SetCon project page v5 (v7, 20.11.2026: the frame's buttons and back-to-the-top button, phones: small type one step larger,
   44-px targets, the results chart at its own width; the greys of the frame a little darker).
   The frame (frame/frame.css) sets the typeface, the neutrals, the type scale, the head block, the link bar, the top bar,
   the citation and the footer, the same on every project page. This file holds what belongs to SetCon: its accent (the
   violet of the simulated sensors), the data colours of the figures and the layout of its hero and figures. No frames,
   no cards, whitespace and type do the structuring. */

:root {
  --bg: var(--fr-bg); --bg-2: var(--fr-bg-2); --bg-3: var(--fr-bg-3); --spot: #ffffff;
  --ink: var(--fr-ink); --ink-2: var(--fr-ink-2); --ink-3: var(--fr-ink-3); --line: var(--fr-line); --line-2: var(--fr-line-2);
  --sans: var(--fr-sans);
  --accent: #5a48e0; --accent-ink: #4a3bc6; --accent-soft: rgba(90, 72, 224, 0.12); --on-accent: #ffffff; --panel: #ebe9e3; --chip-hover: rgba(23, 23, 28, 0.07); --sel: #e0ddd5; --sel-hover: #d6d3ca;
  --hl-base: #d2d2cc; --hl-psel: #b9b1f0; --hl-anch: #8b8c95; --hl-anch-bg: #e4e4df; --hl-anch-ours: #7a6de3; --hl-anch-base: #a6a69f;
  --studio-1: #ebe9e3; --studio-2: #d8d5cd;
  --watch: #35343a; --pod: #6250d6;
  --ax-x: #eb6834; --ax-y: #1baf7a; --ax-z: #2a78d6;
  --sit: #2458c5; --stand: #c98a12; --back: #c2417b; --side: #1f9e74; --walk: #4b5056; --other: #c9cbc9; --map-rest: #b4b6b4;
  /* "All classes" on the map: the six colours of the paper's Fig. 3 (Okabe-Ito), then wine; validated all-pairs (v6_text/check_palette.mjs) */
  --c1: #0072B2; --c2: #009E73; --c3: #E69F00; --c4: #CC79A7; --c5: #D55E00; --c6: #56B4E9; --c7: #882255; --c8: #332288;
  --right: #1f8a4c; --wrong: #c43d2f;
  --gutter: var(--fr-gutter); --maxw: 1360px; --text: 40rem;
  --ease: var(--fr-ease);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --spot: #24252c;
  --accent: #a79dff; --accent-ink: #b5adff; --accent-soft: rgba(167, 157, 255, 0.16); --on-accent: #121317; --panel: #191a1f; --chip-hover: rgba(236, 236, 234, 0.09); --sel: #24252c; --sel-hover: #2d2e36;
  --hl-base: #44454e; --hl-psel: #6a62a8; --hl-anch: #8e8f98; --hl-anch-bg: #2a2b33; --hl-anch-ours: #9a90f0; --hl-anch-base: #6e6f79;
  --studio-1: #25262c; --studio-2: #121317;
  --watch: #dddbd6; --pod: #a79dff;
  --ax-x: #ff8a5c; --ax-y: #3fd39f; --ax-z: #6ea8ff;
  --sit: #6f9cff; --stand: #e8b84a; --back: #ee7cae; --side: #4fd1a2; --walk: #c4c9ce; --other: #3a3b43; --map-rest: #5c5e68;
  --c7: #8d5586; --c8: #a07cff;
  --right: #4ccf7f; --wrong: #ff7b6b; } }
:root[data-theme="dark"] {
  --spot: #24252c;
  --accent: #a79dff; --accent-ink: #b5adff; --accent-soft: rgba(167, 157, 255, 0.16); --on-accent: #121317; --panel: #191a1f; --chip-hover: rgba(236, 236, 234, 0.09); --sel: #24252c; --sel-hover: #2d2e36;
  --hl-base: #44454e; --hl-psel: #6a62a8; --hl-anch: #8e8f98; --hl-anch-bg: #2a2b33; --hl-anch-ours: #9a90f0; --hl-anch-base: #6e6f79;
  --studio-1: #25262c; --studio-2: #121317;
  --watch: #dddbd6; --pod: #a79dff;
  --ax-x: #ff8a5c; --ax-y: #3fd39f; --ax-z: #6ea8ff;
  --sit: #6f9cff; --stand: #e8b84a; --back: #ee7cae; --side: #4fd1a2; --walk: #c4c9ce; --other: #3a3b43; --map-rest: #5c5e68;
  --c7: #8d5586; --c8: #a07cff;
  --right: #4ccf7f; --wrong: #ff7b6b; }

/* ---------------------------------------------------------------- base (body type: frame.css) */
* { box-sizing: border-box }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100% }
body { overflow-x: hidden }
h1, h2, h3, p, ul, ol, figure { margin: 0 }
ul, ol { padding: 0; list-style: none }
a { color: inherit; text-decoration: none }
button, input, output { font: inherit; color: inherit }
button { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 6px }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px }
[hidden] { display: none !important }
canvas { display: block }
.num { font-variant-numeric: tabular-nums }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)) }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* type: the scale and the section headings come from the frame (.fr-h2, .fr-lead); here only the measures */
.finding { max-width: 30ch }
.deck { font-size: var(--fr-size-lead); line-height: 1.55; color: var(--ink-2); max-width: var(--text) }
.deck b, .deck strong { color: var(--ink); font-weight: 540 }
.small { font-size: 0.875rem; line-height: 1.45; color: var(--ink-2) }
.muted { color: var(--ink-3) }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; isolation: isolate }
.hero-main { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: 0 }
.hero-text { align-self: center; padding: 56px 24px 40px max(var(--gutter), env(safe-area-inset-left)); max-width: 44rem; min-width: 0; display: grid; gap: 26px; position: relative; z-index: 2 }
.tldr { font-size: 0.9375rem; line-height: 1.5; color: var(--ink-2); max-width: 30rem; text-wrap: pretty }
/* the headline result under the head: one bar per model, solid up to the accuracy with class names, hatched up to the
   accuracy with anchors (the values of the paper's abstract and Fig. 1, one setting for all three) */
.headline { display: grid; gap: 7px; max-width: 30rem; margin-top: 2px }
.hl-title { font-size: 0.8125rem; font-weight: 540; color: var(--ink); line-height: 1.4 }
.hl-title span { font-weight: 400; color: var(--ink-3); margin-left: 6px }
.hl-rows { display: grid; gap: 6px }
.hl-row { display: grid; grid-template-columns: 3.8rem minmax(0, 1fr) 2.6rem; gap: 10px; align-items: center; font-size: 0.8125rem; line-height: 1.2; color: var(--ink-2) }
.hl-row.ours { color: var(--ink); font-weight: 540 }
/* one stacked bar per model: the parts of its accuracy, one colour per part across the three bars */
.hl-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden }
.hl-bar i { display: block; height: 100%; min-width: 0; flex: none; font-style: normal; font-weight: 500; font-size: 0.625rem; line-height: 14px; letter-spacing: 0; text-align: center; white-space: nowrap; overflow: hidden; color: var(--ink); font-variant-numeric: tabular-nums }
.hl-bar i + i { margin-left: 1px }
.hp-base, .hl-legend .hp-base { background: var(--hl-base) }
.hp-ours, .hl-legend .hp-ours { background: var(--hl-psel); color: var(--ink) }
/* 19.11.: anchors as a solid, darker shade of the same bar (no hatching, which read as something removed) */
.hp-anch-ours, .hl-legend .hp-anch-ours { background: var(--hl-anch-ours) }
.hp-anch-base, .hl-legend .hp-anch-base { background: var(--hl-anch-base) }
.hl-total { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 400 }
.hl-row.ours .hl-total { font-weight: 620; color: var(--ink) }
.hl-legend { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: 0.75rem; line-height: 1.4; color: var(--ink-2) }
.hl-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap }
.hl-legend i { display: inline-block; width: 12px; height: 9px; border-radius: 2px; flex: none }
.hl-note { font-size: 0.75rem; line-height: 1.45; color: var(--ink-3); text-wrap: pretty }
.hl-legend .hl-note { display: block; flex-basis: 100%; white-space: normal }
.hl-legend span i + i { margin-left: -4px }
/* the stage: the flat studio panel of v4; its foot melts into the figure panel below, which carries the controls, the plots and
   the caption, so the body and its signals are one figure */
.stage { position: relative; min-height: 440px; overflow: hidden; touch-action: pan-y; background: linear-gradient(180deg, transparent 72%, var(--panel) 100%), radial-gradient(75% 70% at 50% 42%, var(--studio-1) 0%, var(--studio-2) 100%) }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.1s var(--ease) }
.stage.ready canvas { opacity: 1 }
.stage .status { position: absolute; left: 24px; bottom: 20px; font-size: 0.875rem; color: var(--ink-2) }   /* v7: ink-2 on the studio (ink-3: 2.8:1) */
.stage .tag { position: absolute; left: 24px; bottom: 18px; font-size: 0.875rem; line-height: 1.45; color: var(--ink-2); text-align: left; max-width: 34rem; opacity: 0; transition: opacity .6s var(--ease) .4s }
.stage.ready .tag { opacity: 1 }
.stage .tag { text-shadow: 0 0 6px var(--studio-1), 0 0 14px var(--studio-1), 0 0 24px var(--studio-1) }
.stage .tag b { color: var(--ink); font-weight: 540; display: block; font-size: 1rem }
.stage .tag q { quotes: "“" "”"; color: var(--ink) }
.stage .tag small { display: block; font-size: 0.75rem; color: var(--ink-3); margin-top: 2px }
.viewctl { position: absolute; right: 24px; top: 20px; z-index: 3; display: flex; gap: 14px; align-items: center }
.viewctl .tabs button { font-size: 0.875rem; padding: 4px 0 }
.autoBtn { font-size: 0.8125rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: var(--line) }
.autoBtn:hover { color: var(--ink) }
.hint { position: absolute; right: 24px; top: 22px; font-size: 0.8125rem; color: var(--ink-2); opacity: 0; transition: opacity .6s var(--ease) 1.2s; pointer-events: none }
.stage.ready .hint { opacity: 1 }
.stage.touched .hint { opacity: 0; transition-delay: 0s }
.stage.switching canvas { opacity: 0.15; transition-duration: .25s }

/* the figure panel: toolbar (activity, body part, side, wearings) between the body and the plots, the plots, the legend, the caption */
.strip-band { background: var(--panel) }
.strip { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "ctl" "fan" "legend"; gap: 18px 0; align-items: start; padding-top: 14px; padding-bottom: 32px }
/* v8 (20.11.): the control block is one row: two menus in the look of the map's dataset menu (.dsel), then the figure's one line,
   "Same movement, 12 mountings", as the label of the mountings slider. The menus sit on the panel, so their fill is one step
   off the panel (--sel), as the dataset menu's fill is one step off the page */
.ctl { grid-area: ctl; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 40px }
.menus { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px }
.strip .dsel select { background: var(--sel) }
.strip .dsel select:hover { background: var(--sel-hover) }
.wearing { display: flex; align-items: center; gap: 16px }
.pay { font-size: 1.0625rem; font-weight: 540; letter-spacing: -0.01em; line-height: 1.3; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 15.1em; cursor: default }   /* the widest line ("one mounting") fits: the slider stays put */
.wearing input[type="range"] { width: 12rem }
.tabs { display: flex; flex-wrap: wrap; gap: 2px 20px }
.tabs button { position: relative; padding: 6px 0; font-size: 0.9375rem; color: var(--ink-2); border-radius: 2px; transition: color .2s; letter-spacing: -0.005em }
.tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease) }
.tabs button:hover { color: var(--ink) }
.tabs button[aria-pressed="true"] { color: var(--ink); font-weight: 540 }
.tabs button[aria-pressed="true"]::after { transform: scaleX(1) }
.figcap { grid-area: cap; max-width: 60rem; margin-top: 0 }
.abs { max-width: 46rem; font-size: 1.0625rem; line-height: 1.6 }
.sec#abstract { padding-top: clamp(56px, 7vw, 96px) }
.strip-head .finding { max-width: 40ch; font-size: clamp(1.5rem, 1rem + 1.3vw, 2.125rem) }
.legend { grid-area: legend; display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: baseline; font-size: 0.8125rem; color: var(--ink-2); margin-top: -8px }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 8px; border-radius: 2px }
.legend .sw-line { background: var(--ink); height: 2px }
.legend .sw-thin { background: var(--ink-3); opacity: .6; height: 1px }
.legend .lg-title { color: var(--ink) }
/* laptops: shorter plots, so the body and the plots share more of one 800-px screen */
@media (min-width: 761px) and (max-height: 860px) { .fan-canvas { height: 288px } .fan-canvas.ref { height: 160px } }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; --p: 48%; cursor: pointer }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--p), var(--line) var(--p)) }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line) }
input[type="range"]::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--accent) }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); margin-top: -9.5px; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .12s }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.18) }
input[type="range"]:hover::-webkit-slider-thumb, input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12) }
/* panel b: three canvases that share the clock and the wearings: the device channels, the canonicalised channels, the reference */
.fan { grid-area: fan; position: relative }
.fan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "hdev henc henc" "cdev cenc cref"; gap: 6px 22px; align-items: start }
.fan-h { font-size: 1rem; font-weight: 540; letter-spacing: -0.01em; line-height: 1.3; padding-left: 34px }   /* v8: one short heading, no second line */
.fan-h.hdev { grid-area: hdev } .fan-h.henc { grid-area: henc }
.fan-canvas { position: relative; height: 336px }
.fan-canvas.cdev { grid-area: cdev } .fan-canvas.cenc { grid-area: cenc }
.fan-ref { grid-area: cref; display: grid; gap: 10px; align-content: start }
.fan-canvas.ref { height: 184px }
.fan canvas { position: absolute; inset: 0; width: 100%; height: 100% }
.fan-ref .switch { margin-left: 58px }
#encNote { padding-left: 58px; text-wrap: pretty }
.switch.sm { font-size: 0.875rem }
.switch.sm i { width: 30px; height: 17px } .switch.sm i::after { width: 11px; height: 11px } .switch.sm input:checked + i::after { left: 16px }
.down { font-size: 0.875rem; color: var(--accent-ink); display: inline-flex; align-items: center; gap: 8px; width: fit-content; margin-top: 10px }
.down::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); flex: none }
.down:hover { text-decoration: underline; text-underline-offset: 0.18em }
@keyframes cue { 0% { transform: translateY(0) } 60%, 100% { transform: translateY(60px) } }

/* entrance: one orchestrated moment on load */
.hero-text > * { animation: rise .8s var(--ease) both }
.hero-text > :nth-child(2) { animation-delay: .1s } .hero-text > :nth-child(3) { animation-delay: .2s }
.strip { animation: rise .8s var(--ease) .35s both }
@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* the BibTeX links land on the box below the section heading */
#cite, #abstract, #method, #results { scroll-margin-top: 64px }

/* ---------------------------------------------------------------- sections */
.sec { padding: clamp(72px, 10vw, 140px) 0 0 }
.sec > .wrap > header { display: grid; gap: 18px; margin-bottom: clamp(28px, 4vw, 48px) }
.sec .fig { position: relative }
.caption { font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); max-width: 46rem; margin-top: 16px }
.caption b { color: var(--ink); font-weight: 540 }
.caption { font-variant-numeric: tabular-nums }
.note { font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); max-width: 46rem }

/* legend chips used in several figures */
.key { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.875rem; color: var(--ink-2); align-items: center }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: -1px }
.key i.bar { width: 14px; height: 3px; border-radius: 2px; vertical-align: 2px }
.key i.ring { background: none; border: 2px solid var(--watch); width: 8px; height: 8px }
.key .n { color: var(--ink-3); margin-left: 5px; font-variant-numeric: tabular-nums }

/* §1 the posture figure: (a) and (b) are drawings around the page's MHR character, (c) one 3 x 3 table per model */
.finding.wide { max-width: 40ch }
.post { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 32px 48px; align-items: start }
.post > * { min-width: 0 }
.post-h { font-size: 1rem; font-weight: 540; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 10px; text-wrap: balance }
.post-h b { font-weight: 600; margin-right: 7px }
.post-sub { font-size: 0.8125rem; line-height: 1.45; color: var(--ink-3); margin-bottom: 14px; text-wrap: pretty }
.post-svg { width: 100%; height: auto; display: block; font-family: var(--sans); overflow: visible; max-width: 380px }
.post-svg .t { font-size: 12px; fill: var(--ink); font-weight: 450; letter-spacing: -0.005em }
.post-svg .t.b { font-weight: 600 } .post-svg .t.m { fill: var(--ink-2) } .post-svg .t.q { font-size: 13.5px; font-weight: 600 } .post-svg .t.a { fill: var(--accent-ink) }
.post-svg image.da { display: none }
:root[data-theme="dark"] .post-svg image.li { display: none } :root[data-theme="dark"] .post-svg image.da { display: inline }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .post-svg image.li { display: none } :root:not([data-theme="light"]) .post-svg image.da { display: inline } }
.cm-grid { display: flex; flex-wrap: wrap; gap: 18px 14px; align-items: flex-start }
.cm { display: grid; gap: 6px; justify-items: center }
.cm h4 { font-size: 0.875rem; font-weight: 540; letter-spacing: -0.01em; line-height: 1.3; margin: 0; min-height: 2.6em; text-align: center; align-self: end; text-wrap: balance }
.cm h4 span { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.8125rem }
.cm.own h4, .cm.own h4 span { color: var(--accent-ink) }
.cmt { border-collapse: separate; border-spacing: 2px; font-variant-numeric: tabular-nums; font-size: 0.8125rem }
.cmt th { font-weight: 400; color: var(--ink-3); font-size: 0.75rem; padding: 0 2px 3px; text-align: center; white-space: nowrap }
.cmt th[scope="row"] { text-align: right; padding: 0 6px 0 0; color: var(--ink-2) }
.cm:not(.rl) th[scope="row"], .cm:not(.rl) .corner { display: none }
.cmt td { width: 31px; height: 29px; text-align: center; border-radius: 3px; color: var(--ink); font-weight: 500 }
.cmt td.hi { color: var(--bg) }
/* 19.11.: the correct cells (diagonal) are framed; under every table the same number, the mean of the diagonal */
.cmt td.dg { box-shadow: inset 0 0 0 1.5px var(--ink-2) }
.cm.own .cmt td.dg { box-shadow: inset 0 0 0 2px var(--accent) }
.cm .acc { text-align: center; font-size: 1.0625rem; font-weight: 540; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px }
.cm .acc span { display: block; font-size: 0.75rem; font-weight: 400; color: var(--ink-3); margin-top: 1px }
.cm.own .acc { color: var(--accent-ink) }
#cmsAcc { margin: 12px 0 0 }

/* §2 three panels */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1.22fr) 36px minmax(0, 1fr); gap: 0 8px; align-items: stretch }
.panel { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; min-width: 0 }
.panel h3 { font-size: 1rem; font-weight: 540; letter-spacing: -0.01em; line-height: 1.3; padding-left: 2px }
.panel h3 span { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.875rem }
.panel .pc { position: relative; min-height: 460px; background: var(--bg-2); border-radius: 10px; overflow: hidden }
.panel .pc canvas { position: absolute; inset: 0; width: 100%; height: 100% }
.panel .pc.emb canvas { cursor: crosshair }
.arrow { display: grid; place-items: center; color: var(--ink-3); padding-top: 52px }
.arrow svg { width: 22px; height: 22px }
.flow-note { margin-top: 18px; font-size: 0.9375rem; line-height: 1.5; color: var(--ink-2); max-width: 60rem; min-height: 3em }
.flow-note b { color: var(--ink); font-weight: 540 }
/* §2 the paper's method figure: large inline (pannable on the phone), and a lightbox at 2,000 px for the small labels */
.method { display: grid; gap: 10px }
.method-pan { overflow-x: auto; overscroll-behavior-x: contain; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line-2); -webkit-overflow-scrolling: touch }
.method-img { display: block; width: 100%; padding: 0; border-radius: 10px; cursor: zoom-in; background: #fff; text-align: left }
.method-img picture, .method-img img { display: block; width: 100%; height: auto }
.method-img img { padding: 12px 14px; box-sizing: border-box }
.method-tools { display: flex; align-items: center; gap: 16px; font-size: 0.875rem; margin-top: 2px }
.enlarge { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: var(--line) }
.enlarge:hover { text-decoration-color: currentColor }
.pan-hint { display: none }
:root[data-theme="dark"] .method-pan { box-shadow: 0 0 0 1px var(--line) }
.lightbox { border: 0; padding: 0; margin: auto; background: #fff; color: #17171c; border-radius: 12px; max-width: min(96vw, 2060px); max-height: 92vh; overflow: hidden; box-shadow: 0 24px 70px rgba(0, 0, 0, .4) }
.lightbox::backdrop { background: rgba(8, 8, 12, .62) }
.lb-scroll { overflow: auto; max-width: 96vw; max-height: 92vh; padding: 22px 24px 28px; box-sizing: border-box; overscroll-behavior: contain }
.lb-scroll picture, .lb-scroll img { display: block; width: 2000px; max-width: none; height: auto }
.lb-close { position: absolute; right: 14px; top: 12px; padding: 6px 12px; font-size: 0.8125rem; border-radius: 999px; background: #f6f6f3; color: #585962; box-shadow: 0 0 0 1px #d9d9d4 }
.lb-close:hover { color: #17171c }
.disc { margin-top: 28px; max-width: 100% }
.disc summary { cursor: pointer; font-size: 0.9375rem; color: var(--ink-2); width: fit-content; padding: 6px 0; list-style: none; display: inline-flex; align-items: center; gap: 10px }
.disc summary::-webkit-details-marker { display: none }
.disc summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s; flex: none }
.disc[open] summary::before { transform: rotate(45deg) }
.disc summary:hover { color: var(--ink) }
.disc > :not(summary) { margin-top: 16px }
.sub-h { font-size: 1.125rem; font-weight: 540; letter-spacing: -0.012em; line-height: 1.3 }

/* §3 the map */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-bottom: 20px }
.controls .spacer { flex: 1 1 auto }
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-2); isolation: isolate }
.seg .ind { position: absolute; top: 3px; bottom: 3px; left: 3px; width: 0; border-radius: 999px; background: var(--ink); transition: left .32s var(--ease), width .32s var(--ease); z-index: 0 }
.seg button { position: relative; z-index: 1; padding: 11px 24px; border-radius: 999px; font-size: 1.0625rem; font-weight: 540; color: var(--ink-2); transition: color .2s; letter-spacing: -0.01em }
.seg button:hover { color: var(--ink) }
.seg button[aria-pressed="true"] { color: var(--bg) }
.seg.sm button { padding: 7px 14px; font-size: 0.875rem; font-weight: 500 }
.seg .lbl-s { display: none }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 0.9375rem; color: var(--ink-2); transition: opacity .2s }
.switch i { width: 36px; height: 20px; border-radius: 10px; background: var(--bg-3); position: relative; transition: background .2s; flex: none }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .2s var(--ease) }
.switch input { position: absolute; opacity: 0; width: 0; height: 0 }
.switch input:checked + i { background: var(--accent) }
.switch input:checked + i::after { left: 19px }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 3px }
.switch.off { opacity: 0; pointer-events: none }
.map-wrap { position: relative; min-height: 560px; background: var(--bg-2); border-radius: 12px; overflow: hidden }
.map-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100% }
.map-wrap #mapLoad { position: absolute; left: 18px; bottom: 14px; font-size: 0.875rem }
.map-wrap .corner { position: absolute; left: 18px; top: 14px; font-size: 0.875rem; color: var(--ink-2); pointer-events: none }
.map-wrap .corner b { color: var(--ink); font-weight: 540 }
/* v6: the dataset menu, the classes switch, the legend, the class list, the dot label */
.mapsel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px }
.dsel { display: inline-flex; align-items: center; gap: 10px; font-size: 0.875rem; color: var(--ink-3) }
.dsel-box { position: relative; display: inline-flex }
.dsel-box::after { content: ""; position: absolute; right: 16px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(45deg); pointer-events: none }
.dsel select { appearance: none; -webkit-appearance: none; border: 0; margin: 0; font: inherit; font-size: 0.875rem; font-weight: 500; color: var(--ink); background: var(--bg-2); border-radius: 999px; padding: 10px 38px 10px 16px; cursor: pointer; line-height: 1.25 }
.dsel select:hover { background: var(--bg-3) }
.dsel select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.dsel option { color: var(--fr-ink); background: var(--fr-bg) }
.seg button:disabled { opacity: 0.4; cursor: default }
/* 19.11.: auto-cycle indicator, a thin line in the active model button that fills until the next model */
.seg .cyc { position: absolute; bottom: 7px; height: 2px; border-radius: 1px; background: var(--bg); opacity: 0; transform-origin: left center; transform: scaleX(0); z-index: 2; pointer-events: none }
.seg button:disabled:hover { color: var(--ink-2) }
#map, #mapFade, .map-key, .map-cls { transition: opacity .28s var(--ease) }
#mapFade { opacity: 0; pointer-events: none }
/* "All classes": the map on a dark field, so that the many class colours stand out (the legend, tip and reset inside the field follow) */
.map-wrap { transition: background-color .28s var(--ease) }
.map-wrap.allc { --bg-2: #202127; --bg: #2e2f36; --ink: #f2f2f4; --ink-2: rgba(255, 255, 255, 0.74); --ink-3: rgba(255, 255, 255, 0.5); --line: rgba(255, 255, 255, 0.2); --line-2: rgba(255, 255, 255, 0.36) }
/* the reset of the pinned classes: shown only while classes are pinned */
.map-clear { position: absolute; z-index: 3; right: 14px; bottom: 12px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink-2); font: inherit; font-size: 0.8125rem; line-height: 1.3; cursor: pointer; transition: color .2s, border-color .2s }
.map-clear:hover { color: var(--ink); border-color: var(--line-2) }
.map-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.map-clear[hidden] { display: none }
.map-tip { position: absolute; left: 0; top: 0; z-index: 3; padding: 4px 9px; border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 0.8125rem; line-height: 1.3; white-space: nowrap; pointer-events: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .14) }
/* the legend: in the head band of the map, opposite the model's name (one line, above the dots); on a phone under the map */
.map-wrap .map-key { position: absolute; z-index: 2; top: 14px; right: 18px; left: 190px; justify-content: flex-end; gap: 4px 20px }
.map-key .ki, .map-cls .ki { display: inline-flex; align-items: center; padding: 0; border-radius: 4px; color: inherit; font-size: inherit; text-align: left; transition: opacity .2s, color .2s }
.map-key .ki i, .map-cls .ki i { flex: none }
.map-key.hl .ki:not(.on), .map-cls.hl .ki:not(.on) { opacity: 0.42 }
.map-key .ki.on, .map-cls .ki.on { color: var(--ink) }
/* with group colours: the class names of each group under the map */
.map-cls { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 26px; align-items: baseline; margin-top: 16px }
.map-cls .kg { display: contents }
.map-cls .kgh { color: var(--ink) }
.map-cls .kcs { display: flex; flex-wrap: wrap; gap: 2px 18px }
.map-cls .kc { color: var(--ink-2) }
.map-cls .kc i { width: 9px; height: 9px; margin-right: 6px; vertical-align: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28) }

.side { display: grid; gap: 22px; align-content: start; padding-top: 6px; font-size: 0.9375rem; color: var(--ink-2) }
.side .verdict { font-size: 1.25rem; line-height: 1.3; color: var(--ink); letter-spacing: -0.012em }
.side .verdict .r { color: var(--right) } .side .verdict .w { color: var(--wrong) }
.side .verdict small { display: block; font-size: 0.875rem; color: var(--ink-3); margin-top: 6px; letter-spacing: 0 }
.side ol { display: grid; gap: 6px }
.side ol li { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--line-2); padding-bottom: 6px }
.side ol b { color: var(--ink); font-weight: 500 }
.side ol .c { font-variant-numeric: tabular-nums; color: var(--ink-3) }
.side .keyline { display: grid; gap: 7px }
.side .keyline div { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 9px }
.side .keyline i { width: 10px; height: 10px; border-radius: 50% }
.side .keyline .n { color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right }
.side .keyline .a { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; min-width: 3.4em }
.side .keyline .kh { color: var(--ink-3); font-size: 0.8125rem; padding-bottom: 4px; border-bottom: 1px solid var(--line-2) }
.side .keyline .kh .a { color: var(--ink-3) }
.postline { margin-top: 20px; font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2); max-width: 60rem }
.postline b { color: var(--ink); font-weight: 540; font-variant-numeric: tabular-nums }

/* §4 results */
.results { display: grid; gap: 8px; max-width: 46rem }
.tbl-disc { margin-top: 8px }
.chart svg { width: 100%; height: auto; display: block; font-family: var(--sans); overflow: visible }
.chart .lab { font-size: 15px; fill: var(--ink); font-weight: 500 }
.chart .sub { font-size: 13px; fill: var(--ink-2) }
.chart .tick { font-size: 12px; fill: var(--ink-3); text-anchor: middle; font-variant-numeric: tabular-nums }
.chart .val { font-size: 13px; fill: var(--ink); font-variant-numeric: tabular-nums; font-weight: 540 }
.chart .val.a { fill: var(--accent-ink) }
.chart line.grid { stroke: var(--line-2) }
.chart line.link { stroke: var(--line); stroke-width: 2 }
.chart line.base { stroke: var(--line) }
.chart .row:hover line.link { stroke: var(--ink-3) }
.chart .ours .lab { font-weight: 600 }
.chart .leg { font-size: 13px; fill: var(--ink-2) }
/* v7: phones, the chart at its own width (app.js), each label above its dumbbell; a halo keeps the labels clear of the grid */
.chart.compact .lab, .chart.compact .sub { paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round }
.chart.compact .sub { font-size: 13.5px }
.chart.compact .tick { font-size: 13px }
.chart.compact .val, .chart.compact .leg { font-size: 14px }
.tbl { font-size: 0.9375rem; font-variant-numeric: tabular-nums; width: 100%; border-collapse: collapse }
.tbl th, .tbl td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line-2); vertical-align: baseline; font-weight: 400 }
.tbl th { color: var(--ink-3); font-size: 0.8125rem; padding-bottom: 7px }
.tbl td.n, .tbl th.n { text-align: right; padding-right: 0; padding-left: 14px }
.tbl tr.ours td { color: var(--ink); font-weight: 540 }
.tbl tr.sub td { color: var(--ink-2); padding-left: 14px }
.tbl td.m { color: var(--ink-2) }
.tbl caption { caption-side: bottom; text-align: left; padding-top: 12px; font-size: 0.875rem; line-height: 1.5; color: var(--ink-2) }


/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .hero-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) }
  .strip { gap: 16px 32px }
  .post { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: "a b" "c c" }
  .post-a { grid-area: a } .post-b { grid-area: b } .post-c { grid-area: c }
  .flow { grid-template-columns: 1fr; gap: 28px }
  .arrow { padding: 0; height: 24px }
  .arrow svg { transform: rotate(90deg) }
  .panel .pc { min-height: 400px }
  .map-wrap { min-height: 460px }
}
@media (max-width: 760px) {
  .hero { min-height: 0 }
  .hero-main { grid-template-columns: 1fr }
  .hero-text { padding: 40px max(16px, env(safe-area-inset-right)) 26px max(16px, env(safe-area-inset-left)); gap: 22px; max-width: none }
  .stage { min-height: 0; height: min(60svh, 460px) }
  .stage .tag { right: 16px; left: 16px; text-align: left; max-width: none; bottom: 12px; font-size: 0.8125rem }
  .viewctl { right: 12px; top: 10px }
  .tabs.side { margin-left: 0; padding-left: 0; border-left: 0 }
  .hint { display: none }
  .strip { grid-template-columns: 1fr; grid-template-areas: "ctl" "fan" "legend"; gap: 16px 0; padding-top: 16px; padding-bottom: 24px }
  /* v8: the two menus one under the other (the activity names differ a lot in length, so nothing moves when one is chosen),
     then the line and its slider over the full width; 44-px targets as on the map */
  .ctl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 0 }
  .menus { display: grid; grid-template-columns: minmax(0, max-content); gap: 8px }   /* both menus as wide as the wider one */
  .menus .dsel, .menus .dsel-box, .menus select { width: 100%; max-width: 100% }
  .wearing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 }
  .wearing input[type="range"] { width: 100% }
  .tabs { gap: 0 18px }
  .tabs button { font-size: 0.9375rem }
  .legend { margin-top: 0; gap: 4px 18px }
  .fan-grid { grid-template-columns: 1fr; grid-template-areas: "hdev" "cdev" "henc" "cenc" "cref"; gap: 8px 0 }
  .fan-h { min-height: 0; margin-top: 4px }
  .fan-h.henc { margin-top: 18px }
  .fan-canvas { height: 300px }
  .fan-canvas.ref { height: 166px }
  .sec > .wrap > header { gap: 14px }
  .post { grid-template-columns: 1fr; grid-template-areas: "a" "b" "c"; gap: 36px }
  .post-svg { max-width: 420px }
  .cm-grid { gap: 16px 14px }
  .method-pan { margin-left: calc(-1 * max(var(--gutter), env(safe-area-inset-left))); margin-right: calc(-1 * max(var(--gutter), env(safe-area-inset-right))); border-radius: 0; box-shadow: none; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2) }
  .method-img { width: max-content; border-radius: 0; cursor: default }
  .method-img picture, .method-img img { width: 960px }
  .method-img img { padding: 10px 16px }
  .pan-hint { display: inline }
  .lb-scroll picture, .lb-scroll img { width: 1500px }
  .lb-scroll { padding: 44px 12px 20px }
  .panel .pc { min-height: 340px }
  .map-wrap { min-height: 300px }
  .map-wrap .corner { left: 12px; top: 10px }
  .seg button { padding: 10px 12px; font-size: 0.875rem }
  .seg .lbl-l { display: none } .seg .lbl-s { display: inline }
  .controls { gap: 12px 18px }
  .controls .spacer { display: none }
  .map-key { margin-top: 12px; gap: 0 18px }
  .map-key.gm { display: none }
  .map-key .ki, .map-cls .ki { padding: 6px 0 }
  .map-cls { grid-template-columns: 1fr; gap: 0; margin-top: 10px }
  .map-cls .kg + .kg .kgh { margin-top: 6px }
  .dsel-lab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
  /* v7: 44-px targets (the look stays: only the tappable height grows) */
  input[type="range"] { height: 44px }
  .enlarge { display: inline-flex; align-items: center; min-height: 44px }
  .seg button { padding: 11px 12px }
  .seg.sm button { padding: 11px 14px }
  .dsel select { padding-top: 13px; padding-bottom: 13px }
  .disc summary { min-height: 44px }
  .switch { min-height: 44px }
  .map-key .ki, .map-cls .ki { min-height: 44px; padding: 0 }
  .lb-close { min-height: 44px; padding: 0 16px }
}

/* v7, phones: the small type of the figures one step larger (13 -> 14 px, 12 -> 13 px, 14 -> 15 px), the desktop keeps v6 */
@media (max-width: 520px) {
  .tldr { font-size: 1rem }
  .hl-title, .hl-row { font-size: 0.875rem }
  .hl-legend { font-size: 0.8125rem }
  .hl-bar { height: 16px }
  .hl-bar i { font-size: 0.6875rem; line-height: 16px }
  .legend { font-size: 0.875rem }
  .stage .tag { font-size: 0.875rem }
  .post-sub { font-size: 0.875rem }
  .cm h4 { font-size: 0.9375rem }
  .cm h4 span { font-size: 0.875rem }
  .cmt th { font-size: 0.8125rem }
  .cm .acc span { font-size: 0.8125rem }
  .caption, .note, .key, .method-tools, .map-wrap .corner, .tbl caption, .switch.sm { font-size: 0.9375rem }
  .map-tip { font-size: 0.875rem }
  .tbl th { font-size: 0.875rem }
  .dsel select { font-size: 0.9375rem }
}

@media (max-width: 480px) {
  .cm-grid { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 22px 14px }
  .cm:nth-child(3) th[scope="row"], .cm:nth-child(3) .corner { display: table-cell }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  .hero-text > *, .strip { animation: none }
  .stage canvas, .stage .tag, .hint, .seg .ind, .switch i, .switch i::after { transition: none }
}
