/* Themes. Every colour is a token: dark values here (the default), light
   values in the two blocks below. Light applies when the device prefers it
   (System mode) or when the header toggle sets data-theme="light"; an
   explicit data-theme="dark" wins over a light device. theme.js and
   theme-init.js keep --bg's two values for iOS's theme-color. */
:root {
  --bg: #0f1115;
  --panel: #181b22;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #7c5cff;
  --accent-soft: #7c5cff26;
  --custom: #3ecf8e;          /* your own moves (the Builder) */
  --custom-soft: #3ecf8e1f;
  --mirror: #5ab4ff;          /* a mirrored routine (the Builder) */
  --mirror-soft: #5ab4ff26;
  --variation: #3ecf8e;       /* a variation of a base move (the Type filter) */
  --variation-soft: #3ecf8e1f;
  --reverse: #f0a3ff;         /* a base move run in reverse */
  --reverse-soft: #f0a3ff1f;
  --on-accent: #ffffff;
  --link: #a996ff;
  --danger: #ff8a8a;
  --danger-line: #ff8a8a66;
  --danger-soft: #ff8a8a1a;
  --warn: #f5a524;            /* unsaved changes (saved routines) */
  --warn-soft: #f5a5241f;
  --backdrop: #000000aa;
  --backdrop-strong: #000000cc;
  --shadow: #00000088;
  /* The Song BPM control: its panel, readout well, tape and TAP pad. Dark
     here, and in the light theme it follows the page (white panel, page
     background for the well and tape, the accent for the lit parts). */
  --deck: #16181e;
  --deck-hi: #1e2129;
  --deck-edge: #2c303a;
  --deck-text: #d9dce6;
  --deck-label: #8a91a1;
  --deck-shade: #000000b3;
  --deck-press: #00000066;
  --well: #0a0b0f;
  --tape: #101217;
  --tick: #4a5060;
  --led: #c3b4ff;
  --led-off: #241f3a;
  --led-glow: #7c5cffaa;
  --pad: #211d33;
  --pad-edge: #3a3358;
  --pad-lit: #7c5cff;
  /* Google's sign-in button in its dark theme; the light blocks use its light
     theme (Google Identity branding guidelines). */
  --google-bg: #131314;
  --google-bg-hover: #202124;
  --google-text: #e3e3e3;
  --google-line: #8e918f;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f6fa;
    --panel: #ffffff;
    --line: #d4d7e1;
    --text: #16181d;
    --muted: #5b6372;
    --accent: #6646e6;
    --accent-soft: #6646e61f;
    --custom: #0f8a58;
    --custom-soft: #0f8a581a;
    --mirror: #1565c0;
    --mirror-soft: #1565c01a;
    --variation: #0f8a58;
    --variation-soft: #0f8a581a;
    --reverse: #9c27b0;
    --reverse-soft: #9c27b01a;
    --link: #5a3fd6;
    --danger: #c62828;
    --danger-line: #c6282866;
    --danger-soft: #c628281a;
    --warn: #a15c00;
    --warn-soft: #a15c001a;
    --backdrop: #10121866;
    --backdrop-strong: #101218aa;
    --shadow: #1018282e;
    --deck: #ffffff;
    --deck-hi: #ffffff;
    --deck-edge: #d4d7e1;
    --deck-text: #16181d;
    --deck-label: #5b6372;
    --deck-shade: #1018281a;
    --deck-press: #10182814;
    --well: #f6f6fa;
    --tape: #f6f6fa;
    --tick: #b3b8c5;
    --led: #6646e6;
    --led-off: #e3def8;
    --led-glow: #6646e600;
    --pad: #f0edfc;
    --pad-edge: #c9bff5;
    --pad-lit: #6646e6;
    --google-bg: #ffffff;
    --google-bg-hover: #f2f2f2;
    --google-text: #1f1f1f;
    --google-line: #747775;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f6fa;
  --panel: #ffffff;
  --line: #d4d7e1;
  --text: #16181d;
  --muted: #5b6372;
  --accent: #6646e6;
  --accent-soft: #6646e61f;
  --custom: #0f8a58;
  --custom-soft: #0f8a581a;
  --mirror: #1565c0;
  --mirror-soft: #1565c01a;
  --variation: #0f8a58;
  --variation-soft: #0f8a581a;
  --reverse: #9c27b0;
  --reverse-soft: #9c27b01a;
  --link: #5a3fd6;
  --danger: #c62828;
  --danger-line: #c6282866;
  --danger-soft: #c628281a;
  --warn: #a15c00;
  --warn-soft: #a15c001a;
  --backdrop: #10121866;
  --backdrop-strong: #101218aa;
  --shadow: #1018282e;
  --deck: #ffffff;
  --deck-hi: #ffffff;
  --deck-edge: #d4d7e1;
  --deck-text: #16181d;
  --deck-label: #5b6372;
  --deck-shade: #1018281a;
  --deck-press: #10182814;
  --well: #f6f6fa;
  --tape: #f6f6fa;
  --tick: #b3b8c5;
  --led: #6646e6;
  --led-off: #e3def8;
  --led-glow: #6646e600;
  --pad: #f0edfc;
  --pad-edge: #c9bff5;
  --pad-lit: #6646e6;
  --google-bg: #ffffff;
  --google-bg-hover: #f2f2f2;
  --google-text: #1f1f1f;
  --google-line: #747775;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

/* The app works like an app, not a page: holding a title, a tab or a button
   mustn't select its words (on iPhone, holding "Create" offered Copy). Only
   what you type stays selectable; iOS needs that said on the fields
   themselves, or they can't be typed in. Privacy and Terms are pages to read,
   so they keep selection. */
.app-shell { -webkit-user-select: none; user-select: none; }
.app-shell input, .app-shell textarea, .app-shell select, .app-shell [contenteditable] { -webkit-user-select: text; user-select: text; }
/* No Copy or link-preview callout on holding a control. */
.app-shell button, .app-shell summary, .app-shell a, .app-shell label { -webkit-touch-callout: none; }

header {
  /* The top inset is 0 in a browser tab; it matters if the installed app ever
     draws under the status bar. */
  padding: calc(1.5rem + env(safe-area-inset-top)) 1.25rem 0.5rem; max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 0.5rem 1rem;
}
header h1 { margin: 0; font-size: 1.6rem; }
header p { margin: 0.25rem 0 0; color: var(--muted); }
header .app-version { font-size: 0.8rem; }
header .app-version a { color: var(--muted); }
header .app-version a:hover { color: var(--text); }

main {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 1.25rem;
  padding: 1rem 1.25rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  main { grid-template-columns: 1fr; }
  fieldset { min-width: 0; }
}

/* The app (nav.js): one area at a time, at every width, clear of the bottom
   stack (the area's docked buttons and the tab bar). */
main.app {
  display: block; max-width: 760px;
  padding: 0.75rem 1rem calc(var(--bottom-stack, 8rem) + 1.5rem);
}
main.app > * + * { margin-top: 1rem; }
.area { display: none; }
body[data-area="create"] .area[data-area="create"],
body[data-area="routine"] .area[data-area="routine"],
body[data-area="practice"] .area[data-area="practice"],
body[data-area="you"] .area[data-area="you"] { display: grid; gap: 1rem; }
.area > *, .area form, .area fieldset { min-width: 0; }
.area form { display: grid; gap: 1rem; }
.area > .seg { margin: 0; }
/* Practice's two cards, each with its own Start. */
.practice-card { display: grid; gap: 0.75rem; padding: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.practice-card h2 { margin: 0; font-size: 1.1rem; }
.practice-card .hint { margin: 0; }
.practice-card #drill { border: 0; padding: 0; margin: 0; min-width: 0; }
.practice-card button.wide { min-height: 48px; width: 100%; }
.practice-card #result { margin: 0; }

/* The title bar: the area's name, and Routine's own buttons. */
header.app-bar {
  max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 0.5rem;
  grid-template-columns: none;
  padding: calc(0.5rem + env(safe-area-inset-top)) 1rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
/* Editing: the routine's title stays at the top, and the editor's row
   (Editing, Start blank, Done) right under it. */
body.editing-routine header.app-bar { position: sticky; top: 0; z-index: 4; background: var(--bg); }
body.editing-routine .edit-bar { top: var(--app-bar, 0px); }
.app-title { margin: 0 auto 0 0; font-size: 1.3rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-title:focus { outline: none; }
.app-bar > .mirror-badge { flex: none; }
/* The Mirrored badge belongs to the routine: only on Routine's title bar. */
body:not([data-area="routine"]) .app-bar > .mirror-badge { display: none; }
.area-actions { display: none; align-items: center; gap: 0.25rem; }
body[data-area="routine"]:not(.signed-out) .area-actions { display: flex; }
.area-actions > button { min-height: 44px; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0 0.7rem; }
.area-actions > button.icon-button { width: 44px; padding: 0; justify-content: center; }
.area-actions .share-icon { width: 20px; height: 20px; }
.nav-icon { width: 20px; height: 20px; flex: none; }
.more-menu { position: relative; }
.more-menu > summary {
  list-style: none; cursor: pointer; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line); color: var(--text);
}
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu[open] > summary { border-color: var(--accent); }
.more-panel {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 20; min-width: 12rem;
  display: grid; gap: 0.5rem; padding: 0.5rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px var(--shadow);
}
.more-panel button { min-height: 44px; width: 100%; text-align: left; }
.more-panel button .nav-icon { width: 18px; height: 18px; margin-right: 0.4rem; vertical-align: -3px; }
.notices { max-width: 760px; margin: 0 auto; padding: 0 1rem; display: grid; gap: 0.5rem; }
.notices:has(> :not([hidden])) { padding-top: 0.75rem; }

/* The bottom stack: the area's buttons, docked right above the tab bar (never
   floating over it), then the tab bar; the safe area below both. */
.bottom-stack {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.dock { display: none; gap: 0.5rem; max-width: 760px; margin: 0 auto; padding: 0.5rem 1rem; }
body[data-area="create"] .dock[data-dock="create"],
body[data-area="routine"] .dock[data-dock="routine"] { display: flex; }
.dock button { flex: 1; min-height: 48px; white-space: nowrap; }
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 760px; margin: 0 auto; border-top: 1px solid var(--line); }
.tabbar button {
  min-height: 56px; display: grid; justify-items: center; align-content: center; gap: 2px;
  border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 0.75rem; font-weight: 600; padding: 0;
}
.tabbar button[aria-current="page"] { color: var(--accent); }
.tabbar .nav-icon { width: 22px; height: 22px; }
.tabbar button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* You: one list of rows, each an icon, a label and its value; rows with more
   open in place (docs/prototypes/navigation/, A). */
.you-list { display: grid; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.you-list .account, .you-list .account-billing { display: contents; }
.you-item { box-shadow: 0 -1px 0 var(--line); }
.you-list .you-row {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; box-sizing: border-box; min-height: 52px;
  padding: 0 1rem; margin: 0; background: transparent; color: var(--text); border: 0; border-radius: 0;
  font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; list-style: none;
  touch-action: manipulation;
}
.you-list .you-row::-webkit-details-marker { display: none; }
.you-list .you-row:hover .you-label { color: var(--accent); }
.you-row > .nav-icon { color: var(--muted); }
.you-label { flex: 1 0 auto; }
.you-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.you-chevron { width: 18px; height: 18px; transition: transform 0.15s; }
.you-label small { display: block; color: var(--muted); font-weight: 400; font-size: 0.82rem; }
/* Help, the list's last group: a heading row, then Report a technical problem (emphasised) and Get help. */
.you-group { margin: 0; padding: 0.9rem 1rem 0.35rem; box-shadow: 0 -1px 0 var(--line); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.you-list .you-strong .you-label { font-weight: 700; }
.you-list .you-strong > .nav-icon:first-child { color: var(--accent); }
details[open] > summary .you-chevron { transform: rotate(90deg); }
.you-more { display: grid; gap: 0.5rem; padding: 0 1rem 1rem; }
.you-more button { min-height: 44px; width: 100%; }
.you-link { display: flex; align-items: center; min-height: 44px; color: var(--text); font-weight: 600; text-decoration: none; }
.you-link:hover { color: var(--accent); }
.account-row .avatar,
.account-row .avatar-fallback { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.account-row .avatar-fallback { display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; background: var(--accent-soft); color: var(--text); }
.account-row .avatar-fallback[hidden], .account-row .avatar[hidden] { display: none; }
.account-who { margin: 0 0 0.25rem; display: grid; font-size: 0.95rem; }
.account-who span { color: var(--muted); overflow-wrap: anywhere; }
.account-plan { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; }
.account .account-actions { padding: 0.75rem 1rem; }
.account .account-actions button { flex: 1; min-height: 44px; }
.toast { justify-self: center; }
body:not(.signed-out) .site-footer { display: none; }

[hidden] { display: none !important; }

fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  margin: 0 0 1rem;
  padding: 0.75rem 1rem 1rem;
}
legend { padding: 0 0.4rem; font-weight: 600; }
/* Generator's groups (Style, Difficulty, Moves, Options): headed sections, not boxes. */
fieldset.group {
  border: 0; border-top: 1px solid var(--line); border-radius: 0;
  background: none; margin: 0.75rem 0 0; padding: 0.75rem 0 0;
}
fieldset.group:first-of-type { border-top: 0; margin-top: 0.25rem; padding-top: 0; }
fieldset.group > legend {
  float: left; width: 100%; padding: 0; margin-bottom: 0.5rem;
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
fieldset.group > legend + * { clear: both; }
#drill { border-top: 0; margin-top: 0.25rem; padding-top: 0; }

/* Segmented choice (the Generator's mode, the Drill type): radios drawn as
   one bar, the picked one raised. */
.seg { display: flex; gap: 4px; padding: 4px; margin: 0.25rem 0 0.75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.seg label { position: relative; flex: 1; display: grid; place-items: center; min-height: 44px; margin: 0; padding: 0 0.75rem; border-radius: 9px; color: var(--muted); font-weight: 600; text-align: center; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--accent); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

label { display: block; margin: 0.5rem 0; }
select, input[type="number"] {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.radio-row label, .check { margin: 0.35rem 0; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  box-sizing: border-box;
  margin: 0;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.hint { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0.5rem; }

/* Song BPM (bpm-control.js): an LED readout over the number field, a tape
   under a needle, then the TAP pad and keys. Without JavaScript, only the
   field shows. */
.bpm.enhanced {
  display: grid; gap: 12px; margin: 0.5rem 0; padding: 12px;
  background: linear-gradient(180deg, var(--deck-hi), var(--deck) 45%);
  border: 1px solid var(--deck-edge); border-radius: 14px; color: var(--deck-text);
}
.bpm.enhanced .bpm-display {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--well); border-radius: 10px; padding: 10px 12px;
  box-shadow: inset 0 2px 8px var(--deck-shade);
}
.bpm.enhanced .bpm-readout { position: relative; margin: 0; display: grid; gap: 4px; cursor: text; }
.bpm.enhanced .bpm-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--deck-label); }
.bpm-digits { display: none; }
.bpm.enhanced .bpm-digits { display: flex; gap: 5px; height: 46px; filter: drop-shadow(0 0 6px var(--led-glow)); }
.bpm-digits svg { height: 100%; width: auto; overflow: visible; }
.bpm-digits rect { fill: var(--led-off); }
.bpm-digits rect.on { fill: var(--led); }
.bpm.any .bpm-digits { filter: none; }
.bpm.any .bpm-digits rect.on { fill: var(--deck-label); }
/* The field sits over the digits, invisible until it's focused to type. */
.bpm.enhanced input[name="bpm"] {
  position: absolute; left: -6px; right: -6px; top: 18px; bottom: -4px; width: auto; margin: 0;
  opacity: 0; border-color: var(--pad-edge); background: var(--well); color: var(--led);
  font: 700 1.9rem ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.bpm.enhanced input[name="bpm"]:focus { opacity: 1; outline: 2px solid var(--pad-lit); outline-offset: 0; }
.bpm.enhanced input[name="bpm"]::placeholder { color: var(--deck-label); }
.bpm-count { display: grid; grid-template-columns: repeat(4, auto); gap: 5px 7px; }
.bpm-count span { display: grid; justify-items: center; gap: 1px; font: 0.6rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--deck-label); }
.bpm-count i { width: 10px; height: 10px; border-radius: 50%; background: var(--led-off); }
.bpm-count i.on { background: var(--led); box-shadow: 0 0 8px var(--led-glow); }
.bpm-count span:nth-child(4n + 1) i.on { background: var(--deck-text); } /* the 1 and the 5 */

.tape {
  position: relative; height: 84px; border-radius: 12px; overflow: hidden; background: var(--tape);
  box-shadow: inset 0 0 0 1px var(--deck-edge), inset 0 6px 14px var(--deck-shade);
}
.tape-scroll {
  display: flex; height: 100%; overflow-x: scroll; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain; outline: none;
}
.tape-scroll::-webkit-scrollbar { display: none; }
.tape-scroll:focus-visible { box-shadow: inset 0 0 0 3px var(--pad-lit); }
.tape-spacer { flex: none; width: calc(50% - 6px); }
.tape-tick { flex: none; width: 12px; position: relative; scroll-snap-align: center; }
.tape-tick::before { content: ""; position: absolute; left: 5px; top: 12px; width: 2px; height: 12px; border-radius: 1px; background: var(--tick); }
.tape-tick.five::before { height: 19px; }
.tape-tick.ten::before { height: 28px; background: var(--deck-text); }
.tape-tick span {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  font: 700 0.8rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--deck-label);
}
.tape-tick.sel::before { background: var(--led); box-shadow: 0 0 8px var(--led-glow); }
.tape-tick.sel span { color: var(--led); }
.bpm.any .tape-tick.sel::before { background: var(--tick); box-shadow: none; }
.bpm.any .tape-tick.sel span { color: var(--deck-label); }
.tape-needle {
  position: absolute; left: 50%; top: 5px; height: 40px; width: 2px; margin-left: -1px; z-index: 2;
  background: var(--pad-lit); box-shadow: 0 0 10px var(--led-glow); pointer-events: none;
}
.tape-needle::before { content: ""; position: absolute; left: -5px; top: -2px; border: 6px solid transparent; border-top-color: var(--pad-lit); border-bottom: 0; }
.tape::before, .tape::after { content: ""; position: absolute; top: 0; bottom: 0; width: 44px; pointer-events: none; z-index: 1; }
.tape::before { left: 0; background: linear-gradient(90deg, var(--tape), transparent); }
.tape::after { right: 0; background: linear-gradient(-90deg, var(--tape), transparent); }
.bpm.any .tape-needle { opacity: 0.4; }

.bpm-tap { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
button.tap-pad {
  display: grid; place-content: center; justify-items: center; gap: 2px; min-height: 104px; padding: 0;
  border-radius: 12px; border: 1px solid var(--pad-edge); background: var(--pad); color: var(--deck-text);
  -webkit-user-select: none; user-select: none;
  box-shadow: inset 0 -4px 0 var(--deck-press); transition: background 160ms ease-out, box-shadow 160ms ease-out;
}
.tap-pad b { font-size: 1.25rem; letter-spacing: 0.18em; }
.tap-pad small { font: 0.68rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--deck-label); }
button.tap-pad.lit { background: var(--pad-lit); color: var(--on-accent); box-shadow: 0 0 22px var(--led-glow); transition: none; }
.tap-pad.lit small { color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) { button.tap-pad { transition: none; } }
.bpm-side { display: grid; gap: 8px; align-content: start; min-width: 0; }
.bpm-status { margin: 0; min-height: 2.6em; font-size: 0.82rem; color: var(--deck-label); }
.bpm-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bpm-keys button, .listen-buttons button {
  min-height: 44px; padding: 0; border-radius: 9px; border: 1px solid var(--deck-edge); background: var(--deck-hi);
  color: var(--deck-text); font: 700 0.85rem ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  box-shadow: inset 0 -2px 0 var(--deck-press);
}
.bpm-keys button:active, .listen-buttons button:active { transform: translateY(1px); box-shadow: none; }
.bpm-keys button:disabled { opacity: 0.35; }
.bpm-keys button[aria-pressed="true"] { border-color: var(--pad-lit); color: var(--led); }
.bpm button:focus-visible { outline: 3px solid var(--pad-lit); outline-offset: 2px; }

/* Listen: the deck's last row, keys like the ones above. */
.listen { display: grid; gap: 8px; }
.listen-buttons { display: flex; gap: 6px; }
.listen-buttons button { flex: 1 0 auto; padding: 0 12px; white-space: nowrap; }
#listen-stop { border-color: var(--pad-lit); color: var(--led); }
.listen .hint { margin: 0; font-size: 0.82rem; color: var(--deck-label); }
.listen .hint:empty { display: none; }

/* Moves & options (move-picker.js): Choose moves opens the moves as a sheet. */
.chip-count { color: var(--muted); font-size: 0.85em; }
.pick-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; min-height: 52px;
  padding: 0.4rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); text-align: left;
}
.pick-summary > span { display: grid; min-width: 0; }
.pick-summary small { color: var(--muted); font-size: 0.82rem; }
.pick-summary .nav-icon { flex: none; color: var(--muted); }
.moves-sheet { grid-template-rows: auto auto auto minmax(0, 1fr); max-height: 92dvh; }
.moves-sheet .insert-head .primary { min-height: 44px; padding: 0 1rem; }
.moves-sheet-chips { display: grid; gap: 6px; }
.moves-sheet-chips .insert-styles { scrollbar-width: none; }
.moves-sheet-chips .insert-styles::-webkit-scrollbar { display: none; }
.moves-sheet-chips button { min-height: 44px; }
.moves-sheet-list { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 0.25rem; }
.moves-tools { display: flex; gap: 0.5rem; margin: 0 0 0.25rem; }
.moves-tools button { min-height: 44px; }

.move-list { list-style: none; margin: 0; padding: 0; }
.move-list li { border-top: 1px solid var(--line); padding: 0.3rem 0; }
.move-list li:first-child { border-top: 0; }
.move-list li[hidden] { display: none; }
.move-list .desc { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.85rem; }
.move-list li.filtered .move-info, .move-list li.filtered .desc { opacity: 0.5; }
.move-list li.variant { margin-left: 1.4rem; border-top-style: dashed; }
/* A row: the move, Learn, then its switch. The label wraps the move and the
   switch (one tap target); Learn sits between them but outside the label, so
   it never switches the move. */
.move-list li { display: grid; grid-template-columns: minmax(0, 1fr) 44px 56px; align-items: center; }
.move-row { display: contents; cursor: pointer; }
.move-info { grid-column: 1; grid-row: 1; min-width: 0; display: block; }
.move-info .meta, .move-why { display: block; }
.move-list .switch { grid-column: 3; grid-row: 1; justify-self: center; }
.move-list .learn-button { grid-column: 2; grid-row: 1; }
.move-list li > .desc { grid-column: 1 / -1; }
.move-why { color: var(--warn); font-size: 0.8rem; font-weight: 600; }
.move-why:empty { display: none !important; }
.kind-badge {
  display: inline-block; margin-left: 0.35rem; padding: 0 0.45rem; border-radius: 999px; vertical-align: 1px;
  font-size: 0.7rem; font-weight: 700; line-height: 1.6; letter-spacing: 0.02em;
}
.kind-badge.variation { background: var(--variation-soft); color: var(--variation); }
.kind-badge.reverse { background: var(--reverse-soft); color: var(--reverse); }
/* The move's switch: the form's checkbox, drawn as a switch (44px to the finger). */
.switch {
  appearance: none; -webkit-appearance: none; position: relative; width: 40px; height: 24px; margin: 10px 0; flex: none;
  border-radius: 999px; background: var(--line); cursor: pointer; transition: background 0.15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--panel); box-shadow: 0 1px 2px var(--shadow); transition: left 0.15s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { left: 19px; }
.switch::before { content: ""; position: absolute; inset: -10px -8px; } /* the 44px target */
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }
/* Learn (learn.js): a 44px button beside each move, padlocked when the lesson needs Pro. */
.move-list .learn-button { position: relative; width: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; touch-action: manipulation; }
.move-list .learn-button .lock-icon { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; margin: 0; padding: 2px; border-radius: 50%; background: var(--bg); }

/* Drill's picks: only the moves picked, numbered, with ▲ ▼ and ✕. */
.drill-picks { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 6px; }
.drill-picks[hidden] { display: none; }
.drill-pick {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 44px 44px; align-items: center;
  border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: var(--panel);
}
.drill-num {
  display: grid; place-items: center; width: 26px; height: 26px; margin-left: 6px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 0.78rem; font-weight: 700;
}
.drill-info { display: grid; min-width: 0; padding: 0.4rem 0.25rem; }
.drill-info small, .pick-row small { color: var(--muted); font-size: 0.8rem; }
.drill-arrows { display: grid; grid-template-rows: 44px 44px; }
.drill-arrow, .drill-remove {
  display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--accent); touch-action: manipulation;
}
.drill-remove { color: var(--muted); }
.drill-arrow[aria-disabled="true"] { color: var(--line); cursor: default; }
.drill-add { border-style: dashed; color: var(--accent); }
.drill-status { min-height: 1.2em; color: var(--accent); font-weight: 600; }
.drill-status:empty { display: none; }
.drill-slot { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.drill-slot > span { color: var(--muted); font-weight: 600; }
.drill-slot-text { display: grid; min-width: 0; }
/* Drill's Transitions: how to link the two moves, both ways. */
.drill-link { display: grid; gap: 0.4rem; margin: 0.25rem 0 0.75rem; padding: 0.65rem 0.8rem; border-radius: 10px; background: var(--accent-soft); }
.drill-link h4 { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.drill-link p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.drill-link b { color: var(--text); }
/* Into it: the transition's tip, under the choice. */
.into-tip { margin: 0; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.into-tip b { display: block; color: var(--text); }
.pick-style { margin: 0.4rem 0 0; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pick-row.variant { margin-left: 1.2rem; border-left-color: var(--line); }
.pick-row[aria-disabled="true"] { opacity: 0.55; cursor: default; }

/* The lesson sheet. */
.lesson-sheet { display: grid; gap: 0.5rem; max-height: 92dvh; grid-template-rows: auto minmax(0, 1fr); }
.lesson-sheet:not([open]) { display: none; }
.lesson-meta { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }
.lesson-body { overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 0.75rem; align-content: start; padding-bottom: 0.5rem; }
.lesson-status { margin: 0; color: var(--muted); }
.lesson-status[hidden] { display: none; }
.lesson-floor { display: flex; justify-content: center; height: clamp(170px, 34dvh, 280px); }
.lesson-counts { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; }
.lesson-counts span { padding: 2px 0; border-radius: 6px; text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.lesson-counts span.now { background: var(--accent); color: var(--on-accent); }
.lesson-controls { display: flex; align-items: center; gap: 0.75rem; }
.lesson-controls[hidden] { display: none; }
.lesson-sheet .stage-round { flex: none; width: 56px; height: 56px; min-height: 56px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.lesson-speed { flex: 1; display: flex; align-items: center; gap: 0.6rem; margin: 0; }
.lesson-speed span { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.lesson-speed input { flex: 1; min-height: 44px; accent-color: var(--accent); }
.lesson-speed output { min-width: 2.2rem; text-align: right; font-weight: 700; }
.lesson-section h3 { margin: 0 0 0.35rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lesson-section ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
/* One count column for the whole list (subgrid), as wide as its longest label, up to a wrap. */
.lesson-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: fit-content(5.5rem) minmax(0, 1fr); gap: 4px 0.75rem; }
.lesson-steps li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; gap: 0.75rem; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.lesson-steps li.now { border-color: var(--accent); background: var(--accent-soft); }
.lesson-count { font-variant-numeric: tabular-nums; }
.lesson-locked { display: grid; gap: 0.6rem; padding: 0.8rem; border: 1px dashed var(--accent); border-radius: 12px; }
.lesson-locked[hidden] { display: none; }
.lesson-locked p { margin: 0; }
.lesson-locked button { min-height: 44px; justify-self: start; }
.lesson-links { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.lesson-links h3 { flex-basis: 100%; margin: 0.25rem 0 0; }
.lesson-link { min-height: 44px; }
.lesson-video { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); font-weight: 600; }

.move-name { font-weight: 600; }
.meta { display: block; color: var(--muted); font-size: 0.85rem; }


button {
  /* Quick repeated taps are taps, not iOS double-tap zoom (pinch zoom still works). */
  touch-action: manipulation;
  font: inherit;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--text); border-color: var(--line); }
button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
button:disabled { opacity: 0.5; cursor: default; }
.share-button { display: inline-flex; align-items: center; gap: 0.4rem; }
.share-icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }


.routine { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.routine .move {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  margin: 0.35rem 0;
}
.routine .beats { display: block; color: var(--muted); font-size: 0.8rem; }
/* A move outside its BPM sweet spot: still allowed, just flagged. */
.tempo-tag {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.8rem;
}
.move-list li.off-tempo .meta::after { content: " · outside sweet spot"; color: var(--text); }
/* A transition: a mini card under the move it leaves, with a bracket from it
   (docs/prototypes/transitions/, round 4). Tapping it opens the tip. */
.routine .connector { position: relative; margin: 0 0 0 1.4rem; color: var(--muted); font-size: 0.9rem; }
.routine .connector::before {
  content: ""; position: absolute; left: -0.95rem; top: -0.35rem; height: 1.7rem; width: 0.65rem;
  border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 6px;
}
.routine.no-transitions .connector { display: none; }
.trans-head {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 44px; box-sizing: border-box; margin: 0;
  padding: 0 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted);
  font: inherit; text-align: left;
}
button.trans-head { cursor: pointer; }
.trans-head[aria-expanded="true"] { border-radius: 8px 8px 0 0; border-bottom-color: transparent; }
.trans-mark { width: 20px; height: 20px; flex: none; }
.trans-cue { flex: 1; min-width: 0; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.trans-i {
  flex: none; width: 18px; height: 18px; box-sizing: border-box; display: grid; place-items: center; border-radius: 50%;
  border: 1.25px solid var(--accent); color: var(--accent); font: italic 700 11px/1 Georgia, "Times New Roman", serif;
}
.trans-head[aria-expanded="true"] .trans-i { background: var(--accent); color: var(--on-accent); }
.trans-more {
  display: grid; gap: 0.25rem; padding: 0 0.75rem 0.65rem; border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 8px 8px; background: var(--bg); line-height: 1.4;
}
.trans-more[hidden] { display: none; }
.trans-pair { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.trans-tip { color: var(--text); }
/* The Transitions switch, beside the routine's summary: the double wave, its name and a track. */
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.summary-row > #summary { flex: 1; min-width: 0; }
.transitions-switch {
  flex: none; display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; padding: 0 0.25rem;
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.switch-track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--line); transition: background 0.2s; }
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--panel); transition: transform 0.2s;
}
.transitions-switch[aria-checked="true"] { color: var(--accent); }
.transitions-switch[aria-checked="true"] .switch-track { background: var(--accent); }
.transitions-switch[aria-checked="true"] .switch-track::after { transform: translateX(14px); }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track::after { transition: none; } }
/* How a move is danced (cues.js): lead foot, travel arrow, turn ring and size. */
.routine .move { position: relative; }
.routine .move:has(.cues) { padding-right: 7.5rem; }
.routine.editing .move:has(.cues) { padding-right: 10.25rem; }
.cues { position: absolute; top: 0.55rem; right: 0.8rem; display: flex; gap: 0.35rem; align-items: center; }
.routine.editing .cues { right: 3.25rem; }
.cue-foot { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 0.4rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 0.75rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.cue { display: inline-flex; align-items: center; gap: 1px; height: 1.7rem; min-width: 1.7rem; padding: 0 0.25rem; justify-content: center; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--accent); }
.cue small { font: 700 0.72rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.cue-icon { width: 1rem; height: 1rem; flex: none; }
.cue-icon path, .cue-icon polyline { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.routine .more { margin: 0.35rem 0; padding: 0.55rem 0.8rem; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.routine .more b { color: var(--accent); font-size: 1.15em; }

/* The floor map (route.js): the path, a caption riding with the marker, facing
   marks, and a filmstrip of 8-counts to swipe through. Never scrolls the page. */
.route { display: grid; gap: 0.4rem; justify-items: center; margin-top: 0.5rem; padding: 0.5rem 0; }
.route-map { width: min(100%, 40dvh, 380px); aspect-ratio: 1; border-radius: 14px; background: var(--panel); }
.route-map { cursor: pointer; touch-action: manipulation; }
.route-map:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.route-badge circle { fill: var(--accent); }
.route-badge-icon { fill: var(--on-accent); stroke: var(--on-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.route-film {
  position: relative; width: min(100%, 420px); height: 96px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.route-film:active { cursor: grabbing; }
.route-film:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.route-film::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
.film-track { position: absolute; top: 0; bottom: 0; left: 0; will-change: transform; }
.film-frame { position: absolute; top: 6px; bottom: 6px; border-left: 1px solid var(--line); }
.film-count { position: absolute; top: 0; left: 6px; font: 700 0.66rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.film-ticks { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(8, 1fr); text-align: center; font: 0.6rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--muted); }
.film-block {
  position: absolute; top: 18px; height: 46px; padding: 3px 6px; box-sizing: border-box; overflow: hidden;
  display: grid; align-content: start; gap: 1px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel);
}
.film-block.now { border-color: var(--accent); background: var(--accent-soft); }
.film-block b { font-size: 0.72rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.film-block small { font: 600 0.64rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--accent); white-space: nowrap; }
.route-facing { fill: var(--muted); opacity: 0.7; }
.route-facing.done { fill: var(--accent); opacity: 0.5; }
.route-cap rect { fill: var(--panel); stroke: var(--accent); stroke-width: 1.2; }
.route-cap-name { font: 700 10px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; fill: var(--text); }
.route-cap-cues { font: 600 8.5px ui-monospace, "SF Mono", Menlo, Consolas, monospace; fill: var(--muted); }
.route-readout { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; min-height: 1.3em; }
.route-verdict { width: 100%; display: grid; gap: 0.4rem; justify-items: start; padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.9rem; }
.route-verdict.home { background: var(--accent-soft); }
.route-verdict.away { border: 1px solid var(--accent); }
.route-verdict .fixes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.route-verdict button { min-height: 44px; }
.route-dot { fill: var(--line); }
.route-front { font: 700 9px ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.2em; fill: var(--muted); }
.route-label { font: 700 9px ui-monospace, "SF Mono", Menlo, Consolas, monospace; fill: var(--muted); }
.route-home { fill: none; stroke: var(--accent); stroke-width: 2.2; }
.route-home-dot { fill: var(--accent); }
.route-path { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.route-path.ahead { stroke: var(--muted); stroke-width: 1.8; stroke-dasharray: 1 5; }
.route-turn { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.route-end { fill: var(--muted); }
.route-me-arrow { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.routine .move.here { border-color: var(--accent); background: var(--accent-soft); }

/* Choreography's editor: one row pinned above the routine, which becomes a
   list of cards to move with ▲ ▼, drag, or tap; + between them adds a move. */
.edit-bar {
  position: sticky; top: 0; z-index: 3; display: grid; gap: 0.4rem;
  margin-top: 0.5rem; padding: 0.5rem 0; background: var(--bg); border-bottom: 1px solid var(--line);
}
.edit-bar .hint { margin: 0; }
.edit-more { display: grid; gap: 0.6rem; margin-top: 0.5rem; }
.edit-section { display: grid; gap: 0.3rem; }
.edit-section h3 { margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.edit-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.5rem; }
.edit-status:empty { display: none; }
.edit-status { margin: 0; }
.edit-more .hint { margin: 0; }
.edit-tools { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.5rem; }
.edit-title { margin-right: auto; font-size: 1rem; }
.edit-tools button { min-height: 44px; }
.edit-status { color: var(--muted); font-size: 0.85rem; }
.routine.editing .move {
  position: relative; padding-right: 3.5rem; min-height: 90px; box-sizing: border-box; cursor: grab;
  touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* The whole card opens its sheet (one button under its text), and ▲ ▼ sit on
   its right edge, stacked (docs/prototypes/editor-controls/, round 2, A). */
.move-open {
  position: absolute; inset: 0; z-index: 0; width: 100%; padding: 0; border: 0; border-radius: inherit;
  background: transparent; color: inherit; cursor: inherit;
}
.move-open:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.move-arrows { position: absolute; top: 0; right: 0; bottom: 0; display: grid; grid-template-rows: 1fr 1fr; width: 44px; }
.move-arrow {
  display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--accent); cursor: pointer;
}
.move-arrow:hover:not([aria-disabled="true"]) { background: var(--accent-soft); }
.move-arrow:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.move-arrow[aria-disabled="true"] { color: var(--line); cursor: default; }
/* The card being dragged: still there for the finger, out of sight. */
.routine.editing .move.lifted { visibility: hidden; height: 0; min-height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; }
.routine .placeholder { height: var(--ph, 56px); margin: 0.35rem 0; border: 2px dashed var(--accent); border-radius: 8px; background: var(--accent-soft); }
.routine .empty { padding: 1.25rem 1rem; border: 2px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; }
.drag-ghost {
  /* Sized and placed by choreo-edit.js: the picked-up move's own size, under the finger. */
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; display: grid; align-content: center; box-sizing: border-box;
  padding: 0.55rem 0.8rem; border: 1px solid var(--accent); border-left-width: 4px; border-radius: 8px;
  background: var(--panel); color: var(--text); box-shadow: 0 12px 28px var(--shadow);
}
.drag-ghost .beats { color: var(--muted); font-size: 0.8rem; }
.sheet {
  margin: auto auto 0; width: min(560px, 100vw); max-width: 100vw; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  border: 1px solid var(--line); border-radius: 16px 16px 0 0; background: var(--panel); color: var(--text);
}
.sheet::backdrop { background: var(--backdrop); }
.sheet h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.sheet-group { display: grid; gap: 0.3rem; margin-bottom: 0.75rem; }
.sheet-group > span { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
/* Feet follow on (docs/prototypes/foot-flow/): the lead foot's state, and which foot steps on each count. */
.sheet-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.foot-state { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.foot-state.set { color: var(--accent); }
.move .foot-state { display: block; }
.foot-strip { display: flex; flex-wrap: wrap; gap: 4px; }
.foot-strip span { min-width: 2.1rem; padding: 2px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); display: grid; justify-items: center; font-weight: 700; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.foot-strip span small { font-size: 0.62rem; font-weight: 600; color: var(--muted); }
.foot-strip span.last { border-color: var(--accent); color: var(--accent); }
.sheet-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.sheet-seg button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; min-height: 44px; padding: 0 0.6rem; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; }
.sheet-seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--accent); }
/* The Builder: counts steppers, Start on, holds, and a padlock while locked. */
.stepper { display: grid; grid-template-columns: 44px minmax(4.5rem, 1fr) 44px; align-items: center; gap: 0.4rem; }
.stepper button { min-height: 44px; padding: 0; font-size: 1.2rem; font-weight: 700; }
.stepper output, .stepper-value { display: grid; justify-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper-value output { font-size: 1.25rem; }
.stepper-sub { color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.edit-builder .stepper { grid-template-columns: 44px 4.5rem 44px; }
.start-label { color: var(--muted); font-size: 0.9rem; }
.lock-icon { width: 0.95em; height: 0.95em; margin-left: 0.3rem; vertical-align: -0.1em; }
.locked .stepper output, .locked .stepper-value, .locked .sheet-seg { opacity: 0.6; }
.sheet .locked-note { justify-self: start; min-height: 44px; }
.routine .hold.lead { border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 8px; padding: 0.55rem 0.8rem; margin: 0.35rem 0; }
.routine .move.hold, .routine .hold.lead { border-style: dashed; border-left-style: solid; border-left-color: var(--muted); background: var(--bg); }
.routine .hold .move-name { color: var(--muted); }

/* List | Count sheet, and the Count sheet (count-sheet.js): 8-count rows of counts 1–8. */
.view-toggle { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.view-toggle button { flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; }
.view-toggle button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--accent); }
.count-sheet { display: grid; gap: 0.35rem; margin-top: 0.75rem; }
.cs-row { display: grid; grid-template-columns: 1.5rem 1fr; align-items: end; gap: 0.35rem; }
.cs-label { color: var(--muted); font-weight: 700; font-size: 0.85rem; padding-bottom: 0.9rem; text-align: center; }
.cs-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: 3px; row-gap: 2px; }
.cs-tick { grid-row: 1; text-align: center; color: var(--muted); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.cs-tick.one { color: var(--accent); font-weight: 700; }
.cs-block {
  grid-row: 2; min-width: 0; min-height: 44px; padding: 0.25rem 0.35rem; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--text);
  font-size: 0.8rem; font-weight: 700; line-height: 1.15; text-align: left; hyphens: auto; overflow-wrap: break-word;
}
.cs-block.hold, .cs-block.lead { border-style: dashed; border-color: var(--muted); background: var(--bg); color: var(--muted); font-weight: 600; }
.cs-block.lead { display: flex; align-items: center; }
.cs-phrase { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; text-align: right; padding-top: 0.1rem; }

/* Your own moves (the Builder): dashed, in green, in every view. */
.routine .move.custom { border-style: dashed; border-left-style: solid; border-left-color: var(--custom); }
.routine .move.custom .notes { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.85rem; white-space: pre-line; }
.routine .connector.custom .trans-head, .routine .connector.custom .trans-more { border-style: dashed; border-color: var(--custom); background: var(--custom-soft); }
.routine .connector.custom .trans-head[aria-expanded="true"] { border-bottom-color: transparent; }
.routine .connector.custom .trans-cue, .routine .connector.custom .trans-mark { color: var(--custom); }
.routine .connector.custom .trans-i { border-color: var(--custom); color: var(--custom); }
.routine .connector.custom [aria-expanded="true"] .trans-i { background: var(--custom); color: var(--on-accent); }
.cs-block.custom { border-style: dashed; border-color: var(--custom); background: var(--custom-soft); }
.film-block.custom { border-style: dashed; border-color: var(--custom); }
.own-tag { color: var(--custom); font-weight: 600; }
.sheet-field { display: grid; gap: 0.3rem; }
.sheet-field > span { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.sheet-field input, .sheet-field select, .sheet-field textarea {
  min-height: 44px; padding: 0.5rem 0.65rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 1rem;
}
.sheet-field textarea { min-height: 4.5rem; resize: vertical; }
.sheet-field small { color: var(--muted); font-size: 0.78rem; }

/* The + between cards (editing): insert a move right there. */
.routine .gap { display: flex; justify-content: center; margin: -0.2rem 0; }
.gap-add {
  min-width: 44px; min-height: 32px; padding: 0 1rem; border: 1px dashed var(--line); border-radius: 999px;
  background: var(--bg); color: var(--accent); font-size: 1.1rem; font-weight: 700; line-height: 1;
}
.gap-add::before { content: ""; position: absolute; inset: -6px 0; } /* a 44px-tall tap area */
.gap-add { position: relative; }
.gap-add:hover, .gap-add:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
/* The insert sheet: search, styles, then a list of moves. */
.insert-sheet { display: grid; gap: 0.6rem; max-height: 85vh; grid-template-rows: auto auto auto minmax(0, 1fr); }
.insert-sheet:not([open]) { display: none; }
.insert-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.insert-head h2 { margin: 0; }
.insert-head .icon { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.3rem; }
.insert-styles { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.insert-styles button { flex: none; min-height: 40px; padding: 0 0.8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 600; white-space: nowrap; }
.insert-styles button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.insert-list { display: grid; gap: 6px; overflow-y: auto; overscroll-behavior: contain; align-content: start; padding-bottom: 0.25rem; }
.insert-row {
  display: grid; gap: 0.1rem; min-height: 52px; padding: 0.5rem 0.75rem; text-align: left;
  border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: var(--panel); color: var(--text);
}
.insert-row small { color: var(--muted); font-size: 0.8rem; }
.insert-row.own { border-style: dashed; border-left-style: solid; border-left-color: var(--custom); }
.insert-row.own b { color: var(--custom); }
.insert-row.hold { border-style: dashed; border-left-style: solid; border-left-color: var(--muted); background: var(--bg); }

/* Mirrored (mirror.js): a pill by the heading and on Dance; the icon in Direction. */
.mirror-badge {
  display: inline-flex; align-items: center; gap: 0.3rem; vertical-align: middle; margin-left: 0.4rem;
  padding: 0.15rem 0.6rem; border: 1px solid var(--mirror); border-radius: 999px;
  background: var(--mirror-soft); color: var(--mirror); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
}
.mirror-icon { width: 1.1em; height: 1.1em; flex: none; }
.view-toggle [data-dir] { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; }
.view-toggle [data-dir="mirrored"][aria-pressed="true"] { color: var(--mirror); box-shadow: 0 0 0 1px var(--mirror); background: var(--mirror-soft); }
.stage > .mirror-badge { justify-self: center; align-self: center; margin: 0.25rem auto 0; }

.sheet-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.sheet-actions button { min-height: 44px; }
.sheet-actions [data-act="done"] { grid-column: 1 / -1; }

/* Account (sign-in) area, top right of the header. */
.account { position: relative; }
.account .signin { white-space: nowrap; min-height: 40px; }
.account-notice {
  grid-column: 1 / -1; margin: 0; padding: 0.5rem 0.75rem; font-size: 0.9rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text);
}

/* Install hint (install.js): a strip under the header. */
.install-nudge {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 8px; background: var(--panel);
}
.install-nudge img { width: 44px; height: 44px; border-radius: 22.5%; flex: none; }
.install-nudge p { flex: 1 1 14rem; margin: 0; font-size: 0.9rem; color: var(--text); }
.install-actions { display: flex; gap: 0.5rem; margin-left: auto; }
.install-actions button { min-height: 44px; }
.site-footer button.link { font-size: inherit; color: var(--muted); }
.site-footer button.link:hover { color: var(--text); }

button.danger { background: transparent; color: var(--danger); border-color: var(--danger-line); }
button.danger:hover { background: var(--danger-soft); }

/* Signed out: the landing page (landing.js; docs/prototypes/landing/, round 1),
   and the banner over a shared routine. */
.landing { grid-column: 1 / -1; max-width: 640px; width: 100%; margin: 0 auto; display: grid; gap: 0; }
.landing-sec { display: grid; gap: 0.75rem; padding: 1.5rem 0.25rem; border-bottom: 1px solid var(--line); }
.landing-sec:last-of-type { border-bottom: 0; }
.landing-sec h2 { margin: 0; font-size: 1.2rem; text-wrap: balance; }
.landing-sec p { margin: 0; color: var(--muted); }
.landing-hero { padding-top: 0.75rem; gap: 0.9rem; }
.landing-hero h2 { font-size: clamp(1.75rem, 7vw, 2.4rem); line-height: 1.1; }
.landing-sub { font-size: 1.05rem; }
.landing-demo { margin: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.landing-demo-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); }
.landing-demo-top b { font-variant-numeric: tabular-nums; min-width: 2.5em; }
.landing-demo-top small { color: var(--muted); font-size: 0.8rem; }
.landing-floor { display: grid; place-items: center; padding: 0.5rem; }
.landing-floor .floor-svg { width: min(100%, 220px); height: auto; aspect-ratio: 1; }
.landing-moves { list-style: none; margin: 0; padding: 0.5rem 0.75rem 0.75rem; display: grid; gap: 0.4rem; }
.landing-moves li { display: flex; justify-content: space-between; align-items: center; padding: 0.45rem 0.7rem; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-weight: 600; }
.landing-moves li.now { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--text); }
.landing-moves small { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.landing-actions { display: grid; gap: 0.4rem; }
.landing button { min-height: 48px; font-size: 1rem; }
.landing-actions button.link { min-height: 44px; justify-self: center; }
.landing-fine { text-align: center; margin: 0; }
.landing-steps, .landing-path, .landing-plans { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.landing-steps { counter-reset: step; }
.landing-steps li { display: grid; grid-template-columns: 2rem 1fr; column-gap: 0.75rem; counter-increment: step; }
.landing-steps li::before { content: counter(step); grid-row: span 2; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.landing-steps span, .landing-path span, .landing-plans span { color: var(--muted); font-size: 0.92rem; }
.landing-path { counter-reset: stage; }
.landing-path li, .landing-plans li { display: grid; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.landing-path li { grid-template-columns: 2rem 1fr; column-gap: 0.6rem; counter-increment: stage; }
.landing-path li::before { content: counter(stage); grid-row: span 2; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; color: var(--accent); font-weight: 800; font-size: 0.8rem; box-sizing: border-box; }
.landing-plans li.pro { border-color: var(--accent); }
.landing-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.landing-chips li:has(> a) { padding: 0; }
.landing-chips a { color: var(--link); display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.85rem; }
.landing-sec p a { color: var(--link); }
.landing-chips li { padding: 0.25rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-weight: 600; font-size: 0.88rem; }
.landing-faq { border-top: 1px solid var(--line); }
.landing-faq:first-of-type { border-top: 0; }
.landing-faq summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.landing-faq p { padding-bottom: 0.75rem; }
.landing-sticky { position: sticky; bottom: 0; display: grid; padding: 0.6rem 0.25rem max(0.75rem, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }

/* Continue with Google: Google's standard button, in its dark or light theme to
   match the page. The logo keeps its own colours. */
button.google-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 0 18px 0 14px;
  background: var(--google-bg); color: var(--google-text);
  border: 1px solid var(--google-line); border-radius: 6px;
  font-weight: 600; font-size: 1rem; letter-spacing: 0.01em;
}
button.google-button:hover { background: var(--google-bg-hover); }
button.google-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.google-g { width: 20px; height: 20px; flex: none; }
.sprite { position: absolute; } /* the logo's <symbol> holder; takes no space */

/* Header: the theme button (and, in the app, the account control). */
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
button.theme-toggle {
  display: inline-grid; place-items: center; padding: 0;
  width: 44px; height: 44px; border-radius: 999px;
  background: transparent; color: var(--text); border: 1px solid var(--line);
}
button.theme-toggle:hover { border-color: var(--accent); }
button.theme-toggle svg { width: 20px; height: 20px; }

main.shared-only { grid-template-columns: 1fr; max-width: 760px; }
.shared-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin: 0.5rem 0 1rem; padding: 0.75rem 1rem;
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 10px;
}
.shared-banner p { margin: 0; flex: 1 1 16rem; }
.shared-banner[hidden] { display: none; }

#result[aria-busy="true"] .routine { opacity: 0.55; transition: opacity 0.15s; }

.account-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Play routine: the stage view. Full screen on phones, large on desktop. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.stage {
  --row: 88px; /* a list row and the gap after it */
  touch-action: manipulation; /* tapping along to the music must never zoom */
  /* ...or select text: on iPhone a quick double tap on Tap on the 1 selected
     the words around it. Nothing on the stage needs copying. */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  width: min(720px, 100vw); height: min(760px, 100dvh);
  max-width: 100vw; max-height: 100dvh;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px;
  display: none; flex-direction: column; gap: 0.6rem;
}
.stage[open] { display: flex; }
.stage::backdrop { background: var(--backdrop-strong); }
.stage button { min-height: 44px; min-width: 44px; }
.stage button:focus-visible, .stage input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* The top bar: Close, the tempo in one pill, and the options. */
.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.stage .stage-icon { width: 44px; padding: 0; display: grid; place-items: center; }
.stage-tempo {
  display: flex; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.stage-tempo button { width: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--text); font-size: 1.25rem; font-weight: 700; }
.stage-tempo > span { padding: 0 0.25rem; text-align: center; white-space: nowrap; font-size: 0.95rem; }
.stage-count { color: var(--muted); font-size: 1rem; margin: 0; text-align: center; font-variant-numeric: tabular-nums; }
/* The picture: the floor (floor.js), about a third of the stage. List view and
   short landscape screens keep just the list. */
.stage-floor { flex: none; position: relative; display: flex; justify-content: center; height: clamp(150px, 32dvh, 280px); }
.stage[data-view="list"] .stage-floor { display: none; }
.floor-svg { height: 100%; width: auto; aspect-ratio: 1; }
/* Mirror view: as if facing you. The floor flips; its words don't. */
.stage.mirror-view .floor-svg { transform: scaleX(-1); }
.stage.mirror-view .floor-label, .stage.mirror-view .floor-front { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; }
.floor-ground { fill: var(--panel); }
.floor-dot { fill: var(--line); }
.floor-front { font: 700 11px ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.2em; fill: var(--muted); }
.floor-front-bar { fill: var(--muted); opacity: 0.5; }
.floor-foot { fill: transparent; stroke: var(--muted); stroke-width: 2.5; }
.floor-foot.up { stroke-dasharray: 3 3; opacity: 0.7; } /* lifted */
.floor-press { fill: var(--accent); } /* where the weight is; opacity is set per frame */
.floor-foot-fill { fill: var(--accent); }
.floor-foot-shadow { fill: var(--line); } /* under a lifted foot; opacity is set per frame */
.floor-ripple { fill: none; stroke: var(--accent); stroke-width: 3; }
.floor-label { font: 700 13px ui-monospace, "SF Mono", Menlo, Consolas, monospace; fill: var(--muted); }
.floor-cue { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }
.floor-facing { fill: var(--muted); opacity: 0.6; }
@media (max-height: 560px) { .stage-floor { display: none; } }

/* The routine: the move now at the top, what's next below it (marked Next),
   moves danced sliding off above. Rows are placed by --i. */
.stage-main { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.stage-list {
  position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
}
.stage-track { position: absolute; inset: 0 0 auto 0; will-change: transform; }
.stage-row {
  position: absolute; left: 2px; right: 2px;
  top: calc(var(--i) * var(--row)); height: calc(var(--row) - 8px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; column-gap: 0.5rem; row-gap: 0.1rem;
  padding: 0 0.85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  will-change: opacity; overflow: hidden;
}
.stage-row > * { grid-column: 1; }
.stage-row .cues { position: static; grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0; }
.stage-row.current { border-color: var(--accent); background: var(--accent-soft); }
.stage-row.next { border-style: dashed; border-color: var(--accent); }
.stage-row.done { opacity: 0.45; }
.stage-row-name { font-size: 1.3rem; font-weight: 700; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-row-meta { color: var(--muted); font-size: 0.85rem; }
.stage-row-tag { display: none; }
.stage-row.next .stage-row-name::after {
  content: 'Next'; margin-left: 0.5rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); vertical-align: 0.2em;
}
.stage-row.custom .stage-row-name { color: var(--custom); }
.stage-row.custom { border-style: dashed; border-color: var(--custom); }

/* The beat indicator: one dot per beat of the move. */
.stage-dots { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; min-height: 22px; }
.stage-dots span {
  width: clamp(14px, 4vw, 20px); height: clamp(14px, 4vw, 20px);
  border-radius: 50%; border: 2px solid var(--line); background: var(--bg);
}
.stage-dots span.done { background: var(--accent-soft); border-color: var(--accent); }
.stage-dots span.now { background: var(--accent); border-color: var(--accent); }

/* Count-in: a big 5 6 7 8 over the list. */
.stage-countin { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; text-align: center; background: var(--bg); }
.stage-countin b { font-size: clamp(4rem, 24vw, 8rem); color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.stage-countin small { color: var(--muted); font-size: 1.1rem; }

/* The controls, two rows (round 7, C): ‹ ▶ › centred, then Tap on the 1. */
.stage-controls { flex: none; display: grid; gap: 0.5rem; }
/* Loop on the left; ‹ ▶ › centred whatever it shows. */
.stage-transport { display: grid; grid-template-columns: 1fr repeat(3, auto) 1fr; align-items: center; column-gap: 0.75rem; }
.stage-transport #stage-loop { grid-column: 1; justify-self: start; }
.stage-transport #stage-back { grid-column: 2; }
.stage-transport #stage-play { grid-column: 3; }
.stage-transport #stage-fwd { grid-column: 4; }
.stage .stage-loop { width: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; position: relative; }
.stage .stage-loop[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stage .stage-loop .lock-icon { position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; margin: 0; padding: 2px; border-radius: 50%; background: var(--bg); }
.stage-row.current.looping .stage-row-name::after {
  content: 'Looping'; margin-left: 0.5rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); vertical-align: 0.2em;
}
.stage-options .locked .stage-speed { opacity: 0.6; }
.stage .stage-round { width: 56px; height: 56px; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.stage-round .nav-icon { width: 24px; height: 24px; }
.stage[data-playing] #stage-back, .stage[data-playing] #stage-fwd { visibility: hidden; }
.stage .stage-tap { min-height: 48px; border-color: var(--accent); color: var(--accent); font-weight: 700; font-size: 1.05rem; }

/* Dance options: a sheet over the stage. */
.stage-options { max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; }
.stage-options .sheet-group { margin-bottom: 1rem; }
.stage-options .view-toggle button { min-height: 44px; }
.stage-hint { color: var(--muted); font-size: 0.8rem; }
.stage-speed { display: flex; align-items: center; gap: 0.75rem; }
.stage-speed input { flex: 1; min-height: 44px; accent-color: var(--accent); }
.stage-speed output { min-width: 2.5rem; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.stage-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%;
  padding: 0.5rem 0; border: 0; background: transparent; color: var(--text); text-align: left; font: inherit;
}
.stage-switch b { display: block; }
.stage-switch small { display: block; color: var(--muted); font-size: 0.8rem; }
.stage-switch-track {
  flex: none; position: relative; width: 50px; height: 30px; border-radius: 999px; background: var(--line); transition: background 0.15s;
}
.stage-switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--panel);
  box-shadow: 0 1px 3px var(--shadow); transition: transform 0.15s;
}
.stage-switch[aria-checked="true"] .stage-switch-track { background: var(--accent); }
.stage-switch[aria-checked="true"] .stage-switch-track::after { transform: translateX(20px); }

@media (max-width: 760px) {
  .stage { width: 100vw; height: 100dvh; border-radius: 0; border: none; }
}
/* A short phone: a smaller picture and rows, so the next move still shows. */
@media (max-height: 640px) {
  .stage { --row: 72px; gap: 0.45rem; }
  .stage-floor { height: clamp(110px, 23dvh, 200px); }
  .stage-count { font-size: 0.9rem; }
  .stage-list { -webkit-mask-image: linear-gradient(#000 calc(100% - 14px), transparent); mask-image: linear-gradient(#000 calc(100% - 14px), transparent); }
  .stage-row-name { font-size: 1.1rem; }
  .stage .stage-round { width: 48px; height: 48px; }
}

/* Sign-in panel */
.signin-dialog {
  width: min(420px, calc(100vw - 2rem)); padding: 1.25rem;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
}
.signin-dialog::backdrop { background: var(--backdrop); }
.signin-dialog form { display: grid; gap: 0.75rem; }
.signin-dialog label { display: grid; gap: 0.35rem; }
.signin-dialog input {
  font: inherit; padding: 0.6rem 0.7rem; border-radius: 6px;
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
}
.signin-dialog input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.signin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.signin-head h2 { margin: 0; font-size: 1.3rem; }
button.icon { padding: 0.2rem 0.6rem; font-size: 1.2rem; line-height: 1; }
button.wide { width: 100%; min-height: 44px; }
button.google-button.wide { min-height: 48px; }
button.link { background: none; border: none; padding: 0; color: var(--link); text-decoration: underline; min-height: 0; }
.signin-or { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.85rem; margin: 1rem 0; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.signin-links, .signin-alt { font-size: 0.9rem; margin: 0.25rem 0; }
#signin-status.error { color: var(--danger); }

/* Plans (billing.js): tabs, the period switch, plan cards or a comparison.
   On phones it's a sheet from the bottom of the screen. */
.upgrade-dialog { max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; }
.upgrade-dialog > * + * { margin-top: 0.75rem; }
.upgrade-dialog .signin-head { margin-bottom: 0; align-items: flex-start; gap: 0.5rem; }
.upgrade-dialog .signin-head h2 { text-wrap: balance; }
.upgrade-dialog .signin-head button.icon { min-width: 44px; min-height: 44px; }
.upgrade-reason { margin: 0; padding: 0.6rem 0.75rem; border-radius: 8px; background: var(--accent-soft); }
.upgrade-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.upgrade-switch button { min-height: 44px; background: transparent; border-color: transparent; color: var(--text); font-weight: 600; }
.upgrade-switch button[aria-pressed="true"], .upgrade-switch button[aria-selected="true"] { background: var(--panel); border-color: var(--line); }
.upgrade-save { display: block; font-size: 0.75rem; line-height: 1.2; color: var(--accent); font-weight: 600; }
.upgrade-save:empty { display: none; }
.upgrade-cards { display: grid; gap: 0.6rem; }
.plan-card { border: 2px solid var(--line); border-radius: 12px; padding: 0.7rem 0.85rem; cursor: pointer; display: grid; gap: 0.3rem; }
.plan-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.plan-card.current { cursor: default; }
/* .signin-dialog label is a grid; a card's top is one row. */
.upgrade-dialog .plan-top { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; cursor: inherit; }
.plan-top input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--accent); }
.plan-top input:disabled { display: none; }
.plan-name { font-weight: 700; font-size: 1.05rem; }
.plan-tag { margin-left: auto; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.plan-card.current .plan-tag { background: var(--muted); }
.plan-price { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-price:empty { display: none; }
.plan-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.2rem; font-size: 0.9rem; }
.plan-card li { padding-left: 1.3em; position: relative; }
.plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.plan-card li.soon { color: var(--muted); }
.plan-card li.soon::before { content: "◷"; color: var(--muted); }
.upgrade-compare { overflow-x: auto; }
.upgrade-compare table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.upgrade-compare th, .upgrade-compare td { padding: 0.45rem 0.25rem; border-bottom: 1px solid var(--line); text-align: center; }
.upgrade-compare tbody th { text-align: left; font-weight: 600; }
.upgrade-compare thead .plan-price { display: block; font-size: 0.8rem; }
.upgrade-compare .selected { background: var(--accent-soft); }
.upgrade-go { min-height: 52px; font-weight: 700; font-size: 1.02rem; }
/* The button stays in reach while the plans scroll under it. */
.upgrade-foot { position: sticky; bottom: 0.5rem; z-index: 1; display: grid; gap: 0.4rem; }
.upgrade-go { box-shadow: 0 4px 16px var(--shadow); }
.upgrade-go.secondary { background: var(--panel); }
.upgrade-fine { text-align: center; font-size: 0.8rem; margin: 0; }
#upgrade-status:empty { display: none; }
#upgrade-status { margin: 0; padding: 0.5rem 0.75rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 4px 16px var(--shadow); }
#upgrade-status.error { color: var(--danger); border-color: var(--danger); }
@media (max-width: 760px) {
  .upgrade-dialog {
    width: 100%; max-width: 100%; margin: auto 0 0; box-sizing: border-box;
    border-radius: 18px 18px 0 0; border-bottom: 0;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
}
.account-billing { display: grid; gap: 0.5rem; }
.account-billing:empty { display: none; }
.account-plan { margin: 0; font-size: 0.9rem; color: var(--muted); }
.account-plan.problem { color: var(--danger); }
.plan-badge {
  font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--text);
}

/* Replace your routine? (app.js: confirmReplace) */
.confirm-dialog h2 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.confirm-dialog p { margin: 0 0 1rem; color: var(--muted); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.confirm-actions button { min-height: 44px; }
/* With Save first there are three: one column, Save first on top and Keep
   editing last, so no button sits alone on a second row. */
.confirm-actions:has([data-answer="save"]:not([hidden])) { grid-template-columns: 1fr; }
.confirm-actions:has([data-answer="save"]:not([hidden])) [data-answer="keep"] { order: 1; }

/* Footer and text pages (privacy policy). */
.site-footer { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem 2rem; font-size: 0.85rem; color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.home-link { color: inherit; text-decoration: none; }
main.doc { display: block; }
.doc > * { max-width: 720px; }
.doc h2 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }
.doc h3 { font-size: 1rem; margin: 1.25rem 0 0.25rem; }
.doc li { margin: 0.35rem 0; }
.doc a { color: var(--link); }
/* The public move guides (scripts/make-guides.mjs; /learn, /learn/<move>-shuffle). */
.guide-crumbs { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }
.doc .guide-title { font-size: clamp(1.6rem, 6vw, 2.1rem); line-height: 1.15; margin: 0.5rem 0 0.5rem; text-wrap: balance; }
.guide-lede { color: var(--muted); font-size: 1.05rem; }
.guide-meta, .guide-index { list-style: none; padding: 0; }
.guide-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.doc .guide-meta li { margin: 0; padding: 0.2rem 0.65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 0.85rem; font-weight: 600; }
.guide-demo { margin: 1rem 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.guide-demo-top { display: flex; justify-content: space-between; align-items: baseline; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); }
.guide-demo-top b { font-variant-numeric: tabular-nums; min-width: 2.5em; }
.guide-demo-top small { color: var(--muted); font-size: 0.8rem; }
.guide-floor { display: grid; place-items: center; padding: 0.5rem; }
.guide-floor .floor-svg { width: min(100%, 240px); height: auto; aspect-ratio: 1; }
.guide-steps { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.doc .guide-steps li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.6rem; margin: 0; }
.guide-steps b { color: var(--accent); font-variant-numeric: tabular-nums; }
.guide-index { display: grid; gap: 0.5rem; }
.doc .guide-index li { margin: 0; }
.guide-index a, .guide-index .later { display: grid; gap: 0.15rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.doc .guide-index a { color: var(--text); text-decoration: none; border-color: var(--accent); min-height: 44px; }
.guide-index span { color: var(--muted); font-size: 0.9rem; }
.guide-cta { display: grid; gap: 0.4rem; justify-items: center; margin: 2rem 0 1rem; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.5rem; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; touch-action: manipulation; }
.doc .button-link { color: var(--on-accent); }
.guide-footer { max-width: 720px; padding: 1.5rem 1rem 2rem; color: var(--muted); font-size: 0.85rem; }
.guide-footer a { color: var(--link); display: inline-block; min-height: 44px; line-height: 44px; }

/* ── Saved routines (saved.js; docs/prototypes/saved-routines/) ─────────── */
/* Routine's name opens your routines. */
.title-switch {
  display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; min-height: 44px; padding: 0;
  border: 0; background: transparent; color: var(--text); font: inherit; font-weight: inherit;
}
.title-switch #routine-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-switch .nav-icon { flex: none; color: var(--muted); }
body[data-area="routine"].has-library #area-title { display: none; }
body:not([data-area="routine"]) .title-switch { display: none; }
.app-title:has(.title-switch:not([hidden])) { display: flex; align-items: center; }

/* The open saved routine, above the routine. */
.saved-info { display: grid; gap: 0.3rem; margin: 0 0 0.6rem; }
.saved-info[hidden] { display: none; }
.saved-state { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.85rem; }
.state-pill {
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.1rem 0.55rem; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.state-pill .nav-icon { width: 0.95rem; height: 0.95rem; }
.state-pill.saved { border-color: var(--custom); color: var(--custom); background: var(--custom-soft); }
.state-pill.dirty { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.soon-tag {
  padding: 0.05rem 0.5rem; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: 0.75rem; font-weight: 700; white-space: nowrap;
}
.saved-song, .saved-notes { margin: 0; }
.saved-notes { color: var(--muted); font-size: 0.9rem; white-space: pre-line; }
.song-service { color: var(--muted); font-size: 0.85rem; }
.saved-info-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; }
.saved-info :is(.edit-details, .add-song) { display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; min-height: 44px; }
.saved-info .edit-details .nav-icon { width: 1rem; height: 1rem; }
.edit-details { display: grid; gap: 0.5rem; }
.edit-song-summary { margin: 0; overflow-wrap: anywhere; }
.edit-song { justify-self: start; display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; }
.edit-song .nav-icon, .edit-details-other .nav-icon { width: 1rem; height: 1rem; }
.edit-details-other { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; }
.song-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); font-weight: 600; }

/* The library: a sheet from Routine, a page in You. */
.library-sheet { display: grid; gap: 0.6rem; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; align-content: start; }
.library-sheet:not([open]) { display: none; }
.sheet-head { display: flex; align-items: center; gap: 0.5rem; }
.sheet-head h2 { margin: 0 auto 0 0; }
.sheet-head > button.secondary { min-height: 44px; }
.icon-button { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--text); }
.library { display: grid; gap: 0.6rem; }
.library-page { padding-bottom: 1rem; }
.library-page[hidden] { display: none; }
.library-top { display: flex; align-items: center; gap: 0.5rem; }
.library-top > button.secondary { min-height: 44px; }
.library-title { margin: 0 auto 0 0; font-size: 1.15rem; }
.link-back { display: inline-flex; align-items: center; gap: 0.15rem; min-height: 44px; padding: 0 0.4rem 0 0; border: 0; background: transparent; color: var(--link); font-weight: 600; }
.link-button { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--link); font-weight: 600; text-decoration: underline; }
.library-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.library-head > button { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; }
.library-head .nav-icon { width: 1.1rem; height: 1.1rem; }
.library-count { margin-right: auto; color: var(--muted); font-size: 0.9rem; }
.library-count.full { color: var(--warn); font-weight: 700; }
.library-search {
  min-height: 44px; padding: 0.5rem 0.65rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 1rem;
}
.library-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.library-filters .chip, .made-for .chip { flex: none; min-height: 40px; padding: 0 0.8rem; background: var(--panel); color: var(--text); font-weight: 600; white-space: nowrap; }
.library-filters .chip[aria-pressed="true"], .made-for .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.library-group { display: grid; gap: 6px; }
.library-group-title { display: flex; align-items: center; gap: 0.4rem; margin: 0.3rem 0 0; font-size: 0.95rem; }
.folder-head { display: flex; align-items: center; border-radius: 10px; }
.folder-head.drop-over { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.folder-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5rem; min-height: 52px; padding: 0 0.25rem;
  border: 0; background: transparent; color: var(--text); font-weight: 700; text-align: left;
}
.folder-toggle .nav-icon { flex: none; width: 1.1rem; height: 1.1rem; color: var(--muted); }
.folder-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.folder-chevron { margin-left: auto; transition: transform 0.15s; }
.folder-toggle[aria-expanded="true"] .folder-chevron { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .folder-chevron { transition: none; } }
.folder-empty { margin: 0 0 0.25rem; }
.library-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.library-item {
  display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  /* A hold drags it to a folder: no text selection or callout on the way. */
  touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.library-item.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.library-item.lifted { opacity: 0.4; }
.library-item > .icon-button { align-self: center; }
.library-open {
  flex: 1; min-width: 0; display: grid; gap: 0.1rem; min-height: 64px; padding: 0.5rem 0.25rem 0.5rem 0.75rem;
  border: 0; background: transparent; color: var(--text); text-align: left; border-radius: 12px;
}
.library-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-for { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.85rem; }
.library-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.8rem; }
.library-meta .nav-icon { width: 0.95rem; height: 0.95rem; }
.library-song { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-tags { color: var(--link); font-size: 0.8rem; }
.mirror-badge.small { margin-left: 0; padding: 0 0.45rem; font-size: 0.72rem; }
.library-pick { display: grid; place-items: center; width: 44px; flex: none; }
.library-pick input { width: 22px; height: 22px; accent-color: var(--accent); }
.library-selbar {
  position: sticky; bottom: 0; display: flex; gap: 0.5rem; padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
  background: var(--panel);
}
.library-page .library-selbar { bottom: var(--bottom-stack, 0px); background: var(--bg); }
.library-selbar button { flex: 1; min-height: 44px; }
.library-ghost { max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Save, ⋯ menus, Move to folder, Sort & group. */
.saved-sheet { display: grid; gap: 0.75rem; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; align-content: start; }
/* Up and down only: with overflow-y, iOS would also pan the sheet side to
   side if anything poked out by a pixel. */
.saved-sheet, .library-sheet { overflow-x: hidden; }
.saved-sheet > *, .library-sheet > * { min-width: 0; }
.saved-sheet:not([open]) { display: none; }
.menu-list { display: grid; }
.menu-item {
  display: flex; align-items: center; gap: 0.75rem; min-height: 52px; padding: 0 0.25rem; border: 0; border-radius: 0;
  border-top: 1px solid var(--line); background: transparent; color: var(--text); font-weight: 600; text-align: left;
}
.menu-item:first-child { border-top: 0; }
.menu-item small { margin-left: auto; color: var(--muted); font-weight: 400; }
.menu-item.danger { color: var(--danger); }
/* Add this song to… (saved.js: shareIn): the song, then three rows. */
.share-song { display: grid; gap: 0.15rem; }
.share-song .song-found { margin: 0; }
.share-list .menu-item { min-height: 56px; }
.share-row { display: grid; min-width: 0; text-align: left; }
.share-row small { margin: 0; color: var(--muted); font-weight: 400; }
/* You's Share from a video app guide (share-in.js). */
.share-guide p { margin: 0; }
.share-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.3rem; }
.share-guide .you-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1rem; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; justify-self: start; }
.menu-item[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--accent); }
.sheet-label { margin: 0.25rem 0 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.sheet-input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 0.5rem 0.65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 1rem; }
textarea.sheet-input { min-height: 4.5rem; resize: vertical; }
/* iOS draws a date field at its own width, past a narrow column: keep it in. */
input[type="date"].sheet-input { -webkit-appearance: none; appearance: none; display: block; max-width: 100%; text-align: start; }
input[type="date"].sheet-input::-webkit-date-and-time-value { text-align: start; }
.sheet-primary { min-height: 48px; font-weight: 700; }
.sheet-actions { display: flex; gap: 0.5rem; }
.sheet-actions > button { flex: 1; min-height: 48px; }
.save-more { border-top: 1px solid var(--line); }
.save-more > summary { display: flex; align-items: center; min-height: 44px; color: var(--link); font-weight: 600; cursor: pointer; list-style: none; }
.save-more > summary::-webkit-details-marker { display: none; }
.save-more-body, .song-card { display: grid; gap: 0.75rem; padding-bottom: 0.5rem; }
.made-for { display: flex; flex-wrap: wrap; gap: 6px; }
.song-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem; }
.song-card > button.secondary { min-height: 44px; }
.start-stepper { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.start-input { text-align: center; font-variant-numeric: tabular-nums; }
.song-found { margin: 0; color: var(--muted); font-size: 0.85rem; }
.song-found:empty { display: none; }
.song-found.ok { color: var(--custom); font-weight: 600; }
.song-found.missed { color: var(--warn); font-weight: 600; }
.song-timing { margin: 0; color: var(--text); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.song-timing.over { color: var(--warn); font-weight: 600; }

/* A notice with Undo, in the top layer so it shows over an open sheet. */
.saved-toast {
  /* The full width between the insets (a popover is otherwise only as wide as
     its text), up to 536px, centred. */
  position: fixed; inset: auto 12px calc(var(--bottom-stack, 0px) + 12px) 12px; margin: 0 auto; width: auto; max-width: 536px;
  box-sizing: border-box; min-height: 44px;
  display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.9rem; border: 0; border-radius: 12px;
  background: var(--text); color: var(--bg); box-shadow: 0 8px 24px var(--shadow);
}
.saved-toast span { flex: 1; text-align: center; }
/* With Undo, the words start at the left and the button sits at the right. */
.saved-toast:has(button) { padding-right: 0.35rem; }
.saved-toast:has(button) span { text-align: start; }
.saved-toast button { min-height: 44px; border: 0; background: transparent; color: var(--bg); font-weight: 700; text-decoration: underline; }

/* Report a technical problem, or Get help (report.js). */
.report-sheet { max-height: 90vh; overflow-y: auto; }
.report-view { display: grid; gap: 0.75rem; }
.report-view[hidden] { display: none; }
.report-view button[type="submit"], .report-done .primary { min-height: 44px; }
.report-about { display: grid; gap: 0.1rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.report-about small { color: var(--muted); overflow-wrap: anywhere; }
.report-choices { display: grid; gap: 0.4rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.report-choices legend { margin-bottom: 0.4rem; padding: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.report-choices > div { display: grid; gap: 0.4rem; }
.report-choices label { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.report-choices label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.report-choices input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.report-count { justify-self: end; font-variant-numeric: tabular-nums; }
.report-send > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--muted); font-weight: 600; }
.report-send-list { display: grid; gap: 0.5rem; margin: 0; padding: 0.6rem 0.75rem; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.report-send-list li { display: flex; align-items: flex-start; gap: 0.6rem; min-height: 32px; }
.report-send-list input { width: 18px; height: 18px; margin: 0.15rem 0 0; accent-color: var(--accent); flex: none; }
.report-send-list label { min-width: 0; }
.report-send-list small { display: block; color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; white-space: pre-line; }
.report-failed { margin: 0; padding: 0.5rem 0.75rem; border-radius: 8px; background: var(--danger-soft); color: var(--danger); }
.report-cross { margin: 0; color: var(--muted); font-size: 0.9rem; }
.report-cross button.link { min-height: 44px; }
.report-done { justify-items: center; text-align: center; padding: 1rem 0; }
.report-done h3 { margin: 0; }
.report-done p { margin: 0; color: var(--muted); }
.report-tick { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--custom-soft); color: var(--custom); font-size: 1.6rem; font-weight: 700; }
.report-error-line { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; margin: 0 0 0.5rem; }
.report-error-line .nav-icon { width: 18px; height: 18px; }
.lesson-report { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; gap: 0.4rem; }
.trans-report { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.trans-report .nav-icon, .lesson-report .nav-icon { width: 16px; height: 16px; }


/* Sound (sound.js): You → Sound, Dance's speaker menu, Dance options' row. */
.stage-top-end { position: relative; display: flex; align-items: center; gap: 0.5rem; }
.stage-sound-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: min(250px, calc(100vw - 32px));
  display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); color: var(--text); box-shadow: 0 12px 28px var(--shadow);
}
.stage-sound-menu button {
  min-height: 52px; display: flex; align-items: center; gap: 0.5rem; padding: 4px 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left;
}
.stage-sound-menu button[aria-checked="true"] { background: var(--accent-soft); }
.stage-sound-menu button > span:last-child { display: grid; }
.stage-sound-menu small { color: var(--muted); font-size: 0.8rem; }
.sound-tick { width: 1rem; color: var(--accent); font-weight: 700; visibility: hidden; }
.stage-sound-menu [aria-checked="true"] .sound-tick { visibility: visible; }
.stage-sound-menu .stage-hint { margin: 0; padding: 4px 10px 2px; }
.sound-more { gap: 0.6rem; }
.sound-counts { display: grid; gap: 0.6rem; }
.sound-head { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.sound-voices { display: grid; gap: 0.4rem; }
.you-more .sound-voices button {
  min-height: 52px; display: grid; justify-items: start; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); text-align: left;
}
.sound-voices button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.sound-voices small { color: var(--muted); font-size: 0.8rem; }
.sound-volume { width: 100%; min-height: 44px; accent-color: var(--accent); }
/* Four controls in the top bar: on the narrowest phones (320px) the gaps
   shrink and the tempo's words go small under its number. */
.stage-tempo { flex: 0 1 auto; }
.stage-tempo button { flex: none; }
#stage-bpm.stacked { display: grid; justify-items: center; padding: 0; line-height: 1.1; }
#stage-bpm.stacked .stage-bpm-rest { font-size: 0.66rem; font-weight: 600; color: var(--muted); }
@media (max-width: 359px) {
  .stage-top, .stage-top-end { gap: 0.25rem; }
  #stage-bpm { display: grid; justify-items: center; padding: 0; line-height: 1.1; }
  .stage-bpm-rest { font-size: 0.66rem; font-weight: 600; color: var(--muted); }
  /* Hidden from view only: screen readers still hear "(default)". */
  .stage-bpm-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Guided practice (practice-ui.js; docs/prototypes/guided-practice/, A). */
.guided { display: grid; gap: 0.6rem; }
.guided-head { display: flex; justify-content: space-between; margin: 0.5rem 2px 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.guided-next { display: grid; gap: 0.5rem; padding: 1rem; border: 1px solid var(--accent); border-radius: 12px; background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--panel); }
.guided-next .kick { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.guided-next h3 { margin: 0; font-size: 1.2rem; }
.guided-next p { margin: 0; }
.guided-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.guided-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.guided-row2 { display: flex; gap: 0.5rem; }
.guided-row2 > button { flex: 1; min-height: 44px; }
.guided-path { display: grid; gap: 0.5rem; }
.guided-stage { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.guided-stage > summary { min-height: 52px; display: flex; align-items: center; gap: 0.6rem; padding: 0 1rem; cursor: pointer; list-style: none; font-weight: 700; }
.guided-stage > summary::-webkit-details-marker { display: none; }
.guided-stage > summary .guided-of { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.3rem; }
.guided-stage > summary .you-chevron { transition: transform 0.15s; }
.guided-stage[open] > summary .you-chevron { transform: rotate(90deg); }
.free-tag { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--custom); color: var(--custom); background: var(--custom-soft); font-size: 0.75rem; font-weight: 700; }
.guided-session {
  width: 100%; min-height: 56px; display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 1rem;
  border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: left; font-weight: 400;
}
.guided-session.current { background: var(--accent-soft); }
.guided-session .txt { flex: 1; display: grid; min-width: 0; }
.guided-session .txt small { color: var(--muted); font-size: 0.8rem; }
.guided-session.locked .txt b { color: var(--muted); }
.guided-dot { width: 26px; height: 26px; flex: none; box-sizing: border-box; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.guided-dot.done { background: var(--custom); border-color: var(--custom); color: var(--on-accent); }
.guided-dot.current { border-color: var(--accent); color: var(--accent); }
.guided-dot.lock { border-style: dashed; }
.guided-dot .lock-icon { width: 13px; height: 13px; }
.guided-lockline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; padding: 0.6rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.guided-lockline .link { min-height: 44px; }

/* The session sheet: its steps before it starts. */
.session-stage { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.session-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.25rem 0 0.75rem; }
.session-tags span { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.session-tags .new { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.session-tags .uses { border-color: var(--custom); color: var(--custom); background: var(--custom-soft); }
.session-steps { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.5rem; }
.session-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.session-steps .n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.session-steps .txt { display: grid; min-width: 0; }
.session-steps small { color: var(--muted); font-size: 0.8rem; }
.session-steps .speeds { display: flex; gap: 3px; font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.session-steps .speeds span { padding: 1px 5px; border: 1px solid var(--line); border-radius: 6px; }
.session-lesson { min-height: 44px; justify-self: start; }
.error-text { color: var(--danger); }

/* In Dance: the session bar, and the check-in. */
.stage-session { display: grid; gap: 0.3rem; }
.session-segs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.session-segs i { height: 4px; border-radius: 2px; background: var(--line); }
.session-segs i.done { background: var(--custom); }
.session-segs i.now { background: var(--accent); }
.session-head { display: flex; align-items: center; gap: 0.5rem; }
.session-titles { flex: 1; min-width: 0; display: grid; }
.session-titles b { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-kind { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.session-skip { min-height: 44px; display: inline-flex; align-items: center; gap: 2px; padding: 0 0.6rem 0 0.9rem; }
.session-ramp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.session-ramp:empty { display: none; }
.session-speed { padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); }
.session-speed.done { border-color: var(--custom); color: var(--custom); }
.session-speed.now { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.session-note { margin: 0; padding: 0.35rem 0.6rem; border: 1px solid var(--custom); border-radius: 8px; background: var(--custom-soft); font-size: 0.85rem; }
.session-cue { margin: 0; min-height: 2.6em; padding: 0.35rem 0.6rem; border-left: 3px solid var(--accent); color: var(--text); font-size: 0.88rem; line-height: 1.3; }
.session-cue:empty { display: none; }
/* The practice timer (timer.js; docs/prototypes/practice-timer/, round 1):
   the time left at the end of the speeds row and an edge that empties as the
   stretch plays; on your own, a strip that counts up or down. The last
   seconds turn amber and the digits pulse on the beat. */
.session-meta { display: flex; align-items: center; gap: 0.5rem; }
.session-meta .session-ramp { flex: 1; min-width: 0; }
.timer-left { display: inline-block; margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.session-meta .timer-left { font-size: 0.95rem; }
.timer-left:empty { display: none; }
.timer-edge { height: 4px; border-radius: 2px; background: var(--accent-soft); overflow: hidden; }
.timer-edge i { display: block; height: 100%; background: var(--accent); transform-origin: right center; }
.timer-final .timer-left { color: var(--warn); }
.timer-final .timer-edge { background: var(--warn-soft); }
.timer-final .timer-edge i { background: var(--warn); }
@media (prefers-reduced-motion: no-preference) {
  .timer-final[data-beat="a"] .timer-left { animation: timer-tick-a 0.45s ease-out; }
  .timer-final[data-beat="b"] .timer-left { animation: timer-tick-b 0.45s ease-out; }
}
/* Two copies, so each beat restarts it. */
@keyframes timer-tick-a { from { transform: scale(1.18); } to { transform: scale(1); } }
@keyframes timer-tick-b { from { transform: scale(1.18); } to { transform: scale(1); } }
/* Asking how it went, the stretch is over: no time left to show. */
.stage[data-asking] .session-meta .timer-left, .stage[data-asking] .stage-session .timer-edge { visibility: hidden; }
.stage-timer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.stage-timer .timer-left { margin-left: 0; font-size: 1.15rem; }
.stage-timer-label { flex: 1; min-width: 0; color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage .stage-timer-length { min-height: 44px; padding: 0 0.9rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.stage-timer .timer-edge { flex-basis: 100%; }

/* A session plays its steps once: no Loop, and a smaller floor to make room. */
.stage[data-session] .stage-floor { height: clamp(120px, 22dvh, 220px); }

/* The end of a session. */
.done-hero { display: grid; justify-items: center; text-align: center; gap: 0.3rem; padding: 0.5rem 0; }
.done-tick { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--custom-soft); color: var(--custom); font-size: 1.6rem; font-weight: 700; }
.done-hero h2 { margin: 0; }
.done-steps { list-style: none; margin: 0 0 0.75rem; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.done-steps li { display: flex; gap: 0.6rem; align-items: center; min-height: 44px; padding: 0.3rem 0.75rem; border-top: 1px solid var(--line); }
.done-steps li:first-child { border-top: 0; }
.done-steps li span { flex: 1; }
.done-steps .ok { flex: none; width: 1rem; color: var(--custom); font-weight: 700; }
.done-steps small { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
#done-next:not(:empty) { margin-bottom: 0.75rem; }
/* Short phones (320×568): the session bar needs the room, so the floor shrinks
   further and the move list keeps its now-and-next. */
@media (max-height: 640px) {
  .stage[data-session] .stage-floor { height: clamp(90px, 17dvh, 140px); }
  .stage[data-session] .session-cue { min-height: 0; }
  /* The count line above the floor already says "Get ready". */
  .stage[data-session] .stage-countin small { display: none; }
}

/* Guided practice: the ask strip, in place of Dance's controls at the end of a
   stretch. Not a sheet: the floor and the routine stay in full view. */
.stage-ask { display: grid; gap: 0.35rem; }
.stage[data-asking] .stage-transport, .stage[data-asking] #stage-tap { display: none; }
.stage-ask-title { margin: 0; font-weight: 700; text-align: center; }
.stage-ask-detail { margin: -0.15rem 0 0; color: var(--muted); font-size: 0.85rem; text-align: center; }
.stage-ask-choices { display: flex; gap: 0.4rem; }
.stage-ask-choices button { flex: 1; min-width: 0; min-height: 52px; display: grid; align-content: center; justify-items: center; gap: 1px; padding: 0.3rem 0.4rem; text-align: center; line-height: 1.15; }
.stage-ask-choices button small { color: var(--muted); font-size: 0.72rem; font-weight: 500; }
.stage-ask-choices button.primary small { color: inherit; opacity: 0.85; }
.stage-ask .session-end { min-height: 44px; justify-self: center; color: var(--muted); }

/* ── Practice: Train by goal (training-ui.js; docs/prototypes/practice-workouts/) ── */
.practice-home, .practice-goal { display: grid; gap: 0.75rem; }
.practice-home > h2.guided-head, .program > h2.guided-head { font-size: 0.75rem; }
.train-goals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.train-tile { display: grid; align-content: start; gap: 0.2rem; min-height: 112px; padding: 0.8rem; text-align: left; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font: inherit; cursor: pointer; touch-action: manipulation; }
.train-tile:hover { border-color: var(--accent); }
.train-tile .train-icon { width: 24px; height: 24px; color: var(--accent); }
.train-tile b { font-size: 1rem; }
.train-tile span { font-size: 0.8rem; line-height: 1.3; color: var(--muted); }
.train-tile small { font-size: 0.75rem; color: var(--muted); }
.program { display: grid; gap: 0.5rem; }
.program-card { display: grid; gap: 0.5rem; }
.program-name { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.program-name .hint { margin: 0; font-size: 0.85rem; }
.goal-head { display: flex; align-items: center; gap: 0.5rem; }
.goal-head h2 { margin: 0; font-size: 1.25rem; }
.goal-head .icon { min-width: 44px; min-height: 44px; }
.goal-back-icon { transform: rotate(180deg); }
.goal-line { margin: 0; }
.goal-sessions { display: grid; gap: 0.5rem; }
.goal-sessions .list-card { display: grid; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.goal-session { display: flex; align-items: center; gap: 0.75rem; min-height: 60px; padding: 0.5rem 1rem; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
.goal-session:first-child { border-top: 0; }
.goal-session .txt { flex: 1; display: grid; min-width: 0; }
.goal-session .txt small { color: var(--muted); font-size: 0.8rem; }
.goal-session.locked .txt b { color: var(--muted); }
.goal-session-time { color: var(--muted); font-size: 0.85rem; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; }
.goal-sessions .guided-lockline { border: 1px solid var(--line); border-radius: 12px; }
.practice-goal[data-goal="moves"] .drill-type, .practice-goal[data-goal="transitions"] .drill-type { display: none; }
.training-offer { display: grid; gap: 0.5rem; margin-bottom: 0.75rem; padding: 0.75rem; border: 1px solid var(--accent); border-radius: 12px; background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--panel); }
.training-offer p { margin: 0; }
.training-length { margin-bottom: 0.75rem; }
.training-length button { flex: 1; display: grid; gap: 0; line-height: 1.2; }
.training-length button small { font-size: 0.75rem; font-weight: 400; }
.training-safe { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0 0 0.75rem; padding: 0.6rem 0.75rem; border-radius: 12px; background: var(--warn-soft); font-size: 0.85rem; }
.training-safe .nav-icon { color: var(--warn); flex: none; }
.training-feel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.75rem; }
.training-feel button { min-height: 64px; display: grid; place-items: center; gap: 2px; padding: 0.4rem; }
.training-feel button small { font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.training-feel button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
/* A training drill with nothing for the floor: its steps where the floor and the list would be. */
.stage[data-drill] .stage-floor, .stage[data-drill] .stage-main { display: none; }
.stage-drill { flex: 1; min-height: 0; overflow-y: auto; margin: 0.5rem 1rem; padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.stage-drill-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; font-size: 1.05rem; line-height: 1.45; }
