/* Design tokens for the site. Light values on bare :root, dark values in the two blocks below.
   The two dark blocks must stay identical. Component rules use tokens only. See design/README.md. */
:root {
  /* Surfaces: the cloth the table is laid with, the cards set on it, and a tray cut into a card */
  --paper: #ebe6dc;
  --card: #faf8f3;
  --inset: #e0d9cc;
  /* Text: iron-gall ink, and a softer ink for secondary lines */
  --ink: #2a241e;
  --ink-soft: #625a50;
  /* Rules: the ruled line on a recipe card, and the heavier rule under a heading */
  --rule: #cdc4b4;
  --rule-strong: #8f8270;
  /* One accent: walnut. Buttons, selected tabs and chips, focus rings */
  --accent: #6b4a2b;
  --accent-ink: #faf8f3;
  /* Say this: green, like a check mark in the margin */
  --say-paper: #e3eedb;
  --say-ink: #22491f;
  --say-rule: #9dbd8f;
  /* Avoid this: red, like a correction in the margin */
  --avoid-paper: #f6e3de;
  --avoid-ink: #7a2518;
  --avoid-rule: #d9a69a;
  /* Type: Libre Caslon for headings (hymnal, almanac), Source Sans for everything read at length */
  --font-display: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --font-text: "Source Sans 3", "Segoe UI", Roboto, system-ui, sans-serif;
  --fs-label: 12px;
  --fs-small: 14px;
  --fs-body: 16px;
  --fs-lead: 18px;
  --fs-h3: 20px;
  --fs-h2: 24px;
  --fs-h1: 30px;
  --lh-tight: 1.2;
  --lh-body: 1.375;
  --track-label: 0.07em;
  /* Space: a 4px grid */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --measure: 46rem;
  --control-h: 44px;
  /* Corners: paper is nearly square, a control is barely softened, a chip is a pill */
  --r-paper: 3px;
  --r-control: 5px;
  --r-pill: 999px;
  /* Shadow: only the sheet that lifts off the table gets one */
  --shadow-sheet: 0 6px 24px rgba(42, 36, 30, 0.18);
  --rule-double: 3px double var(--rule-strong);
  /* Seasonal layer: Thanksgiving. Only the table runner under the masthead uses these.
     December swaps these values (and the two seasonal lines in the markup) and nothing else. */
  --season-1: #b35b2a;
  --season-2: #c99a3d;
  --season-3: #6f7a3e;
  --season-4: #86392d;
  --season-runner: repeating-linear-gradient(90deg, var(--season-1) 0 28px, var(--season-2) 28px 36px, var(--season-3) 36px 64px, var(--season-2) 64px 72px, var(--season-4) 72px 100px, var(--season-2) 100px 108px);
  --season-runner-h: 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #211c17;
  --card: #2c2620;
  --inset: #3a322a;
  --ink: #ece4d6;
  --ink-soft: #b5a995;
  --rule: #4c4238;
  --rule-strong: #8a7a66;
  --accent: #d6b483;
  --accent-ink: #211c17;
  --say-paper: #213621;
  --say-ink: #c4e2b7;
  --say-rule: #4b7343;
  --avoid-paper: #41211b;
  --avoid-ink: #f1c3b7;
  --avoid-rule: #7e3f33;
  --font-display: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --font-text: "Source Sans 3", "Segoe UI", Roboto, system-ui, sans-serif;
  --fs-label: 12px;
  --fs-small: 14px;
  --fs-body: 16px;
  --fs-lead: 18px;
  --fs-h3: 20px;
  --fs-h2: 24px;
  --fs-h1: 30px;
  --lh-tight: 1.2;
  --lh-body: 1.375;
  --track-label: 0.07em;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --measure: 46rem;
  --control-h: 44px;
  --r-paper: 3px;
  --r-control: 5px;
  --r-pill: 999px;
  --shadow-sheet: 0 6px 24px rgba(0, 0, 0, 0.5);
  --rule-double: 3px double var(--rule-strong);
  --season-1: #9e522a;
  --season-2: #b08738;
  --season-3: #636d3a;
  --season-4: #78362c;
  --season-runner: repeating-linear-gradient(90deg, var(--season-1) 0 28px, var(--season-2) 28px 36px, var(--season-3) 36px 64px, var(--season-2) 64px 72px, var(--season-4) 72px 100px, var(--season-2) 100px 108px);
  --season-runner-h: 6px;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --paper: #211c17;
  --card: #2c2620;
  --inset: #3a322a;
  --ink: #ece4d6;
  --ink-soft: #b5a995;
  --rule: #4c4238;
  --rule-strong: #8a7a66;
  --accent: #d6b483;
  --accent-ink: #211c17;
  --say-paper: #213621;
  --say-ink: #c4e2b7;
  --say-rule: #4b7343;
  --avoid-paper: #41211b;
  --avoid-ink: #f1c3b7;
  --avoid-rule: #7e3f33;
  --font-display: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --font-text: "Source Sans 3", "Segoe UI", Roboto, system-ui, sans-serif;
  --fs-label: 12px;
  --fs-small: 14px;
  --fs-body: 16px;
  --fs-lead: 18px;
  --fs-h3: 20px;
  --fs-h2: 24px;
  --fs-h1: 30px;
  --lh-tight: 1.2;
  --lh-body: 1.375;
  --track-label: 0.07em;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --measure: 46rem;
  --control-h: 44px;
  --r-paper: 3px;
  --r-control: 5px;
  --r-pill: 999px;
  --shadow-sheet: 0 6px 24px rgba(0, 0, 0, 0.5);
  --rule-double: 3px double var(--rule-strong);
  --season-1: #9e522a;
  --season-2: #b08738;
  --season-3: #636d3a;
  --season-4: #78362c;
  --season-runner: repeating-linear-gradient(90deg, var(--season-1) 0 28px, var(--season-2) 28px 36px, var(--season-3) 36px 64px, var(--season-2) 64px 72px, var(--season-4) 72px 100px, var(--season-2) 100px 108px);
  --season-runner-h: 6px;
  color-scheme: dark }

/* ---- Base. The design system in design/README.md: linen and walnut, two faces, paper with one rule and no shadow. ---- */
html, body { height: 100%; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-text); font-size: var(--fs-body); line-height: var(--lh-body);
  -webkit-text-size-adjust: 100%; display: flex; flex-direction: column; overflow: hidden; }
/* Every page but the Topics board scrolls as a document. The build sets class="flow" on <html>; the script does too. */
html.flow, html.flow body { height: auto; min-height: 100%; overflow: visible; display: block; }
h1, h2, h3, p, ul { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.gut { padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.label { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-soft); line-height: var(--lh-tight); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--control-h); padding: 0 var(--sp-4);
  background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--r-control); font-weight: 600; color: var(--ink); text-decoration: none; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: default; }

/* ---- Masthead: the wordmark, three text links, the double rule and the Thanksgiving runner. On every page. ---- */
.mast { flex: none; background: var(--card); }
.mast-in { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0 var(--sp-5); padding-top: var(--sp-2); }
.brand { display: flex; flex-direction: column; padding-bottom: var(--sp-2); min-width: 0; }
.wm { align-self: flex-start; display: inline-flex; align-items: center; min-height: var(--control-h); font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h2); line-height: var(--lh-tight); color: var(--ink); text-decoration: none; }
.sub { font-size: var(--fs-small); color: var(--ink-soft); line-height: var(--lh-tight); }
.tabs { display: flex; gap: var(--sp-4); margin-left: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: var(--control-h); padding: 0 var(--sp-1); font-weight: 600; color: var(--ink-soft); text-decoration: none; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.runner { height: var(--season-runner-h); background: var(--season-runner); border-top: var(--rule-double); margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l)); }
@media (max-width: 480px) { .sub { display: none; } .wm { font-size: var(--fs-h3); } }

/* ---- Home: a two-step picker. Who, then what. ---- */
#home { padding-top: var(--sp-4); padding-bottom: var(--sp-7); }
.home-in { max-width: 78rem; margin: 0 auto; }
#intro { max-width: var(--measure); font-size: var(--fs-lead); }
.step { margin-top: var(--sp-5); }
.step h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h2); line-height: var(--lh-tight); border-top: var(--rule-double); padding-top: var(--sp-2); }
#aud { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: var(--sp-3); border-top: 1px solid var(--rule); }
#aud button { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); text-align: left; min-width: 0; min-height: var(--control-h);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; margin-left: var(--sp-3); background: none; border: 0; border-top: 3px solid transparent; border-bottom: 1px solid var(--rule); color: var(--ink); }
#aud button:first-child { margin-left: 0; }
#aud button + button { border-left: 1px solid var(--rule); margin-left: 0; padding-left: var(--sp-3); }
#aud .n { font-family: var(--font-display); font-size: var(--fs-lead); line-height: var(--lh-tight); }
#aud .v { font-size: var(--fs-small); color: var(--ink-soft); line-height: 1.3; }
#aud button:hover .n { color: var(--accent); }
#aud button[aria-pressed="true"] { border-top-color: var(--accent); }
#aud button[aria-pressed="true"] .n { color: var(--accent); font-weight: 700; }
#aud button[aria-pressed="true"] .v { color: var(--ink); }
#q { display: block; width: 100%; max-width: var(--measure); min-height: var(--control-h); margin-top: var(--sp-3); padding: 0 var(--sp-3);
  background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--r-control); }
#q::placeholder { color: var(--ink-soft); opacity: 1; }
#groups { columns: 3; column-gap: var(--sp-6); margin-top: var(--sp-4); }
#groups section { break-inside: avoid; page-break-inside: avoid; margin-bottom: var(--sp-5); }
#groups h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h3); line-height: var(--lh-tight); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--rule-strong); }
#groups ul { list-style: none; padding: 0; }
#groups li { border-bottom: 1px solid var(--rule); }
a.topic { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--control-h); padding: var(--sp-1) 0; color: var(--ink); text-decoration: none; }
a.topic svg { flex: none; width: 28px; height: 28px; color: var(--ink-soft); }
a.topic .t { font-weight: 600; }
a.topic .r { color: var(--ink-soft); }
a.topic:hover .t { color: var(--accent); text-decoration: underline; }
a.topic:hover svg { color: var(--accent); }
#nomatch { margin-top: var(--sp-4); }
#nomatch button { background: none; border: 0; padding: 0; min-height: var(--control-h); color: var(--accent); font-weight: 600; text-decoration: underline; }
@media (max-width: 1100px) { #groups { columns: 2; } }
@media (max-width: 760px) {
  #aud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #aud button + button { border-left: 0; padding-left: 0; }
  #aud button:nth-child(even) { border-left: 1px solid var(--rule); padding-left: var(--sp-3); }
  #groups { columns: 1; }
}
@media (max-width: 600px) { #aud button:nth-child(even) { border-left: 0; padding-left: 0; } #aud { grid-template-columns: minmax(0, 1fr); } #aud .n { font-size: var(--fs-body); } }
@media (min-width: 601px) and (max-width: 760px) { #aud .n { font-size: var(--fs-body); } }

/* ---- Feedback ---- */
#fb { padding-top: var(--sp-5); padding-bottom: var(--sp-7); }
#fb form { max-width: var(--measure); margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-4); position: relative; }
#fb h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h1); line-height: var(--lh-tight); }
#fb label { display: flex; flex-direction: column; gap: var(--sp-2); font-weight: 600; }
#fb input, #fb textarea { font-weight: 400; background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--r-control); padding: var(--sp-2) var(--sp-3); min-height: var(--control-h); width: 100%; }
#fb textarea { min-height: 160px; resize: vertical; }
#fb .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
#fb .btn { align-self: flex-start; }
#fb .fine, #fbmsg { margin: 0; }
#fb .fine { color: var(--ink-soft); font-size: var(--fs-small); }
#fbmsg:empty { display: none; }
@media (max-width: 600px) { #fb .btn { align-self: stretch; } }

/* ---- Topics board: a toolbar, then one large pannable, zoomable grid. Columns are audiences, rows are topics. ---- */
.tools { flex: none; display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding-block: var(--sp-2); background: var(--card); border-bottom: 1px solid var(--rule); }
.tools button { min-height: var(--control-h); min-width: var(--control-h); padding: 0 var(--sp-3); font-size: var(--fs-small); font-weight: 600; color: var(--ink); background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--r-control); }
.tools button:hover { border-color: var(--accent); color: var(--accent); }
#boardhint { font-size: var(--fs-small); color: var(--ink-soft); }
@media (max-width: 700px) { #boardhint { display: none; } }
#pct { font-size: var(--fs-small); color: var(--ink-soft); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

#view { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; touch-action: none; cursor: grab; }
#view.drag { cursor: grabbing; }
#where { position: absolute; left: var(--sp-3); top: var(--sp-3); z-index: 2; pointer-events: none; max-width: calc(100% - 2 * var(--sp-3)); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-control);
  background: var(--card); color: var(--ink); border: 1px solid var(--rule-strong); font-size: var(--fs-small); font-weight: 600; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: max-content; padding: var(--sp-5);
  display: grid; grid-template-columns: 270px repeat(5, 300px); gap: var(--sp-3); user-select: none; -webkit-user-select: none; }

.corner { align-self: end; color: var(--ink-soft); font-size: var(--fs-small); padding: var(--sp-1); }
.col { background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--r-paper); padding: var(--sp-4); }
.col h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h3); line-height: var(--lh-tight); margin: 0 0 var(--sp-2); text-wrap: balance; padding-bottom: var(--sp-2); border-bottom: var(--rule-double); }
.col dl { margin: 0; font-size: var(--fs-small); display: grid; gap: var(--sp-1); }
.col dt { font-size: var(--fs-label); font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--ink-soft); }
.col dd { margin: 0; }

.row { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-paper); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.row .n { font-family: var(--font-display); font-size: var(--fs-small); color: var(--ink-soft); font-variant-numeric: oldstyle-nums tabular-nums; }
.row h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h3); line-height: var(--lh-tight); margin: 0; text-wrap: balance; }
.row .lab { font-size: var(--fs-label); font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--ink-soft); margin-top: var(--sp-1); }
.row p { margin: var(--sp-1) 0 0; font-size: var(--fs-small); }

/* ---- A card: a recipe card laid on the cloth. One rule, no shadow. Order never changes. ---- */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-paper); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.tag { font-size: var(--fs-label); font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--ink-soft); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--rule); }
.say { background: var(--say-paper); color: var(--say-ink); border-left: 3px solid var(--say-rule); border-radius: 0 var(--r-paper) var(--r-paper) 0; padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-display); font-size: var(--fs-lead); }
.who { font-size: var(--fs-small); color: var(--ink-soft); }
.who b { color: var(--ink); font-weight: 600; }
.avoid { margin-top: auto; background: var(--avoid-paper); color: var(--avoid-ink); border-left: 3px solid var(--avoid-rule); border-radius: 0 var(--r-paper) var(--r-paper) 0; padding: var(--sp-2) var(--sp-4); }
.avoid span, .say .lbl { font-family: var(--font-text); font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); font-size: var(--fs-label); display: block; margin-bottom: var(--sp-1); color: inherit; }
.more { display: inline-flex; align-items: center; align-self: flex-start; min-height: var(--control-h); padding: 0 var(--sp-4); color: var(--accent); background: none; border: 1px solid var(--rule-strong);
  border-radius: var(--r-control); text-decoration: none; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.more:hover { border-color: var(--accent); }

/* ---- Phone board view: one card at a time, topic and audience pinned above it. ---- */
#m { display: none; flex: 1 1 auto; min-height: 0; flex-direction: column; }
@media (max-width: 760px) { #view { display: none; } #m { display: flex; } .tools { display: none; } }
.m-head { flex: none; display: flex; gap: var(--sp-2); align-items: flex-start; background: var(--card); padding-block: var(--sp-2); border-bottom: 1px solid var(--rule); }
.m-head .txt { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; }
.m-head .txt span { display: block; }
.m-head .n { font-size: var(--fs-label); font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--ink-soft); }
.m-head .h { font-family: var(--font-display); font-size: var(--fs-body); line-height: var(--lh-tight); margin: var(--sp-1) 0; text-wrap: balance; }
.m-head .txt .f { display: none; }
.m-step { flex: none; display: flex; flex-direction: row; gap: 2px; }
.m-step button { width: var(--control-h); height: var(--control-h); border-radius: var(--r-control); border: 1px solid var(--rule-strong); background: var(--card); color: var(--ink); font-size: var(--fs-label); line-height: 1; padding: 0; }
.m-step button:disabled { opacity: .35; cursor: default; }
@media (prefers-reduced-motion: no-preference) {
  .m-head .txt.u { animation: inu .22s ease-out; } .m-head .txt.d { animation: ind .22s ease-out; } }
#mplist button { display: flex; gap: var(--sp-2); width: 100%; text-align: left; font-size: var(--fs-small); padding: var(--sp-3) var(--sp-2); min-height: var(--control-h); border: 0;
  border-bottom: 1px solid var(--rule); background: none; color: var(--ink); cursor: pointer; border-radius: 0; }
#mplist button.on { font-weight: 600; color: var(--accent); }
#mplist .num { flex: none; width: 20px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
#mplist .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-map { flex: none; display: grid; grid-template-columns: repeat(3, 6px); gap: 2px; padding: 6px; min-width: var(--control-h); min-height: var(--control-h); place-content: center; background: var(--card);
  border: 1px solid var(--rule-strong); border-radius: var(--r-control); cursor: pointer; }
.m-map i { width: 6px; height: 6px; border-radius: 1px; background: var(--rule); }
.m-map i.near { background: var(--rule-strong); }
.m-map i.on { background: var(--accent); }
.m-cols { flex: none; display: flex; gap: var(--sp-1); background: var(--card); border-bottom: 1px solid var(--rule); }
.m-cols button { flex: 1 1 auto; min-width: 0; font-size: var(--fs-small); font-weight: 600; padding: 0 var(--sp-1); min-height: var(--control-h); border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink-soft); }
.m-cols button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.m-gi { display: none; }
.m-stage { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--sp-2); padding-block: var(--sp-3); touch-action: none; overflow: hidden; }
.peek { background: var(--card); border: 1px solid var(--rule-strong); color: var(--ink-soft); font-size: var(--fs-label); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--track-label); cursor: pointer; border-radius: var(--r-control); }
.peek.l, .peek.r { grid-row: 1; writing-mode: vertical-rl; width: 28px; padding: 0; }
.peek.l { grid-column: 1; } .peek.r { grid-column: 3; }
.peek.b { grid-row: 2; grid-column: 1 / -1; padding: 0 var(--sp-2); min-height: var(--control-h); }
.m-hold { grid-row: 1; grid-column: 2; min-width: 0; min-height: 0; display: flex; }
.m-hold .card { flex: 1; min-width: 0; overflow: hidden; touch-action: none; }
.m-hold.scroll .card { overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
.m-hold.scroll .card > * { flex-shrink: 0; }
.m-hold .say .lbl { display: inline; margin: 0 var(--sp-2) 0 0; vertical-align: 2px; } /* inline on the phone card, where a line of height matters (#47, #60) */
@keyframes inr { from { transform: translateX(40px); opacity: .3; } }
@keyframes inl { from { transform: translateX(-40px); opacity: .3; } }
@keyframes inu { from { transform: translateY(40px); opacity: .3; } }
@keyframes ind { from { transform: translateY(-40px); opacity: .3; } }
@media (prefers-reduced-motion: no-preference) {
  .m-hold.r { animation: inr .18s ease-out; } .m-hold.l { animation: inl .18s ease-out; }
  .m-hold.u { animation: inu .18s ease-out; } .m-hold.d { animation: ind .18s ease-out; } }
#mi, #mp { position: fixed; inset: 0; z-index: 20; background: var(--paper); overflow: auto;
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--sp-3)); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--sp-4)); }
.mi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); }
.mi-top h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h3); line-height: var(--lh-tight); margin: 0; }
.mi-top button { font-size: var(--fs-small); font-weight: 600; color: var(--ink); background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--r-control); min-height: var(--control-h); padding: 0 var(--sp-3); }
.mi-grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, 34px); gap: 5px; align-items: center; }
.mi-grid .ch { writing-mode: vertical-rl; transform: rotate(180deg); font-size: var(--fs-label); font-weight: 600; color: var(--ink-soft); justify-self: center; padding-block: var(--sp-1); }
.mi-grid .rh { font-size: var(--fs-small); min-width: 0; }
.mi-grid button { width: 34px; height: 34px; border-radius: var(--r-paper); border: 1px solid var(--rule-strong); background: var(--card); cursor: pointer; padding: 0; }
.mi-grid button.on { background: var(--accent); border-color: var(--accent); }

/* ---- Pre-rendered pages (topic, card, About, Research, 404): one reading column at the measure. ---- */
.dp .doc { max-width: var(--measure); margin: 0 auto; padding-block: var(--sp-5) var(--sp-7); display: flex; flex-direction: column; gap: var(--sp-4); }
.dp .doc h1, .dp .doc h2 { font-family: var(--font-display); font-weight: 400; line-height: var(--lh-tight); margin: 0; text-wrap: balance; }
.dp .doc h1 { font-size: var(--fs-h1); }
.dp .doc h2 { font-size: var(--fs-h2); border-top: var(--rule-double); padding-top: var(--sp-3); margin-top: var(--sp-3); }
.dp .doc h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h3); line-height: var(--lh-tight); margin: var(--sp-3) 0 0; }
.dp .crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-small); color: var(--ink-soft); }
.dp .crumbs a { display: inline-flex; align-items: center; min-height: var(--control-h); color: var(--accent); }
.dp .doc p { margin: 0; }
.dp .doc .fact { color: var(--ink-soft); font-size: var(--fs-small); }
.dp .topic-head { display: flex; gap: var(--sp-4); align-items: flex-start; }
.dp .thumb { flex: none; width: 56px; height: 56px; color: var(--ink-soft); margin-top: var(--sp-1); }
.dp .topic-head > div { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.dp .lead { font-size: var(--fs-lead); }
.dp .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.dp .doc .card { gap: var(--sp-3); }
.dp .fine { border-top: 1px solid var(--rule); padding-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-small); color: var(--ink-soft); }
.dp .fine h2 { font-family: var(--font-text); font-size: var(--fs-label); font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--ink-soft); border: 0; padding: 0; margin: 0; }
.dp .fine p { margin: 0; }
.dp .finelink { align-self: flex-start; font-size: var(--fs-small); color: var(--accent); }
.dp .navrow { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2) var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--rule); }
.dp .navrow a { display: inline-flex; align-items: center; min-height: var(--control-h); font-weight: 600; color: var(--accent); text-decoration: none; }
.dp .navrow a:hover { text-decoration: underline; }
/* The audience switcher on a card page: the same quiet row as Home, the current one marked by the rule. */
.dp .others { display: flex; flex-wrap: wrap; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0; justify-content: flex-start; }
.dp .others a, .dp .others span { display: inline-flex; align-items: center; flex: 1 1 auto; min-height: var(--control-h); padding: var(--sp-1) var(--sp-3) 0 0; margin-right: var(--sp-3); border-top: 3px solid transparent; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.dp .others a:hover { color: var(--ink); text-decoration: none; }
.dp .others [aria-current="page"] { color: var(--accent); border-top-color: var(--accent); }
/* The full page: a sheet lifted off the table. The one place a shadow is used. */
.dp .sheet { margin-top: var(--sp-3); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-paper); box-shadow: var(--shadow-sheet);
  padding: var(--sp-4) var(--sp-5) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); }
.dp .sheet h3 { border-top: var(--rule-double); padding-top: var(--sp-3); margin-top: var(--sp-2); }
.dp .sheet h3:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.dp .sheet .say { font-size: var(--fs-lead); }
.obj { display: flex; flex-direction: column; gap: var(--sp-2); }
.obj .they { background: var(--inset); border-radius: var(--r-paper); padding: var(--sp-3) var(--sp-4); font-weight: 600; }
.obj .you { border-left: 3px solid var(--say-rule); padding: var(--sp-1) 0 var(--sp-1) var(--sp-4); }
.obj span { display: block; font-size: var(--fs-label); font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); color: var(--ink-soft); margin-bottom: var(--sp-1); }
.dp .doc ul.mistakes { margin: 0; padding: var(--sp-3) var(--sp-4) var(--sp-3) calc(var(--sp-4) + 1.2em); background: var(--avoid-paper); color: var(--avoid-ink); border-left: 3px solid var(--avoid-rule);
  border-radius: 0 var(--r-paper) var(--r-paper) 0; display: flex; flex-direction: column; gap: var(--sp-1); }
@media (max-width: 480px) { .dp .sheet { padding-left: var(--sp-4); padding-right: var(--sp-4); } .dp .thumb { width: 44px; height: 44px; } }
/* About and Research */
.dp .rgrid { display: grid; gap: var(--sp-4); }
.dp .rcard { position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-paper); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.dp .rcard:hover { border-color: var(--rule-strong); }
.dp .rcard h3 { font-family: var(--font-text); font-weight: 600; font-size: var(--fs-body); margin: 0; }
.dp .rcard a.rlink { color: var(--ink); font-weight: 600; text-decoration: none; }
.dp .rcard a.rlink::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-paper); }
.dp .rcard a.rlink:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.dp .rcard .rmeta { font-size: var(--fs-small); color: var(--ink-soft); }
.dp .rcard a.rfree { position: relative; z-index: 1; align-self: flex-start; display: inline-flex; align-items: center; min-height: var(--control-h); font-weight: 600; color: var(--accent); }
.dp .rstrength, .dp .rverdict { align-self: flex-start; font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-soft); }
.dp .rverdict.warn { color: var(--ink); }
.dp .rsrc { margin: 0; padding-left: 20px; font-size: var(--fs-small); display: flex; flex-direction: column; gap: 2px; }
.dp .rsrc a { display: inline; min-height: 0; }
.dp .rctl { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; }
.dp .rctl label { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-small); font-weight: 600; color: var(--ink-soft); }
.dp .rctl select { min-height: var(--control-h); padding: 0 var(--sp-3); color: var(--ink); background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--r-control); max-width: 100%; }
.dp #rcount { font-weight: 600; min-height: var(--control-h); display: inline-flex; align-items: center; }
.dp .rcard[hidden], .dp .rsec[hidden] { display: none; }
.dp .thanks { color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
