/* mulkiyestat.com: the live activities. The look is the one the instructor chose (design/DESIGN.md, option B):
   black and white, one highlighter yellow, red only for a shared birthday. Light is the default; the projector
   page can switch to dark. Every colour comes from the tokens below. */

@font-face { font-family: "Archivo"; src: url("/assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; src: url("/assets/fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --paper: #ffffff;
  --ink: #000000;
  --ink2: #54565c;
  --line: #d9d9d9;
  --wash: #f2f2f0;
  --hl: #ffe01f;          /* highlighter, hover, the active item; text on it is always black */
  --match: #e5202e;       /* a shared birthday, and the dot that marks what is live */
  --bub: #c9c9c9;         /* outline of an empty bubble */
  --bad: #c4121f;         /* error text */
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side: 248px;
}
:root[data-theme="dark"] {
  --paper: #0e0e0f;
  --ink: #ffffff;
  --ink2: #a9abb1;
  --line: #343437;
  --wash: #1c1c1e;
  --match: #ff4b57;
  --bub: #4a4a4e;
  --bad: #ff6b75;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 500 17px/1.45 var(--font); }
h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--match); outline-offset: 3px; }

.btn { display: inline-block; font: 700 17px/1 var(--font); font-stretch: 108%; padding: 15px 26px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none; text-align: center; }
.btn:disabled { opacity: .35; cursor: default; background: var(--ink); color: var(--paper); }
.btn--block { display: block; width: 100%; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--ghost:disabled { background: transparent; color: var(--ink); }
input[type="range"] { width: 100%; height: 32px; margin: 0; accent-color: var(--ink); }

/* Hover colours only where the pointer can hover: on a phone a tapped button would otherwise stay yellow. */
@media (hover: hover) {
  .btn:hover { background: var(--hl); color: #000; }
  .btn--ghost:hover { background: var(--hl); color: #000; box-shadow: inset 0 0 0 2px #000; }
  .side a:hover { color: #fff; background: #1c1c1e; }
  .side a.is-on:hover { background: var(--hl); color: #000; }
  .row:hover { background: var(--hl); color: #000; }
  .row:hover .row-p { color: #000; }
  .pillbtn:hover { background: var(--hl); color: #000; box-shadow: none; }
  .h-steps button:hover { color: #fff; background: #1c1c1e; }
  .tool:hover { background: var(--hl); border-color: var(--hl); color: #000; }
  .dlg .tool:hover { color: #000; border-color: #000; }
}
.btn:active, .tool:active, .pillbtn:active { transform: translateY(1px); }
.h-steps button[aria-current="step"]:hover { background: var(--hl); color: #000; }

/* The cow is the instructor's own drawing (assets/js/cows.js), shown as an image file (assets/img/icon.svg, on its
   white tile). An image, not live shapes: browsers and extensions that darken pages repaint shapes (the white head
   went dark and the black eyes disappeared on an iPhone) and leave images alone. */
.cowimg { display: block; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 9px; }

/* ───────────────────────── Home and the other pages that are not a running activity ───────────────────────── */
body.hub { padding-left: var(--side); }
body.hub::before { content: ""; position: fixed; inset: 0 auto 0 0; width: var(--side); background: #000; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); overflow-y: auto; background: #000; color: #d9d9d9; font: 500 16px/1.3 var(--font); padding-bottom: 24px; }
:root[data-theme="dark"] .side { box-shadow: inset -1px 0 0 #2c2c2e; }
.side a.side-head { display: block; padding: 22px 18px 14px; }
.side a.side-head:hover { background: none; }
.side-part { margin: 18px 0 6px; padding: 0 18px; font: 600 12.5px/1.3 var(--font); color: #8f9197; }
.side a { display: block; padding: 8px 18px; color: #e4e4e6; text-decoration: none; }
.side a.is-on { background: var(--hl); color: #000; font-weight: 700; }
.side :focus-visible { outline-color: var(--hl); outline-offset: -3px; }

/* The top bar holds what a visitor expects in the top right corner. On a wide screen it carries nothing else. */
.top { position: absolute; inset: 0 0 auto var(--side); display: flex; justify-content: flex-end; align-items: center; height: 64px; padding: 0 clamp(18px, 3.2vw, 56px); }
.top-brand { display: none; line-height: 0; }
.pillbtn { font: 600 14px/1 var(--font); padding: 9px 14px; border-radius: 999px; border: 0; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; }

/* The text sits in the middle of the space to the right of the bar, so the free space is equal on both sides. */
.page { max-width: 860px; margin: 0 auto; padding: 96px clamp(18px, 3.2vw, 56px) 72px; }
.where { margin-bottom: 12px; font-size: 14.5px; font-weight: 600; color: var(--ink2); }
.page h1 { max-width: 20ch; margin-bottom: 18px; font: 740 clamp(38px, 4.4vw, 64px)/1.02 var(--font); font-stretch: 116%; letter-spacing: -0.03em; text-wrap: balance; }
.lede { max-width: 52ch; margin-bottom: 8px; font-size: 19px; line-height: 1.5; color: var(--ink2); }
/* The question of an activity, on the highlighter. */
.question { max-width: 26ch; margin: 2px 0 6px; font: 700 clamp(23px, 2.5vw, 32px)/1.42 var(--font); font-stretch: 104%; letter-spacing: -0.01em; }
.question mark { padding: .1em .3em; background: var(--hl); color: #000; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* A blinking red dot marks what is live (instructor, 2026-10-06). */
.live-dot { display: inline-block; width: .62em; height: .62em; margin-left: .55em; border-radius: 50%; background: var(--match); vertical-align: baseline; animation: live 1.3s ease-in-out infinite; }
.side .live-dot { width: 8px; height: 8px; background: #ff4b57; }
@keyframes live { 0%, 100% { opacity: 1; } 50% { opacity: .12; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.block { margin-top: 44px; padding-top: 20px; border-top: 2px solid var(--ink); }
.block h2 { margin-bottom: 10px; font: 720 24px/1.15 var(--font); font-stretch: 112%; letter-spacing: -0.02em; }
.block-p { max-width: 52ch; margin-bottom: 16px; color: var(--ink2); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 20px; align-items: center; padding: 16px 18px; margin: 0 -18px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.row::after { content: "→"; grid-row: 1 / 3; grid-column: 2; font-size: 26px; font-weight: 600; }
.row-t { font: 700 20px/1.25 var(--font); font-stretch: 106%; }
.row-p { grid-column: 1; font-size: 16px; color: var(--ink2); }
.joinform label { display: block; margin-bottom: 9px; font-size: 14.5px; font-weight: 600; }
.code-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.code-row input { width: 190px; padding: 12px 8px 12px 18px; font: 650 27px/1 var(--font); font-stretch: 112%; letter-spacing: .26em; text-transform: uppercase; color: var(--ink); background: var(--paper); border: 2.5px solid var(--ink); border-radius: 6px; }
.form-err { margin-top: 12px; font-size: 15.5px; font-weight: 600; color: var(--bad); }
.privacy { max-width: 60ch; margin-top: 48px; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.empty { margin-top: 28px; padding: 28px 30px; border-radius: 8px; background: var(--wash); }
.empty-h { margin-bottom: 6px; font: 700 20px/1.25 var(--font); font-stretch: 106%; }
.empty p:last-child { color: var(--ink2); }

@media (max-width: 900px) {
  body.hub { padding-left: 0; }
  body.hub::before, .side { display: none; }
  .top { position: static; justify-content: space-between; height: auto; padding: 14px 18px 0; }
  .top-brand { display: block; }
  .page { padding-top: 26px; padding-bottom: 48px; }
  .block { margin-top: 34px; }
  .code-row input { flex: 1 1 150px; width: auto; min-width: 0; }
  .code-row .btn { flex: 0 0 auto; }
}

/* ───────────────────────── Phone: the three screens of an activity ───────────────────────── */
body.join { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 460px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
.j-top { display: flex; justify-content: space-between; align-items: center; min-height: 36px; margin-bottom: 22px; font-size: 14px; font-weight: 600; color: var(--ink2); font-variant-numeric: tabular-nums; }
.j-top-right { display: inline-flex; gap: 12px; align-items: center; }
.j-note { margin-bottom: 16px; padding: 12px 14px; border-radius: 6px; background: var(--hl); color: #000; font-size: 15.5px; font-weight: 600; }
body.join main { flex: 1; display: flex; flex-direction: column; }
.j-screen { flex: 1; display: flex; flex-direction: column; }
.j-screen h1 { margin-bottom: 10px; font: 720 28px/1.08 var(--font); font-stretch: 112%; letter-spacing: -0.02em; }
.j-sub { margin-bottom: 14px; font-size: 17px; line-height: 1.45; color: var(--ink2); }
.j-wait { margin: auto; font-size: 17px; color: var(--ink2); }
.j-guess { flex: 1; display: grid; place-items: center; min-height: 150px; font: 700 96px/1 var(--font); font-stretch: 112%; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
body.join input[type="range"] { height: 44px; }
.j-scale { display: flex; justify-content: space-between; margin: 0 2px 22px; font-size: 13.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.j-label { margin: 6px 0 8px; font-size: 14.5px; font-weight: 600; }
.j-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.j-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.j-months button, .j-days button { font: 600 16px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--ink); background: transparent; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.j-months button { padding: 14px 0; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--bub); }
/* A fixed height and a free width: seven buttons of 44 px would not fit a 320 px phone. */
.j-days button { height: 44px; min-width: 0; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--bub); font-size: 15px; }
.j-months button[aria-pressed="true"], .j-days button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.j-days button:disabled { visibility: hidden; }
.j-field { display: block; margin-bottom: 18px; }
.j-field span { display: block; margin-bottom: 6px; font-size: 14.5px; font-weight: 600; }
.j-field input { width: 100%; padding: 12px 14px; font: 500 17px var(--font); color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; }
.j-field small { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.4; color: var(--ink2); }
.j-result { flex: 1; margin: 6px 0 16px; padding: 18px 18px; border-radius: 6px; background: var(--wash); font-size: 19px; line-height: 1.4; }
.j-result p { margin-bottom: 8px; }
.j-result .is-match { font-weight: 700; color: var(--match); }
.j-small { font-size: 15px; color: var(--ink2); }
.j-screen > .btn { margin-top: auto; }
.j-screen > .btn + .btn { margin-top: 10px; }

/* ───────────────────────── Projector: the gate ───────────────────────── */
.g-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.g-box { width: min(560px, 100%); }
.g-brand { margin-bottom: 22px; }
.g-brand .cowimg { width: 64px; height: 64px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.g-box h1 { margin-bottom: 10px; font: 740 44px/1.02 var(--font); font-stretch: 116%; letter-spacing: -0.03em; }
.g-sub { margin-bottom: 26px; font-size: 18px; line-height: 1.5; color: var(--ink2); }
.g-box label { display: block; margin-bottom: 8px; font-size: 14.5px; font-weight: 600; }
.g-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.g-row input { flex: 1 1 220px; min-width: 0; padding: 12px 14px; font: 500 18px var(--font); color: var(--ink); background: var(--paper); border: 2.5px solid var(--ink); border-radius: 6px; }
.g-hint { margin-top: 10px; font-size: 14px; color: var(--ink2); }
.g-lang { margin: 0 0 20px; padding: 0; border: 0; display: flex; gap: 8px 22px; flex-wrap: wrap; align-items: center; font-size: 16px; }
.g-lang legend { padding: 0; margin-bottom: 8px; font-size: 14.5px; font-weight: 600; }
.g-lang label { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-size: 17px; font-weight: 500; cursor: pointer; }
.g-lang input { width: 20px; height: 20px; accent-color: var(--ink); }
.g-err { margin-top: 16px; font-weight: 600; color: var(--bad); }

/* ───────────────────────── Projector: the seven steps ───────────────────────── */
.h-app { min-height: 100vh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.h-bar { display: flex; gap: 18px; align-items: center; padding: 10px clamp(16px, 2.2vw, 40px); background: #000; color: #fff; }
.h-brand .cowimg { width: clamp(40px, 3vw, 60px); height: auto; }
.h-steps { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; counter-reset: st; }
.h-steps button { counter-increment: st; padding: 9px 13px; border: 0; border-radius: 999px; background: transparent; color: #b9bbc0; font: 600 clamp(15px, 1.08vw, 22px)/1 var(--font); cursor: pointer; }
.h-steps button::before { content: counter(st) "  "; font-variant-numeric: tabular-nums; opacity: .6; }
.h-steps button[aria-current="step"] { background: var(--hl); color: #000; font-weight: 700; }
.h-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tool { padding: .6em .9em; border-radius: 999px; border: 1.5px solid #5a5b60; background: transparent; color: #e4e4e6; font: 600 clamp(13.5px, .92vw, 19px)/1 var(--font); cursor: pointer; }
.h-bar :focus-visible { outline-color: var(--hl); }
.h-note { padding: 10px clamp(16px, 2.2vw, 40px); background: var(--hl); color: #000; font-weight: 600; }
.h-stage { grid-row: 3; min-height: 0; padding: clamp(18px, 2.4vw, 40px) clamp(20px, 2.8vw, 52px) clamp(12px, 1.6vw, 24px); }
.h-foot { grid-row: 4; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px clamp(20px, 2.8vw, 52px) 18px; }
.h-foot .btn, .st-actions .btn { font-size: clamp(17px, 1.25vw, 25px); padding: .85em 1.5em; }
.h-foot-code { font: 700 clamp(17px, 1.5vw, 24px)/1 var(--font); letter-spacing: .06em; white-space: pre; font-variant-numeric: tabular-nums; color: var(--ink2); }

.st { height: 100%; }
.st-h, .st-q { margin-bottom: clamp(12px, 1.4vw, 22px); font: 740 clamp(28px, 3vw, 54px)/1.04 var(--font); font-stretch: 114%; letter-spacing: -0.028em; text-wrap: balance; }
.st-line { max-width: 62ch; margin-bottom: 14px; font-size: clamp(18px, 1.55vw, 27px); line-height: 1.35; }
.st-line--quiet { color: var(--ink2); font-size: clamp(16px, 1.25vw, 21px); }
.st-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.st-main { min-width: 0; }

.stats { display: grid; gap: clamp(12px, 1.4vw, 22px); margin: 0; }
.stats--row { display: flex; flex-wrap: wrap; gap: 14px clamp(28px, 3.4vw, 64px); margin: 14px 0; }
.stats dt { font-size: clamp(14px, 1.05vw, 18px); color: var(--ink2); }
.stats dd { margin: 3px 0 0; font: 700 clamp(34px, 3.3vw, 58px)/1 var(--font); font-stretch: 110%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats--big dd { font-size: clamp(46px, 5vw, 96px); }
/* The number that carries the step sits on the highlighter. */
.stats .is-key dd { display: inline-block; padding: .04em .16em .06em; margin-left: -.16em; background: var(--hl); color: #000; }

/* Step 1: join card and guesses */
.st-guess { display: grid; grid-template-columns: clamp(250px, 24vw, 430px) minmax(0, 1fr); gap: clamp(24px, 3.4vw, 64px); align-items: start; }
.join-card h2 { margin-bottom: 12px; font: 720 clamp(20px, 1.7vw, 30px)/1.1 var(--font); font-stretch: 112%; letter-spacing: -0.02em; }
.qr { padding: 10px; background: #fff; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); line-height: 0; }
.qr svg { display: block; width: 100%; height: auto; }
.join-or { margin: 14px 0 4px; font-size: clamp(15px, 1.2vw, 21px); color: var(--ink2); overflow-wrap: anywhere; }
.join-code { font: 760 clamp(54px, 6vw, 112px)/1 var(--font); font-stretch: 116%; letter-spacing: .08em; font-variant-numeric: tabular-nums; }

/* The guesses are covered until the host shows them: nobody should guess with the room's answers in view. */
.guess-hold { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: clamp(18px, 2.4vw, 44px); padding: clamp(16px, 1.8vw, 30px); border-radius: 8px; background: var(--wash); }
.guess-hold p { flex: 1 1 16em; font-size: clamp(17px, 1.4vw, 25px); color: var(--ink2); }
.guess-hold .btn { font-size: clamp(17px, 1.25vw, 25px); }

/* Step 2: the wall */
.st-wall { display: grid; grid-template-columns: clamp(190px, 16vw, 290px) minmax(0, 1fr); gap: clamp(22px, 3vw, 56px); align-items: start; }
.wall-side .btn { margin-top: clamp(14px, 1.6vw, 26px); padding: .7em 1.3em; font-size: clamp(15px, 1.05vw, 21px); }
.join-mini { margin-top: clamp(16px, 2vw, 32px); font-size: clamp(14.5px, 1vw, 20px); font-weight: 600; color: var(--ink2); white-space: pre-wrap; }
.qr--mini { width: clamp(96px, 8vw, 140px); margin-bottom: 8px; padding: 6px; border-radius: 8px; }
.year { display: grid; gap: 1px; container-type: inline-size; }
.yrow { display: grid; grid-template-columns: 4.4% repeat(31, minmax(0, 1fr)); align-items: center; }
.ylab { font-size: clamp(11px, 1.35cqw, 20px); font-weight: 600; color: var(--ink2); }
.bub { aspect-ratio: 1; margin: 8%; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.25px var(--bub); font-size: clamp(8px, 1.02cqw, 18px); font-weight: 600; font-stretch: 78%; color: var(--ink2); font-variant-numeric: tabular-nums; }
.bub.none { visibility: hidden; }
.bub.on { background: var(--ink); color: var(--paper); box-shadow: none; }
.bub.hit { position: relative; z-index: 1; background: var(--match); color: #fff; font-weight: 800; font-size: clamp(9px, 1.25cqw, 22px); box-shadow: 0 0 0 2.5px var(--paper), 0 0 0 5.5px var(--hl); }
.bub.mine { outline: 3px solid var(--hl); outline-offset: 2px; }
.bub.pop { animation: pop .42s ease-out; }
@keyframes pop { 0% { transform: scale(.4); } 60% { transform: scale(1.28); } 100% { transform: scale(1); } }
.matches { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; min-height: 44px; margin-top: clamp(14px, 1.6vw, 26px); font-size: clamp(16px, 1.35vw, 24px); }
.matches-h { font-weight: 700; margin-right: 4px; }
.matches-list { display: contents; }
.matches-none { color: var(--ink2); }
.chip { padding: 7px 14px; border-radius: 4px; background: var(--hl); color: #000; overflow: hidden; }   /* a nickname built from stacked accents stays inside its chip */
.chip b { margin-right: 8px; }

/* Step 3: guesses against the truth */
.st-truth { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); gap: 0 clamp(28px, 3.6vw, 70px); align-content: start; }
.st-truth > .st-h, .st-truth > .stats, .st-truth > .st-line, .st-truth > #truthPlot { grid-column: 1; }
/* The plot is 1,000 by 360: its width is held back so that the step fits one screen. */
#truthPlot { max-width: calc((100vh - 450px) * 2.78); }
.contrast { grid-column: 2; grid-row: 1 / -1; align-self: start; padding: clamp(18px, 2vw, 34px); border-radius: 8px; background: var(--wash); }
.contrast h2 { margin-bottom: 8px; font: 720 clamp(20px, 1.8vw, 32px)/1.1 var(--font); font-stretch: 112%; letter-spacing: -0.02em; }
.contrast p { margin-bottom: 8px; font-size: clamp(16px, 1.25vw, 22px); line-height: 1.4; color: var(--ink2); }
.contrast .stats--row { flex-direction: column; gap: 16px; }

/* Step 4: pairs. Step 7: simulation. Text on the left, picture on the right. */
.st-pairs, .st-sim { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 3.4vw, 64px); align-items: start; }
.slider { display: block; max-width: 520px; margin: 10px 0; font-size: clamp(16px, 1.25vw, 21px); font-weight: 600; font-variant-numeric: tabular-nums; }
.formula { margin: 6px 0 12px; font: 600 clamp(18px, 1.6vw, 28px)/1.3 var(--font); font-variant-numeric: tabular-nums; }
#pairsWeb { max-width: min(100%, 68vh); margin: 0 auto; width: 100%; }

/* Step 5: the calculation as a chain of fractions */
.chain { display: flex; flex-wrap: wrap; gap: clamp(8px, 1vw, 18px); align-items: center; min-height: clamp(120px, 12vw, 200px); margin: clamp(10px, 1.4vw, 24px) 0; }
.factor { display: grid; justify-items: center; gap: 6px; padding: clamp(10px, 1vw, 18px) clamp(12px, 1.2vw, 22px); border-radius: 8px; background: var(--wash); }
.factor-who { font-size: clamp(13px, 1vw, 17px); font-weight: 700; }
.frac { display: grid; justify-items: center; font: 700 clamp(22px, 2.2vw, 40px)/1.12 var(--font); font-variant-numeric: tabular-nums; }
.frac > span:first-child { padding: 0 6px 2px; border-bottom: 3px solid var(--ink); }
.factor-why { font-size: clamp(12px, .92vw, 16px); color: var(--ink2); }
.times { font: 600 clamp(20px, 2vw, 36px)/1 var(--font); color: var(--ink2); }

/* Step 6: the curve */
/* The chart is 720 by 320: its width is held back so that heading, chart and footer fit one screen. */
.st-curve #curve { max-width: min(100%, calc((100vh - 21vw - 90px) * 2.25)); }
@media (min-aspect-ratio: 2/1) { .st-curve #curve { max-width: calc((100vh - 330px) * 2.25); } }
.tableview { margin-top: 12px; font-size: 16px; }
.tableview summary { cursor: pointer; font-weight: 600; }

/* ───────────────────────── Charts (assets/js/charts.js) ───────────────────────── */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.chart svg:focus-visible { outline-offset: 6px; }
.ch-grid, .ch-ref { stroke: var(--line); stroke-width: 1; }
.ch-ref { stroke: var(--ink2); }
.ch-text { fill: var(--ink2); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ch-axis-title { font-size: 14px; }
/* The two guess plots are drawn 1,000 units wide, so their text needs larger units to stay readable on the screen. */
#guessPlot .ch-text, #truthPlot .ch-text { font-size: 18px; }
#guessPlot .ch-label, #truthPlot .ch-label { font-size: 21px; }
#truthPlot .ch-label-strong { font-size: 25px; }
.ch-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ch-dot { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.ch-dot--quiet { fill: var(--paper); stroke: var(--ink2); }
.ch-dot--node { stroke-width: 2; }
/* The class's own point: highlighter with an ink ring, on the curve and on the running simulation. */
#curve .ch-dot:not(.ch-dot--quiet), #simChart .ch-dot { fill: var(--hl); stroke: var(--ink); }
.ch-label { fill: var(--ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-label--quiet { fill: var(--ink2); font-size: 13.5px; font-weight: 500; }
.ch-label-strong { font-size: 20px; font-weight: 800; }
.ch-truth { stroke: var(--ink); stroke-width: 3; }
.ch-median { fill: var(--ink2); }
.ch-web line, .ch-web path { stroke: var(--ink); stroke-width: 1; stroke-opacity: .5; fill: none; }
.ch-cross line { stroke: var(--ink2); stroke-width: 1; }
.ch-cross circle { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.ch-hit { fill: transparent; }
.ch-tip { position: absolute; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 6px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.ch-table { border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
.ch-table th, .ch-table td { padding: 6px 18px 6px 0; border-bottom: 1px solid var(--line); text-align: right; }
.ch-table th { border-bottom: 2px solid var(--ink); font-weight: 700; }

/* ───────────────────────── Dialogs on the projector page ───────────────────────── */
.dlg { width: min(640px, calc(100vw - 32px)); max-height: 84vh; padding: 26px; border: 0; border-radius: 10px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.dlg::backdrop { background: rgba(0, 0, 0, .6); }
.dlg h2 { margin-bottom: 14px; font: 720 26px/1.1 var(--font); font-stretch: 112%; }
.dlg > p { margin-bottom: 18px; font-size: 19px; }
.dlg-list { max-height: 56vh; overflow-y: auto; margin-bottom: 18px; }
.dlg-row { display: grid; grid-template-columns: minmax(0, 1fr) 9.5em 4em auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.dlg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dlg .tool { border-color: var(--ink); color: var(--ink); }

@media (max-width: 1000px) {
  .st-guess, .st-wall, .st-pairs, .st-sim, .st-truth { grid-template-columns: minmax(0, 1fr); }
  .st-truth > *, .contrast { grid-column: 1; grid-row: auto; }
  .contrast { margin-top: 18px; }
  .join-card { max-width: 320px; }
  .h-bar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .bub.pop { animation: none; } }
