/* Drill Editor's look: the whole stylesheet of drill-editor.html (kept beside it; a later rule with the same weight wins). */
[hidden] { display: none !important; }   /* one rule for every hidden part: a class that sets display can't bring it back */
@font-face { font-family: "Barlow"; src: url("data:font/woff2;base64,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") format("woff2"); font-weight: 600; font-display: block; }   /* the name beside the mark: Barlow SemiBold, its letters only (tools/make-font.py barlow) */
/* shared with the site (drilleditor.com): the night ground, ink, soft and dots, the dark ink, amber, paper and lime. This file loads no
   stylesheet, so each is written here too: change one, change every copy tests/site/05-shared-colours.js names */
:root {
  color-scheme: light;   /* the browser's own parts (number arrows, the search ×, the slider, Firefox's scrollbars) follow the look; each look below says its own */
  --chrome: #2b3440;
  --chrome-2: #333d4b;
  --chrome-line: #3f4a5a;
  --panel: #ffffff;
  --panel-2: #f4f6f9;
  --panel-line: #e2e7ee;
  --ink: #1c2530;
  --ink-soft: #5d6b7d;
  --ink-faint: #8b97a6;
  --primary: #ffb000;   /* the brand's amber, as on the home page's button; My colours' Editor swatch sets another on <html> */
  --on-primary: #111315;   /* text on amber: dark, white would be hard to read (applyAccent picks it for another colour) */
  --primary-text: color-mix(in srgb, var(--primary) 60%, black);   /* the accent as thin text on a light panel; every shade is mixed from --primary */
  --primary-soft: color-mix(in srgb, var(--primary) 16%, transparent);
  --primary-edge: color-mix(in srgb, var(--primary) 80%, var(--ink));   /* the edge of a lit button: a white or silver pick still shows on the white panel (--ink flips with the theme) */
  --pitch-a: #4a7f55;   /* calm sage grass, soft stripes; the picture export reads these too */
  --pitch-b: #467b51;
  --select: var(--primary);   /* the selection is amber too, like the buttons and handles */
  --aid-dim: .3;   /* temporary arrow visibility while editing */
  --new: #b7e600;
  --new-ink: #24300a;
  --danger: #e5533d;
  --shadow: 0 8px 24px rgba(20,30,45,.14);
  --dot-step: 18px;   /* the board's dot grid, the same step as the site's (site.css --dot-step; tests/site/05) */
  --mod-key: 44px; --mod-key-gap: 8px; --mod-row-width: calc(3 * var(--mod-key) + 2 * var(--mod-key-gap)); --mod-once-bg: color-mix(in srgb, var(--chrome) 80%, var(--primary)); --mod-key-left: 56px; --mod-key-bottom: 24px;   /* the on-screen modifier row, its left edge in the stage (beside ?) and its bottom (clear of iOS's home bar); the toast and the corner keep clear of it */
  --radius: 10px;
  --radius-s: 7px;
  /* the controls (the site's soft look): a fill a step off the panel, a 3:1 line under fields; mixed from --ink / --panel, so every look follows */
  --field-r: 8px;
  --field-bg: color-mix(in oklch, var(--ink) 7%, var(--panel));
  --field-line: color-mix(in oklch, var(--ink) 55%, transparent);
  --danger-text: color-mix(in srgb, var(--danger) 55%, var(--ink));   /* red words on the fill: darker on White, lighter on Night and Grey (--ink flips) */
  --on-chrome: #dbe3ec;
  --on-chrome-soft: #93a1b2;
  --board-dot: color-mix(in srgb, var(--ink-faint) 40%, transparent);   /* the board's dot grid */
  /* Paper ground (Scandi colours), the same in both themes; the picture export reads these too */
  --paper: #F2F0E8;
  --paper-frame: #E4E2DA;
  --paper-lines: #8FA08F;
  --paper-ink: #1F3329;
  --print-lines: #6F826F;   /* White and the PDF: Paper's sage lines one step darker, on pure white */
  --notes-ink: #2b3440;   /* the notes' words, on their cream sheet and in print: the same in every look */
}
/* three looks, each setting the whole list, so one never leaks into another: Night (stored "dark", and a dark device's default) is the home page's dark,
   near-black with its dot grid; White ("light") is the base above; Grey ("grey") is the older grey-blue dark */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --chrome: #141619; --chrome-2: #1d2024; --chrome-line: #2c3035;
    --panel: #16191c; --panel-2: #0e1012; --panel-line: #33373c;
    --ink: #e8e6e1; --ink-soft: #a3a8ad; --ink-faint: #80868c;
    --primary-soft: color-mix(in srgb, var(--primary) 20%, transparent); --primary-text: color-mix(in srgb, var(--primary) 75%, white);
    --shadow: 0 8px 24px rgba(0,0,0,.6);
    --on-chrome: #e8e6e1; --on-chrome-soft: #a3a8ad; --board-dot: #24282d;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --chrome: #2b3440; --chrome-2: #333d4b; --chrome-line: #3f4a5a;
  --panel: #ffffff; --panel-2: #f4f6f9; --panel-line: #e2e7ee;
  --ink: #1c2530; --ink-soft: #5d6b7d; --ink-faint: #8b97a6;
  --primary-soft: color-mix(in srgb, var(--primary) 16%, transparent); --primary-text: color-mix(in srgb, var(--primary) 60%, black); --shadow: 0 8px 24px rgba(20,30,45,.14);
  --on-chrome: #dbe3ec; --on-chrome-soft: #93a1b2; --board-dot: color-mix(in srgb, var(--ink-faint) 40%, transparent);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --chrome: #141619; --chrome-2: #1d2024; --chrome-line: #2c3035;
  --panel: #16191c; --panel-2: #0e1012; --panel-line: #33373c;
  --ink: #e8e6e1; --ink-soft: #a3a8ad; --ink-faint: #80868c;
  --primary-soft: color-mix(in srgb, var(--primary) 20%, transparent); --primary-text: color-mix(in srgb, var(--primary) 75%, white); --shadow: 0 8px 24px rgba(0,0,0,.6);
  --on-chrome: #e8e6e1; --on-chrome-soft: #a3a8ad; --board-dot: #24282d;
}
:root[data-theme="grey"] {
  color-scheme: dark;
  --chrome: #2b3440; --chrome-2: #333d4b; --chrome-line: #3f4a5a;
  --panel: #1b222c; --panel-2: #222b37; --panel-line: #313c4a;
  --ink: #e7edf4; --ink-soft: #a7b4c3; --ink-faint: #7b8798;
  --primary-soft: color-mix(in srgb, var(--primary) 20%, transparent); --primary-text: color-mix(in srgb, var(--primary) 75%, white); --shadow: 0 8px 24px rgba(0,0,0,.4);
  --on-chrome: #dbe3ec; --on-chrome-soft: #93a1b2; --board-dot: color-mix(in srgb, var(--ink-faint) 40%, transparent);
}

/* thin accent text: the pick's own hue at a lightness that reads on the panel (navy or black lightened on the dark theme, white greyed on the light one);
   a browser without relative colours keeps the mixes above */
@supports (color: oklch(from red l c h)) {
  :root { --primary-text: oklch(from var(--primary) clamp(0.4, l, 0.56) c h); }
  @media (prefers-color-scheme: dark) { :root { --primary-text: oklch(from var(--primary) clamp(0.72, l, 0.9) c h); } }
  :root[data-theme="light"] { --primary-text: oklch(from var(--primary) clamp(0.4, l, 0.56) c h); }
  :root:is([data-theme="dark"], [data-theme="grey"]) { --primary-text: oklch(from var(--primary) clamp(0.72, l, 0.9) c h); }
}

* { box-sizing: border-box; }
/* slim scrollbars everywhere (palette, My drills, shortcuts): a thin rounded thumb, no track or arrows; it firms up under the mouse */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink-faint) 40%, transparent); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink-faint) 40%, transparent) transparent; } }
/* one keyboard ring for every button and link (Tab only, never on a click); hover looks below are mouse-only, so a tap doesn't stay lit */
button:focus-visible, a:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 2px; }   /* --primary-text: amber is 1.9:1 on White, a white pick 1:1 */
:is(.toolbar, .hint) :is(button, a):focus-visible { outline-color: var(--primary); }   /* on the dark chrome: the accent itself */
.toast button:focus-visible { outline-color: currentColor; }   /* the toast is --ink: its own words' colour reads on it */
/* a long press on a button doesn't select its words or open the phone's Copy menu */
button { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button, input, select, textarea { font-family: inherit; }   /* the page's font, not the browser's Arial; a part's own font: rule still wins */
/* fields and quiet buttons, the site's soft look: a fill, no box border, a line under fields. :where weighs nothing, so each part's own
   rule (size, .on, pressed, danger, the phone block) still wins; those rules leave fill, edge and corner to this one */
:where(.md-q, .gapctl input, .gp-size input, #edAskIn) { background: var(--field-bg); border: 1px solid transparent; border-block-end: 1.5px solid var(--field-line); border-radius: var(--field-r); }
.md-q::placeholder { color: var(--ink-soft); opacity: 1; }   /* the browser's grey is under 4.5:1 on the fill */
:is(.md-q, .gapctl input, .gp-size input, #edAskIn, .drill-name):focus-visible { outline: 2px solid var(--primary-text); outline-offset: 1px; }   /* --primary-text: a white or pale pick still shows */
:is(.md-q, .gapctl input, .gp-size input, #edAskIn):focus-visible { background: color-mix(in oklch, var(--field-bg) 50%, var(--panel)); }
:where(.dp-row > button, .dp-foot button, .dp-here button, .md-more, .penshape button, .mark-edge, .pitchpick button, .card-head button, .ground-btn,
  .gp-presets button, .ap-actions button:not(.gp-ok), .selbar > button:not(.sb-x), .selbar-restore, .card-notes.empty > .cn-add) {
  background: var(--q-bg, var(--field-bg)); border: 1px solid transparent; border-radius: var(--field-r); }   /* the selection bar and Cancel keep their border: 0 */
/* a step darker under the mouse and when pressed: only a background that reads --q-bg (the list above) changes; never a lit, pressed or disabled one */
@media (hover: hover) and (pointer: fine) { :where(button:not(.on:not(#paperBtn), [aria-pressed="true"], :disabled):hover) { --q-bg: color-mix(in oklch, var(--ink) 6%, var(--field-bg)); --q-ink: var(--ink); } }
:where(button:not(.on:not(#paperBtn), [aria-pressed="true"], :disabled):active) { --q-bg: color-mix(in oklch, var(--ink) 10%, var(--field-bg)); --q-ink: var(--ink); }   /* grey words (--q-ink) go full ink: 4.5:1 on the darker fill */
.card-head, .card-notes { --field-bg: color-mix(in oklch, var(--ink) 5%, var(--panel-2)); }   /* the drill's buttons stand on the board (--panel-2), not a panel: a step off it */
@media (forced-colors: active) {   /* fills vanish there: an edge all round, and the system's ring */
  :is(.md-q, .gapctl input, .gp-size input, #edAskIn, .dp-row > button, .dp-foot button, .dp-here button, .md-more, .penshape button, .mark-edge, .pitchpick button, .card-head button,
    .ground-btn, .gp-presets button, .ap-actions button, .selbar > button:not(.sb-x), .selbar-restore, .cn-add) { border: 1px solid ButtonBorder; }
  :focus-visible { outline-color: Highlight; }
  :is(.pitchpick button.on:not(#paperBtn), .penshape button.on, .popmenu button.on, .dp-place[aria-pressed="true"], .md-chip[aria-pressed="true"], #playbar .ico[aria-pressed="true"], #sigBtn[aria-pressed="true"], #gameBtn[aria-pressed="true"], #visBtn[aria-pressed="true"], #airBtn[aria-pressed="true"]) { outline: 2px solid Highlight; outline-offset: 1px; }   /* a pick's ring and tint vanish there */
}
html, body { margin: 0; height: 100%; }
html { touch-action: manipulation; }   /* a double tap never zooms the page (iPad); a pinch still does, and the board keeps its own (none) */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--panel-2);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 520px; }   /* dvh: the height shown under the browser's bars (an iPad's tab row), so the bottom keys stay on screen; older browsers keep vh */
/* the icons: one sprite (the hidden <svg> at the top of <body>, JS: ico), in the words' colour (ButtonText in forced colours); 16 px, 18 in the ⋯ menus
   (as the floodlight). Smaller only where the words are: the shortcuts, a drill's header and notes, the tiles' round badges, a topic's × */
svg.i { width: var(--icon, 16px); height: var(--icon, 16px); flex: none; vertical-align: calc(.41em - var(--icon, 16px) / 2); }   /* inline: its middle on the words' middle */
.popmenu { --icon: 18px; }
.hint, .card-head, .md-chip { --icon: 13px; } .card-notes { --icon: 1.2em; } .tool .asset-x { --icon: 11px; }

/* ---- top chrome ---- */
.toolbar {
  display: flex; align-items: center; gap: 16px;
  background: var(--chrome); color: var(--on-chrome);
  padding: 9px 16px; min-height: 52px; flex: 0 0 auto; flex-wrap: wrap; row-gap: 6px;
  border-bottom: 1px solid #0d1219;
}
/* under 1280 px: the name and the zoom label go, so a signed-in bar keeps one row down to 1024 px (with the six words below); under ~1000 it wraps */
@media (max-width: 1279px) {
  .toolbar { gap: 10px; padding: 9px 10px; }
  .brand-name, .zoomctl .zlabel { display: none; }
  .toolbar .zoomctl input[type="range"] { width: 80px; }   /* .toolbar: stronger than the 110 px rule further down */
}
/* a laptop: these six show their symbol only (the word in the tooltip and aria-label), so Latvian signed in keeps one row from 1024 px
   (plan: 2026-10-20-topbar-one-row.md); :where keeps it weaker than .popmenu .tb-word (Mirror folds into ⋯ on a phone). Save's " a copy" stays */
@media (max-width: 1559px) { :where(#drillsBtn, #undoBtn, #redoBtn, #mirrorBtn, #fitBtn, #dashBtn) .tb-word { display: none; } }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .5px; }
.brand .mark { flex: none; color: var(--on-chrome); }   /* the pitch in dots (site/mark.svg), 21 px high: its 7 dots on whole pixels */
.brand-name { font: 600 17px "Barlow", system-ui, sans-serif; letter-spacing: normal; }   /* the face has 600 only: no faux bold */
.brand small { font-weight: 600; color: var(--on-chrome-soft); letter-spacing: .3px; font-size: 12px; }
.tb-tools { display: flex; gap: 4px; }
.tb-tools button, .toolbar > a.tb-btn {
  width: 34px; height: 34px; border-radius: 7px; border: 0; cursor: pointer;
  background: transparent; color: var(--on-chrome-soft); font-size: 15px;
  display: grid; place-items: center; transition: background .12s, color .12s;
}
@media (hover: hover) { .tb-tools button:hover, .toolbar > a.tb-btn:hover { background: var(--chrome-2); color: var(--on-chrome); } }
.tb-tools .tb-btn, .toolbar > a.tb-btn {
  width: auto; padding: 0 8px; font-size: 12.5px; font-weight: 700; color: var(--on-chrome);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; text-decoration: none;
}
/* unsaved changes: a small dot on Save */
.tb-tools .tb-btn.dirty::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--new);
}
/* a club's work: its crest (or a dot in its colour) on Save */
.tb-tools .tb-btn .save-crest { flex: none; width: 14px; height: 14px; border-radius: 50%; object-fit: cover; background: var(--club, var(--primary)); box-shadow: 0 0 0 1px var(--chrome-line); }
.tb-tools .tb-btn:disabled { opacity: .38; cursor: default; background: transparent; }
/* ＋ Add and the shade under the panel are for phones only (the 720 px block shows them) */
.tb-tools .tb-add, .pal-shade { display: none; }
.tb-sep { width: 1px; background: var(--chrome-line); margin: 7px 2px; }
.spacer { flex: 1 1 auto; }

/* drill name, in the stage head */
.drill-name {
  flex: 1 1 auto; min-width: 0; max-width: 420px; font: 700 14px system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 5px 8px;
}
.drill-name::placeholder { color: var(--ink-faint); font-weight: 600; }
@media (hover: hover) { .drill-name:hover { border-color: var(--panel-line); } }
.drill-name:focus { background: var(--panel); }   /* the fields' ring (above) shows it */
.drill-total { flex: 0 1000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }   /* read-only: the drills ticked for the PDF; a narrow window cuts it before the name box */

/* My sessions window; My drills uses it too */
.ap-panel.dp-panel { width: min(560px, 94vw); }   /* beats .ap-panel's 300px, which comes later */
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-x { border: 0; background: transparent; color: var(--ink-faint); font-size: 20px; cursor: pointer; width: 30px; height: 30px; border-radius: 7px; }
@media (hover: hover) { .dp-x:hover { background: var(--panel-2); color: var(--ink); } }
.dp-list { max-height: min(60vh, 460px); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.dp-row {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 9px;
  border: 1px solid var(--panel-line); background: var(--panel-2);
}
.dp-row.current { border-color: var(--primary); }
.dp-row img, .dp-row .dp-thumb { width: 84px; height: 63px; object-fit: cover; border-radius: 5px; background: var(--pitch-b); flex: 0 0 auto; }
.dp-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dp-meta b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-meta span { font-size: 11.5px; color: var(--ink-soft); }
.dp-row button, .dp-foot button, .dp-here button { color: var(--ink); font-weight: 700; font-size: 12.5px; padding: 7px 12px; cursor: pointer; }
.dp-row .dp-del { color: var(--danger-text); }
.dp-ex { margin-bottom: 14px; }   /* ▤ My sessions: the built-in examples, above the coach's own list */
.dp-ex .dp-thumb { display: grid; place-items: center; color: #fff; }   /* the sketch in chalk on the grass */
.dp-ex .dp-thumb svg { width: 86%; height: auto; }
.dp-ex h3 { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }   /* no h3 rule elsewhere: without it the browser's big heading */
.dp-empty { padding: 26px 10px; text-align: center; color: var(--ink-soft); font-size: 13px; }
/* an empty list for a new coach (emptyState): an ink sketch, a heading, one sentence, at most one button. Two classes deep, so the later
   .ap-panel h2 / p rules can't win; the sketch takes its width from the box (150 px at most), never a breakpoint */
.es { display: grid; justify-items: center; gap: 6px; padding: 16px 10px 22px; text-align: center; }
.es .es-pic { inline-size: min(150px, 62%); block-size: auto; aspect-ratio: 160 / 96; margin-block-end: 8px; color: var(--ink); }
.es .es-h { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--ink); text-wrap: balance; }
.es .es-s { margin: 0; max-inline-size: 56ch; font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); text-wrap: balance; }
.es .es-go { margin-block-start: 10px; padding: 8px 22px; border: 1px solid var(--primary-edge); border-radius: var(--field-r); background: var(--primary);
  color: var(--on-primary); font-size: 13px; font-weight: 700; text-decoration: none; }   /* the window's one main call (E3's Sign in) */
.dp-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
/* signed in: the sessions still only in this browser, and the button that copies them to the account */
.dp-here { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-soft); }
.dp-here button { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-panel .dp-note { margin: 10px 0 0; font-size: 11.5px; color: var(--ink-soft); }
.dp-row button:disabled { opacity: .45; cursor: default; }
/* My drills: Save the active drill, a search box, the same rows; signed out, one line to sign in */
/* Save is a filled button, set apart from the search box below it, so the two never look alike */
.md-save { display: block; width: 100%; border: 1px solid; font-weight: 700; font-size: 13px;
  padding: 9px 12px; margin-bottom: 16px; border-radius: var(--field-r); cursor: pointer; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-save:disabled { opacity: .5; cursor: default; }
.md-q { display: block; width: 100%; box-sizing: border-box; margin: 10px 0; font: inherit; font-size: 13px; padding: 8px 10px; color: var(--ink); }
#mdList .dp-row button { flex: none; white-space: nowrap; }
:is(#mdPanel, #drillsPanel) .dp-panel { max-height: calc(100dvh - 16px); overflow-y: auto; }   /* a phone on its side: the whole window scrolls, the last row stays reachable */
/* My drills topics: chips under the search box (several filter the list together; a long list scrolls), the same chips as toggles under a row,
   opened by the row's grey topics line. Ids beat .dp-row button and #mdList .dp-row button, which would give the line a button's frame */
.md-chips { display: flex; flex-wrap: wrap; gap: 5px; max-height: 164px; overflow-y: auto; margin: -2px 0 10px; }
#mdPanel .md-chip { border: 1px solid var(--panel-line); background: var(--panel-2); color: var(--ink-soft); font: inherit; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { #mdPanel .md-chip:hover { border-color: var(--primary); color: var(--ink); } }
#mdPanel .md-chip:disabled { opacity: .45; cursor: default; }
#mdList .md-ticks { flex: none; max-height: none; overflow: visible; margin: -2px 0 2px; padding: 8px; border: 1px solid var(--panel-line); border-radius: 9px; }
#mdList .dp-row .md-tline { border: 0; background: none; padding: 0; font: inherit; font-size: 11.5px; font-weight: 400; color: var(--ink-soft);
  text-align: left; white-space: normal; cursor: pointer; }
@media (hover: hover) { #mdList .dp-row button.md-tline:hover { color: var(--primary-text); } }
#mdList .dp-row span.md-tline { cursor: default; }   /* a colleague's club drill: its topics as words only */
/* clubs: Copy to My workspace / to a club, a line under the topics; Show more under a club's 100 */
#mdList .dp-row .md-copy { align-self: flex-start; max-width: 100%; border: 0; background: none; padding: 0; font: inherit; font-size: 11.5px; font-weight: 700;
  color: var(--primary-text); text-align: left; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
#mdList .dp-row .md-copy:disabled { opacity: .45; cursor: default; }
.md-more { display: block; margin: 10px auto 0; color: var(--ink); font-weight: 700; font-size: 12.5px; padding: 7px 12px; cursor: pointer; }
.md-new { margin: -10px 0 6px; font-weight: 600; }   /* Save as new: quiet, right under Update, on its left edge */
.md-more:disabled { opacity: .45; cursor: default; }
/* the place switch in both windows' heads (only with a club): my workspace, then each club, one row that slides sideways (a phone: its own
   row under the title). A club's pill carries its colour as its own --primary / --on-primary (applyAccent), and its crest */
.dp-places { flex: 1 1 auto; min-width: 0; display: flex; justify-content: flex-end; gap: 5px; margin: 0 8px; overflow-x: auto; scrollbar-width: none; }
.dp-places::-webkit-scrollbar { display: none; }
.dp-place { flex: none; display: inline-flex; align-items: center; gap: 5px; max-width: 14em; border: 1px solid var(--panel-line); background: var(--panel-2);
  color: var(--ink-soft); font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.dp-place > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }   /* min-width: a long club name shortens inside the pill */
.dp-place.club { border-color: var(--primary); color: var(--ink); }
.dp-place.club[aria-pressed="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--panel-2)); }   /* the picked club: a double-weight ring and a tint in its own colour (every club pill has the 1px edge) */
@media (hover: hover) { .dp-place[aria-pressed="false"]:hover { border-color: var(--primary); color: var(--ink); } }
.dp-place > .dp-crest { flex: none; width: 16px; height: 16px; margin-left: -5px; border-radius: 50%; object-fit: cover; background: var(--primary); box-shadow: 0 0 0 1px currentColor; }
@media (max-width: 720px) { .dp-head { flex-wrap: wrap; } .dp-places { order: 3; flex-basis: 100%; justify-content: flex-start; margin: 6px 0 0; } }

/* zoom control */
.zoomctl { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--on-chrome-soft); }
.zoomctl input[type="range"] { width: 110px; accent-color: var(--primary); }
.zoomctl .zpct { color: var(--on-chrome); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.zoomctl .fit-btn {
  border: 1px solid var(--chrome-line); background: var(--chrome-2); color: var(--on-chrome);
  height: 28px; padding: 0 7px; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 700;
}
@media (hover: hover) { .zoomctl .fit-btn:hover { border-color: var(--primary); } }

.theme-btn {
  border: 1px solid var(--chrome-line); background: var(--chrome-2); color: var(--on-chrome);
  width: 34px; height: 34px; padding: 0; border-radius: 7px; cursor: pointer; font-size: 15px;
}
/* the floodlight: White = lamps off (outlines), Grey = half lit, Night = all lit with a glow; none chosen on a dark device = Night */
.theme-btn svg { display: block; width: 16px; height: 20px; margin: auto; overflow: visible; }
.popmenu .theme-btn svg { width: 18px; margin: 0; flex: none; }
.theme-btn .lamp { fill: #ffd36b; fill-opacity: 0; stroke: currentColor; stroke-width: 1.4; filter: none; transition: fill-opacity .35s ease-out, filter .35s ease-out; }
:root[data-theme="grey"] .theme-btn .lamp { fill-opacity: .45; }
:root[data-theme="dark"] .theme-btn .lamp { fill-opacity: 1; filter: drop-shadow(0 0 2.5px #ffb000); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .theme-btn .lamp { fill-opacity: 1; filter: drop-shadow(0 0 2.5px #ffb000); } }
/* a press: the new look spreads from the button in a circle (the script animates it), the old one stays still under it; clicks go through to the page.
   Scoped to .flood, so the soft fade from the landing page is untouched. Going to Night the lamps warm up one after another, with a flicker */
:root.flood::view-transition-old(root), :root.flood::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root.flood::view-transition { pointer-events: none; }
:root.flood :not(.lamp) { transition: none !important; }   /* the circle is the change: colours inside it don't fade too (the lamps going out still do) */
@media (prefers-reduced-motion: no-preference) {
  .theme-btn.warm .lamp { animation: lamp-on .42s ease-out both; transition: none; }
  .theme-btn.warm .lamp:nth-of-type(2) { animation-delay: 50ms; } .theme-btn.warm .lamp:nth-of-type(3) { animation-delay: 100ms; }
  .theme-btn.warm .lamp:nth-of-type(4) { animation-delay: 150ms; } .theme-btn.warm .lamp:nth-of-type(5) { animation-delay: 200ms; } .theme-btn.warm .lamp:nth-of-type(6) { animation-delay: 250ms; }
}
@keyframes lamp-on { 0% { fill-opacity: 0; } 25% { fill-opacity: 1; } 40% { fill-opacity: .2; } 55% { fill-opacity: .9; } 70% { fill-opacity: .5; } 100% { fill-opacity: 1; } }
/* the account, only on drilleditor.com: Sign in, or the address's first letter */
.acct { flex: none; display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--chrome-line);
  background: var(--chrome-2); color: var(--on-chrome); font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.acct.me { padding: 0; font-size: 14px; }
/* phone: in the ⋯ menu, a menu row; signed in, the letter and the whole address */
.popmenu .acct { display: flex; justify-content: flex-start; gap: 9px; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font-size: 12.5px; }
.popmenu .acct.me::after { content: attr(title); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.popmenu .acct:empty { display: none; }   /* while /api/me is out: no blank row in ⋯ */
@media (hover: hover) { .acct:hover { border-color: var(--primary); } }

/* ---- body split ---- */
.split { display: flex; flex: 1 1 auto; min-height: 0; }

.palette {
  flex: 0 0 232px; background: var(--panel); border-right: 1px solid var(--panel-line);
  overflow-y: auto; padding: 14px; position: relative;
}
/* an .svg dragged over the panel */
.palette.hot { background: color-mix(in srgb, var(--new) 12%, var(--panel)); box-shadow: inset 0 0 0 1.5px var(--new); }
/* ✎ Customize: top right, beside the first section title */
.pal-edit {
  position: absolute; top: 14px; right: 14px; border: 0; background: none; color: var(--ink-soft);
  font: inherit; font-size: 12px; font-weight: 600; padding: 3px 6px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
@media (hover: hover) { .pal-edit:hover { color: var(--primary-text); } }
.palette.customizing .pal-edit { background: var(--primary); color: var(--on-primary); }
/* hidden tiles (and a section with nothing left) stay out of the way, but show faded while customizing */
.tool.off, .pal-sec.empty { display: none; }
.palette.customizing .tool.off { display: grid; }
.palette.customizing .tool.off > svg { opacity: .35; }
.palette.customizing .pal-sec.empty { display: block; }
/* player shape for new players, numbers and outlines on/off: only while customizing, the four shapes in a row, each switch a row of its own under them */
#playerShape { flex-wrap: wrap; }
#playerShape button[data-shape] { flex: 0 0 calc(25% - 3px); }
#playerShape .pal-switch { flex-basis: 100%; }
.palette:not(.customizing) #playerShape { display: none; }
/* the look for new step markers, the same way: three looks in a row, the Steps colour under them */
#stepLook { flex-wrap: wrap; }
#stepLook button[data-look] { flex: 0 0 calc(33.333% - 3px); }
#stepLook button[data-look].on { background: none; box-shadow: inset 0 0 0 1px var(--primary); }   /* an amber marker vanished on the amber fill: the pick is a ring instead */
.palette:not(.customizing) #stepLook { display: none; }
/* my colours: three team pickers, four cone-colour pickers and Reset, only while customizing */
#myColors { flex-wrap: wrap; }
#myColors .mc-row, #stepLook .mc-row { flex: 0 0 100%; display: flex; gap: 4px; align-items: center; }   /* Teams on one line, Colours on the next */
#myColors .mc-label, #stepLook .mc-label { flex: 0 0 52px; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
#myColors .mc-sw, #stepLook .mc-sw { flex: 0 0 30px; height: 26px; padding: 0; border: 1px solid var(--panel-line); border-radius: 6px; transition: none; }   /* its colour is set inline, and changes at once */
/* the colour picker: one small popover under its swatch, 16 kit colours and the device's own picker as the 17th */
/* a popover (the colour picker, ⋯ More): one at a time, under its button */
.pop { position: fixed; z-index: 200; background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cpick { display: grid; grid-template-columns: repeat(6, 26px); gap: 8px; padding: 10px; }
.popmenu { display: flex; flex-direction: column; gap: 2px; padding: 6px; min-width: 160px; }
.popmenu button { display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent;
  color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 700; text-align: left; cursor: pointer; white-space: nowrap; }
@media (hover: hover) { .popmenu button:hover, .popmenu .acct:hover { background: var(--panel-2); } }
.popmenu button:focus-visible, .alignpick button:focus-visible { background: var(--panel-2); outline-offset: -2px; }   /* inside the row: the 2px gap can't hold a ring */
.popmenu button.on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 80%, var(--ink)); }   /* the current ground in the phone's ground menu: a pick's ring */
#sigBtn[aria-pressed="true"], #gameBtn[aria-pressed="true"], #visBtn[aria-pressed="true"], #airBtn[aria-pressed="true"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 80%, var(--ink)); }   /* ▶ Play's start Signal and Game side: the same ring, in the bar or the ⋯ menu */
.popmenu .pp-label { padding: 4px 10px 2px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.mw { display: none; }   /* a button's word, shown only when a phone folds it into a menu */
.popmenu .mw, .popmenu .tb-word { display: inline; }
.ground-btn, .toolbar .tb-more { display: none; }   /* phone only */
.cp-sw { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(128,128,128,.45); }   /* a faint edge, so navy and black show on the dark panels */
.cp-sw[data-hex="#ffffff"], .cp-sw[data-hex="#1c1f24"] { box-shadow: inset 0 0 0 1px rgba(128,128,128,.6); }   /* a hairline, so white and black show on both themes */
.cp-sw.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--primary); }   /* the current colour */
.cp-sw:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.cp-any, .selbar .swatches .cp-any { -webkit-appearance: none; appearance: none; background: conic-gradient(#e5453b, #f2c531, #a6d13a, #3aa0d6, #6b2fa3, #e8609a, #e5453b); }
.cp-any::-webkit-color-swatch-wrapper { padding: 0; }
.cp-any::-webkit-color-swatch { border: 0; opacity: 0; }
.cp-any::-moz-color-swatch { border: 0; opacity: 0; }
.seepick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.seepick input { width: 140px; accent-color: var(--primary); }
/* Align: six small pictures (the line they meet on in the accent) and Spread evenly under them */
.alignpick { display: grid; grid-template-columns: repeat(3, 38px); gap: 4px; padding: 8px; }
.alignpick .pp-label { grid-column: 1 / -1; padding: 0 4px 2px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.alignpick button { display: grid; place-items: center; height: 34px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--ink); cursor: pointer; }
@media (hover: hover) { .alignpick button:hover { background: var(--panel-2); } }
.alignpick .al-sep { grid-column: 1 / -1; height: 1px; margin: 2px 2px; background: var(--panel-line); }
.alignpick .al-spread { grid-column: 1 / -1; display: flex; justify-content: flex-start; gap: 9px; padding: 0 9px; font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.al-ico { display: block; width: 20px; height: 20px; overflow: visible; }
.al-bar { fill: currentColor; fill-opacity: .82; }
.al-line { fill: none; stroke: var(--primary-text); stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 720px) { .alignpick { grid-template-columns: repeat(3, 46px); } .alignpick button { height: 42px; } }   /* finger-sized */
@media (max-width: 720px) { .cpick { grid-template-columns: repeat(6, 32px); } .cp-sw { width: 32px; height: 32px; } #myColors .mc-sw, #stepLook .mc-sw { flex-basis: 32px; height: 32px; } }   /* finger-sized */
#myColors .pal-switch { flex-basis: 100%; }
.palette:not(.customizing) #myColors { display: none; }
/* + SVG: your own drawing into this section, only while customizing */
.pal-add {
  display: none; aspect-ratio: 1; place-items: center; padding: 0; cursor: pointer;
  border: 1.5px dashed var(--panel-line); border-radius: var(--radius-s); background: none;
  color: var(--ink-soft); font: inherit; font-size: 11px; font-weight: 800;
}
.palette.customizing .pal-add { display: grid; }
@media (hover: hover) { .pal-add:hover { border-color: var(--primary-text); color: var(--primary-text); } }
.pal-sec-title {
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft); margin: 4px 0 9px; display: flex; align-items: center; gap: 7px;
}
.grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 18px;
}
.tool {
  aspect-ratio: 1; border: 1px solid var(--panel-line); border-radius: var(--radius-s);
  background: var(--panel-2); cursor: pointer; display: grid; place-items: center;
  padding: 7px; transition: border-color .12s, transform .08s, box-shadow .12s; position: relative;
}
@media (hover: hover) { .tool:hover { border-color: var(--primary); box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 25%, transparent); } }
.tool.armed { border-color: var(--primary-edge); background: var(--primary-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 45%, transparent); }
/* the counter on an armed tile (×2, ×3…), bottom right, clear of the × and −/+ badges at the top */
.tool[data-n]::after {
  content: "×" attr(data-n); position: absolute; right: -6px; bottom: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  box-sizing: border-box; border-radius: 9px; display: grid; place-items: center; font-size: 11px; line-height: 1; font-weight: 800;
  background: var(--primary); color: var(--on-primary); box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
/* a pinned line tool (it stays on after each line): a pin head, where the counter sits on piece tiles (a line tool never has one) */
.tool.pinned::after {
  content: ""; position: absolute; right: -5px; bottom: -5px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.tool:active { transform: scale(.94); }
/* customize mode: built-in tiles get a − badge (+ when hidden) in the same look as × */
.tool .asset-x, .palette.customizing .tool[data-key]::after {
  position: absolute; top: -6px; right: -6px; width: 17px; height: 17px; border-radius: 50%;
  display: none; place-items: center; font-size: 12px; line-height: 1; font-weight: 800;
  background: var(--panel); color: var(--ink-soft); border: 1px solid var(--panel-line); box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tool:hover .asset-x, .palette.customizing .tool.asset .asset-x { display: grid; }
.palette.customizing .tool[data-key]::after { content: "−"; display: grid; }
.palette.customizing .tool.off::after { content: "+"; background: var(--primary); border-color: var(--primary-edge); color: var(--on-primary); }
@media (hover: hover) { .tool .asset-x:hover { background: var(--danger); border-color: var(--danger); color: #fff; } }
.tool > svg { width: 100%; height: 100%; display: block; pointer-events: none; }
/* My sets: wider tiles with a picture and a name */
/* minmax(0, …) + min-width: 0 so a long name ellipsizes instead of widening the column */
.grid.sets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.sets:empty { margin-bottom: 8px; }   /* the hint text below brings its own gap */
.tool.set { aspect-ratio: auto; display: flex; flex-direction: column; gap: 4px; padding: 6px; min-width: 0; min-height: 76px; }
/* the picture sits on a little patch of grass, so white goals and arrows show in both themes */
/* it's an <img>, so nothing inside the picture can run or be clicked */
.tool.set > img { display: block; width: 100%; height: 46px; padding: 3px; box-sizing: border-box; border-radius: 4px;
  background: var(--pitch-a); object-fit: contain; pointer-events: none; }
.tool.set .set-name { font-size: 11px; font-weight: 700; color: var(--ink-soft); width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.tool .set-ren { left: -3px; right: auto; }
.tool.set .asset-x:not(.set-ren) { right: -3px; }   /* a set's × and the next set's ✎ sit 3 px out: 1 px apart, never over each other (drawing tiles keep −6 px) */
.tool:hover .set-ren { display: grid; }
/* a finger has no hover: a set's ✎ and × always show, each taking a finger-sized area round the small badge */
@media (hover: none), (any-pointer: coarse) {
  .tool.set .asset-x { display: grid; }
  .tool.set .asset-x::before { content: ""; position: absolute; inset: 0 0 -9px -9px; }   /* grown down and inwards only: the next tile's ✎ sits a few px away, the row above just over it */
  .tool.set .set-ren::before { inset: 0 -9px -9px 0; }
}
.sets-empty { font-size: 12px; line-height: 1.4; color: var(--ink-soft); margin: 0 0 18px; }
/* white icons (paths, goal) turn dark grey on the light theme's pale tiles */
.tool.on-grass svg { color: #fff; filter: invert(.8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tool.on-grass svg { filter: none; } }
:root:is([data-theme="dark"], [data-theme="grey"]) .tool.on-grass svg { filter: none; }
/* dark theme: a faint light edge round the player tiles, so a dark team's outline still reads on the dark tile */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tool[data-team] svg { filter: drop-shadow(0 0 1px rgba(255,255,255,.55)); } }
:root:is([data-theme="dark"], [data-theme="grey"]) .tool[data-team] svg { filter: drop-shadow(0 0 1px rgba(255,255,255,.55)); }
/* step marker tiles and looks: a faint dark edge, so a white or pale Steps colour still reads on the pale tile; a light one on the dark theme */
#palSteps .tool svg, #stepLook button[data-look] svg { filter: drop-shadow(0 0 1px rgba(0,0,0,.45)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(#palSteps .tool, #stepLook button[data-look]) svg { filter: drop-shadow(0 0 1px rgba(255,255,255,.55)); } }
:root:is([data-theme="dark"], [data-theme="grey"]) :is(#palSteps .tool, #stepLook button[data-look]) svg { filter: drop-shadow(0 0 1px rgba(255,255,255,.55)); }

/* path shape switch: straight arrows vs freehand curves */
.penshape { display: flex; gap: 4px; margin: -8px 0 18px; }
.penshape button {
  flex: 1; color: var(--q-ink, var(--ink-soft)); font-size: 12px; font-weight: 700; padding: 5px 0; cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.penshape + .penshape { margin-top: -12px; }   /* option rows sit close under the pens */
.penshape svg { display: block; margin: 0 auto; }
.penshape .lw-sample { flex: 2; display: grid; place-items: center; color: var(--ink); }
.penshape button:disabled { opacity: .4; cursor: default; }
.penshape [data-step] { font-size: 17px; line-height: 1; }

/* Marking: cone colour + spacing for cone lines and boxes */
.markopts { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: -8px 0 18px; }
.swatches { display: flex; gap: 6px; }
.swatches button {
  width: 20px; height: 20px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid rgba(0,0,0,.18);
}
.swatches button.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--primary); }
#stepColors button, #selColors [data-team] { border: 1px solid rgba(128,128,128,.6); }   /* a hairline, so the black and white team dots show on both themes */
.gapctl { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.gapctl input { width: 46px; font: inherit; color: var(--ink); text-align: center; padding: 4px 2px; }
.mark-edge { width: 100%; margin: -8px 0 18px; color: var(--q-ink, var(--ink-soft)); font-size: 12px; font-weight: 700; padding: 6px 0; cursor: pointer; }


/* ---- stage ---- */
.stage { flex: 1 1 auto; position: relative; min-width: 0; display: flex; flex-direction: column; container-type: inline-size; }   /* the selection bar sizes to it (@container below) */
.stage-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--panel-line); background: var(--panel); flex: 0 0 auto;
}
@media (min-width: 721px) { .stage-head, .pitchpick { flex-wrap: wrap; } .pitchpick button { white-space: nowrap; } }   /* a narrow window: the ground buttons go to a second line (a phone has its ground menu) */
/* the board: an endless dotted surface; #world inside it is moved and scaled by the camera */
.canvas-wrap {
  flex: 1 1 auto; position: relative; overflow: hidden; touch-action: none;
  background-color: var(--panel-2);
  background-image: radial-gradient(circle, var(--board-dot) 1px, transparent 1.3px);
  background-size: var(--dot-step) var(--dot-step);
}
.canvas-wrap.space, .canvas-wrap.space * { cursor: grab !important; }
.canvas-wrap.panning, .canvas-wrap.panning * { cursor: grabbing !important; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; --inv: 1; }

.pitch {
  position: absolute; left: 0; top: 0; z-index: 0;   /* its pieces stay in their own drill's layer: they never show through another drill's notes */
  background:
    repeating-linear-gradient(90deg, var(--pitch-a) 0 100px, var(--pitch-b) 100px 200px);
  border-radius: 8px; box-shadow: var(--shadow), inset 0 0 0 3px rgba(255,255,255,.5);
  overflow: hidden; cursor: crosshair; touch-action: none;
  user-select: none; color: #fff;   /* pitch lines, arrows and goals take this colour */
}
/* paper: warm paper ground, sage pitch lines, dark green ink for arrows and goals — prints without a tank of green ink */
.pitch.paper { background: var(--paper); color: var(--paper-ink); box-shadow: var(--shadow), inset 0 0 0 1px var(--paper-frame); }
.pitch.paper > .lines { color: var(--paper-lines); }
.pitch.paper .guides line { stroke: color-mix(in srgb, var(--paper-ink) 50%, transparent); }
/* white: Paper on pure white with the print's darker sage lines, as the PDF prints it; the same in both themes */
.pitch.white { background: #fff; }
.pitch.white > .lines { color: var(--print-lines); }
.card { position: absolute; top: 0; left: 0; }
.card.active { z-index: 3; }   /* the drill you work on is on top of everything, its header buttons above the next card's header */
/* card header: name + controls, the same size on screen at any zoom */
/* it sits on the card's top line (.card has no height, so bottom: 100% is that line); + Card goes at the end of the last card's header */
.card-head { position: absolute; left: 0; bottom: 100%; transform-origin: 0 100%; transform: scale(min(max(1, calc(var(--inv, 1) * 0.8)), var(--cap, 99))); white-space: nowrap;
  display: flex; gap: 3px; padding-bottom: 6px; }   /* one screen size when zoomed in; zoomed out it shrinks a little (to 80%), so a small drill isn't dwarfed by its name */
.card-head button { color: var(--q-ink, var(--ink-soft));
  font: 700 12px/1 system-ui, sans-serif; padding: 5px 7px; cursor: pointer; }
.card-head .ch-name { color: var(--ink); max-width: 220px; overflow: hidden; text-overflow: ellipsis; cursor: grab; }
.card:not(.active) .card-head [data-act], .world:not(.multi) .card-head [data-act]:not([data-act=dup]):not([data-act=before]):not([data-act=play]) { display: none; }
#addCardBtn { margin-left: 6px; }
/* the tick (in the PDF) and the minutes chip show on every drill (no data-act, so the rule above leaves them); one drill has no tick */
.card-head .ch-tick { min-width: 24px; }
.world:not(.multi) .card-head .ch-tick, .card:not(.active) .ch-min.empty { display: none; }
.card.off .ch-name { color: var(--ink-faint); }   /* left out of the PDF: faded, never gone */
/* resize grips on the active card's corners (JS places them), each wholly outside its corner so a press on the pitch always draws;
   the same size on screen at any zoom */
.card-grip { --gs: 10px; position: absolute; z-index: 3; width: calc(var(--gs) * var(--inv, 1)); height: calc(var(--gs) * var(--inv, 1)); border-radius: calc(3px * var(--inv, 1)); display: none; }   /* amber: with the handles below */
@media (pointer: coarse) { .card-grip { --gs: 16px; } }   /* a finger: bigger, still wholly outside */
.card.active > .card-grip { display: block; }
.card-grip.nw, .card-grip.se { cursor: nwse-resize; }
.card-grip.ne, .card-grip.sw { cursor: nesw-resize; }
.card-grip.nw, .card-grip.ne { margin-top: calc(var(--gs) * var(--inv, 1) * -1); }
.card-grip.nw, .card-grip.sw { margin-left: calc(var(--gs) * var(--inv, 1) * -1); }
.card.active > .card-head { z-index: 4; }   /* on a narrow card the buttons reach past the ne grip: they stay clickable */
/* notes: a sheet of paper under the pitch, in card units (JS sets top, --w and the font size from the card's width);
   cream paper in both themes and on Paper, with a folded corner showing the board behind it */
.card-notes { position: absolute; z-index: 2; left: 0; width: var(--w); font-family: system-ui, "Segoe UI", sans-serif; line-height: 1.45; color: var(--notes-ink);
  background: #fdf8e9; border-radius: .4em .4em 0 .4em; box-shadow: 0 .2em .8em rgba(20,30,45,.2), inset 0 0 0 1px rgba(140,115,50,.2); }
.card-notes::after { content: ""; position: absolute; right: 0; bottom: 0; width: 1.5em; height: 1.5em;
  background: linear-gradient(315deg, var(--panel-2) 0 50%, #d8c690 50%, #efe3bc 85%); border-top-left-radius: .25em; }
.cn-head { display: flex; align-items: center; gap: .4em; padding: .3em .35em .3em .8em; font-size: .8em; font-weight: 700; letter-spacing: .02em;
  color: #7a6431; background: #f4e9c4; border-bottom: 1px solid rgba(140,115,50,.25); border-radius: .5em .5em 0 0; user-select: none; }
.cn-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-fold { border: 0; background: none; font: inherit; font-size: 1.15em; line-height: 1; color: inherit; padding: .1em .4em; border-radius: .35em; cursor: pointer; }
@media (hover: hover) { .cn-fold:hover { background: rgba(140,115,50,.18); } }
/* ruled like a notepad; it grows with the words and never scrolls inside (the wheel pans the board) */
.card-notes textarea { display: block; width: 100%; margin: 0; border: 0; resize: none; overflow: hidden; font: inherit; color: inherit; tab-size: 4;
  padding: .5em .9em 1.4em; background: repeating-linear-gradient(transparent 0 calc(1.45em - 1px), rgba(47,128,237,.14) calc(1.45em - 1px) 1.45em) 0 .5em;
  background-origin: border-box; background-clip: content-box; }
.card-notes textarea::placeholder { color: #a8997a; }
.card-notes :is(.cn-fold, textarea):focus-visible { outline: 2px solid #7a6431; }   /* the sheet is cream in every look: its head's brown, not the accent (+ Notes sits on the board) */
.card-notes textarea:focus-visible { outline-offset: -2px; }
/* folded: just the strip, a tab you click to open */
.card-notes.folded { width: auto; max-width: var(--w); border-radius: .4em; }
.card-notes.folded::after, .card-notes.folded textarea { display: none; }
.card-notes.folded .cn-head { border-bottom: 0; border-radius: .5em; cursor: pointer; }
/* no notes yet: only a small + Notes tab, the same size on screen at any zoom, like the header */
.cn-add { display: none; }
.card-notes.empty { background: none; box-shadow: none; width: auto; pointer-events: none; }
.card-notes.empty > *, .card-notes.empty::after { display: none; }
.card-notes.empty > .cn-add { display: block; pointer-events: auto; transform-origin: 0 0; transform: scale(max(1, calc(var(--inv, 1) * 0.8))); white-space: nowrap;
  color: var(--q-ink, var(--ink-soft)); font: 700 12px/1 system-ui, sans-serif; padding: 5px 8px; cursor: pointer; }   /* a quiet button, as the drill's buttons beside it */
.world.multi .card.active > .pitch { outline: calc(3px * var(--inv, 1)) solid var(--primary); outline-offset: calc(3px * var(--inv, 1)); }
/* at rest (a tap on empty board) no drill looks picked: no outline, grips or drill buttons */
.world.rest .card.active > .pitch { outline: none; }
.world.rest .card-grip, .world.rest .card-head [data-act], .world.rest .ch-min.empty { display: none; }
/* zoomed far out (JS sets the classes) every header is just ✓ name min; farther, only the active drill's name, none at rest */
.world.far .card-head [data-act], .world.far .ch-min.empty, .world.far #addCardBtn, .world.far .card-notes.empty > .cn-add { display: none; }
.world.farther .card:not(.active) > .card-head, .world.farther .card-head > :not(.ch-name), .world.rest.farther .card-head { display: none; }
.pitch > .lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pitch > .lines *, .ap-pitch svg * { vector-effect: non-scaling-stroke; }

/* pitch area picker (stage head) */
.pitchpick { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pitchpick .pp-label {
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft); margin-right: 2px;
}
.pitchpick button {
  color: var(--q-ink, var(--ink-soft)); font-size: 12px; font-weight: 700; padding: 5px 10px; cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}

/* custom-area dialog */
.areapick { position: fixed; inset: 0; z-index: 100; background: rgba(10,15,22,.55); display: grid; place-items: center; }
.ap-panel {
  background: var(--panel); border-radius: 12px; box-shadow: var(--shadow);
  padding: 18px 20px; width: min(300px, 92vw);
}
.ap-panel h2 { margin: 0 0 4px; font-size: 14px; }
.ap-panel p { margin: 0 0 12px; font-size: 12px; color: var(--ink-soft); line-height: 1.45; }
.ap-pitch {
  position: relative; width: 100%; aspect-ratio: 68 / 105; border-radius: 6px; overflow: hidden;
  cursor: crosshair; touch-action: none; user-select: none;
  background: repeating-linear-gradient(90deg, var(--pitch-a) 0 24px, var(--pitch-b) 24px 48px); color: #fff;
}
.ap-pitch svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ap-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.ap-actions button { border: 0; color: var(--ink); font-weight: 700; font-size: 12.5px; padding: 8px 14px; cursor: pointer; }
.gp-panel { width: min(360px, 92vw); }
.gp-orient { margin: 0 0 8px; }   /* Wide / Tall: the panel's toggle pair, without its tuck under the pens */
.gp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.gp-presets button, .ap-actions .gp-ok {
  color: var(--ink); font-weight: 700; font-size: 13px;
  padding: 9px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.gp-presets button small { font-size: 10.5px; font-weight: 600; color: var(--q-ink, var(--ink-soft)); }   /* full ink under the mouse and pressed, as the fill darkens */
.gp-size { display: flex; gap: 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.gp-size input { width: 64px; font: inherit; color: var(--ink); padding: 5px 6px; margin: 0 4px; }
.ap-actions .gp-ok { border: 1px solid; border-radius: var(--field-r); }
/* amber fills only the one main button (My drills' Save, New session, a window's OK); a pick (a topic, a place, the ground, the pens) is ink words in a
   thin ring of the accent (a club's pill: its own colour). After the plain colours and the border shorthands above, so it wins; each selector keeps
   its own weight, so a club's pill edge and the red Delete below still win */
.md-save, .ap-actions .gp-ok { background: var(--primary); border-color: var(--primary-edge); color: var(--on-primary); }
#playbar .ico[aria-pressed] { border: 1px solid transparent; }   /* the bar's buttons have no edge (border: 0): the eye gets one for its pressed ring, the line below colours it */
#mdPanel .md-chip[aria-pressed="true"], .dp-place[aria-pressed="true"], .penshape button.on, .pitchpick button.on, #playbar .ico[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--primary) 80%, var(--ink)); color: var(--ink); }
#paperBtn.on { border-color: transparent; }   /* Papīrs cycles the ground and its word names it: not a pick, so the plain edge, its words in ink, darker under the mouse (.on stays: test 162 reads it) */
/* the editor's own question box (#edAsk, plan 2026-10-19-editor-dialog.md): the panel above over a dimmed page; the question, a field for a name,
   Cancel and the action (red for a delete: darker than --danger, so white words are 4.5:1). A phone: the top third, clear of the keyboard */
#edAsk { padding: 0; border: 0; background: none; color: var(--ink); overflow: visible; }
#edAsk::backdrop { background: rgba(10,15,22,.55); }
#edAsk .ap-panel { width: min(380px, calc(100vw - 32px)); }
#edAsk h2 { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
#edAskIn { display: block; width: 100%; margin-top: 12px; font: inherit; font-size: 14px; padding: 8px 10px; color: var(--ink); }
#edAsk .gp-ok { justify-content: center; }
#edAsk .gp-ok.bad { background: color-mix(in oklch, var(--danger) 78%, black); border-color: transparent; color: #fff; }
#edAsk button:active { scale: .97; }
:is(#world, .ap-panel)[tabindex="-1"]:focus { outline: none; }   /* focus parked after a question (its opener gone): a place, not a control */
@media (prefers-reduced-motion: no-preference) {
  #edAsk[open], #edAsk[open]::backdrop { transition: opacity .15s ease-out; }
  @starting-style { #edAsk[open], #edAsk[open]::backdrop { opacity: 0; } }
}
@media (max-width: 720px) {
  #edAsk { margin-block: 12vh auto; }
  #edAskIn { font-size: 16px; }   /* 16px: iOS doesn't zoom in */
  #edAsk .ap-actions button { flex: 1; min-height: 2.75rem; }
}

.item {
  position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px;
  cursor: grab;
  display: grid; place-items: center; z-index: 2;
}
.item svg { width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.item.faded > svg { filter: opacity(var(--op)); }   /* ◑ See-through: on the drawing, so the selection box stays solid; a filter, so a drawing's own opacity multiplies in, as in the Picture */
.card:not(.aid-off) .item.aid-dim:not(.sel) { opacity: var(--aid-dim); }   /* temporary drawing aid; op, exported appearance and Play stay intact */
.card:not(.aid-off) .item.aid-hide:not(.sel) { display: none; }
/* ▶ Play: the moving copies on one layer with no z-index of its own, so they stack with the pieces; the arrows wait at half, the step's own come up
   (the element's opacity, never `op`: .faded's filter multiplies in) */
.pitch > .play { position: absolute; inset: 0; pointer-events: none; }
/* the vision cones (the play bar's eye): first in the play layer, over zones and arrows, under every copy (z-index 2, as .item); clipped to the pitch.
   Each a wrapper moved to its player, its child turned (plan: 2026-11-01-player-vision.md) */
.play > .vis { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.vis > div { position: absolute; left: 0; top: 0; } .vis svg { position: absolute; overflow: visible; }
@media (forced-colors: active) { .vis .vf { display: none; } .vis .vr { stroke: CanvasText; } }   /* the rim only, in the system's ink */
/* the shadows and the possession ring (SHADOW): first in the play layer, one SVG in pitch space; z-index 1, so over the arrows and flat gear but under
   standing gear (a player's shadow never darkens a cone), the cones of vision and every copy */
.play > .shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.pitch > .board-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.shade svg { position: absolute; left: 0; top: 0; }
@media (forced-colors: active) { .shade .sh, .pitch > .board-shade { display: none; } .shade .rg { stroke: CanvasText; } }
.card.playing .item.path { opacity: .5; } .card.playing .item.path.now { opacity: 1; }
.card.nolines .item.path { visibility: hidden; }   /* the play bar's Paths (Bultas) off: only the players and balls move; the end shows them again (showPlay takes the class off), but not Repeat's short wait */
.card.aid-off .sigs [data-game] { display: none; }   /* Hide through the end hold and Repeat, until Stop; Signal lines stay. */
.card.gifing .pitch > .play { display: none; }   /* ▶ Play's Save as GIF: the engine moves its copies unseen, the drill shows as drawn */
/* ▶ Play: the balls into each goal, a number over it (goalNums draws it, the GIF too): over the goals' copies (z-index 3), in card units */
.play > .goal-nums { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; z-index: 4; pointer-events: none; }
/* ▶ Play: the amber mark where an arrow was left out (plan: 2026-11-04-play-skip-mark.md). Over the goals' copies (z-index 3), and after the end too (no .playing). The same size on screen at
   any zoom (scale × --inv); its centre (--x, --y: card units) held inside the card so the pitch's overflow doesn't cut it, nor a finger's area on a phone */
.play-skip { --skip-size: 20px; --skip-edge: 1px; --skip-edge-ink: rgba(0,0,0,.75); --skip-hit: var(--skip-size); --skip-in: calc((var(--skip-hit) / 2 + var(--skip-edge)) * var(--inv, 1));
  position: absolute; z-index: 4; pointer-events: auto; left: clamp(var(--skip-in), var(--x), calc(100% - var(--skip-in))); top: clamp(var(--skip-in), var(--y), calc(100% - var(--skip-in)));
  width: var(--skip-size); height: var(--skip-size); padding: 0; border: 0; border-radius: 50%; transform: translate(-50%, -50%) scale(var(--inv, 1));
  background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 var(--skip-edge) var(--skip-edge-ink); font-size: 14px; font-weight: 800; line-height: 1; cursor: pointer; }
.play-skip::before { content: ""; position: absolute; inset: calc((var(--skip-size) - var(--skip-hit)) / 2); border-radius: 50%; }
@media (pointer: coarse) { .play-skip { --skip-hit: 32px; } }
.item.sel::after {
  content: ""; position: absolute; inset: -6px; border-radius: 8px;
  border: 2px solid var(--select); background: color-mix(in srgb, var(--select) 16%, transparent);
  box-shadow: 0 0 0 2px rgba(255,255,255,.35);
}
.item.dragging { cursor: grabbing; z-index: 40; }
/* paths and the ladder lie under players and gear: grabbing a player never grabs the arrow leaving them */
.item.low { z-index: 1; }
.item.zone { z-index: 0; }   /* a zone lies under everything, paths included */
.item.low.dragging { z-index: 40; }
/* a freehand curve's box can cover half the pitch — only the stroke itself is clickable */
.item.free { pointer-events: none; }
.item.free .hit { pointer-events: stroke; cursor: grab; }
.freeprev { position: absolute; inset: 0; pointer-events: none; z-index: 41; }
.freeprev svg { width: 100%; height: 100%; overflow: visible; }
/* cone lines and boxes: only the discs and the edge strip take clicks, so you can click and box-select inside a box */
.item.mark { pointer-events: none; }
.item.mark .disc { pointer-events: visiblePainted; cursor: grab; }
.item.mark .hit { pointer-events: stroke; cursor: grab; }
/* a piece tile is armed: every click on the card places one, so pieces show the crosshair too */
.canvas-wrap.stamping .item, .canvas-wrap.stamping .item * { cursor: crosshair; }
.canvas-wrap.stamping .groupbox .handle, .canvas-wrap.stamping .groupbox .rot { display: none; }   /* a click there places, never resizes */
.item.mark.sel::after, .item.zone.sel::after { background: none; }   /* no tint over a selected box or zone: it would dull their colours */
/* a selected curve: no box round its whole area (the coach), the stroke glows instead; its end grips do the rest */
.item.free.sel::after { display: none; }
.item.free.sel > svg { filter: drop-shadow(0 0 2px var(--select)) drop-shadow(0 0 1px var(--select)); }
.item.free.sel.faded > svg { filter: opacity(var(--op)) drop-shadow(0 0 2px var(--select)) drop-shadow(0 0 1px var(--select)); }
/* size readout while drawing a cone line or box, and over a selected one */
.measure { position: absolute; z-index: 70; pointer-events: none; transform: translate(-50%, calc(-100% - 10px * var(--inv, 1))) scale(var(--inv, 1));
  transform-origin: 50% 100%; background: rgba(20,28,38,.88); color: #fff; font: 700 12px/1 system-ui, sans-serif;
  padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.measure.below { transform: translate(-50%, calc(12px * var(--inv, 1))) scale(var(--inv, 1)); transform-origin: 50% 0; }   /* several pieces: under the box, the turn knob is on top */
@media (pointer: coarse) { .measure.below { transform: translate(-50%, calc(24px * var(--inv, 1))) scale(var(--inv, 1)); } }   /* clear of the bigger bottom handle */
/* the dot on the last arrow's tip while a line tool stays on: press there to draw on from it. The same size on screen at any zoom */
.tipdot { position: absolute; z-index: 60; pointer-events: none; width: 10px; height: 10px; border-radius: 50%; background: var(--primary);
  transform: translate(-50%, -50%) scale(var(--inv, 1)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent), 0 0 10px 2px var(--primary); }

.numedit {
  position: absolute; z-index: 50; width: 38px; height: 26px; margin: -13px 0 0 -19px;
  text-align: center; font: 800 14px system-ui, sans-serif; color: var(--ink);
  background: var(--panel); border: 2px solid var(--select); border-radius: 7px; outline: none;
  box-shadow: var(--shadow); transform: scale(var(--inv, 1));   /* the same size on screen at any zoom */
}

/* selection chrome lives inside the zoomed card: × --inv (1/zoom) keeps it the same size on screen */
.marquee {
  position: absolute; border: calc(1.5px * var(--inv, 1)) solid var(--select);
  background: color-mix(in srgb, var(--select) 16%, transparent); pointer-events: none; z-index: 30;
  border-radius: calc(3px * var(--inv, 1));
}
/* snap guides: faint, only while dragging, never clickable */
.guides { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 37; overflow: visible; }
.guides line { stroke: rgba(255,255,255,.6); stroke-width: 1; vector-effect: non-scaling-stroke; }
.card-guides { inset: auto; left: 0; top: 0; width: 1px; height: 1px; z-index: 5; }   /* in #world, between drills: board units */
.card-guides line { stroke: var(--primary); stroke-width: 1.5; }
/* ▶ Play's start signal: a faint dashed line between a marked pair of cones, under the pieces, in the pitch's own ink (white on grass, the paper ink on Paper and White) */
.sigs { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.sigs :is(line, circle) { fill: none; stroke: currentColor; stroke-opacity: .7; stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.guides text { fill: #fff; font-weight: 700; font-family: system-ui, sans-serif; text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,.45); stroke-width: 3px; vector-effect: non-scaling-stroke; }

/* group bounding box + corner scale handles */
.groupbox {
  position: absolute; z-index: 35; pointer-events: none;
  border: calc(1.5px * var(--inv, 1)) dashed var(--select); border-radius: calc(6px * var(--inv, 1));
  box-shadow: 0 0 0 1px rgba(255,255,255,.25);
}
/* a real group: solid outline instead of the dashed selection box */
.groupbox.grouped { border-style: solid; border-width: calc(2px * var(--inv, 1)); }   /* × 1/zoom, like the rest of the selection chrome */
/* the handles: amber, like the buttons and the selection. The same size on screen at any zoom (× --inv);
   a mouse gets small handles, a finger (the pointer: coarse block) bigger ones with an invisible pad round them */
.groupbox .handle, .groupbox .rot, .endpt, .card-grip {
  background: var(--primary); border: calc(1.5px * var(--inv, 1)) solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4); touch-action: none;
}
@media (hover: hover) {
  .groupbox .handle:hover, .groupbox .rot:hover, .endpt:hover, .card-grip:hover { filter: brightness(1.15); }
}
.groupbox .handle {
  --hs: 10px; --ho: 0px;   /* size, and how far out from the box its centre sits */
  position: absolute; width: calc(var(--hs) * var(--inv, 1)); height: calc(var(--hs) * var(--inv, 1));
  transform: translate(-50%, -50%); pointer-events: auto; border-radius: calc(3px * var(--inv, 1));
}
.handle.nw, .handle.w, .handle.sw { left: calc(var(--ho) * var(--inv, 1) * -1); }
.handle.ne, .handle.e, .handle.se { left: calc(100% + var(--ho) * var(--inv, 1)); }
.handle.nw, .handle.n, .handle.ne { top: calc(var(--ho) * var(--inv, 1) * -1); }
.handle.sw, .handle.s, .handle.se { top: calc(100% + var(--ho) * var(--inv, 1)); }
.handle.n, .handle.s { left: 50%; cursor: ns-resize; }
.handle.e, .handle.w { top: 50%; cursor: ew-resize; }
.handle.nw, .handle.se { cursor: nwse-resize; }
.handle.ne, .handle.sw { cursor: nesw-resize; }
/* endpoint grips for a selected arrow */
.endpt {
  position: absolute; width: calc(14px * var(--inv, 1)); height: calc(14px * var(--inv, 1));
  margin: calc(-7px * var(--inv, 1)) 0 0 calc(-7px * var(--inv, 1)); border-radius: 50%; z-index: 36; cursor: grab; display: none;
}
.endpt.show { display: block; }
.groupbox .rot {
  --rt: 26px;   /* from the knob's top down to the box */
  position: absolute; left: 50%; top: calc(var(--rt) * var(--inv, 1) * -1); width: calc(14px * var(--inv, 1)); height: calc(14px * var(--inv, 1));
  margin-left: calc(-7px * var(--inv, 1)); pointer-events: auto; border-radius: 50%; cursor: grab;
}
.groupbox .rot::after {   /* the stem, behind the top handle */
  content: ""; position: absolute; left: 50%; top: 100%; z-index: -1; width: calc(2px * var(--inv, 1));
  height: calc((var(--rt) - 14px) * var(--inv, 1)); margin-left: calc(-1px * var(--inv, 1)); background: var(--primary);
}
.groupbox.locked .handle, .groupbox.locked .rot, .groupbox.upright .rot { display: none; }   /* only locked pieces selected: nothing to drag; only slalom poles: nothing to turn */
@media (pointer: coarse) {
  .groupbox .handle { --hs: 14px; --ho: 8px; }   /* further out, so a press in the middle of a small piece still moves it */
  .groupbox .rot { --rt: 40px; }   /* clear of the top handle's pad */
  /* no pad on an arrow's end grips: they sit on the arrow, and would cover a short one */
  .groupbox .handle::before, .groupbox .rot::before { content: ""; position: absolute; inset: calc(-8px * var(--inv, 1)); border-radius: 50%; }
}

/* floating multi-select bar — lives on the stage, outside the pitch, so narrow crops never clip it */
.selbar {
  position: absolute; top: 52px;   /* over the ground row's second line when it wraps: picked once, not needed while drawing */ left: 50%; transform: translateX(-50%) translateY(-8px);
  display: flex; align-items: center; gap: 4px; z-index: 60; width: max-content;   /* one row: centred via left 50%, so don't shrink-wrap to half the stage */
  max-width: calc(100% - 16px); flex-wrap: wrap; justify-content: center;   /* a narrow window wraps it onto two rows */
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 11px;
  box-shadow: var(--shadow); padding: 6px; opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s;
}
.selbar.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.selbar .count {
  font-size: 12px; font-weight: 800; color: var(--primary-text); padding: 0 10px 0 8px;
  border-right: 1px solid var(--panel-line); white-space: nowrap;
}
.selbar button {
  border: 0; color: var(--ink); cursor: pointer;
  height: 32px; padding: 0 11px; border-radius: var(--field-r); font-size: 12.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px; transition: background .12s, color .12s; white-space: nowrap;
}
@media (hover: hover) { .selbar button:hover { background: var(--primary); color: var(--on-primary); } }
.selbar button.danger { color: var(--danger-text); }   /* red words on the fill; the hover below turns them --on-primary on red */
@media (hover: hover) { .selbar button.danger:hover { background: var(--danger); color: var(--on-primary); } }
.selbar button.ico { width: 35px; padding: 0; justify-content: center; }   /* the icon-only six and ⋯, as wide as ⇅ */
.selbar .sb-x {
  background: transparent; color: var(--ink-faint); width: 26px; padding: 0; justify-content: center;
  font-size: 14px; height: 32px;
}
@media (hover: hover) { .selbar .sb-x:hover { background: var(--panel-2); color: var(--ink); } }
/* the grip ⠿: a mouse drags the bar to another edge or along one (JS: placeSelbar). Not on a touch screen or a phone-wide window; a short one (a MacBook) gets it too, top and bottom only (coach) */
.selbar .sb-grip { display: none; place-items: center; width: 14px; height: 32px; color: var(--ink-faint); font-size: 14px; cursor: grab; user-select: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 721px) { .selbar .sb-grip { display: grid; } .selbar .sb-grip:hover { color: var(--ink); } }
.selbar.side .sb-grip { width: auto; height: 8px; font-size: 11px; } .selbar.side .sb-grip .i { rotate: 90deg; }   /* short: the tallest column (661 px) fits a 1280 × 800 window between Paper and ⊹ Snap */
.selbar.dragging { transition: none; } .selbar.dragging, .selbar.dragging .sb-grip { cursor: grabbing; }
/* colour dots: round swatches, not selbar buttons */
.selbar .swatches { padding: 0 6px; }
.selbar .swatches button { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid rgba(0,0,0,.18); }
.selbar .swatches [data-color="auto"] { border-color: var(--panel-line); }
.selbar-restore {
  position: absolute; top: 52px; left: 50%; transform: translateX(-50%);
  z-index: 60; display: none; width: 28px; height: 28px; border-radius: 50%;   /* a quiet button, round */
  color: var(--q-ink, var(--ink-soft)); cursor: pointer; font-size: 13px; font-weight: 800; box-shadow: var(--shadow);
}
.selbar-restore.show { display: block; }
/* ✎ Customize can put the bar at the bottom of the board; the toast then shows above it */
.selbar.bottom, .selbar-restore.bottom { top: auto; bottom: 14px; }
.selbar.bottom.show ~ .toast { bottom: calc(var(--sb-h, 46px) + 16px); }   /* the bar's real height (placeSelbar), a wrapped bar too */
/* …or stand it on the right edge, one column of symbols (JS puts it at the top where the column doesn't fit) */
.selbar.side { top: 50%; left: auto; right: 16px; flex-direction: column; flex-wrap: nowrap; gap: 2px; max-width: none; transform: translateY(-50%) translateX(8px); }
.selbar.side.show { transform: translateY(-50%) translateX(0); }
.selbar.side > * { flex: none; }
.selbar.side button { height: 28px; }   /* a compact column: it fits more windows */
.selbar.side .count { align-self: stretch; text-align: center; padding: 2px 0 6px; border-right: 0; border-bottom: 1px solid var(--panel-line); }
.selbar.side .word, .selbar.side .sbw { display: none; }   /* the word stays in the button's title */
.selbar.side #shapeBtn, .selbar.side #stepBtn, .selbar.side #paceBtn, .selbar.side #visBtn, .selbar.side #airBtn, .selbar.side #fillBtn, .selbar.side #tapeBtn, .selbar.side #lockBtn, .selbar.side #layerBtn, .selbar.side #seeBtn, .selbar.side #delBtn { width: 35px; padding: 0; justify-content: center; }
.selbar.side .swatches:not([hidden]) { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; width: 44px; padding: 2px 0; }   /* two dots to a row, a lone one centred */
.selbar.side .swatches button { height: 20px; }   /* round, not the column's 28 px buttons */
.selbar-restore.side { top: 50%; left: auto; right: 16px; transform: translateY(-50%); }
/* a stage narrower than the full bar (every kind selected, step-marker dots included, Latvian, Unlock): Lock, Shape, Fill, Tape and the count go icon-only, so it keeps one row; the word stays in each title */
@container (max-width: 1140px) {
  .selbar:not(.side) .count, .selbar .word, .selbar .sbw { display: none; }
  .selbar #shapeBtn, .selbar #stepBtn, .selbar #paceBtn, .selbar #visBtn, .selbar #airBtn, .selbar #fillBtn, .selbar #tapeBtn, .selbar #lockBtn, .selbar #layerBtn, .selbar #seeBtn, .selbar #delBtn { width: 35px; padding: 0; justify-content: center; }   /* fixed widths: no font can push the bar over */
  .selbar { gap: 2px; } .selbar .swatches { gap: 3px; padding: 0 1px; }   /* room for the step marker's three team dots */
  .selbar .sb-grip { width: 10px; } .selbar .sb-x { width: 22px; }   /* and for the grip: the widest mix is 774 of 776 px at 1024 */
}

/* Phone selection controls: leave room for Air and the close button on the same row. */
@container (max-width: 420px) {
#selbar:not(.side) > button:not(.sb-x) { width: 32px; padding: 0; justify-content: center; }
}

/* hint legend */
.hint {
  position: absolute; left: 16px; bottom: 14px; z-index: 20;
  background: color-mix(in srgb, var(--chrome) 90%, transparent); color: var(--on-chrome);
  border-radius: 9px; padding: 9px 28px 9px 12px; font-size: 11.5px; line-height: 1.7; max-width: 260px;
  max-height: calc(100% - 90px); overflow-y: auto;   /* stays under the name and Ground bar; scrolls when the window is short */
  box-shadow: var(--shadow); backdrop-filter: blur(3px);
}
.hint b { color: #fff; }
.hint.hidden { display: none; }
.hint-x {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border: 0; background: transparent; color: var(--on-chrome-soft); cursor: pointer;
  font-size: 14px; line-height: 1; border-radius: 5px; padding: 0;
}
@media (hover: hover) { .hint-x:hover { background: rgba(255,255,255,.15); color: #fff; } }
.hint-restore {
  position: absolute; left: 16px; bottom: 14px; z-index: 20; display: none;
  width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--chrome) 90%, transparent); color: var(--on-chrome);
  font-weight: 800; font-size: 14px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--on-chrome) 45%, transparent), var(--shadow);
}
@media (hover: hover) { .hint-restore:hover { color: #fff; } }
.hint-restore.show { display: block; }
/* Touch modifier row, bottom left beside ?: held is pressed in, once is outlined, locked is filled.
   Clear of the screen's edges (iOS's back swipe, the home bar). Plan: 2026-11-23-modifier-keys-spec.md */
.mod-keys { display: flex; gap: var(--mod-key-gap);
  position: absolute; left: var(--mod-key-left); bottom: max(var(--mod-key-bottom), env(safe-area-inset-bottom, 0px)); z-index: 21;
}
.mod-keys[hidden], .mod-hint[hidden] { display: none; }
.mod-hint-at { position: relative; height: 0; z-index: 21; }   /* no height of its own between the stage's head and the board: the hint hangs from it, so it follows a head that wraps */
.mod-hint { position: absolute; top: 8px; left: 8px; max-width: calc(100% - 16px); padding: 6px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }   /* what the lit keys do, top left of the board; the toast's look */
.mod-key {
  width: var(--mod-key); height: var(--mod-key); border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--chrome) 90%, transparent); color: var(--on-chrome); font-weight: 600; font-size: 15px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--on-chrome) 45%, transparent), var(--shadow);
  touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .08s, background .12s;
}
.mod-key.once { background: var(--mod-once-bg); box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.mod-key.lock { background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow); }
.mod-key.down { transform: translateY(2px); background: color-mix(in srgb, var(--chrome) 80%, black); color: var(--on-chrome); box-shadow: 0 0 0 2px var(--primary), var(--shadow); }   /* pressed in: darker and 2 px down, as a real key */
.mod-keys:not([hidden]) ~ .toast { bottom: calc(var(--mod-key-bottom) + var(--mod-key) + 10px); }   /* above the key row, so a message never covers the key (a bar at the bottom: its own rule wins) */
.stage:has(> .mod-keys:not([hidden])) > .hint { bottom: calc(var(--mod-key-bottom) + var(--mod-key) + 10px); max-height: calc(100% - 100px - var(--mod-key)); }   /* the shortcut legend opens above the key */
.app.pal-open .mod-keys, .app.pal-open .mod-hint { display: none; }   /* the phone's tile panel and its shade over the board */
@media (max-width: 720px) { :root { --mod-key-left: max(24px, env(safe-area-inset-left, 0px)); } }   /* no ? on a phone; clear of iOS's back swipe */
.mod-keys:not([hidden]) ~ .stage-corner { max-width: calc(100% - 16px - var(--mod-key-left) - var(--mod-row-width) - 8px); }   /* the drawing aid's colours scroll short of the key */
@media (max-width: 360px) {   /* a small phone: no room beside three keys, so the corner sits in its own row above them, and a message above both (the corner is a key high) */
  .mod-keys:not([hidden]) ~ .stage-corner { bottom: calc(var(--mod-key-bottom) + var(--mod-key) + 10px); max-width: calc(100% - 32px); }
  .mod-keys:not([hidden]) ~ .toast { bottom: calc(var(--mod-key-bottom) + 2 * var(--mod-key) + 20px); }
}
/* Drawing visibility and Snap, bottom right; colours scroll while recovery and Snap stay in reach. */
.stage-corner { position: absolute; right: 16px; bottom: 14px; z-index: 20; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); }
.snap-btn {
  flex: none; height: 28px; padding: 0 11px; border-radius: 999px; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--chrome) 90%, transparent); color: var(--on-chrome); font-weight: 700; font-size: 12px; box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 5px;
}
@media (hover: hover) { .snap-btn:hover { color: #fff; } }
.snap-btn:not(.on) { opacity: .55; text-decoration: line-through; }
#aidBar { display: flex; align-items: center; min-width: 0; border-radius: 999px; padding: 2px; background: color-mix(in srgb, var(--chrome) 90%, transparent); color: var(--on-chrome); box-shadow: var(--shadow); }
#aidDots { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#aidDots::-webkit-scrollbar { display: none; }
#aidBar button { position: relative; flex: none; height: 28px; border: 0; border-radius: 999px; padding: 0 9px; color: inherit; background: transparent; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
#aidDots button { width: 30px; padding: 0; }
#aidDots button::before { content: ""; position: absolute; width: 14px; height: 14px; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px solid var(--on-chrome); border-radius: 50%; background: var(--aid-colour); }
#aidDots [data-aid-state=dim]::before { opacity: .4; }
#aidDots [data-aid-state=hide]::before { background: transparent; border-color: var(--aid-colour); box-shadow: 0 0 0 1px var(--on-chrome); }
#aidDots [data-aid-state=hide]::after { content: ""; position: absolute; width: 18px; height: 2px; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-45deg); background: var(--on-chrome); }
#aidBar button:focus-visible { outline-color: var(--on-chrome); outline-offset: -2px; }
@media (hover: hover) { #aidBar button:hover { background: rgba(255,255,255,.12); } }
@media (pointer: coarse) { #aidBar button { height: 40px; } #aidDots button { width: 40px; } }
.kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px;
  background: rgba(255,255,255,.16); padding: 1px 6px; border-radius: 4px; border: 1px solid rgba(255,255,255,.14);
}

.toast, .mod-hint { background: var(--ink); color: var(--panel); border-radius: 999px; font-size: 12.5px; font-weight: 600; }   /* one look for a message and the keys' hint */
.toast {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 9px 16px;
  opacity: 0; transition: opacity .2s, transform .2s; z-index: 70; white-space: nowrap;
  pointer-events: none;   /* a hidden message takes no clicks (its button stays in it until the next message) */
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast button { font: inherit; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 999px; padding: 6px 11px; margin: -6px -9px -6px 6px; cursor: pointer; }
@media (hover: hover) { .toast button:hover { background: color-mix(in srgb, currentColor 15%, transparent); } }

@media (max-width: 720px) {
  .pal-edit { position: static; display: block; margin: -6px 0 4px auto; }   /* its own row above the titles on a phone */
  .hint, .hint-restore { display: none !important; }
  /* phone: the board gets the whole width. The tile panel pops out over its left side from ＋ Add (JS: the phone section),
     with a see-through shade under it that takes a tap beside it */
  .drill-name, #markGap, .gp-size input, .md-q, .numedit { font-size: 16px; }   /* smaller text boxes make an iPhone zoom in when tapped, and stay zoomed */
  #mdList .dp-row { flex-wrap: wrap; }   /* My drills: the name beside the picture, its two buttons under them */
  #mdList .dp-meta { flex-basis: calc(100% - 96px); }
  /* the topic chips in one row that slides sideways (#mdChips only: a row's toggles share .md-chips); + Topic goes first and stays
     at the left edge, its frame in the panel's colour so chips slide under it; scroll-padding keeps a picked chip clear of it */
  #mdChips { flex-wrap: nowrap; overflow-x: auto; max-height: none; scrollbar-width: none; scroll-padding-left: 84px;
    padding: 4px; margin: -6px -4px 6px; }   /* room for the focus ring, which the sliding row would cut */
  #mdChips::-webkit-scrollbar { display: none; }
  #mdChips .md-chip { flex: none; max-width: calc(100% - 140px); }   /* a long picked name and its × fit beside the sticky + Topic */
  #mdChips .md-add { order: -1; position: sticky; left: 0; z-index: 1; box-shadow: 0 0 0 6px var(--panel); }
  .split { position: relative; }
  .palette { display: none; }
  .app.pal-open .palette { display: block; position: absolute; left: 0; top: 0; bottom: 0; width: 250px; max-width: 85vw; z-index: 91; box-shadow: var(--shadow); }
  .app.pal-open .pal-shade { display: block; position: fixed; inset: 0; z-index: 90; }
  .tb-tools .tb-add { display: inline-flex; }
  /* the toolbar in one row: no logo, symbols only (＋ Add and ⤢ Fit too; the words stay in the tooltips), and Fit instead of the slider (pinch zooms) */
  .brand, .tb-word, .zoomctl input[type="range"], .zoomctl .zpct { display: none; }
  /* the top in one row each: the ground is one button (its choices, Picture, PDF and light / dark fold into menus: JS, the phone section);
     the selection bar drops its count and the four colour dots (the colour wheel has them), and Shape shows its symbol only */
  .toolbar .tb-more { display: flex; }
  .tb-tools .tb-sep { display: none; }   /* room for Drills: the top bar stays one row at 390 px */
  .toolbar { gap: 4px; padding-left: 8px; padding-right: 8px; } .tb-tools .tb-btn, .toolbar > a.tb-btn { padding: 0 4px; }
  #saveBtn .i { display: none; }   /* Save keeps its word instead, the one word in the bar: 320 px still one row */
  .toolbar .tb-export { display: none; }   /* Picture and PDF are in ⋯ (JS): their empty group takes no gap */
  .stage-head { gap: 8px; padding: 8px 10px; }
  .drill-name { max-width: none; }
  .drill-total { display: none; }   /* the top keeps one row; the total is in the PDF */
  .ground-btn { display: inline-flex; align-items: center; gap: 3px; flex: none; color: var(--ink);
    font: inherit; font-size: 12px; font-weight: 700; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
  .selbar .count, .selbar .word, .selbar .swatches button:not([data-color="own"]):not([data-color="auto"]) { display: none; }
  .selbar #shapeBtn { width: 35px; padding: 0; justify-content: center; }
  .toast { white-space: normal; width: max-content; max-width: calc(100% - 24px); text-align: center; text-wrap: balance;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; row-gap: 12px; }   /* its button an item of its own, so wrapped words never run under it. A long tip wraps instead of widening the page */
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }   /* a soft fade from the landing page */
/* ⤓ PDF: while the page sheet stands, printing shows only it (not an iframe: iPhones print the main page) */
/* its pages: A4 on screen too, so the notes are measured off-screen (.fit) before printing; fixed colours, never the theme's */
#printSheet { display: none; color: #1c2530; background: #fff; font-family: system-ui, "Segoe UI", sans-serif; }
#printSheet.fit { display: block; position: fixed; left: -400mm; top: 0; visibility: hidden; }
#printSheet .pg { box-sizing: border-box; width: 297mm; height: 210mm; padding: 11mm 13mm 7mm; overflow: hidden; background: #fff;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; break-after: page; page-break-after: always; }
#printSheet .pg:last-child { break-after: auto; page-break-after: auto; }
/* the header: the session's name big on page 1 with the total and the count on the right, small on the pages after */
#printSheet .pg-head { display: flex; align-items: flex-end; gap: 10mm; padding-bottom: 3.5mm; border-bottom: 0.3mm solid #d5dbe2; }
#printSheet .pg-title { flex: 1; min-width: 0; }
#printSheet .pg-name { margin: 0; font-size: 22pt; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
#printSheet .pg + .pg .pg-name { font-size: 13pt; }
#printSheet .pg-time { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
#printSheet .pg-min { font-size: 15pt; font-weight: 700; line-height: 1.2; }
#printSheet .pg-count { font-size: 10pt; color: #5b6675; margin-top: .6mm; }
/* the drills: a grid of tiles, each its number, name and minutes over the drawing, the notes under it or beside it (the fit picks, then keeps it) */
#printSheet .pg-grid { display: grid; gap: 6mm 8mm; padding-top: 5mm; min-width: 0; min-height: 0; }
#printSheet .pg-tile { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
#printSheet .pg-tt { display: flex; gap: 2mm; align-items: baseline; font-size: 10.5pt; font-weight: 700; line-height: 1.25; margin-bottom: 1.8mm; min-width: 0; }
#printSheet .pg-n { color: var(--print-lines); }
#printSheet .pg-tname { flex: 1; min-width: 0; overflow-wrap: anywhere; }   /* a long name wraps, never cut: its height counts in the fit */
#printSheet .pg-tmin { flex: none; color: #5b6675; font-weight: 600; font-size: 9pt; font-variant-numeric: tabular-nums; white-space: nowrap; }
#printSheet .pg-tb { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 2mm; min-width: 0; min-height: 0; }
#printSheet .pg-tile.side .pg-tb { grid-template-rows: minmax(0, 1fr); gap: 4mm; }
#printSheet .pg-dw { min-width: 0; min-height: 0; }
#printSheet .pg-draw { display: block; width: 100%; height: 100%; }   /* drawn to its box's exact shape */
#printSheet .pg-notes { position: relative; min-width: 0; min-height: 0; overflow: hidden; font-size: 9pt; line-height: 1.38; color: var(--notes-ink); }
#printSheet .pg.f8 .pg-notes { font-size: 8pt; }
#printSheet .pg.more .pg-grid { grid-template-rows: minmax(0, 1fr); }   /* notes carried on: the whole page is theirs */
#printSheet .pg-notes > div { white-space: pre-wrap; overflow-wrap: anywhere; }
#printSheet .pg-notes .li { padding-left: 1.1em; text-indent: -1.1em; }   /* "- " lines: the words line up under the words, not under the dash */
#printSheet .pg-notes .li::before { content: "•"; display: inline-block; width: 1.1em; text-indent: 0; color: #5b6675; }
#printSheet .pg-notes .b { font-weight: 700; }
#printSheet .pg-notes .gap { height: .5em; }
#printSheet .pg-foot { display: flex; justify-content: space-between; align-items: flex-end; height: 7mm; font-size: 8.5pt;   /* a fixed height: the number comes after the fit; the right cell is kept for a mark later */
  color: #8a94a3; font-variant-numeric: tabular-nums; }
@media print {
  @page { size: A4 landscape; margin: 0; }   /* no room for the browser's date, address and page number; each page pads itself */
  html.printing, html.printing body { height: auto !important; overflow: visible !important; background: #fff !important; }
  html.printing body > :not(#printSheet) { display: none !important; }
  html.printing #printSheet { display: block; }
}
