/* Inter, cut down to the signs Figtree lacks (arrows, ticks, stars, ♪ ♫, Δ, keyboard signs): 38 KB in place of the
 * whole 352 KB font. The browser fetches it only for a page that shows one of these. ♭ and ♯ are in neither font and
 * come from the device's own. Made with fontTools' pyftsubset (tools/fonts/README.md). */
@font-face {
  font-family: "Inter var";
  src: url("fonts/InterVariable-signs.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0394, U+2032-2033, U+2070-209F, U+2190-21FF, U+2200-22FF, U+2300-23FF, U+25A0-25FF, U+2600-26FF, U+2700-27BF;
}
:root {
  --accent-2: #c8f58a;
  --warn: #ffb86b;
  --danger: #ff7b7b;
  /* One typeface, Inter, kept in the app (fonts/, OFL licence) so it looks
   * the same offline and on every device. What was monospace (bar numbers,
   * a chord's notes, key labels) is Inter with figures of even width. */
  --sans: "Inter var", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: var(--sans);
  --code: ui-monospace, "SF Mono", Menlo, monospace;
  --bars: 4;
  --chord-size: 18px;
  /* Text size: --fs-screen sets the size for the screen (16 px body text on
   * phones and tablets, a little more on a laptop, read from further away);
   * --fs-user is the Text size setting. Every font size and icon in this
   * sheet is a multiple of --fs. */
  --fs-screen: 1.143;   /* 16 / 14: body text and the 14 px boxes land on 16 px */
  --fs-user: 1;
  --fs: calc(var(--fs-screen) * var(--fs-user));
}
@media (min-width: 1100px) { :root { --fs-screen: 1.15; } }
/* On a phone the largest setting stops where a 320 px screen still fits. */
@media (max-width: 699px) { :root { --fs: min(calc(var(--fs-screen) * var(--fs-user)), 1.4); } }
html { font-size: calc(16px * var(--fs)); }

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 { margin: 0; font-weight: 600; }

.muted { color: var(--muted); }

.hidden { display: none !important; }

button {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

button.tiny { padding: 4px 9px; font-size: calc(12px * var(--fs)); }
button.icon { font-size: calc(15px * var(--fs)); line-height: 1; }

input[type=text], input[type=number], select {
  font: inherit;
}
input[type=text]:focus, input[type=number]:focus, select:focus { outline-offset: -1px; }

/* ---------------------------------------------------------------- top */
.topbar {
  display: flex; align-items: center;
  flex: none; z-index: 20;
}

.loader { display: flex; gap: 8px; flex: 1; }
.loader input { flex: 1; }

main {
  flex: 1; min-height: 0; width: 100%; margin: 0 auto;
}

/* In stage mode the song owns the window: the body is pinned to exactly one
   viewport so main cannot grow, which leaves the grid as the only scrolling
   region and keeps the dock and player on screen. */
body.stage-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.stage-mode main { display: flex; overflow: hidden;
}

.panel {
  margin-bottom: 16px;
}

/* ------------------------------------------------------------ welcome */
.welcome h2 { margin-bottom: 6px; }

.stage-toggles { display: flex; flex-wrap: wrap; margin-top: 18px; }
.stage-toggles label {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 999px; cursor: pointer; font-size: calc(13px * var(--fs));
}
.stage-toggles label:has(input:checked) { border-color: var(--accent); color: var(--accent); }
#envLine { margin: 16px 0 0; font-family: var(--mono); }

/* ----------------------------------------------------------- progress */
.progress .bar {
  height: 6px; border-radius: 99px; background: var(--panel-2);
  overflow: hidden; margin: 14px 0 10px;
}
.progress .fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s ease;
}
.stage-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 6px; }
.stage-list li {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: calc(13px * var(--fs));
}
.stage-list li::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--line); flex: none;
}
.stage-list li.active { color: var(--text); }
.stage-list li.active::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(47,191,113,.18); }
.stage-list li.done::before { background: var(--accent-2); }
.stage-list li.failed { color: var(--danger); }
.stage-list li.failed::before { background: var(--danger); }

/* ------------------------------------------------------------ library */

.library-item .lib-title { flex: 1; font-weight: 500; }

.library-item .del { background: none; }

/* ======================================================== stage layout */
.result { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.stage-head {
  flex: none;
  display: flex; align-items: center; flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.title-block { flex: 1; min-width: 200px; }

.facts { display: flex; gap: 22px; margin: 0; }
.facts div { display: flex; flex-direction: column; gap: 1px; }
.facts dt { color: var(--muted); text-transform: uppercase; }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.head-actions { display: flex; align-items: center; flex-wrap: wrap; }

.stage {
  flex: 1; overflow-y: auto;
  padding: 16px 20px 24px;
}

/* ------------------------------------------------------------ the dock */
.dock {
  flex: none;
  border-top: 1px solid var(--line);
  padding: 10px 20px 12px;
}
.dock-head {
  display: flex; gap: 14px; flex-wrap: wrap;
}
.dock-head h3 { font-variant-numeric: tabular-nums; min-width: 72px; }
#chordNotes { font-family: var(--mono); margin: 0; }
.voicing-tabs { display: flex; margin-left: auto; }
.voicing-tabs button { background: transparent;
  color: var(--muted); border-radius: 999px;
}
.voicing-tabs button.on { border-color: var(--accent); color: var(--accent); background: rgba(47,191,113,.1); }

/* ------------------------------------------------------- player bar */
.player-bar {
  flex: none;
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  padding: 6px 20px 10px;
}
#waveform { width: 100%; height: 44px; display: block; cursor: pointer; border-radius: 6px; }
.transport { display: flex; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.play { font-size: calc(14px * var(--fs)); }

#seek { flex: 1; min-width: 160px; }
.rate { display: flex; align-items: center; gap: 6px; color: var(--muted); }

.toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }

/* ---------------------------------------------------------- drawers */
.drawer {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-top: 14px;
}
.drawer > summary {
  cursor: pointer; padding: 11px 14px;
  list-style: none; display: flex; align-items: center; gap: 10px;
}
.drawer > summary::-webkit-details-marker { display: none; }
.drawer > summary::before {
  content: "›"; color: var(--muted); font-size: calc(15px * var(--fs));
  transition: transform .15s; display: inline-block;
}
.drawer[open] > summary::before { transform: rotate(90deg); }
.drawer-body { padding: 0 14px 14px; }

/* --------------------------------------------------------- chord grid */
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.legend span { padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.chord-grid { display: grid; grid-template-columns: repeat(var(--bars), 1fr); gap: 8px; }
@media (max-width: 760px) { .chord-grid { grid-template-columns: repeat(2, 1fr); } }

.bar-cell {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sect, var(--line));
  border-radius: 10px;
  padding: 9px 10px 8px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .12s, background .12s;
}
.bar-cell:hover { background: #1f2c25; }
.bar-cell.playing { border-color: var(--accent); background: #16301f; }
.bar-head {
  display: flex; justify-content: space-between; color: var(--muted); font-family: var(--mono);
}
.beats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.beat {
  text-align: center; padding: 5px 2px; border-radius: 6px;
  font-size: var(--chord-size); font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--muted); background: transparent;
  line-height: 1.15;
}
.beat.change { color: var(--text); background: #23332a; }
.beat.now { background: var(--accent); color: var(--on-accent); }
.beat.now .deg { color: var(--on-accent); opacity: .72; }
.beat.nc { color: #5d6778; font-weight: 400; }
.beat .deg {
  display: block; letter-spacing: .02em; margin-top: 1px;
}
.beat.degrees-only { font-size: calc(var(--chord-size) * .9); }

/* A chord whose extension was named from the transcription rather than by the
 * chord recogniser. Marked, because it is a second inference on top of a
 * first and the player should know which readings are which — quietly, since
 * on this repertoire most chords carry one. */
.beat .heard {
  display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: var(--accent); opacity: .85;
  vertical-align: super; margin-left: 2px;
}
.beat.now .heard { background: var(--on-accent); opacity: .55; }

/* ----------------------------------------------------------- diagrams */
.diagrams { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.diagram { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.diagram svg { display: block; }
.diagram .dlabel { text-align: center; font-size: calc(11.5px * var(--fs)); color: var(--muted); font-family: var(--mono); margin-top: 4px; }
.piano-diagram { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.piano-diagram svg { width: 100%; height: auto; max-height: 132px; }
.piano-diagram .dlabel { font-family: var(--mono); color: var(--muted); }

/* -------------------------------------------------------------- stems */
.stem-list { display: grid; gap: 10px; margin-top: 10px; }
.stem {
  display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 10px;
}
.stem input[type=range] { accent-color: var(--accent-2); width: 100%; }

.stem.muted { opacity: .45; }
.stem a { color: var(--muted); text-decoration: none; }
.stem a:hover { color: var(--accent); }

/* ------------------------------------------------------------- counts */
.chord-counts { flex-wrap: wrap; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 11px;
  display: inline-flex; gap: 7px; align-items: baseline; cursor: default;
}
.chip b { font-weight: 600; }
.chip span { color: var(--muted); font-size: calc(11.5px * var(--fs)); font-family: var(--mono); }

/* ------------------------------------------------------------- lyrics */
.lyrics { display: grid; gap: 3px; max-height: 320px; overflow-y: auto; padding-right: 6px; }
.lyric-line {
  padding: 6px 10px; border-radius: 8px; color: var(--muted);
  cursor: pointer; line-height: 1.45;
}
.lyric-line:hover { background: var(--panel-2); }
.lyric-line.now { background: #16301f; color: var(--text); }
.lyric-time { font-family: var(--mono); font-size: calc(10px * var(--fs)); color: #5d6778; margin-right: 10px; }

/* --------------------------------------------------------------- drop */
.drop-hint {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10,14,20,.86);
  display: none; align-items: center; justify-content: center;
  border: 2px dashed var(--accent); border-radius: 16px; margin: 12px;
  font-size: calc(20px * var(--fs)); font-weight: 600;
}
.drop-hint.show { display: flex; }

/* ------------------------------------------------------ settings sheet */
.sheet {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8,11,16,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.sheet-card { width: 100%; max-width: 520px;
  max-height: 100%; display: flex; flex-direction: column;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
}
.sheet-body { padding: 6px 18px 18px; overflow-y: auto; }

.setting { padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: none; }
.setting > label {
  display: block; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 9px;
}
.setting .row-label {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; text-transform: none; letter-spacing: 0; color: var(--text); cursor: pointer; margin-bottom: 9px;
}
.setting input[type=range] { width: 100%; accent-color: var(--accent); }
.setting input[type=checkbox] { accent-color: var(--accent); width: 17px; height: 17px; }

.segmented {
  display: flex;
}
.segmented button {
  flex: 1; white-space: nowrap;
}

.preview {
  margin: 10px 0 0; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--code); line-height: 1.7; color: var(--muted);
  white-space: pre; overflow-x: auto;
}
.preview b { color: var(--text); font-weight: 600; }

/* Five naming systems do not fit one row on a narrow sheet. */
.segmented.wrap { flex-wrap: wrap; }
.segmented.wrap button { flex: 1 1 30%; }

/* An observed voicing is a measurement, so it is labelled as one. */
.obs-note {
  margin-top: 6px; line-height: 1.5;
  color: var(--muted); text-align: center;
}
.voicing-tabs button:first-child.on { border-color: var(--accent-2); color: var(--accent-2); background: rgba(200,245,138,.12); }

/* ------------------------------------------------------------- melody */
.melody-row {
  position: relative; margin-top: 6px;
  border-top: 1px dashed var(--line); padding-top: 3px;
}
.mnote {
  position: absolute;
  height: 3px; border-radius: 2px;
  background: var(--accent-2);
  font-size: calc(9px * var(--fs)); line-height: 1; color: var(--accent-2);
  text-align: center; white-space: nowrap; overflow: visible;
}
.mnote > i {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 4px; font-style: normal; white-space: nowrap; pointer-events: none;
}
.bar-cell.playing .mnote { background: var(--accent); }
.bar-cell.playing .mnote > i { color: var(--text); }

/* The dock must not crowd out the music. On a short window the keyboard
   shrinks rather than pushing the grid off the screen. */
.dock { overflow-y: auto; }
.piano-diagram svg { max-height: min(132px, 18vh); }
.stage { min-height: 22vh; }
.dock-head { position: sticky; top: 0; background: var(--panel); z-index: 1; }

/* Note names and fingerings are two different numberings, so they are never
   written next to each other without saying which is which. */

/* ------------------------------------------------- legibility pass
 *
 * Most of the interface is small labels in a muted grey, which reads as thin
 * at a glance and worse at arm's length from a keyboard. Weight and contrast
 * both go up; sizes mostly stay, so nothing reflows.
 */
body { font-weight: 450; }

          /* was #8b97a9 */

/* Small uppercase labels carried almost no weight at 10–12px. */
.facts dt,
.setting > label,
.drawer > summary,
.legend span,
.bar-head { font-weight: 600; }

/* Scale degrees sit under the chord and were the thinnest thing on screen. */
.beat .deg { font-weight: 600; color: #b3c0d2; }

/* Voicing tabs and the melody syllables. */
.voicing-tabs button { font-weight: 600; }
.mnote > i { font-weight: 600; color: #a9b7ca; }

/* Note names and fingerings drawn inside the keyboard SVG. CSS overrides the
   presentation attributes, so this reaches them without touching the markup. */
.piano-diagram text { font-weight: 700; }

/* The hand captions are the thing you actually read while playing. */

.chip, .stem, .lyric-line { font-weight: 500; }
#chordNotes { font-weight: 600; }

/* ------------------------------------------------------- size pass
 *
 * Everything here was sized for a dense desktop panel, which is far too
 * small to read from a piano. Sizes go up roughly a quarter across the
 * board; the layout absorbs it because the grid and the dock both flow.
 */

h1 { font-size: calc(19px * var(--fs)); } h2 { font-size: calc(21px * var(--fs)); } h3 { font-size: calc(16px * var(--fs)); }
.small { font-size: calc(14px * var(--fs)); }

.bar-head { font-size: calc(12px * var(--fs)); }
.beat .deg { font-size: calc(14px * var(--fs)); }
.legend span { font-size: calc(13px * var(--fs)); }

.dock-head h3 { font-size: calc(26px * var(--fs)); }
.voicing-tabs button { font-size: calc(13px * var(--fs)); padding: 6px 13px; }
.piano-diagram .dlabel { font-size: calc(14px * var(--fs)); }

.obs-note { font-size: calc(13px * var(--fs)); max-width: 60ch; }

.time { min-width: 50px; }
.rate, .toggle { font-size: calc(14px * var(--fs)); }
.rate select { font-size: calc(14px * var(--fs)); padding: 6px 10px; }

.drawer > summary { font-size: calc(15px * var(--fs)); }
.chip { font-size: calc(14px * var(--fs)); }
.stem { font-size: calc(14px * var(--fs)); }
.mnote > i { font-size: calc(11px * var(--fs)); }

.setting > label { font-size: calc(13px * var(--fs)); }
.setting .row-label { font-size: calc(15px * var(--fs)); }
.segmented button { font-size: calc(14px * var(--fs)); padding: 9px 10px; }
.preview { font-size: calc(14px * var(--fs)); }

/* The keyboard is width-constrained by 35 keys, so its labels only grow by
   taking more of each key. Few keys carry text at once, so the occasional
   overhang is cheaper than a label nobody can read. */
.piano-diagram text[font-size="7"] { font-size: calc(10px * var(--fs)); }
.piano-diagram svg { max-height: min(190px, 26vh); }

/* Section chips are editable: the letters are a starting point, not a verdict. */
.sect-chip { cursor: pointer; transition: background .12s; }
.sect-chip:hover { background: rgba(255,255,255,.06); }
.sect-edit {
  font: inherit; font-size: calc(13px * var(--fs)); font-weight: 600;
  width: 9em; padding: 3px 9px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--accent);
  color: var(--text); outline: none;
}
.bar-sect { max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Voicings are chosen in two steps: the family, then the shape within it. */
.voicing-tabs { gap: 5px; }
.vfam, .vshape { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vfam button { font-weight: 700; }
.vshape button { font-size: calc(12px * var(--fs)); padding: 4px 11px; opacity: .92; }

/* The keyboard is playable: lit keys sound alone, the rest sound the chord. */
.piano-diagram svg { cursor: pointer; }
.piano-diagram rect.pkey.on:hover { opacity: .78; }
.sound-hint {
  margin-top: 5px; text-align: center;
  font-size: calc(11px * var(--fs)); color: var(--muted); letter-spacing: .02em;
}

/* Named progressions: a badge where one starts, and a list to jump between. */
.bar-flags { display: flex; align-items: center; gap: 7px; }
.prog {
  font-size: calc(10px * var(--fs)); font-weight: 700; letter-spacing: .03em;
  color: var(--on-accent); background: var(--accent-2);
  padding: 1px 6px; border-radius: 4px; text-transform: lowercase;
}
.prog-list { display: grid; gap: 4px; }
.prog-row {
  display: grid; grid-template-columns: 56px 130px 1fr; gap: 12px;
  align-items: baseline; padding: 6px 9px; border-radius: 7px; cursor: pointer;
}
.prog-row:hover { background: var(--panel-2); }
.prog-row .at { font-family: var(--mono); font-size: calc(12px * var(--fs)); color: var(--muted); }
.prog-row .what { font-weight: 700; color: var(--accent-2); }
.prog-row .how { font-family: var(--mono); font-size: calc(13px * var(--fs)); color: var(--muted); }

/* Transposing moves the chart, not the audio. Say so while it is non-zero. */
.transpose-note {
  font-size: calc(12px * var(--fs)); color: var(--warn);
  border-left: 1px solid var(--line); padding-left: 10px;
}
.transpose-note.busy { color: var(--accent); }

/* A black key is narrower than its label, so the name is allowed to overhang
   slightly rather than be dropped. Letter-spacing is tightened to limit it. */
.piano-diagram text.bkey-name { letter-spacing: -0.4px; }

/* A chord someone has checked, and the field for checking one. */
.beat.fixed { box-shadow: inset 0 -2px 0 var(--accent-2); }
.beat.fixed.now { box-shadow: inset 0 -2px 0 var(--on-accent); }
.chord-edit {
  font: inherit; font-size: var(--chord-size); font-weight: 600;
  width: 100%; min-width: 0; text-align: center;
  padding: 4px 2px; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--accent);
  color: var(--text); outline: none;
}

/* ------------------------------------------------- home and metronome */
.brand {
  display: flex; align-items: center;
  background: none; border: none; cursor: pointer;
}

.home h2 { margin-bottom: 18px; }
.tiles {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.tile {
  display: flex; flex-direction: column; text-align: left; cursor: pointer;
}

.tile span { font-weight: 400; }

.metro { display: grid; }
.metro-bpm { display: flex; align-items: center; justify-content: center; }
.bpm-readout { display: flex; align-items: baseline; gap: 8px; }
#bpmValue {
  font: inherit; font-weight: 700;
  text-align: center; background: none; border: none; color: var(--text);
  font-variant-numeric: tabular-nums; padding: 0;
}
#bpmValue::-webkit-inner-spin-button { display: none; }
.bpm-unit { color: var(--muted); letter-spacing: .08em; }
button.round { border-radius: 50%; padding: 0; }
#bpmSlider { accent-color: var(--accent); }

button.wide { flex: 1; min-width: 150px; padding: 13px; font-size: calc(16px * var(--fs)); }
button.running { background: var(--warn); border-color: var(--warn); }

.metro-beads { display: flex; justify-content: center; }
.bead { border-radius: 50%;
  border: 2px solid var(--line); background: transparent;
  transition: background .06s, transform .06s;
}
.bead.strong { border-color: var(--accent); }
.bead.hit { background: var(--accent-2); transform: scale(1.25); }
.bead.strong.hit { background: var(--accent); }

/* A held beat: the chord is still sounding, it just is not re-announced. */
.beat.held { background: transparent; }
.beat.held .held {
  color: #4a5668; font-size: calc(13px * var(--fs)); font-weight: 400;
}
.beat.held.now { background: var(--accent); }
.beat.held.now .held { color: var(--on-accent); }

/* The metronome is read from across a room, so it is centred and large. */
.metronome-page { padding: 28px; }
.metronome-page h2 { margin-bottom: 22px; }
.metro { gap: 20px; }

#bpmValue { font-size: calc(92px * var(--fs)); }
.bpm-unit { font-size: calc(17px * var(--fs)); }
button.round { width: 50px; height: 50px; font-size: calc(24px * var(--fs)); }
.metro-meter { align-items: center; }
.metro-meter > label {
  font-size: calc(13px * var(--fs)); color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
}
.metro-meter .segmented { flex: 1; }
.metro-row { justify-content: space-between; }
.metro-beads { gap: 14px; padding: 10px 0; }
.bead { width: 26px; height: 26px; }

/* A fact you can act on says so. */
.facts dd.clickable { cursor: pointer; }
.beat-state { margin: 4px 14px; }
.beat-state[hidden] { display: none; }
.facts dd.clickable:hover { color: var(--accent); }

/* Tempo ramp, shown only once it is switched on. */
.ramp { border-top: 1px solid var(--line); padding-top: 14px; }
.ramp-fields { margin-top: 4px; }
.ramp-fields label {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: calc(14px * var(--fs)); color: var(--muted);
}
.ramp-fields input[type=number] {
  font: inherit; font-size: calc(15px * var(--fs)); font-weight: 600; width: 4em;
  text-align: center; padding: 5px 4px; border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
}

/* Bars inside the loop, so the range is visible rather than remembered. */
.bar-cell.looped {
  background: #172a20;
  border-color: var(--accent-2);
}
.bar-cell.looped.playing { background: #1b3a29; }

/* Analysis options say what they give you and what they cost. */
.stage-toggles { flex-direction: column; align-items: stretch; gap: 8px; }
.stage-opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; width: 100%;
}
.stage-opt.fixed { opacity: .72; cursor: default; }
.stage-text { display: grid; gap: 2px; }
.stage-text b { font-size: calc(14px * var(--fs)); }
.stage-text i { font-style: normal; color: var(--muted); font-size: calc(13px * var(--fs)); }
.stage-text em {
  font-style: normal; font-size: calc(11px * var(--fs)); color: var(--warn);
  text-transform: uppercase; letter-spacing: .05em;
}

/* ------------------------------------------------------------ play along */
.play-strip {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
  padding: 8px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px;
}
.play-strip.ok { border-color: #3ddc84; }
.play-strip.waiting { border-color: var(--warn); }
.play-strip .prow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.play-strip .prow.small { font-size: calc(13px * var(--fs)); color: var(--muted); }
.play-strip .ptones { display: flex; gap: 5px; }
.play-strip .tone {
  min-width: 34px; text-align: center; padding: 4px 7px; border-radius: 7px;
  font: 700 calc(15px * var(--fs)) var(--sans); border: 1.5px solid var(--line); color: var(--muted);
}
.play-strip .tone.hit { background: #3ddc84; border-color: #3ddc84; color: var(--on-accent); }
.play-strip .tone.skip { border-style: dashed; }
.play-strip .tone.wrong { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.play-strip .pyou b { font-size: calc(17px * var(--fs)); color: var(--text); }
.play-strip .phint { color: var(--text); }
.play-strip.waiting .phint { color: var(--warn); font-weight: 600; }
.play-strip.ok .phint { color: #3ddc84; font-weight: 600; }
.play-strip .pscore { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.play-strip kbd {
  font: 600 calc(12px * var(--fs)) var(--sans); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
}
#practiceBtn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pkey.held-ok { stroke: #f4fff7; stroke-width: 3; }
.pkey.held-bad { fill: var(--danger); stroke: var(--danger); stroke-width: 2; }

/* ============================================================ small screens
 *
 * You practise at a piano, with the screen on the music stand, not hunched
 * over a laptop. Three things change as the window narrows: controls grow
 * to the size of a fingertip, the header gives its height back to the music,
 * and on a phone the transport folds so nothing runs off the side.
 */

/* Anything driven by touch: 44px is the smallest target a finger hits
   reliably, and hover styles are meaningless. */
@media (pointer: coarse) {
  button.tiny, .voicing-tabs button, .legend span { min-height: 38px; }
  .voicing-tabs button, .vshape button { padding: 8px 14px; font-size: calc(14px * var(--fs)); }
  input[type=checkbox] { width: 22px; height: 22px; }
  .toggle { font-size: calc(14px * var(--fs)); }
  .play { font-size: calc(18px * var(--fs)); }
  #seek { height: 32px; }
  .beat { min-height: 44px; }

  .loader { min-width: 0; }
}

/* Tablet upright, and anything narrower. */
@media (max-width: 900px) {
  .loader { order: 5; flex: 1 1 100%; min-width: 0; }
  .loader input { min-width: 0; }

  .stage-head { padding: 10px 14px; }
  .title-block { flex: 1 1 100%; min-width: 0; }
  .title-block h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stage { padding: 12px 14px 20px; }
  .dock { padding: 8px 14px 10px; }
  .player-bar { padding: 6px 14px calc(10px + env(safe-area-inset-bottom)); }
  .head-actions { margin-left: auto; }
}

/* Phone. */
@media (max-width: 600px) {
  .loader .primary { flex: none; }

  #trackMeta { display: none; }

  .head-actions { flex-wrap: nowrap; max-width: 100%; margin-left: 0; }
  .head-actions .legend { flex-wrap: nowrap; }
  .head-actions button { flex: none; }
  .stage { padding: 10px 10px 16px; }

  .dock-head { gap: 8px; }

  .voicing-tabs { width: 100%; }
  .vfam, .vshape { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
  .vfam button, .vshape button { flex: none; }

  .obs-note { font-size: calc(12px * var(--fs)); }
  .player-bar { padding: 4px 10px calc(8px + env(safe-area-inset-bottom)); }
  #waveform { height: 26px; }

  .time { min-width: 0; }
  #seek { flex: 1 1 40%; min-width: 0; }
  .play-strip .pscore { margin-left: 0; }
  .sheet-card { width: 100%; max-width: none; height: 100dvh; max-height: none; }
  .metronome-page { padding: 18px 14px; }

}

/* A phone on its side, or a very short window: the keyboard and the grid
   cannot both be tall, so the header goes. */
@media (max-height: 520px) {
  .stage-head .facts, .stage-head .legend, #trackMeta { display: none; }
  .stage-head { padding: 6px 12px; }
  #waveform { display: none; }

}

/* A flex child will not shrink below its content unless told it may. Without
   this one long row — the transport, the voicing tabs — set the width of the
   whole song view, and on a narrow screen pushed it off both sides. */
.result, .result > *, .stage > * { min-width: 0; }
body.stage-mode main { min-width: 0; }
.result { width: 100%; }

/* Phone, second pass: the fixed parts of the song view have to add up to less
   than one screen, or the transport is pushed off the bottom of it. */
@media (max-width: 600px) {
  /* Once a song is open the link box is not what the screen is for. */
  body.stage-mode .loader { display: none; }

  .head-actions .legend { display: none; }

  /* Two bars to a line, each allowed to be narrower than its longest chord. */
  .chord-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); --chord-size: calc(15px * var(--fs)); }
  .stage { min-height: 0; }

  #waveform { display: none; }
  .transport { margin-top: 2px; }
  .transport button, .transport select { min-height: 38px; }
  .transport .toggle { min-height: 38px; }

  .play-strip { padding: 6px 8px; gap: 4px; }
  .play-strip .prow { gap: 8px; }
  .play-strip .tone { min-width: 30px; padding: 3px 5px; font-size: calc(14px * var(--fs)); }
  .play-strip .toggle { min-height: 30px; }
  .play-strip .psource { flex: 1 1 100%; font-size: calc(12px * var(--fs)); }
}
.chord-grid { grid-template-columns: repeat(var(--bars), minmax(0, 1fr)); }
@media (max-width: 760px) { .chord-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* A tablet on its side — the usual way one sits on a music stand — is wide
   but short. The header and the play-along strip each took two lines where
   one will do, and that left a single row of bars visible. */
@media (max-height: 900px) and (min-width: 601px) {
  .stage-head { padding: 8px 16px; flex-wrap: nowrap; }
  .title-block { min-width: 0; flex: 1 1 0; }
  .title-block h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #trackMeta { display: none; }
  .head-actions { flex-wrap: nowrap; flex: none; }
  .play-strip { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding: 6px 12px; }
  .play-strip .prow.small { margin-left: auto; }
  .play-strip .toggle { min-height: 32px; }
  .piano-diagram svg { max-height: min(150px, 20vh); }
  #waveform { height: 30px; }

  .stage { min-height: 0; }
}
@media (max-height: 900px) and (min-width: 601px) and (max-width: 900px) {
  .stage-head { flex-wrap: wrap; }
}

/* ------------------------------------------------------------ lead sheet
   Dark ink on paper: notation is read against white everywhere else, and a
   printed page of it should look like the screen did. */
.lead-sheet { background: #f7f4ec; border-radius: 8px; padding: 10px 8px 4px; margin: 0 14px 14px; overflow: hidden; }
.lead-sheet .ls-line { line-height: 0; }
.lead-sheet svg { display: block; max-width: 100%; }
.ls-chord { font: 700 15px var(--sans); fill: #14432a; }
.ls-bar { fill: transparent; stroke: none; cursor: pointer; }
.ls-bar:hover { fill: rgba(47,191,113,.08); }
.ls-bar.playing { fill: rgba(47,191,113,.2); }

/* One timeline, not two. Where the waveform is drawn it is the scrubber and
   the slider is hidden; where the waveform is hidden to save height (phones,
   very short windows) the slider comes back in its place. */
#waveform { touch-action: none; }
#seek { display: none; }
@media (max-width: 600px), (max-height: 520px) { #seek { display: block; } }
.transport #timeNow::after { content: " /"; color: var(--muted); }
.transport #timeNow { min-width: 0; }

/* ------------------------------------------------------------ breadcrumbs
   Where you are, and the way back to the library, on every screen. In a
   song the last crumb follows the music: "Section B · bar 23". */
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); }
.crumbs:empty { display: none; }
.crumb { white-space: nowrap; }
button.crumb {
  background: none; border: 0;
  font: inherit; cursor: pointer; flex: none;
}

.crumb.song { font-weight: 600; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
button.crumb.where { color: var(--muted); font-variant-numeric: tabular-nums; }
.crumb-sep { color: var(--muted); flex: none; }
body.stage-mode .crumbs { flex: 0 1 auto; max-width: 48%; }

/* A key change, short form for narrow screens. */
.k-short { display: none; }

/* Folding the keyboard away. */
.dock-toggle { flex: none; padding: 4px 10px; font-size: calc(13px * var(--fs)); }
#currentChordName { cursor: pointer; }
body.dock-min #chordDiagrams, body.dock-min #voicingTabs, body.dock-min #playStrip { display: none; }
body.dock-min .dock-head { margin-bottom: 0; }

/* The secondary transport controls are one group: inline on a wide screen,
   a row of their own that slides sideways on a phone. */
.transport-more { display: contents; }

/* Phone, third pass: the chart is the point of the screen. Everything that
   stays fixed around it gets one line where it had two or three. */
@media (max-width: 600px) {
  body.stage-mode .topbar { gap: 8px; padding: 6px 10px; }

  body.stage-mode .crumbs { max-width: none; font-size: calc(14px * var(--fs)); }

  /* Title is in the crumbs; the facts go on one line. */
  body.stage-mode .title-block { display: none; }
  .stage-head { flex-wrap: nowrap; align-items: center; padding: 4px 10px; }
  .facts { flex: 1 1 auto; min-width: 0; gap: 0; overflow: hidden; white-space: nowrap; }
  .facts div { flex-direction: row; align-items: baseline; flex: none; }
  .facts dt { display: none; }

  .facts div + div::before { content: "·"; color: var(--muted); }
  .facts div:last-child { display: none; }
  .k-long { display: none; }
  .k-short { display: inline; }

  /* Bars: less frame, same chords. */
  .chord-grid { gap: 5px; }
  .bar-cell { padding: 4px 6px 5px; gap: 2px; border-radius: 8px; }
  .bar-head { font-size: calc(9px * var(--fs)); line-height: 1.3; }
  .bar-head .prog { font-size: calc(8.5px * var(--fs)); padding: 0 4px; }
  .beat { padding: 3px 1px; }
  .beat .deg { font-size: calc(10px * var(--fs)); }

  /* Dock: name, notes and the fold button on one line, the voicing choices
     on a sliding row under it, and a shorter keyboard. */
  .dock { padding: 4px 10px 6px; }
  .dock-head { flex-wrap: wrap; row-gap: 4px; }
  .dock-head h3 { font-size: calc(20px * var(--fs)); min-width: 0; }

  .voicing-tabs { flex: 1 1 100%;
    overflow-x: auto; gap: 4px; margin-left: 0;
    scrollbar-width: none;
  }
  .vfam, .vshape { flex: none; gap: 4px; }

  .voicing-tabs button { padding: 3px 10px; font-size: calc(13px * var(--fs)); }
  .piano-diagram svg { max-height: 104px; }

  /* Player: play, time and position on the first line; the rest slides. */

  .transport-more {
    display: flex; flex: 1 1 100%; align-items: center; scrollbar-width: none;
  }
  .transport-more > * { flex: none; }
  .transport-more button, .transport-more select, .transport-more .toggle { min-height: 32px; }

  .transport-more .rate span, .transport-more .toggle span { font-size: calc(13px * var(--fs)); }

}

/* ------------------------------------------------------------ bar tools
   The tapped bar's actions, pinned to the top of the chart while it scrolls. */
.bar-tools { top: 0; z-index: 3;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: calc(13px * var(--fs));
}
.bar-tools b { margin-right: 4px; }
.bar-tools button { padding: 4px 10px; font-size: calc(13px * var(--fs)); }
.bar-tools .bt-group { display: inline-flex; gap: 4px; }
.bar-tools .bt-note { color: var(--muted); font-size: calc(13px * var(--fs)); }
.bar-tools .bt-note a { color: var(--accent); }
.bar-tools .bt-key { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.bar-tools select { padding: 3px 6px; font-size: calc(13px * var(--fs)); }
.bar-tools .bt-close { margin-left: auto; }
.bar-cell.selected { outline: 2px dashed var(--accent); outline-offset: 2px; }

@media (max-width: 600px) {
  .bar-tools { scrollbar-width: none; }
  .bar-tools > * { flex: none; }

}

/* ------------------------------------------------------------- layers
   Which part the keyboard is showing. A segmented switch, because exactly
   one is on. */
.layer-tabs {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; gap: 2px; flex: none;
}
.layer-tabs[hidden] { display: none; }
.layer-tabs button { font-weight: 600; border: 0;
  background: transparent; color: var(--muted); border-radius: 999px;
}
.layer-tabs button.on { background: var(--accent-2); color: var(--on-accent); }
.melody-row.bass-row .mnote { background: #ffb86b; }
.bar-cell.playing .bass-row .mnote { background: var(--accent); }
/* The bass caption changes with every note; it keeps one line of fixed
   height so its length never moves the keyboard under it. */
body[data-layer="bass"] #chordNotes {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1 1 12ch; line-height: 1.5; min-height: 1.5em;
}
.bass-board { overflow-x: auto; }
.bass-board svg { margin: 0 auto; }
.mnote.tech > i { color: #ffb86b; }

@media (max-width: 600px) {
  /* The bass caption says how the note was played; it gets its own line. */
  body[data-layer="bass"] #chordNotes { flex: 1 1 100%; order: 9; }
}

/* ------------------------------------------------- lead and no vocals */
.melody-row.lead-row .mnote { background: #c79bff; }
.bar-cell.playing .lead-row .mnote { background: var(--accent); }
.prog.solo { background: rgba(199,155,255,.18); color: #c79bff; }
.solo-jumps { align-items: center; display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; }
.solo-jumps .muted { white-space: nowrap; }
#vocalsBtn.on { border-color: var(--accent-2); color: var(--accent-2); background: rgba(200,245,138,.12); }

#instrumentalLink[hidden] { display: none; }
body[data-layer="lead"] #chordNotes {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1 1 12ch; line-height: 1.5; min-height: 1.5em;
}
@media (max-width: 600px) {
  body[data-layer="lead"] #chordNotes { flex: 1 1 100%; order: 9; }
}

/* ----------------------------------------------------------- all parts
   One keyboard per voice, stacked and aligned. */
.stack { display: flex; flex-direction: column; gap: 6px; }
.stack-row { display: flex; align-items: center; gap: 10px; }
.stack-row svg { flex: 0 1 auto; min-width: 0; }
.stack-label { flex: 0 0 104px; font-size: calc(11px * var(--fs)); line-height: 1.25; min-width: 0; }
.stack-label b { display: block; }
.stack-notes {
  display: block; font-family: var(--mono); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.25em;
}
.skey.w { fill: #e7ecf3; stroke: #2f3a4c; }
.skey.b { fill: #161b23; stroke: #2f3a4c; }
.stack-row[data-voice="voice"] .skey.on { fill: var(--accent); }
.stack-row[data-voice="other"] .skey.on { fill: #c79bff; }
.stack-row[data-voice="piano"] .skey.on { fill: #6fd2e8; }
.stack-row[data-voice="guitar"] .skey.on { fill: #ff8fa3; }
.stack-row[data-voice="bass"] .skey.on { fill: #ffb86b; }
.stack-row[data-voice="voice"] b { color: var(--accent); }
.stack-row[data-voice="other"] b { color: #c79bff; }
.stack-row[data-voice="piano"] b { color: #6fd2e8; }
.stack-row[data-voice="guitar"] b { color: #ff8fa3; }
.stack-row[data-voice="bass"] b { color: #ffb86b; }
body[data-layer="all"] #chordNotes {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1 1 12ch; line-height: 1.5; min-height: 1.5em;
}
body[data-layer="all"] .dock { max-height: 46vh; }
@media (max-width: 600px) {
  .stack-row { gap: 6px; }
  .stack-label { flex-basis: 44px; font-size: calc(10px * var(--fs)); }
  .stack-notes { display: none; }
  body[data-layer="all"] #chordNotes { flex: 1 1 100%; order: 9; }
  body[data-layer="all"] .dock { max-height: 44vh; }
}

/* ================================================================ UI pass
   Settles the layout problems found in a review of the main screens; later
   than everything above, so it wins without touching the earlier passes. */

/* -- Every control is big enough to hit: 34px with a mouse, 44 by touch. */
.head-actions button,
.bar-tools button,
.bar-tools select,
.dock-toggle,
.voicing-tabs button,
.transport-more button,
.transport-more select,
#soloReset,
#instrumentalLink { min-height: 34px; }
.layer-tabs button { min-height: 32px; padding: 4px 12px; font-size: calc(12px * var(--fs)); }
.layer-tabs { padding: 2px; }

.toggle { min-height: 34px; }
#instrumentalLink {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-size: calc(13px * var(--fs)); text-decoration: none;
}
#instrumentalLink:hover { border-color: var(--accent); }
#soloReset { padding: 6px 12px; font-size: calc(13px * var(--fs)); }
@media (pointer: coarse) {
  .head-actions button,
.bar-tools button,
.bar-tools select,
.dock-toggle,
.voicing-tabs button,
.vshape button,
.transport-more button,
.transport-more select,
#soloReset,
#instrumentalLink,
.toggle { min-height: 44px; }
  .layer-tabs button { min-height: 40px; }

  .brand { min-width: 44px; }
}

/* -- Header actions: words on a wide screen, icons on a phone. */
.head-actions .ic { display: none; }
.head-actions button { display: inline-flex; align-items: center; justify-content: center; }

/* -- The selected bar's tools: a row of their own above the chart, so they
      never sit on top of the bars they are about. */
.bar-tools {
  position: static; flex: none; margin: 0; border-radius: 0;
  border: 0; border-bottom: 1px solid var(--accent);
  background: var(--panel-2); padding: 6px 20px;
}
.bar-tools.hidden { display: none; }

/* -- Desktop: the chart gets the room. The dock is one header line, a
      shorter keyboard and the two hands side by side. */
.voicing-tabs { flex-direction: row; align-items: center; flex-wrap: wrap; }
.vshape { padding-left: 8px; border-left: 1px solid var(--line); }
.vshape:first-child { padding-left: 0; border-left: 0; }
.dock-head { align-items: center; margin-bottom: 6px; }
.piano-diagram .dlabel {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 28px;
}
.sound-hint { display: none; }
.piano-diagram svg { max-height: min(150px, 19vh); }
.dock { max-height: 36vh; }
.melody-row { height: 34px; }
@media (max-height: 900px) and (min-width: 601px) {
  .piano-diagram svg { max-height: min(130px, 17vh); }
  .dock { max-height: 34vh; }
}

/* -- Badges in a bar head wrap rather than run past the bar's edge. */
.bar-flags { flex-wrap: wrap; justify-content: flex-end; row-gap: 3px; min-width: 0; }

/* -- Home: recent songs, and what a new song gets. */

.recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.recent-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item span { color: var(--muted); font-size: calc(13px * var(--fs)); }
.recent-item em { font-style: normal; color: var(--accent); }
.home-defaults { line-height: 1.5; }
.linkish {
  background: none; border: 0; padding: 0 2px; min-height: 0; font: inherit; cursor: pointer;
}
.linkish:hover { background: none; }

/* -- Transport: short labels only where the long ones do not fit. */
.lbl-short { display: none; }

/* -- Phone. */
@media (max-width: 600px) {
  /* The app's name on the home screen; in a song the crumbs need the room. */
  body:not(.stage-mode) .brand .brand-name { font-size: calc(17px * var(--fs)); }

  /* Header: one line of facts and a row of icon buttons that fits. */
  .head-actions { overflow: visible; flex: none; }
  .head-actions button { font-size: calc(16px * var(--fs)); }
  .head-actions .ic { display: inline; }
  .head-actions .lbl { display: none; }

  .facts div + div::before { margin: 0 4px; }

  /* Bar tools: wrap onto a second line instead of sliding off the edge. */
  .bar-tools { flex-wrap: wrap; overflow: visible; padding: 6px 10px; gap: 6px; }
  .bar-tools .bt-close { margin-left: auto; }

  /* Player: every control visible, wrapping onto a second row. */
  .transport-more { overflow: visible; }
  .transport-more .lbl-long { display: none; }
  .transport-more .lbl-short { display: inline; font-size: calc(13px * var(--fs)); }
  .transport-more button { padding: 4px 10px; font-size: calc(13px * var(--fs)); }
  .transport-more .toggle span { font-size: calc(13px * var(--fs)); }

  /* The rows around the chart got taller; the keyboard gives a little back. */
  .dock { max-height: 34dvh; }

}

/* -- Second look at the phone, and the last small controls. */
.dock-toggle .ic { display: none; }
.stem a, .stem .mute {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px; min-width: 40px; padding: 6px 10px; font-size: calc(13px * var(--fs));
}
.bar-tools .bt-close { min-width: 34px; }
@media (max-width: 600px) {
  /* Logo and breadcrumbs share one line; the song's name gives way. */
  body.stage-mode .topbar { flex-wrap: nowrap; }
  body.stage-mode .crumbs { flex: 1 1 0; min-width: 0; overflow: hidden; }
  body.stage-mode .brand { min-width: 40px; justify-content: center; padding: 4px; flex: none; }

  /* Dock: the layer switch, the chord and the fold arrow on the first line,
     the chord's notes under them, then the voicing choices. The fingers and
     note names are on the keys themselves, so the caption under the
     keyboard is left out here rather than cut off by the dock's height. */
  .dock-head { column-gap: 8px; }
  #layerTabs { order: 0; }
  .dock-head h3 { order: 1; }
  .dock-toggle { order: 2; margin-left: auto; min-width: 40px; padding: 4px 10px; }
  .dock-toggle .ic { display: inline; font-size: calc(16px * var(--fs)); }
  .dock-toggle .lbl { display: none; }
  #chordNotes { order: 3; flex: 1 1 100%; font-size: calc(13px * var(--fs)); }
  .voicing-tabs { order: 4; }

  .piano-diagram .dlabel { display: none; }
}

/* A part with few notes may be leakage: shown, but quieter. */
.stack-row.faint svg { opacity: .6; }

@media (max-width: 600px) { .stack-row.faint .stack-label b::after { content: " ?"; } }

/* All parts: the Lead, Chords and Bass views stacked, in their own colours. */

.stack-row[data-voice="lead"] .skey.on { fill: #c79bff; }
.stack-row[data-voice="lead"] b { color: #c79bff; }

/* Instrument views: the same colours in their own tab and in All parts. */

.layer-tabs .lbl-short { display: none; }
@media (max-width: 600px) {
  .layer-tabs .lbl-long { display: none; }
  .layer-tabs .lbl-short { display: inline; }
  .layer-tabs button { padding: 4px 8px; }
}

.prog.solo[data-part="piano"] { background: rgba(111,210,232,.16); color: #6fd2e8; }
.prog.solo[data-part="guitar"] { background: rgba(255,143,163,.16); color: #ff8fa3; }
.prog.solo[data-part="other"] { background: rgba(199,155,255,.16); color: #c79bff; }

/* ------------------------------------------------ a dock that holds still
 * Nothing in the dock changes size while a song plays or between views:
 * the tab row is one row that scrolls sideways, the note line is one line,
 * and the keyboard area is a fixed height the drawing scales into. The
 * keyboard's span is fixed per song in the script. */
#keyboardDock { --diagram-h: calc(176px * var(--fs)); }
@media (max-width: 600px) { #keyboardDock { --diagram-h: calc(128px * var(--fs)); } }
#currentChordName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chordNotes { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
              height: 20px; line-height: 20px; }
#voicingTabs { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 6px;
               overflow-x: auto; overflow-y: hidden; height: 38px; min-height: 38px; max-width: 100%;
               flex: 1 1 0; min-width: 0; justify-content: flex-start;
               scrollbar-width: none; }
#voicingTabs::-webkit-scrollbar { display: none; }
#voicingTabs > div, #voicingTabs .vfam, #voicingTabs .vshape { flex-wrap: nowrap; flex: none; display: flex; align-items: center; }
#voicingTabs button { flex: none; white-space: nowrap; }
#chordDiagrams { height: var(--diagram-h); min-height: var(--diagram-h); max-height: var(--diagram-h); overflow: hidden; }
#chordDiagrams > .diagram { height: 100%; box-sizing: border-box; display: flex; flex-direction: column;
                            justify-content: center; min-height: 0; margin: 0; }
#chordDiagrams > .diagram > svg { flex: 1 1 0; min-height: 0; width: 100%; height: 100%; }
#chordDiagrams .dlabel { flex: none; height: 2.7em; overflow: hidden; margin-top: 2px; }

#chordDiagrams .sound-hint, #chordDiagrams .obs-note { display: none; }
#chordDiagrams .resting .pkey.on { opacity: .5; }
#chordDiagrams .stack { gap: 4px; }
#chordDiagrams .stack-row { flex: 1 1 0; min-height: 0; }
#chordDiagrams .stack-row svg { flex: 1 1 0; min-width: 0; }
/* On a phone the tab row always has its own line, in every view, so the
   dock does not change height when a view's tabs happen to fit beside the
   chord name. */
@media (max-width: 600px) { #voicingTabs { flex: 0 0 100%; } }

/* The Hear switch while the chart is being rendered. */

/* All parts: the rows share the space the tab row has in the other views,
   so the keyboards are taller and the dock is the same height. */
body[data-layer="all"] #voicingTabs { visibility: hidden; }
@media (max-width: 600px) {
  /* On a phone the tab row is a line of its own, so it can be given over. */
  body[data-layer="all"] #voicingTabs { display: none; }
  body[data-layer="all"] #chordDiagrams { --stack-h: calc(var(--diagram-h) + 42px);
    height: var(--stack-h); min-height: var(--stack-h); max-height: var(--stack-h); }
}
#chordDiagrams .stack-row svg { height: 100%; width: 100%; }
.stack-row[data-voice="chord"] .skey.on { fill: #2fbf71; }
.stack-row[data-voice="chord"] .skey.on.lh { fill: #c8f58a; }
.stack-row[data-voice="chord"] b { color: #2fbf71; }
.stack-row .sname { font: 600 7px var(--mono, monospace); fill: #05140c; pointer-events: none; }
.stack-row .sname.on-black { font-size: calc(6px * var(--fs)); }

/* ------------------------------------------------------- falling notes */
.fall-view { display: flex; flex-direction: column; height: 100%; min-height: 260px; gap: 8px; }
.fall-view[hidden] { display: none; }
body[data-fall="1"] #chordGrid, body[data-fall="1"] #stage > .drawer { display: none; }
body[data-fall="1"] #stage { display: flex; flex-direction: column; overflow: hidden; }
.fall-opts { display: flex; align-items: center; flex-wrap: nowrap; overflow-x: auto;
             font-size: calc(12px * var(--fs)); color: var(--muted); scrollbar-width: none; flex: none; }
.fall-opts::-webkit-scrollbar { display: none; }
.fall-opts label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.fall-opts select { font-size: calc(12px * var(--fs)); }

#fallCanvas { flex: 1; min-height: 0; width: 100%; border-radius: 10px; display: block; }
#fallBtn.on { border-color: var(--accent); }

/* Chords in this song: one card per chord, its voicing underneath. */
.chord-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.chord-card { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 8px 10px;
              background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--text); }
.chord-card:hover { border-color: var(--accent); }
.chord-card .cc-head { display: flex; align-items: baseline; gap: 8px; }
.chord-card .cc-head b { font-size: calc(17px * var(--fs)); }
.chord-card .deg { color: var(--muted); font-size: calc(12px * var(--fs)); }
.chord-card .cc-count { margin-left: auto; color: var(--muted); font-size: calc(11.5px * var(--fs)); font-family: var(--mono); }
.chord-card .piano-diagram { padding: 0; background: none; border: 0; }
.chord-card svg { width: 100%; height: auto; }
@media (max-width: 600px) { .chord-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* The mix: song and chart volumes, and how the chart plays. It lives on the
   page itself, placed above its button when opened, so no panel covers it. */
.mix-wrap { display: inline-flex; }
.mix-panel { position: fixed; z-index: 1000;
             width: calc(380px * var(--fs)); max-width: calc(100vw - 32px); display: grid; border: 1px solid var(--line); }
.mix-panel[hidden] { display: none; }
.mix-panel { grid-template-columns: minmax(0, 1fr); }
.mix-panel > *, .mix-panel select { min-width: 0; }
.mix-panel select { width: 100%; }
.mix-panel label { display: grid; grid-template-columns: 82px 1fr 44px; align-items: center; gap: 8px; }
.mix-panel label:has(select) { grid-template-columns: 82px 1fr; }

.mix-panel label[hidden] { display: none; }
.mix-panel output { font-size: calc(12px * var(--fs)); color: var(--muted); text-align: right; }
.mix-panel p { margin: 0; }
.mix-panel { overflow-y: auto; }
.mix-sound { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.mix-eq-head { display: flex; justify-content: space-between; align-items: center; font-size: calc(13px * var(--fs)); }
.mix-eq-head button { padding: 2px 10px; font-size: calc(12px * var(--fs)); }
#mixBtn.on { border-color: var(--accent); color: var(--accent); }
.chord-card .cc-count { white-space: nowrap; }

.fall-parts { display: inline-flex; gap: 6px; flex: none; }
.fall-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: calc(12px * var(--fs));
             border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); white-space: nowrap; }
.fall-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--chip); opacity: .35; }
.fall-chip.on { color: var(--text); border-color: var(--chip); }
.fall-chip.on i { opacity: 1; }
/* Wide screens have room for every falling-notes setting: wrap, don't hide. */

/* The export menu: one button per format, what it is for underneath. */
.export-panel button { display: grid; gap: 1px; text-align: left;
                       background: transparent; border: 1px solid var(--line); color: inherit; cursor: pointer; }

.export-panel button b { font-size: calc(14px * var(--fs)); }
.export-panel button span { font-size: calc(12px * var(--fs)); color: var(--muted); }

/* Live chords: one large chord, its degree and notes, a keyboard, what came before. */
.live { display: grid; gap: 14px; justify-items: center; text-align: center; }
.live-now { display: grid; gap: 4px; min-height: 150px; align-content: center; }
.live-chord { font-size: clamp(56px, 16vw, 110px); font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.live-chord.fresh { color: var(--accent); }
.live-degree { font-size: calc(22px * var(--fs)); color: var(--muted); font-weight: 600; min-height: 26px; }
.live-notes { font-size: calc(15px * var(--fs)); min-height: 18px; }
.live-keys { width: min(520px, 100%); }
.live-meta { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.live-level { display: inline-block; width: 120px; height: 6px; border-radius: 3px; overflow: hidden; }
.live-level i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.live-history { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 640px; }
.live-history li { border: 1px solid var(--line); font-weight: 600; }
.live-history li:last-child { border-color: var(--accent); }
.live-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Chord dictionary. */
.dict { display: grid; gap: 12px; }
.dict-form { display: flex; gap: 8px; }
.dict-form input { flex: 1; min-width: 0; font-size: calc(16px * var(--fs)); }
.dict-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dict-chips button { border: 1px solid var(--line); background: transparent; cursor: pointer; }

.dict-result { display: grid; gap: 10px; }
.dict-head { display: flex; align-items: center; gap: 12px; }
.dict-head h2 { margin: 0; }
.dict-notes { display: flex; flex-wrap: wrap; gap: 8px; }
.dict-notes span { display: inline-grid; justify-items: center; border: 1px solid var(--line); }
.dict-notes b { font-size: calc(16px * var(--fs)); } .dict-notes i { font-style: normal; font-size: calc(12px * var(--fs)); color: var(--muted); }
.dict-tabs { margin-left: 0; }
.dict-strings { flex-wrap: wrap; }

/* Tuner. */
.tuner { display: grid; gap: 14px; justify-items: center; text-align: center; }
.tuner-note { font-size: clamp(64px, 20vw, 120px); font-weight: 700; line-height: 1; }
.tuner-note sub { font-size: .3em; color: var(--muted); margin-left: 4px; }
.tuner-note.in { color: var(--accent); }
.tuner-meter { position: relative; width: min(420px, 100%); height: 46px; }
.tuner-scale { position: absolute; inset: 18px 0 auto 0; display: flex; justify-content: space-between; }
.tuner-scale i { width: 2px; height: 12px; background: var(--line); }
.tuner-scale i.mid { height: 22px; margin-top: -5px; background: var(--muted); }
.tuner-needle { position: absolute; left: 50%; top: 0; width: 4px; height: 46px; margin-left: -2px; border-radius: 2px;
                background: var(--muted); transition: left .08s linear, background .1s; }
.tuner-needle.in { background: var(--accent); }
.tuner-cents { font-size: calc(15px * var(--fs)); min-height: 18px; }
.tuner-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.tuner-controls input { width: 64px; }
.tuner-strings { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tuner-strings button { min-width: 52px; padding: 8px 10px; border: 1px solid var(--line); background: transparent; color: inherit; font-weight: 700; cursor: pointer; }
.tuner-strings button.near { color: var(--accent); }

/* Setlists. */
.setlists-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.setlist-list { display: grid; }
.setlist { border: 1px solid var(--line); display: grid; gap: 6px; }
.setlist-top { display: flex; align-items: center; }
.setlist-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.setlist ol { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.setlist li { display: flex; align-items: center; gap: 6px; }
.setlist li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setlist li button, .setlist-top button { padding: 2px 8px; }
.setlist select { width: 100%; }
.setlist-bar { display: flex; align-items: center; gap: 8px; margin: 4px 14px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; }
.setlist-bar[hidden] { display: none; }
.setlist-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ===================================================== design system, v2
   A consistent layer over everything above (2026-11-18 review): one type
   scale, one set of surfaces, one icon set, controls styled alike (buttons,
   chips, fields, selects, switches, sliders), the app's sections always one
   tap away (a top nav on wide screens, a tab bar on phones and tablets) and
   adding a song as the home screen's first act. Later rules win, so the
   earlier passes keep their layout work. */

:root {
  color-scheme: dark;
  --bg: #090e0b;
  --panel: #0f1612;
  --panel-2: #151e19;
  --panel-3: #1b2620;
  --line: #1e2a24;
  --line-2: #2a3a31;
  --text: #edf4f0;
  --text-2: #bac8c0;
  --muted: #84958b;
  --accent: #34c77b;
  --accent-hover: #4fd791;
  --accent-soft: rgba(52, 199, 123, .13);
  --accent-line: rgba(52, 199, 123, .45);
  --on-accent: #04130b;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-pop: 0 18px 48px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  --tab-h: 62px;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2384958b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

body { background: var(--bg); font-size: calc(14px * var(--fs)); line-height: 1.45; text-rendering: optimizeLegibility; }
h1, h2, h3 { letter-spacing: -0.015em; }

/* Icons. */
.ico { width: calc(18px * var(--fs)); height: calc(18px * var(--fs)); flex: none; display: block; }
.i { display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* Focus is always visible for the keyboard, never for a tap. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
/* The top bar is dark green in both themes: its ring is the bar's own ink. On phones and tablets its tabs sit along the
   bottom on the page's colours (.appnav), so they keep the page's ring. */
.topbar :focus-visible { outline-color: var(--top-ink, #fff); }
@media (max-width: 900px) { .topbar .appnav :focus-visible { outline-color: var(--focus, var(--accent)); } }
/* What the keyboard reaches is scrolled clear of the bars, the top one and, on phones and tablets, the tab bar (review AX-03). */
html { scroll-padding-top: 76px; }
@media (max-width: 900px) { html { scroll-padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); } }
input[type=text]:focus, input[type=number]:focus, input[type=search]:focus, select:focus { outline: none; }

/* An element the app hides stays hidden, whatever display its class gives it
   (the button rule below would otherwise show every hidden button). */
[hidden] { display: none !important; }

/* Buttons: primary (one per screen), secondary (bordered), ghost (quiet), icon. */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 14px; border-radius: 10px;
  font-weight: 500; line-height: 1.2;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
button:hover { background: var(--panel-3); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .35; cursor: default; transform: none; }
button:disabled:hover { background: inherit; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.secondary { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); }
button.secondary:hover { background: var(--panel-3); border-color: #36483e; }
button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover { background: var(--panel-3); color: var(--text); }
button.icon { width: 36px; padding: 0; }
button.icon .ico { width: calc(19px * var(--fs)); height: calc(19px * var(--fs)); }
.link-btn {
  background: none; border: 0; color: var(--accent); padding: 0 6px; min-height: 32px; gap: 4px; font-size: calc(13px * var(--fs)); font-weight: 600;
}
.link-btn:hover { background: var(--accent-soft); }
.link-btn .ico { width: calc(16px * var(--fs)); height: calc(16px * var(--fs)); }

/* Fields. */
input[type=text], input[type=number], input[type=search], select {
  min-height: 40px; border-radius: 10px; background: var(--panel-2);
  border: 1px solid var(--line-2); color: var(--text); padding: 0 12px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input[type=text]:focus, input[type=number]:focus, input[type=search]:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: #66776d; }
input[type=search]::-webkit-search-cancel-button { filter: invert(.6); }
select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: var(--chevron); background-repeat: no-repeat;
  background-position: right 9px center; background-size: 16px; padding-right: 32px;
}
.field { position: relative; display: flex; align-items: center; min-width: 0; }
.field > .i { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.field > input { width: 100%; padding-left: 40px; }

/* Sliders and boxes take the accent; settings-like checkboxes are switches. */
input[type=range], input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input[type=range] { cursor: pointer; }
.setting .row-label input[type=checkbox], .mix-panel label.check input, .metro-row .toggle input,
.ramp .row-label input, .stage-opt input, #setCurwen, .play-strip .toggle input {
  -webkit-appearance: none; appearance: none; flex: none; cursor: pointer;
  width: 40px; height: 24px; margin: 0; border-radius: 999px; position: relative;
  background: var(--switch-off, var(--line-2)); transition: background .18s var(--ease);
}
.setting .row-label input[type=checkbox]::before, .mix-panel label.check input::before, .metro-row .toggle input::before,
.ramp .row-label input::before, .stage-opt input::before, #setCurwen::before, .play-strip .toggle input::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--switch-knob, #dfe8e3); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .18s var(--ease);
}
.setting .row-label input[type=checkbox]:checked, .mix-panel label.check input:checked, .metro-row .toggle input:checked,
.ramp .row-label input:checked, .stage-opt input:checked, #setCurwen:checked, .play-strip .toggle input:checked { background: var(--accent); }
.setting .row-label input[type=checkbox]:checked::before, .mix-panel label.check input:checked::before, .metro-row .toggle input:checked::before,
.ramp .row-label input:checked::before, .stage-opt input:checked::before, #setCurwen:checked::before, .play-strip .toggle input:checked::before { transform: translateX(16px); background: #fff; }
.stage-opt input:disabled { opacity: .5; cursor: default; }
.mix-panel label.check { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mix-panel label.check input { order: 2; }

/* Segmented controls. */
.segmented { background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.segmented button { border: 0; border-radius: 8px; min-height: 34px; color: var(--text-2); background: transparent; }
.segmented button:hover { background: var(--panel-3); color: var(--text); }
.segmented button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ------------------------------------------------------------- the shell */
.topbar {
  gap: 14px; min-height: 58px; padding: 0 20px;
  background: rgba(9, 14, 11, .82); -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
body.stage-mode .topbar { position: static; }
.brand { gap: 10px; flex: none; min-height: 40px; padding: 0 6px 0 0; border-radius: 10px; }
.brand:hover { background: none; opacity: 1; }
.brand .brand-name { font-size: calc(16px * var(--fs)); font-weight: 700; letter-spacing: -0.02em; }

.crumbs { flex: 1 1 auto; font-size: calc(13.5px * var(--fs)); }
button.crumb { color: var(--text-2); min-height: 32px; padding: 0 4px; border-radius: 6px; font-weight: 500; }
button.crumb:hover { color: var(--text); background: var(--panel-3); text-decoration: none; }
.crumb.back::before { content: ""; }
.crumb.song { color: var(--text); }
.crumb-sep { opacity: .45; }

.appnav { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.appnav button {
  background: transparent; border: 0; color: var(--muted); min-height: 36px; padding: 0 11px; gap: 7px;
  font-size: calc(13.5px * var(--fs)); font-weight: 500; border-radius: 9px;
}
.appnav button:hover { color: var(--text); background: var(--panel-3); }
.appnav button.on { color: var(--text); background: var(--panel-3); }
.appnav button.on .ico { color: var(--accent); }
.appnav .ico { width: calc(17px * var(--fs)); height: calc(17px * var(--fs)); }
.appnav .nav-home { display: none; }
.add-song { min-height: 36px; padding: 0 14px 0 11px; gap: 6px; flex: none; }
.add-song .ico { width: calc(17px * var(--fs)); height: calc(17px * var(--fs)); }
body[data-view="home"] .add-song { display: none; }

main { max-width: 1120px; padding: 28px 24px 48px; }
body.stage-mode main { max-width: none; padding: 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }

.drop-hint > div { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: calc(17px * var(--fs)); font-weight: 600; }
.drop-hint .ico { width: calc(36px * var(--fs)); height: calc(36px * var(--fs)); color: var(--accent); }

/* Section headings inside a page. */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; min-height: 32px; }
.section-head h3 { font-size: calc(13px * var(--fs)); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------------------ home */
.home { display: grid; gap: 36px; }
.hero {
  padding: 40px 40px 34px; border-radius: 22px; border: 1px solid var(--line);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(52, 199, 123, .17), transparent 60%),
    radial-gradient(60% 90% at 100% 100%, rgba(200, 245, 138, .06), transparent 60%),
    var(--panel);
}
.hero h1 { font-size: calc(34px * var(--fs)); font-weight: 750; letter-spacing: -0.03em; margin: 0; }
.hero-sub { color: var(--text-2); font-size: calc(15.5px * var(--fs)); line-height: 1.55; max-width: 58ch; margin: 10px 0 24px; }
.hero .loader { display: flex; gap: 10px; align-items: stretch; }
.hero .loader .field { flex: 1 1 auto; }
.hero .loader input { min-height: 50px; font-size: calc(15.5px * var(--fs)); border-radius: 12px; background: rgba(9, 14, 11, .6); }
.hero .loader button { min-height: 50px; padding: 0 20px; border-radius: 12px; font-size: calc(15px * var(--fs)); flex: none; }
.home-defaults { margin: 16px 0 0; font-size: calc(13px * var(--fs)); color: var(--muted); }
.linkish { color: var(--accent); text-decoration: none; font-weight: 600; }
.linkish:hover { text-decoration: underline; }

.home-recent { margin-top: 0; }
.recent-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.recent-item, .library-item {
  display: flex; flex-direction: row; align-items: center; gap: 14px; text-align: left; min-width: 0;
  padding: 10px 14px 10px 10px; border-radius: 14px; cursor: pointer; color: var(--text);
}
.recent-item { background: var(--panel); border: 1px solid var(--line); min-height: 66px; justify-content: flex-start; }
.recent-item:hover { background: var(--panel-2); border-color: var(--line-2); }
.thumb {
  width: 44px; height: 44px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: linear-gradient(140deg, hsl(var(--h) 42% 30%), hsl(calc(var(--h) + 35) 40% 17%));
  color: hsl(var(--h) 85% 88%); font-weight: 700; font-size: calc(15px * var(--fs)); letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.lib-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; }
.lib-text > b, .lib-text > span, .lib-title, .lib-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.recent-item b, .lib-title { font-size: calc(15px * var(--fs)); font-weight: 600; color: var(--text); max-width: none; }
.recent-item .lib-text span, .library-item .lib-meta { font-size: calc(13px * var(--fs)); color: var(--muted); font-family: var(--sans); }
.recent-item .dur { color: var(--muted); font-size: calc(13px * var(--fs)); font-variant-numeric: tabular-nums; flex: none; }

.home-tools .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile {
  gap: 4px; padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
  align-items: flex-start; justify-content: flex-start; color: var(--text);
}
.tile:hover { background: var(--panel-2); border-color: var(--line-2); }
.tile-ic { width: calc(40px * var(--fs)); height: calc(40px * var(--fs)); border-radius: 11px; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.tile-ic .ico { width: calc(21px * var(--fs)); height: calc(21px * var(--fs)); }
.tile b { font-size: calc(15px * var(--fs)); font-weight: 600; }
.tile span { font-size: calc(13px * var(--fs)); line-height: 1.45; color: var(--muted); }

/* --------------------------------------------------------------- library */
.library-page { display: grid; gap: 10px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: calc(30px * var(--fs)); font-weight: 750; letter-spacing: -0.03em; }
.page-head .search { width: min(360px, 100%); }
.library-list { display: grid; gap: 2px; margin-bottom: 8px; }
.library-item { background: transparent; border: 1px solid transparent; }
.library-item[hidden] { display: none; }
.library-item:hover { background: var(--panel); border-color: var(--line); }
.library-item .del { color: var(--muted); opacity: 0; width: 36px; min-height: 36px; padding: 0; border: 0; }
.library-item:hover .del, .library-item:focus-within .del { opacity: 1; }
.library-item .del:hover { color: var(--danger); background: rgba(255, 123, 123, .1); }
.setlists-head { margin-top: 8px; }
.setlist-list { margin-bottom: 22px; gap: 10px; }
.setlist { background: var(--panel); border-color: var(--line); border-radius: 14px; padding: 12px 14px; }
.empty {
  display: grid; justify-items: center; gap: 8px; text-align: center; padding: 48px 20px;
  border: 1px dashed var(--line-2); border-radius: 16px; color: var(--muted);
}
.empty b { color: var(--text); font-size: calc(16px * var(--fs)); }
.empty button { margin-top: 8px; }

/* ------------------------------------------------------------- song view */
.stage-head { background: var(--bg); gap: 24px; }
.title-block h2 { font-size: calc(17px * var(--fs)); font-weight: 650; }
.facts dt { font-size: calc(11.5px * var(--fs)); font-weight: 600; letter-spacing: .07em; }
.facts dd { font-size: calc(15px * var(--fs)); }
.head-actions { gap: 4px; }
.head-actions button.ghost { color: var(--text-2); }
.head-actions button[aria-pressed="true"], #fallBtn.on { background: var(--accent-soft); color: var(--accent); }
.dock { background: var(--panel); }
.dock-toggle { gap: 6px; }
.dock-toggle .ico { width: calc(16px * var(--fs)); height: calc(16px * var(--fs)); }

.player-bar { background: rgba(9, 14, 11, .94); padding-top: 8px; }
.transport { gap: 10px; }
.play {
  width: 44px; height: 44px; border-radius: 50%; padding: 0; flex: none;
  background: var(--text); color: var(--bg); border: 0; box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.play:hover { background: #fff; }
.play .ico { width: calc(20px * var(--fs)); height: calc(20px * var(--fs)); }
.time { font-family: var(--sans); font-size: calc(13px * var(--fs)); font-variant-numeric: tabular-nums; color: var(--text-2); }

/* Transport chips: one shape for buttons, menus and toggles alike. */
.tchip, button.loop {
  min-height: 34px; padding: 0 12px; gap: 6px; border-radius: 999px; font-size: calc(13px * var(--fs)); font-weight: 500;
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
}
.tchip:hover, button.loop:hover { background: var(--panel-3); color: var(--text); }
.tchip .ico { width: calc(16px * var(--fs)); height: calc(16px * var(--fs)); }
button.tchip.on, button.tchip[aria-pressed="true"], button.loop.on,
label.tchip:has(input:checked) {
  background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent);
}
label.tchip { display: inline-flex; align-items: center; cursor: pointer; position: relative; }
label.toggle.tchip input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
label.toggle.tchip:has(input:focus-visible) { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
label.rate.tchip { padding: 0 2px 0 12px; gap: 2px; color: var(--muted); }
label.rate.tchip select {
  min-height: 32px; border: 0; background-color: transparent; padding: 0 26px 0 4px; font-size: calc(13px * var(--fs)); font-weight: 600;
  color: var(--text); background-position: right 6px center; box-shadow: none;
}
#vocalsBtn .slash { opacity: 0; }
#vocalsBtn.on .slash { opacity: 1; }
#seek { accent-color: var(--accent); }

/* Pop-overs. */
.mix-panel { background: var(--panel-2); border-color: var(--line-2); border-radius: 16px; box-shadow: var(--shadow-pop); padding: 16px; gap: 12px; }
.mix-panel label { font-size: calc(13px * var(--fs)); color: var(--text-2); }
.mix-panel output { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.export-panel button { border-color: var(--line-2); border-radius: 10px; padding: 10px 12px; min-height: 0; justify-content: flex-start; }
.export-panel button:hover { background: var(--panel-3); border-color: var(--accent-line); }

/* Settings sheet. */
.sheet-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow-pop); }
.sheet-head { border-bottom: 1px solid var(--line); }
.setting > label:first-child:not(.row-label) {
  font-size: calc(12px * var(--fs)); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

/* ---------------------------------------------------- live, tuner, dictionary */
.live-chord.idle, .tuner-note.idle #tunerNote { color: var(--line-2); font-weight: 300; }
.live, .tuner { padding: 36px 24px; }
.live-history li { border-radius: 999px; padding: 4px 12px; border-color: var(--line-2); font-size: calc(13px * var(--fs)); }
.live-level { background: var(--line-2); }
.tuner-strings button { border-color: var(--line-2); border-radius: 12px; min-height: 44px; }
.tuner-strings button.near { background: var(--accent-soft); border-color: var(--accent-line); }
.tuner-controls select { min-width: 160px; }
.dict-chips button { border-color: var(--line-2); border-radius: 999px; padding: 0 12px; min-height: 34px; color: var(--text-2); font-weight: 600; }
.dict-chips button:hover { color: var(--text); }
.dict-chips button.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.dict-form input { min-height: 46px; }
.dict-form button { min-height: 46px; }
.dict-notes span { border-color: var(--line-2); border-radius: 10px; padding: 6px 12px; background: var(--panel-2); }
.dict-head h2 { font-size: calc(40px * var(--fs)); font-weight: 750; letter-spacing: -0.03em; }
.welcome h2 { font-size: calc(22px * var(--fs)); font-weight: 700; }
.stage-opt { border-radius: 12px; }

/* ------------------------------------------- tablets and phones: a tab bar */
@media (max-width: 900px) {
  .appnav {
    position: fixed; z-index: 900; left: 0; right: 0; bottom: 0; margin: 0;
    display: grid; gap: 0;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 4px 6px env(safe-area-inset-bottom);
    background: rgba(12, 18, 15, .92); -webkit-backdrop-filter: saturate(140%) blur(16px); backdrop-filter: saturate(140%) blur(16px);
    border-top: 1px solid var(--line);
  }
  .appnav button {
    flex-direction: column; gap: 3px; min-height: 0; height: 54px; padding: 0; font-size: calc(12px * var(--fs)); font-weight: 600;
    background: none !important; border-radius: 12px; color: var(--muted);
  }
  .appnav button.on { color: var(--accent); }
  .appnav .ico { width: calc(23px * var(--fs)); height: calc(23px * var(--fs)); }
  .appnav .nav-home { display: inline-flex; }

  body.stage-mode .appnav { display: none; }
  body:not(.stage-mode) main { padding-bottom: calc(var(--tab-h) + 32px + env(safe-area-inset-bottom)); }
  /* A backdrop filter makes the header the containing block of anything
     fixed inside it, which would pin the tab bar to the header. */
  .topbar { flex-wrap: nowrap; min-height: 54px; padding: 0 14px; -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(9, 14, 11, .97); }
  .home-tools .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  main { padding: 16px 16px 40px; }
  .topbar { gap: 8px; padding: 0 12px; }

  body[data-view="home"] .brand .brand-name { font-size: calc(17px * var(--fs)); }
  .add-song { width: 38px; min-height: 38px; padding: 0; border-radius: 50%; margin-left: auto; }
  .add-song span { display: none; }
  .crumbs { font-size: calc(14px * var(--fs)); }

  .home { gap: 28px; }
  .hero { padding: 26px 20px 22px; border-radius: 20px; }
  .hero h1 { font-size: calc(28px * var(--fs)); }
  .hero-sub { font-size: calc(15px * var(--fs)); margin: 8px 0 18px; }
  .hero .loader { flex-wrap: wrap; }
  .hero .loader .field { flex: 1 1 100%; }
  .hero .loader button { flex: 1 1 0; min-height: 48px; padding: 0 12px; }
  .recent-list { grid-template-columns: 1fr; gap: 8px; }
  .tile { padding: 16px; }

  .page-head { margin-bottom: 8px; }
  .page-head h2 { font-size: calc(26px * var(--fs)); }
  .page-head .search { width: 100%; }
  .library-item { padding: 10px 6px 10px 8px; }
  .library-item .del { opacity: .55; }

  .panel { background: transparent; border: 0; padding: 4px 0; }
  .live, .tuner { padding: 24px 0; }

  .play { width: 46px; height: 46px; }

  .tchip, button.loop { min-height: 36px; padding: 0 11px; }

  .head-actions .ico { width: calc(20px * var(--fs)); height: calc(20px * var(--fs)); }
  .head-actions button { padding: 0; }
  .sheet-card { border-radius: 0; border: 0; }
}

@media (pointer: coarse) {
  .tchip, button.loop { min-height: 40px; }
  .transport-more .toggle { min-height: 40px; }
}

/* -- Second look. */
.transport .tchip, .transport button.loop { display: inline-flex; align-items: center; font-family: var(--sans); }
.tchip > span { font-family: var(--sans); font-size: calc(13px * var(--fs)); color: inherit; }
label.rate.tchip > span { color: var(--muted); }
.mix-help { font-size: calc(12.5px * var(--fs)); line-height: 1.5; }

/* The metronome fits a phone: number, buttons and beats all on screen. */
.metronome-page { max-width: 640px; margin: 0 auto; }
.metronome-page h2 { font-size: calc(24px * var(--fs)); font-weight: 700; text-align: left; }
.metro { width: 100%; max-width: 100%; }
.metro-bpm { gap: 12px; }
.metro-bpm button.round { width: 52px; height: 52px; min-height: 52px; border-radius: 50%; padding: 0; font-size: calc(26px * var(--fs));
                          border: 1px solid var(--line-2); flex: none; }
#bpmValue { font-size: clamp(56px, 18vw, 84px); width: 3.1ch; min-height: 0; }
.metro-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.metro-row .wide { flex: 1 1 160px; min-height: 48px; }
.metro-meter { display: grid; gap: 8px; flex: 1 1 100%; min-width: 0; }
.metro-meter label { font-size: calc(12px * var(--fs)); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#metroBeats { display: flex; width: 100%; }
#metroBeats button { flex: 1 1 0; min-width: 0; padding: 0; }
/* At the largest text on a narrow phone, the time signatures (12/8) shrink to fit their share of the row. */
#metroBeats button { font-size: min(calc(15px * var(--fs)), 4.4vw); }
.metro-row .toggle { display: flex; align-items: center; gap: 10px; font-size: calc(14px * var(--fs)); color: var(--text-2); }
.ramp .row-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#bpmSlider { width: 100%; }

@media (max-width: 600px) {
  body.stage-mode .add-song { display: none; }

  .head-actions button { width: 34px; min-width: 34px; }
  .mix-help { display: none; }
}

/* Setlist cards. */
.setlist-top { gap: 6px; }
.setlist-top b { display: inline-flex; align-items: center; gap: 6px; font-size: calc(15px * var(--fs)); }
.setlist-top b .ico { width: calc(16px * var(--fs)); height: calc(16px * var(--fs)); color: var(--muted); }
.setlist-top button { min-height: 34px; }
.setlist-top button.primary { padding: 0 14px 0 10px; }
.setlist-top button.primary .ico { width: calc(14px * var(--fs)); height: calc(14px * var(--fs)); }
.setlist li { min-height: 36px; }
.setlist li button.icon { width: 32px; min-height: 32px; }
.setlist li button.icon .ico { width: calc(16px * var(--fs)); height: calc(16px * var(--fs)); }
.setlist select { margin-top: 4px; }
.setlist-empty { margin: 0 0 6px; }

/* Chord dictionary: how notes are named, and in which key. */
.dict-view { display: grid; gap: 10px; padding: 14px 0 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.dict-view-row { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.dict-view-label { font-size: calc(13px * var(--fs)); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); min-width: 118px; }
#dictNames { flex: 0 1 auto; }
#dictNames button { padding: 0 12px; font-size: calc(13px * var(--fs)); }
#dictKey { min-width: 190px; }
.dict-head { flex-wrap: wrap; row-gap: 4px; }
.dict-degree { color: var(--accent); font-weight: 650; font-size: calc(16px * var(--fs)); }
.dict-head #dictPlay { margin-left: auto; }
.dict-notes-key { margin: -2px 0 0; }
@media (max-width: 600px) {
  .dict-view-label { min-width: 0; flex: 1 1 100%; }
  #dictNames { width: 100%; }
  #dictNames button { flex: 1 1 auto; padding: 0 8px; }
  #dictKey { flex: 1 1 auto; min-width: 0; }
}

/* Dictionary: Chords | Scales. */
.dict-mode { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); justify-self: start; }
.dict-mode button { min-height: 36px; padding: 0 22px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 600; }
.dict-mode button:hover { background: var(--panel-3); color: var(--text); }
.dict-mode button.on { background: var(--accent); color: var(--on-accent); }
.dict-pane { display: grid; gap: 12px; }
.dict-pane[hidden] { display: none; }

.scale-about { color: var(--text-2); margin: 0; line-height: 1.5; max-width: 70ch; }
.scale-chords-box { display: grid; gap: 8px; margin-top: 8px; }
.scale-chords-box[hidden] { display: none; }
.scale-chords-box .segmented button { min-height: 30px; padding: 0 12px; font-size: calc(13px * var(--fs)); }
.scale-chords { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.scale-chord {
  display: grid; justify-items: center; gap: 2px; padding: 10px 4px; min-height: 0; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text);
}
.scale-chord:hover { border-color: var(--accent-line); background: var(--panel-3); }
.scale-chord b { font-size: calc(15px * var(--fs)); font-weight: 650; }
.scale-chord i { font-style: normal; font-size: calc(12px * var(--fs)); color: var(--accent); font-weight: 600; }
.scale-chord.empty { display: grid; place-items: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 12px; }
#scaleFlip { color: var(--accent); font-size: calc(13px * var(--fs)); }
@media (max-width: 600px) {
  .dict-mode { justify-self: stretch; }
  .dict-mode button { flex: 1 1 0; }
  .scale-chords { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.scale-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#scaleType { flex: 1 1 260px; max-width: 420px; min-height: 44px; font-size: calc(15px * var(--fs)); }
@media (max-width: 600px) { #scaleType { max-width: none; } }
/* A result the other tab owns stays hidden (.dict-result sets display: grid). */
.dict-result[hidden] { display: none; }
/* Nothing in the dictionary may widen the page past the screen. */
.dict > *, .dict-pane > *, .scale-pick > * { min-width: 0; }
#scaleType { width: 100%; min-width: 0; }
#scalePiano .dlabel { display: none; }
.dict-head #scalePlay { margin-left: auto; }
@media (min-width: 601px) {
  #dictNames { flex-wrap: nowrap; }
  #dictNames button { flex: none; }
}

/* Fret diagrams in the dictionary: a grid of cards, each fitted to its card. */
.dict-strings { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dict-strings > .diagram { display: grid; justify-items: center; padding: 10px 6px 8px; border-radius: 14px;
                           background: var(--panel-2); border-color: var(--line-2); }
.dict-strings > .diagram svg { width: 100%; max-width: 170px; height: auto; }
.dict-strings .dlabel { font-family: var(--sans); font-size: calc(11.5px * var(--fs)); letter-spacing: .04em; }
.dict-strings-head { margin-top: 10px; }
.dict-strings-head select { min-width: 200px; }
#dictTabs { order: 0; }
.dict-result > * { order: 0; }
/* The scale's fingering and its neck. */
.scale-fingers { margin: -2px 0 4px; }
.scale-neck-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.scale-positions button { min-height: 32px; padding: 0 12px; font-size: calc(13px * var(--fs)); }
.scale-neck { overflow-x: auto; padding: 8px 4px 2px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-2); }
.scale-neck svg { display: block; margin: 0 auto; max-width: none; }
.scale-neck:not(.whole) svg { max-width: 100%; height: auto; }
#scaleHand button, #scaleNeckLabel button { min-height: 30px; padding: 0 12px; font-size: calc(13px * var(--fs)); }
@media (max-width: 600px) {
  .dict-strings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dict-strings-head select { min-width: 0; flex: 1 1 auto; }
}
.dict-strings > div { width: auto; }

/* Song view, Guitar chords: one shape at a time, centred in the dock. */
/* The shape scales to the dock's fixed height (the dock never changes size), whole. */
body[data-layer="gtr"] #chordDiagrams > .diagram { height: 100%; width: 100%; background: transparent; border: 0; padding: 2px 0; }
body[data-layer="gtr"] #chordDiagrams > .diagram > svg { flex: 1 1 0; min-height: 0; width: 100%; height: 100%; }
body[data-layer="gtr"] #chordDiagrams .dlabel { display: none; }
.gtr-none { padding: 18px; text-align: center; }

/* ---- Song screen, simplified (2026-11-19). */
/* Falling notes: note style and the parts in view, the rest under View. */
.fall-opts select { padding: 0 26px 0 10px; min-height: 32px; background-position: right 7px center; background-size: 14px; }
.fall-opts { gap: 10px; }
.fall-more-btn { margin-left: auto; min-height: 32px; padding: 0 12px; gap: 6px; font-size: calc(13px * var(--fs)); flex: none; }
.fall-more-btn .ico { width: calc(16px * var(--fs)); height: calc(16px * var(--fs)); }
.fall-more-btn.on { background: var(--accent-soft); color: var(--accent); }
.fall-more { z-index: 1000; }
.fall-more label { grid-template-columns: 110px 1fr; }
.fall-more label.check { display: flex; }
@media (min-width: 601px) { .fall-opts { flex-wrap: nowrap; overflow-x: visible; } }

/* Player: Play along, No vocals, Follow and Count in sit inline on a wide
   screen; on a phone they wait under More, so the player is two rows. */
.transport-extra { display: contents; }
.more-btn { display: none !important; }
.more-btn .ico { width: calc(16px * var(--fs)); height: calc(16px * var(--fs)); }
@media (max-width: 600px) {
  .more-btn { display: inline-flex !important; }
  .transport-extra { display: none; }
  .transport-extra.open {
    display: grid; position: fixed; z-index: 1000; gap: 8px; padding: 12px; width: min(260px, calc(100vw - 32px));
    background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-pop);
  }
  .transport-extra.open > * { width: 100%; justify-content: flex-start; min-height: 44px; }
  .transport-more { flex-wrap: nowrap; }
  label.rate.tchip .lbl-long { display: none; }
}
/* The occasional controls after Speed and Key on a wide screen. */
.transport-extra > * { order: 5; }
.more-btn { order: 6; }
@media (max-width: 600px) {
  /* A backdrop filter would make the player bar the containing block of the
     More panel (fixed), and clip it. */
  .player-bar { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(9, 14, 11, .985); }
  .transport-more { gap: 6px; }
  .transport-more .tchip { padding: 0 10px; }
  label.rate.tchip { padding: 0 0 0 10px; }
  label.rate.tchip select { padding: 0 22px 0 2px; background-position: right 4px center; }
  .more-btn { width: 40px; padding: 0 !important; justify-content: center; }
  .more-btn span { display: none; }
  /* Falling notes: the parts scroll, View stays put. */
  .fall-opts { overflow: visible; }
  .fall-opts > label { font-size: 0; gap: 0; }
  .fall-opts > label select { font-size: calc(13px * var(--fs)); }
  .fall-parts { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .fall-parts::-webkit-scrollbar { display: none; }
  .fall-more-btn { margin-left: 0; padding: 0 10px; }
}
#mixBtn .lbl-short { display: none; }
@media (max-width: 600px) {
  #mixBtn .lbl-long { display: none; }
  #mixBtn .lbl-short { display: inline; }
}

/* ---- The Rooted mark and wordmark (brand kit, 2026-11-19). The wordmark
   carries the R itself; where the name does not fit, the R stands alone. */
.brand-mark { width: 26px; height: 26px; display: none; flex: none; }
.brand .brand-name { display: flex; align-items: center; margin: 0; line-height: 0; }
.brand-word { height: 28px; width: auto; display: block; }

/* The R alone up to 720 px (it was 600): from 601 to 700 the page's trail ran under Log in (review AX-01). */
@media (max-width: 720px) {
  .brand .brand-name, body:not(.stage-mode) .brand .brand-name { display: none; }
  body[data-view="home"] .brand .brand-name { display: flex; }
  .brand-mark { display: block; }
  body[data-view="home"] .brand-mark { display: none; }
  .brand-word { height: 26px; }
}
/* …and on Home too on the narrowest phones, where the whole word pushed the page 27 px wider than 320 (review AX-03). */
@media (max-width: 359px) {
  body[data-view="home"] .brand .brand-name { display: none; }
  body[data-view="home"] .brand-mark { display: block; }
}

/* ---- Progression trainer and ear trainer (2026-11-19). */
.home-tools .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trainer-head h1 { font-size: calc(26px * var(--fs)); font-weight: 750; letter-spacing: -0.02em; margin: 0 0 4px; }
.trainer-head p { margin: 0 0 18px; }
.prog-pick { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 10px; }
.prog-pick > label:not(.check) { display: grid; gap: 6px; min-width: 0; flex: 1 1 200px; }
.prog-pick > label.check { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.prog-pick select { width: 100%; }
.prog-about { color: var(--text-2); margin: 4px 0 14px; }
.prog-stage { display: grid; gap: 12px; padding: 18px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line-2); }
.prog-now { display: grid; justify-items: center; gap: 2px; text-align: center; }
/* Sentence case, not capitals: in capitals a flat key read BB and EB. */
.prog-keynow { font-size: calc(15px * var(--fs)); font-weight: 600; color: var(--muted); }
.prog-chord { font-size: clamp(44px, 11vw, 72px); font-weight: 750; letter-spacing: -0.03em; line-height: 1.05; }
.prog-numeral { font-size: calc(22px * var(--fs)); font-weight: 650; color: var(--accent); min-height: 28px; }
.prog-next { font-size: calc(14px * var(--fs)); color: var(--muted); min-height: 18px; }
.prog-steps { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.prog-step { display: grid; justify-items: center; gap: 1px; min-height: 0; padding: 6px 10px; border-radius: 10px;
             border: 1px solid var(--line-2); background: transparent; color: var(--text-2); }
.prog-step b { font-size: calc(14px * var(--fs)); color: var(--text); } .prog-step i { font-style: normal; font-size: calc(11.5px * var(--fs)); color: var(--muted); }
.prog-step.now { border-color: var(--accent); background: var(--accent-soft); }
.prog-step.now i { color: var(--accent); }
.prog-piano .dlabel { display: none; }
.prog-reveal { justify-self: center; }
.prog-all { margin-top: 18px; }
.prog-all summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.prog-all-wrap { overflow-x: auto; margin-top: 10px; }
.prog-all table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.prog-all th, .prog-all td { padding: 6px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prog-all thead th { color: var(--muted); font-weight: 600; }
.prog-all tr.cur { background: var(--accent-soft); }
.prog-controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-top: 14px; }
.prog-play { min-width: 120px; min-height: 46px; }
.prog-tempo { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; }
.prog-tempo input { flex: 1; }
.prog-tempo output { font-variant-numeric: tabular-nums; min-width: 64px; color: var(--text-2); }
.prog-controls label.check { display: flex; align-items: center; gap: 8px; }
.prog-controls label.check input, .prog-pick label.check input {
  -webkit-appearance: none; appearance: none; width: 40px; height: 24px; border-radius: 999px; position: relative;
  background: var(--switch-off, var(--line-2)); margin: 0; cursor: pointer; transition: background .18s var(--ease); flex: none; }
.prog-controls label.check input::before, .prog-pick label.check input::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--switch-knob, #dfe8e3);
  transition: transform .18s var(--ease); }
.prog-controls label.check input:checked, .prog-pick label.check input:checked { background: var(--accent); }
.prog-controls label.check input:checked::before, .prog-pick label.check input:checked::before { transform: translateX(16px); background: #fff; }

.ear-card { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 22px 18px;
            border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line-2); }
.ear-prompt { font-size: calc(17px * var(--fs)); color: var(--text); margin: 0; max-width: 46ch; }
.ear-play { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ear-answers { display: grid; gap: 8px; width: 100%; max-width: 560px; }
.ear-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.ear-row.minor-row button { min-height: 40px; font-size: calc(14px * var(--fs)); color: var(--muted); }
.ear-answers button { min-height: 52px; font-size: calc(18px * var(--fs)); font-weight: 650; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); }
.ear-answers button:hover:not(:disabled) { border-color: var(--accent-line); background: var(--panel-3); }
.ear-answers button.right { background: var(--accent); border-color: var(--accent); color: var(--on-accent); opacity: 1; }
.ear-answers button.wrong { background: rgba(255,123,123,.16); border-color: var(--danger); color: var(--danger); opacity: 1; }
.ear-answers button:disabled:not(.right):not(.wrong) { opacity: .45; }
.ear-result { min-height: 24px; font-size: calc(16px * var(--fs)); }
.ear-result b.good { color: var(--accent); } .ear-result b.bad { color: var(--danger); }
.ear-score { margin-top: 18px; }
.ear-score-body { display: grid; gap: 10px; }
.ear-total { display: flex; gap: 22px; flex-wrap: wrap; color: var(--text-2); }
.ear-total b { font-size: calc(22px * var(--fs)); color: var(--text); display: block; }
.ear-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; }
.ear-bar { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; align-items: center; font-size: calc(13px * var(--fs)); }
.ear-bar b { font-weight: 650; } .ear-bar span { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ear-bar i { display: block; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.ear-bar i > u { display: block; height: 100%; background: var(--accent); }
@media (max-width: 600px) {
  .home-tools .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prog-stage { padding: 14px 10px; }
  .prog-play { flex: 1 1 100%; }
}
/* The chord-type answers are words: wider buttons, smaller type. */
.ear-row.type-row { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.ear-row.type-row button { font-size: calc(15px * var(--fs)); padding: 0 8px; }

.prog-groove { flex: 2 1 280px !important; }
#progGrooveState { margin: -2px 0 8px; min-height: 1em; }
.prog-groove-level { flex: 0 1 220px; }

/* Groove controls in the metronome and Play live. */
.groove-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.groove-pick { display: grid; gap: 6px; flex: 1 1 260px; min-width: 0; }
.groove-pick select { width: 100%; }
.groove-level, .groove-bpm { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.groove-level input { width: 140px; }
.groove-bpm input { width: 80px; }
.groove-note:empty, #metroGrooveState:empty, #liveGrooveState:empty { display: none; }
.live-groove { display: grid; gap: 10px; width: 100%; max-width: 560px; padding: 14px; border-radius: 16px;
               border: 1px solid var(--line-2); background: var(--panel-2); text-align: left; }
.groove-row .toggle { display: flex; align-items: center; gap: 10px; min-height: 40px; color: var(--text-2); }
.groove-row .toggle input {
  -webkit-appearance: none; appearance: none; width: 40px; height: 24px; border-radius: 999px; position: relative;
  background: var(--switch-off, var(--line-2)); margin: 0; cursor: pointer; transition: background .18s var(--ease); flex: none; }
.groove-row .toggle input::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--switch-knob, #dfe8e3);
  transition: transform .18s var(--ease); }
.groove-row .toggle input:checked { background: var(--accent); }
.groove-row .toggle input:checked::before { transform: translateX(16px); background: #fff; }

/* ---- Ear trainer: the notes game. */
.ear-mode { margin-bottom: 16px; }
.notes-game { display: grid; gap: 14px; }
.notes-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.notes-levels button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 1px;
  align-items: center; justify-items: start; text-align: left; min-height: 58px; padding: 8px 12px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text); }
.notes-levels button b { grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel-3); font-size: calc(14px * var(--fs)); }
.notes-levels button b .ico { width: calc(14px * var(--fs)); height: calc(14px * var(--fs)); }
.notes-levels button span { font-size: calc(13px * var(--fs)); font-weight: 600; line-height: 1.2; }
.notes-levels button i { font-style: normal; font-size: calc(12px * var(--fs)); color: #e7c35a; letter-spacing: 1px; }
.notes-levels button:disabled { opacity: .45; }
.notes-levels button:disabled i { color: var(--muted); letter-spacing: 0; }
.notes-levels button.on { border-color: var(--accent); background: var(--accent-soft); }
.notes-levels button.on b { background: var(--accent); color: var(--on-accent); }
.notes-board { display: grid; justify-items: center; gap: 12px; padding: 18px 14px; border-radius: 18px;
  background: var(--panel-2); border: 1px solid var(--line-2); }
.notes-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: calc(14px * var(--fs)); }
.notes-hearts span { font-size: calc(20px * var(--fs)); color: var(--line-2); margin: 0 1px; }
.notes-hearts span.full { color: #ff6b81; }
.notes-points b { font-size: calc(20px * var(--fs)); color: var(--text); font-variant-numeric: tabular-nums; }
.notes-streak { color: var(--accent-2); font-weight: 650; }
.notes-msg { margin: 0; min-height: 24px; font-size: calc(16px * var(--fs)); text-align: center; }
.notes-msg b.good { color: var(--accent); } .notes-msg b.bad { color: var(--danger); }
.notes-play { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.notes-start { min-width: 200px; min-height: 48px; }
/* The modulator: a ladder of rungs, do' on top; chromatic notes set in. */
.notes-ladder { display: grid; gap: 6px; width: min(320px, 100%); }
.notes-ladder .rung { display: flex; justify-content: space-between; min-height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); }
.notes-ladder .rung b { font-size: calc(20px * var(--fs)); font-weight: 700; }
.notes-ladder .rung span { font-size: calc(13px * var(--fs)); color: var(--muted); }
.notes-ladder .rung.home { border-color: var(--accent-line); }
.notes-ladder .rung.chroma { margin-left: 34%; min-height: 36px; background: transparent; }
.notes-ladder .rung.chroma b { font-size: calc(16px * var(--fs)); color: var(--text-2); }
.notes-ladder .rung:hover:not(:disabled) { background: var(--panel-3); border-color: var(--accent-line); }
.notes-ladder .rung.right { background: var(--accent); border-color: var(--accent); }
.notes-ladder .rung.right b, .notes-ladder .rung.right span { color: var(--on-accent); }
.notes-ladder .rung.wrong { background: rgba(255,123,123,.16); border-color: var(--danger); }
.notes-ladder .rung:disabled:not(.right):not(.wrong) { opacity: .5; }
.notes-end { display: grid; justify-items: center; gap: 6px; text-align: center; }
.notes-stars { font-size: calc(34px * var(--fs)); color: #e7c35a; letter-spacing: 4px; }
.notes-end h3 { font-size: calc(20px * var(--fs)); }
.notes-ladder .rung { align-items: center; }
.notes-ladder .rung.right, .notes-ladder .rung.wrong { opacity: 1; }
.notes-ladder .rung.wrong b { color: var(--danger); }
.ear-mode button { white-space: nowrap; padding: 0 18px; }

/* ---- Loop player. */
.loops-page { display: grid; gap: 12px; }
.lp-now { display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--accent-line);
          position: sticky; top: 66px; z-index: 5; }
.lp-now-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lp-now-head > div:first-child { display: grid; gap: 2px; min-width: 0; }
.lp-now-head b { font-size: calc(17px * var(--fs)); }
.lp-buttons { display: flex; gap: 8px; }
.lp-slider { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 10px; align-items: center; font-size: calc(13px * var(--fs)); color: var(--text-2); }
.lp-slider:first-of-type { grid-template-columns: 64px 1fr; }
.lp-slider output { font-variant-numeric: tabular-nums; min-width: 104px; text-align: right; }
.lp-search { max-width: 420px; }
.lp-list { display: grid; gap: 14px; }
.lp-group { display: grid; gap: 2px; }
.lp-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; border: 1px solid transparent; }
.lp-row:hover { background: var(--panel); border-color: var(--line); }
.lp-row.on { background: var(--accent-soft); border-color: var(--accent-line); }
.lp-row .lp-go { flex: none; }
.lp-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.lp-text b { font-size: calc(14.5px * var(--fs)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-text span { font-size: calc(12.5px * var(--fs)); color: var(--muted); }
.lp-inapp { font-size: calc(12px * var(--fs)); color: var(--accent); font-weight: 600; flex: none; }
.lp-adopt { flex: none; }
@media (max-width: 900px) { .lp-now { top: 60px; } }
@media (max-width: 600px) {
  .lp-slider, .lp-slider:first-of-type { grid-template-columns: 56px 1fr; }
  .lp-slider output { grid-column: 2; text-align: left; min-width: 0; }
  .lp-slider .link-btn { display: none; }
  .lp-adopt { font-size: calc(12px * var(--fs)); padding: 0 4px; }
}

/* ---- Your own progressions. */
.prog-pick-main { flex: 2 1 320px !important; }
.prog-pick-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.prog-pick-row select { flex: 1 1 auto; min-width: 0; }
.prog-pick-row button { flex: none; }
.prog-builder { display: grid; gap: 12px; padding: 16px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--accent-line); margin: 4px 0 12px; }
.prog-build-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px 14px; }
.prog-build-row label, .prog-build-chords { display: grid; gap: 6px; min-width: 0; }
.prog-build-chords input { font-size: calc(16px * var(--fs)); min-height: 46px; }
.prog-build-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.prog-build-chip { display: grid; justify-items: center; gap: 2px; padding: 8px 8px 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); min-width: 84px; }
.prog-build-chip b { font-size: calc(16px * var(--fs)); } .prog-build-chip i { font-style: normal; font-size: calc(12px * var(--fs)); color: var(--accent); font-weight: 600; }
.prog-build-chip select { min-height: 30px; font-size: calc(12px * var(--fs)); padding: 0 24px 0 8px; background-position: right 6px center; }
.prog-build-actions { display: flex; gap: 8px; }
@media (max-width: 600px) {
  .prog-build-row { grid-template-columns: 1fr 1fr; }
  .prog-build-row label:first-child { grid-column: 1 / -1; }
  .prog-pick-row button span { display: none; }
}
#lpState:empty { display: none; }

/* ---- Ear trainer chords: how the moments are chosen. */
.ear-how { margin: -4px 0 4px; text-align: center; }

/* ---- The naming bar: how notes and chord numbers are named, on each page that names them. */
.name-bar { display: grid; gap: 8px; padding: 10px 0 4px; margin: 2px 0 10px; border-top: 1px solid var(--line); }
.name-bar-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.name-bar .segmented button { min-height: 34px; font-size: calc(13px * var(--fs)); }
.name-bar .open-settings { margin-left: auto; }
.tuner .name-bar, .live .name-bar { width: 100%; }
#settingsSheet .away-note { display: none; margin: 0 0 4px; }
#settingsSheet.away .away-note { display: block; }
#settingsSheet.away .song-only { display: none; }
@media (max-width: 600px) {
  .name-bar .dict-view-label { min-width: 0; flex: 1 1 100%; }
  .name-bar .open-settings { margin-left: 0; }
}
.tuner .name-bar { justify-items: center; }
.tuner .name-bar-row { justify-content: center; }
.tuner .name-bar .dict-view-label { min-width: 0; flex: 1 1 100%; text-align: center; }
/* The naming bar keeps its five names on one row, as the dictionary's does. */
.name-bar .segmented.wrap { flex-wrap: nowrap; }
.name-bar .segmented.wrap button { flex: 1 1 auto; }
.name-bar .segmented button { padding: 0 12px; }
@media (max-width: 600px) {
  .name-bar .segmented { width: 100%; }
  .name-bar .segmented button { padding: 0 6px; font-size: calc(12.5px * var(--fs)); }
}

/* ---- Nav: Home, Library and the Tools menu. */
.appnav button.here { color: var(--text); background: var(--panel-3); }
.appnav button.here .ico { color: var(--accent); }
.tools-menu { display: grid; gap: 2px; padding: 6px; z-index: 1000; }
.tools-menu button { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 10px;
  align-items: center; justify-items: start; text-align: left; padding: 8px 10px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text); min-height: 0; }
.tools-menu button .ico { grid-row: 1 / span 2; width: calc(20px * var(--fs)); height: calc(20px * var(--fs)); color: var(--text-2); }
.tools-menu button b { font-size: calc(14px * var(--fs)); font-weight: 600; }
.tools-menu button span { font-size: calc(12px * var(--fs)); color: var(--muted); }
.tools-menu button:hover { background: var(--panel-3); }
.tools-menu button.here { background: var(--accent-soft); }
.tools-menu button.here .ico { color: var(--accent); }
@media (max-width: 900px) {
  .appnav { grid-template-columns: repeat(4, 1fr) !important; }
  .appnav button.here { color: var(--accent); background: none !important; }
}
/* ---- Under a keyboard: which colour is which hand (the keys carry the names). */
.hand-keys { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font-size: calc(12px * var(--fs)); color: var(--muted); }
.hand-key { display: inline-flex; align-items: center; gap: 6px; }
.hand-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tools-menu button > i { grid-column: 1; grid-row: 1 / span 2; display: grid; place-items: center; }
.tools-menu button > b, .tools-menu button > span { grid-column: 2; }
.hand-keys { font-family: inherit; }

/* ---- Ten tools: two columns where there is room, so the menu stays short. */
@media (min-width: 700px) {
  .tools-menu { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

/* ---- Runs and fills: the run's notes in order, the one sounding lit. */
.run-notes { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; list-style: none; margin: 0; padding: 0; }
.run-note { min-width: 40px; min-height: 0; padding: 6px 6px; border-radius: 9px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text-2); font-size: calc(13px * var(--fs)); line-height: 1.25; font-variant-numeric: tabular-nums; }
.run-note.quick { min-width: 34px; padding: 5px 4px; font-size: calc(12px * var(--fs)); }
.run-note.now { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
#runChord { cursor: pointer; }

/* ---- Hum to chords. */
.hum-tempo { display: flex; align-items: center; gap: 10px; }
.hum-tempo input { flex: 1; }
.hum-tempo output { font-variant-numeric: tabular-nums; min-width: 64px; color: var(--text-2); }
.hum-record { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 6px 0 4px; }
.hum-record label.check { display: flex; align-items: center; gap: 8px; }
.hum-beat { font-size: calc(15px * var(--fs)); font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }
.hum-result { display: grid; gap: 12px; margin-top: 10px; padding: 18px; border-radius: 18px;
  background: var(--panel-2); border: 1px solid var(--line-2); }
.hum-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.hum-head h3 { font-size: calc(20px * var(--fs)); font-weight: 700; }
.hum-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.hum-actions label.check { display: flex; align-items: center; gap: 8px; }
.prog-step small { font-size: calc(11.5px * var(--fs)); color: var(--muted); }

/* ---- Your key. */
.voice-range { display: grid; gap: 12px; padding: 18px; border-radius: 18px; background: var(--panel-2);
  border: 1px solid var(--line-2); margin-bottom: 18px; }
.voice-ends { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.voice-end { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 12px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); }
.voice-note { display: flex; align-items: center; gap: 12px; }
.voice-note b { font-size: calc(34px * var(--fs)); font-weight: 750; letter-spacing: -0.02em; min-width: 3.2ch; font-variant-numeric: tabular-nums; }
.voice-note button { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; font-size: calc(18px * var(--fs)); }
.voice-live { display: flex; align-items: baseline; justify-content: center; gap: 12px; }
.voice-live b { font-size: calc(28px * var(--fs)); color: var(--accent); font-variant-numeric: tabular-nums; }
.voice-type { display: grid; gap: 6px; max-width: min(100%, 360px); }
.voice-type select { min-width: 0; max-width: 100%; }
.voice-songs { display: grid; gap: 8px; }
.voice-song { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) auto; gap: 8px 14px; align-items: center;
  padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.voice-song-title { display: grid; gap: 2px; min-width: 0; }
.voice-song-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-strain { display: block; font-size: calc(12px * var(--fs)); color: var(--warn); }
@media (max-width: 640px) {
  .voice-song { grid-template-columns: 1fr; }
  .voice-song-open button { width: 100%; }
}

/* ---- Less empty space (2026-11-19) ------------------------------------- */

/* The logo: big enough to read as the app's name. */
.brand-word { height: 36px; }
.brand-mark { width: 34px; height: 34px; }
@media (max-width: 600px) {
  .brand-word { height: 32px; }
}

/* The chart fits as many bars as the screen holds ("Fit", the default):
   about six to a line on a laptop, three on a phone, the way a printed
   chart reads. Each bar is only as tall as its chords. */
:root.bars-fit .chord-grid { grid-template-columns: repeat(auto-fill, minmax(var(--bar-min, calc(176px * var(--fs))), 1fr)); }
.chord-grid { gap: 6px; }
.bar-cell { padding: 5px 7px 6px; gap: 2px; border-radius: 9px; }
.bar-head { font-size: calc(10px * var(--fs)); line-height: 1.25; }
.beat { padding: 3px 1px; }
@media (max-width: 760px) {
  :root.bars-fit .chord-grid { --bar-min: calc(104px * var(--fs)); grid-template-columns: repeat(auto-fill, minmax(var(--bar-min), 1fr)); }
  :root.bars-fit .chord-grid { --chord-size: calc(14px * var(--fs)); gap: 4px; }
  :root.bars-fit .bar-cell { padding: 3px 3px 4px; border-left-width: 2px; border-radius: 7px; }
  :root.bars-fit .bar-head { font-size: calc(8.5px * var(--fs)); }
  :root.bars-fit .bar-head .prog { display: none; }
  :root.bars-fit .beat { padding: 2px 0; letter-spacing: -0.02em; overflow-wrap: anywhere; }
  :root.bars-fit .beat .deg { font-size: calc(9px * var(--fs)); }
}
/* A chord takes the room it needs and a held beat shrinks to its dot, so a
   slash chord fits a narrow bar without breaking; a crowded bar (three
   chords, or long slash chords) sets its names a little smaller. */
:root.bars-fit .beats { display: flex; gap: 2px; }
:root.bars-fit .beat { flex: 0 1 auto; min-width: 0; overflow-wrap: normal; white-space: nowrap; }
:root.bars-fit .beat.change, :root.bars-fit .beat.nc { flex: 1 1 auto; }
:root.bars-fit .beat.held { flex: 0 0 10px; }
:root.bars-fit .bar-cell.tight .beat { font-size: calc(var(--chord-size) * .88); letter-spacing: -0.02em; }
:root.bars-fit .bar-cell.tighter .beat { font-size: calc(var(--chord-size) * .72); letter-spacing: -0.02em; }
:root.bars-fit .bar-cell.tighter .beat .deg { font-size: .7em; }
@media (max-width: 760px) {
  :root.bars-fit .bar-cell.tight .beat { font-size: calc(var(--chord-size) * .84); letter-spacing: -0.02em; }
  :root.bars-fit .bar-cell.tighter .beat { font-size: calc(var(--chord-size) * .66); letter-spacing: -0.03em; }
  :root.bars-fit .bar-cell.tight .beat .deg, :root.bars-fit .bar-cell.tighter .beat .deg { font-size: .62em; }
}

/* A note the page has not filled in yet takes no room. */
.panel > p:empty { display: none; }

/* The keyboard panel: on a wide screen the chord's name, notes and shapes
   sit beside the keyboard rather than above it. */
@media (min-width: 900px) {
  .dock { display: grid; grid-template-columns: minmax(calc(250px * var(--fs)), calc(320px * var(--fs))) minmax(0, 1fr); column-gap: 20px; align-items: center; }
  .dock-head { grid-column: 1; grid-row: 1; flex-direction: column; align-items: flex-start; flex-wrap: nowrap; gap: 8px; margin-bottom: 0; position: static; }
  .dock-head .voicing-tabs { flex-wrap: wrap; margin-left: 0; justify-content: flex-start; }
  #chordDiagrams { grid-column: 2; grid-row: 1; min-width: 0; }
  #playStrip { grid-column: 1 / -1; grid-row: 2; }
  body.dock-min .dock { display: block; }
  body.dock-min .dock-head { flex-direction: row; align-items: center; }
}
/* Falling notes bring their own keyboard: the panel keeps only the chord. */
body[data-fall="1"] #chordDiagrams, body[data-fall="1"] #voicingTabs, body[data-fall="1"] #dockToggle { display: none; }
body[data-fall="1"] .dock { display: block; }
body[data-fall="1"] .dock-head { flex-direction: row; align-items: center; margin-bottom: 0; }

/* A tool's settings, folded into one line. */
.tool-settings { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); margin: 4px 0 14px; }
.tool-settings > summary {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 44px;
  cursor: pointer; list-style: none; color: var(--text);
}
.tool-settings > summary::-webkit-details-marker { display: none; }
.tool-settings > summary .i { color: var(--muted); flex: none; }
.tool-settings .ts-sum { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(14px * var(--fs)); }
.tool-settings .ts-edit { flex: none; color: var(--accent); font-size: calc(13.5px * var(--fs)); font-weight: 600; }
.tool-settings[open] .ts-edit { visibility: hidden; }
.tool-settings[open] > summary { border-bottom: 1px solid var(--line); }
.tool-settings > :not(summary) { margin: 12px 14px; max-width: calc(100% - 28px); box-sizing: border-box; }

/* Before a tune is sung, the page says where its chords will appear. */
.tool-empty {
  display: grid; justify-items: center; gap: 10px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-2, var(--line)); border-radius: 18px; padding: 48px 20px; margin-top: 16px;
}
.tool-empty .i { width: 30px; height: 30px; opacity: .6; }
.tool-empty p { max-width: 36ch; margin: 0; }
.tool-empty[hidden] { display: none; }

/* The tuner uses the screen it has: a bigger note and a wider meter. */
@media (min-width: 700px) {
  .tuner-note { font-size: clamp(120px, 16vw, 180px); }
  .tuner-meter { width: min(680px, 100%); height: 64px; }
  .tuner-needle { height: 64px; width: 5px; }
  .tuner-scale { inset: 24px 0 auto 0; }
  .tuner-scale i { height: 16px; }
  .tuner-scale i.mid { height: 30px; margin-top: -7px; }
  .tuner-cents { font-size: calc(18px * var(--fs)); }
}

/* ---- Song view: learning and fixing apart, tabs, progress (2026-11-19) ---- */

/* Fix chart: undo, redo and Analyse again belong to fixing, not to playing. */
body:not(.fixing) #undoBtn, body:not(.fixing) #redoBtn, body:not(.fixing) #rerunBtn { display: none; }
#fixBtn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.fix-hint { margin: 6px 16px 0; padding: 8px 12px; border-radius: 10px; font-size: calc(13.5px * var(--fs));
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); }
.fix-hint[hidden] { display: none; }
body.fixing .bar-cell { cursor: cell; }

/* A key change, on the bar where it happens. */
.bar-head .key-mark { font-family: var(--sans, inherit); font-size: calc(10px * var(--fs)); font-weight: 700; padding: 0 6px; border-radius: 999px;
  background: var(--accent-2, #c7f08a); color: #10200f; white-space: nowrap; }

/* The song's other pages as tabs beside the chart. */
.pane-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 6px 16px 2px; flex: none; }
.pane-tabs::-webkit-scrollbar { display: none; }
.pane-tabs button { flex: none; padding: 6px 12px; min-height: 34px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: calc(13.5px * var(--fs)); font-weight: 600; cursor: pointer; }
.pane-tabs button.on { background: var(--panel-2); color: var(--text); border-color: var(--line-2, var(--line)); }
body[data-pane]:not([data-pane="chart"]) #chordGrid,
body[data-pane]:not([data-pane="chart"]) #stage > .drawer:not(.pane-on) { display: none; }
#stage > .drawer.pane-on > summary { display: none; }
body[data-pane="chart"] #stage > .drawer { display: none; }
body[data-pane="chart"] #stage > #errorPanel:not(.hidden) { display: block; }
body[data-fall="1"] .pane-tabs { display: none; }

/* The progress page. */
.progress-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.progress-actions [hidden] { display: none; }

/* The guitar capo. */
.capo-pick { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: calc(13px * var(--fs)); margin-right: 6px; }
.capo-pick select { padding: 4px 6px; }

/* The Library's setlists on a phone: the name on its own line, the buttons under it. */
@media (max-width: 600px) {
  .setlist-top { flex-wrap: wrap; gap: 6px; }
  .setlist-top b { flex: 1 1 100%; }
}

/* Fingers need 44 px. */
@media (pointer: coarse) {
  .stage-head .head-actions button, .crumbs a, .crumbs button, .transport select, .tchip,
  .dock-tabs button, .layer-tabs button, .pane-tabs button, .bar-tools button { min-height: 44px; }
  .stage-head .head-actions button.icon { min-width: 44px; }
}

/* Less motion for those who ask for it: no smooth scrolling after the playhead. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---- Find your voice part (2026-11-19) ---- */
.range-test { display: grid; gap: 12px; padding: 18px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 16px; }
.range-test h3 { margin: 0 0 4px; font-size: calc(18px * var(--fs)); }
#rtBody { display: grid; gap: 12px; justify-items: start; }
.rt-say { font-size: calc(22px * var(--fs)); margin: 0; }
.rt-say b { font-size: calc(34px * var(--fs)); color: var(--accent); }
.rt-step b { color: var(--text); }
.rt-live { display: flex; align-items: baseline; gap: 12px; }
.rt-live b { font-size: calc(40px * var(--fs)); font-variant-numeric: tabular-nums; min-width: 3ch; }
.rt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-result { display: grid; gap: 12px; width: 100%; }
.rt-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.rt-facts > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.rt-facts b { font-size: calc(20px * var(--fs)); }
.rt-chart { width: 100%; height: auto; max-width: 720px; }
.rt-chart .rt-grid { stroke: var(--line); stroke-width: 1; }
.rt-chart .rt-tick { fill: var(--muted); font-size: calc(11px * var(--fs)); text-anchor: middle; font-family: var(--mono, monospace); }
.rt-chart .rt-name { fill: var(--muted); font-size: calc(12.5px * var(--fs)); text-anchor: end; }
.rt-chart .rt-name.on { fill: var(--text); font-weight: 700; }
.rt-chart .rt-type { fill: var(--line); }
.rt-chart .rt-type.on { fill: var(--accent); }
.rt-chart .rt-you { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--accent); stroke-dasharray: 4 3; }
.rt-chart .rt-comfy { fill: color-mix(in srgb, var(--accent) 18%, transparent); stroke: none; }

/* ---- The phone paused the sound (2026-11-19) ---- */
.audio-paused { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-weight: 650; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.audio-paused[hidden] { display: none; }

/* ---- UI pass 2 (2026-11-19) ------------------------------------------- */

/* Crowded bars: chords wrap onto a second line inside the bar rather than
   shrinking or running into each other; numbers never under 10 px. */
:root.bars-fit .beats { flex-wrap: wrap; row-gap: 3px; }
:root.bars-fit .beat { flex: 0 0 auto; }
:root.bars-fit .beat.change, :root.bars-fit .beat.nc { flex: 1 0 auto; }
:root.bars-fit .bar-cell.tight .beat, :root.bars-fit .bar-cell.tighter .beat { letter-spacing: 0; }
:root.bars-fit .bar-cell.tighter .beat { font-size: calc(var(--chord-size) * .9); }
:root.bars-fit .bar-cell.tight .beat { font-size: var(--chord-size); }
:root.bars-fit .beat .deg, :root.bars-fit .bar-cell.tight .beat .deg, :root.bars-fit .bar-cell.tighter .beat .deg { font-size: max(10px, .62em); }
@media (max-width: 760px) {
  :root.bars-fit .bar-cell.tight .beat, :root.bars-fit .bar-cell.tighter .beat { font-size: var(--chord-size); }
  :root.bars-fit .bar-head { font-size: calc(10px * var(--fs)); }
  :root.bars-fit .beat .deg { font-size: calc(10px * var(--fs)); }
}

/* Bar tools: rows (the bar, this bar, the whole song), a floating bar while
   learning, a sheet while fixing on a phone. */
.bar-tools .bt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.bar-tools .bt-label { font-size: calc(12px * var(--fs)); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; min-width: 72px; }
.bar-tools .bt-whole { border-top: 1px solid var(--line); padding-top: 6px; }
.bar-tools.floating { position: fixed; left: 50%; transform: translateX(-50%); z-index: 25; width: auto; max-width: calc(100vw - 24px);
  flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2, var(--line));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.bar-tools.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: column; align-items: stretch;
  gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); max-height: 55vh; overflow-y: auto;
  background: var(--panel); border-top: 1px solid var(--line-2, var(--line)); box-shadow: 0 -10px 30px rgba(0, 0, 0, .5); }
.bar-tools.sheet button, .bar-tools.sheet select { min-height: 44px; font-size: calc(15px * var(--fs)); }
body.fixing:has(.bar-tools.sheet) .chord-grid { padding-bottom: 50vh; }
.bar-tools select, .capo-pick select { padding-right: 28px; min-width: 64px; }

/* One on/off switch everywhere a tool has a yes/no (Hum's checkboxes were native). */
.panel label.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.panel label.check input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 40px; height: 24px; border-radius: 999px; position: relative;
  background: var(--switch-off, var(--line-2)); margin: 0; cursor: pointer; transition: background .18s var(--ease); flex: none; }
.panel label.check input[type=checkbox]::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--switch-knob, #dfe8e3);
  transition: transform .18s var(--ease); }
.panel label.check input[type=checkbox]:checked { background: var(--accent); }
.panel label.check input[type=checkbox]:checked::before { transform: translateX(16px); }

/* The tuner's A4 box shows all three digits. */
#tunerA4 { width: 72px; }

/* Fingers need 44 px, in every tool. */
@media (pointer: coarse) {
  .segmented button, button.primary, button.secondary, .ghost, .dict-chips button, .tuner-strings button,
  .rt-actions button, .lp-row button, .tool-settings > summary, .pane-tabs button { min-height: 44px; }
  .ghost.icon, .icon-btn { min-width: 44px; }
  #addSongBtn { min-height: 44px; min-width: 44px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* The range chart's key. */
.rt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; }
.rt-key { display: inline-block; width: 18px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: -4px; }
.rt-key-you { border: 1px dashed var(--accent); }
.rt-key-comfy { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.rt-key-type { background: var(--line); }
.rt-chart .rt-name, .rt-chart .rt-tick { font-size: calc(12px * var(--fs)); }
/* During the test only the prompt and the singer's note matter. */
.range-test:not([data-phase="intro"]):not([data-phase="done"]) .rt-head p { display: none; }
.voice-manual > summary { cursor: pointer; padding: 10px 0; min-height: 44px; color: var(--accent); font-weight: 600; }

/* Parts mixer: a save icon, and room for "Aux keys". */
.stem-save { display: inline-flex; align-items: center; justify-content: center; }
.stem-save .i { transform: rotate(180deg); }
.stem label { white-space: nowrap; }
@media (pointer: coarse) { .stem .mute, .stem-save { min-height: 44px; min-width: 44px; } }

/* Progress: a tick on each part done. */
.stage-list li.done::before { content: "✓"; color: var(--accent); margin-right: 6px; font-weight: 700; }

/* Falling notes have their own keyboard: the panel's part tabs would do nothing there. */
body[data-fall="1"] #layerTabs { display: none; }
@media (max-width: 600px) {
  .fall-parts { flex-wrap: wrap; overflow: visible; }
}

/* Library on a phone: the setlist's song picker fits, the delete buttons line up. */
.setlist select { min-width: 0; max-width: 100%; }
@media (pointer: coarse) { .library-item .del { flex: none; width: 44px; height: 44px; } }

/* The phone transport keeps its More button on screen. */
@media (max-width: 420px) {
  .transport .tchip select { max-width: 74px; }
  .transport .tchip { padding-left: 8px; padding-right: 8px; }
}

/* Dock header on a phone: one line, the chord name shortened rather than a blank row. */
@media (max-width: 600px) {
  .dock-head h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
}

/* Section chips are buttons now: they look as they did. */
.legend button.sect-chip { background: transparent; font: inherit; font-size: calc(13px * var(--fs)); padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); min-height: 30px; }

/* Play along on a phone: the keys to tap stay in view (no shape chips or note row above them). */
@media (max-width: 600px) {
  body.practicing #voicingTabs, body.practicing #chordNotes { display: none; }
  body.practicing .play-strip { flex-wrap: nowrap; overflow-x: auto; }
}

/* The floating bar tools and the fix sheet sit at the bottom only (the
   toolbar's own rule pins it to the top as well, which stretched them). */
.bar-tools.floating, .bar-tools.sheet { top: auto; height: auto; }
.bar-tools.floating { left: 12px; right: 12px; transform: none; width: auto; justify-content: center; max-width: none; }
@media (min-width: 760px) {
  .bar-tools.floating { left: 50%; right: auto; transform: translateX(-50%); max-width: 720px; }
}

/* The floating bar tools: one row of buttons, not a stack. */
.bar-tools.floating { flex-direction: row; flex-wrap: wrap; align-items: center; }
.bar-tools.floating > * { width: auto; flex: 0 1 auto; }
.bar-tools.floating > b { flex: none; }
.bar-tools.floating .bt-close { margin-left: auto; }

/* Chords and scales on a phone: each row of chips slides sideways, so the chord is on the first screen. */
@media (max-width: 600px) {
  .dict .dict-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .dict .dict-chips::-webkit-scrollbar { display: none; }
  .dict .dict-chips > * { flex: none; }
}

/* The voicing chips beside the keyboard wrap rather than run out of the panel. */
.dock-head .voicing-tabs .vshape, .dock-head .voicing-tabs > div { flex-wrap: wrap; }
.bar-tools.floating { padding-right: 56px; }
.bar-tools.floating .bt-close { position: absolute; top: 6px; right: 6px; margin: 0; }

/* ---- Ear trainer: notes to practise as chips; find the key (2026-11-19) ---- */
.notes-pick { display: grid; gap: 6px; margin-bottom: 12px; }
.notes-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.notes-levels button { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line-2, var(--line)); background: transparent; color: var(--text-2, var(--text)); font-weight: 600; cursor: pointer; }
.notes-levels button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
@media (max-width: 600px) {
  .notes-levels { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .notes-levels::-webkit-scrollbar { display: none; }
  .notes-levels button { flex: none; }
}
.notes-status { display: flex; align-items: center; gap: 14px; min-height: 24px; }
.key-game { display: grid; gap: 12px; }
.key-notes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 6px 0; }
.key-notes button { min-height: 48px; border-radius: 10px; border: 1px solid var(--line-2, var(--line)); background: #eef2ef; color: #111;
  font-weight: 700; font-size: calc(16px * var(--fs)); cursor: pointer; }
.key-notes button.black { background: #1c2420; color: var(--text); }
.key-notes button.on { outline: 3px solid var(--accent); outline-offset: 1px; }
.key-choose { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (min-width: 700px) { .key-notes { grid-template-columns: repeat(12, 1fr); } }

/* Loop player: search and Add a loop side by side. */
.lp-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lp-tools .lp-search { flex: 1 1 220px; margin: 0; }
.lp-add { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; cursor: pointer; }
.lp-row.fresh { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- One keyboard per hand on a phone (2026-11-19) ---- */
.hands-split { display: grid; gap: 8px; width: 100%; }
.hands-split .piano-diagram svg { width: 100%; height: auto; max-height: none; }
.hands-split .piano-diagram .dlabel { margin-top: 2px; }

/* ---- Loop player: styles as sections, chips to jump, a compact card (2026-11-19) ---- */
.lp-styles { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-styles button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line-2, var(--line)); background: transparent; color: var(--text-2, var(--text)); font-weight: 600; cursor: pointer; }
.lp-styles button span { color: var(--muted); font-weight: 500; font-size: calc(12px * var(--fs)); }
.lp-styles button.on { border-color: var(--accent); color: var(--accent); }
.lp-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 2px 4px; border-bottom: 1px solid var(--line); scroll-margin-top: 150px; }
.lp-group > summary::-webkit-details-marker { display: none; }
.lp-group > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.lp-group[open] > summary::before { transform: rotate(90deg); }
.lp-group > summary h3 { margin: 0; flex: 1; }
@media (max-width: 600px) {
  .lp-styles { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .lp-styles::-webkit-scrollbar { display: none; }
  .lp-styles button { flex: none; min-height: 40px; }
  /* The playing card: one line of name and buttons, two thin sliders. */
  .lp-now { padding: 10px 12px; gap: 6px; border-radius: 14px; }
  .lp-now-head { flex-wrap: nowrap; }
  .lp-now-head b { font-size: calc(15px * var(--fs)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #lpNowMeta { display: none; }
  .lp-buttons button { min-height: 40px; padding: 0 12px; }
  .lp-slider { grid-template-columns: 52px 1fr auto auto; gap: 8px; font-size: calc(12px * var(--fs)); }
  .lp-slider:first-of-type { grid-template-columns: 52px 1fr; }
  .lp-slider output { min-width: 0; }
  #lpState:empty { display: none; }
}
.hands-split .piano-diagram { padding-bottom: 4px; min-height: 0; }
@media (max-width: 600px) { .lp-adopt { padding: 0 10px; font-size: calc(13px * var(--fs)); } }
.lp-list { gap: 4px; }
.lp-group > summary.section-head { margin: 0; padding: 6px 4px; }
.lp-group[open] > summary { margin-bottom: 4px; }
.lp-rows { display: grid; gap: 2px; }
.lp-row .lp-text { flex: 1 1 auto; min-width: 0; }

/* ---- Wide screens (2026-11-19). On a laptop the pages sat in a 1,070-pixel
 * column with the controls stacked down its middle, leaving most of the
 * screen empty. The page now runs wider, and pages with a "thing to look at"
 * and settings put them side by side. The column wrappers vanish on smaller
 * screens (display: contents), so the phone layout is untouched. */
.tool-cols, .tool-main, .tool-side { display: contents; }
.metro.tool-cols { display: grid; }
.tool-main > *, .tool-side > * { min-width: 0; }
.tool-main > p:empty, .tool-side > p:empty { display: none; }

/* The keyboards fill the width they are given instead of staying at their
 * drawn size, so the note names grow with them. */
@media (min-width: 641px) {
  .dict-piano svg, .prog-piano svg { width: 100%; height: auto; max-height: 250px; }
}

@media (min-width: 1100px) {
  main { max-width: 1400px; padding-left: 32px; padding-right: 32px; }
  .tool-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px 32px;
               align-items: start; width: 100%; }
  .tool-main, .tool-side { display: grid; gap: 14px; align-content: start; }

  /* Tuner and Play live: the reading on the left, what to set on the right. */
  .tuner, .live { padding: 28px; }
  .tuner .tool-cols, .live .tool-cols { align-items: center; }
  .tuner .tool-main, .live .tool-main { justify-items: center; text-align: center; }
  .tuner .tool-side, .live .tool-side { gap: 16px; }
  .live .tool-side { justify-items: stretch; text-align: left; }
  .live .tool-side .live-groove { max-width: none; }
  .tuner-meter { width: min(520px, 100%); }
  .live-keys { width: 100%; }

  /* Metronome: tempo and Start on the left, the settings on the right. */
  .metronome-page { max-width: 1080px; }
  .metro.tool-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 36px; }
  .metro .tool-main { gap: 20px; align-content: center; }
  .metro .tool-side { gap: 18px; padding: 20px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line); }

  /* Chords and scales: the picker stays in view on the left while the
   * answer fills the rest. */
  .dict-cols { grid-template-columns: minmax(calc(330px * var(--fs)), calc(400px * var(--fs))) minmax(0, 1fr); gap: 20px 28px; }
  .dict-pick { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto;
               padding: 2px 4px 12px 2px; }
  .dict-answer { gap: 12px; }

  /* Your key: the test and the range by hand side by side. */
  .voice-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 20px; margin-bottom: 18px; }
  .voice-cols .range-test { margin-bottom: 0; }
  .voice-songs { grid-template-columns: repeat(2, minmax(0, 1fr)); }


  /* Library: two songs a row. */
  .library-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }

  /* Loop player: closed styles three a row; an open one takes the full width
   * with its loops two a row. */
  .lp-list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; align-items: start; }
  .lp-list > p { grid-column: 1 / -1; }
  .lp-group[open] { grid-column: 1 / -1; }
  .lp-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
}

/* ---- Home, roomier (2026-11-19). The user found the home page squished and
 * pointed to a product page as the model: a large, light headline set free of
 * any box, big section titles, and big cards, each showing a picture of what
 * it opens, laid out unevenly (a wide card beside a narrow one). The cards
 * draw their picture from what the tool shows (a chord, a keyboard, beat
 * lights) instead of a photograph. A phone keeps compact tiles. */
.home-tools .tile { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden;
                    text-align: left; border-radius: 18px; }
.home-tools .tile span { color: inherit; font-size: inherit; line-height: inherit; }
.tile-body { display: grid; gap: 6px; padding: 16px; flex: 1 1 auto; align-content: start; }
.tile-name { display: flex; align-items: center; gap: 10px; }
.home-tools .tile-ic { margin: 0; flex: none; display: grid; place-items: center;
                       width: calc(34px * var(--fs)); height: calc(34px * var(--fs)); border-radius: 10px; }
.home-tools .tile-name b { font-size: calc(16px * var(--fs)); font-weight: 600; color: var(--text); }
.home-tools .tile .tile-desc { font-size: calc(13.5px * var(--fs)); line-height: 1.45; color: var(--muted); }
.tile-art, .home-tools .tile .tile-go { display: none; }

@media (min-width: 700px) {
  .home { gap: 48px; }
  /* The opening: no box, a big light headline, the link field centred. */
  .hero { border: 0; border-radius: 0; text-align: center; padding: 40px 0 8px;
          background: radial-gradient(55% 90% at 50% 0%, rgba(52, 199, 123, .13), transparent 70%); }
  .hero h1 { font-size: calc(58px * var(--fs)); font-weight: 300; letter-spacing: -0.04em; line-height: 1.02; }
  .hero-sub { font-size: calc(19px * var(--fs)); line-height: 1.5; max-width: 46ch; margin: 18px auto 30px; color: var(--text-2); }
  .hero .loader { max-width: 860px; margin: 0 auto; }
  .hero .loader input { min-height: 56px; font-size: calc(16px * var(--fs)); border-radius: 14px; }
  .hero .loader button { min-height: 56px; padding: 0 24px; border-radius: 14px; font-size: calc(16px * var(--fs)); }
  .home-defaults { text-align: center; }
  .hero h1, .hero-sub { text-wrap: balance; }

  /* Section titles you can read from across the room. */
  .home .section-head { margin-bottom: 18px; }
  .home .section-head h3 { font-size: calc(30px * var(--fs)); font-weight: 300; letter-spacing: -0.025em;
                           text-transform: none; color: var(--text); }

  /* Song cards: bigger, and a long title takes two lines instead of being cut. */
  .recent-list { gap: 12px; }
  .recent-item { min-height: 86px; padding: 14px 18px 14px 14px; border-radius: 18px; gap: 16px; }
  .recent-item .thumb { width: 56px; height: 56px; border-radius: 14px; font-size: calc(17px * var(--fs)); }
  .recent-item .lib-text > b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                               font-size: calc(16.5px * var(--fs)); line-height: 1.25; }

  /* Tool cards with their picture. */
  .home-tools .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .home-tools .tile.wide { grid-column: span 2; }
  .tile-body { padding: 20px 22px 18px; gap: 8px; }
  .home-tools .tile-name b { font-size: calc(21px * var(--fs)); font-weight: 500; letter-spacing: -0.01em; }
  .home-tools .tile .tile-desc { font-size: calc(15px * var(--fs)); line-height: 1.5; }
  .home-tools .tile .tile-go { display: block; justify-self: end; margin-top: 6px; color: var(--accent);
                               font-size: calc(15px * var(--fs)); font-weight: 500; }
  .home-tools .tile:hover .tile-go { text-decoration: underline; }
  .home-tools .tile:hover .tile-art { filter: brightness(1.12); }

  .tile-art { display: flex; align-items: center; justify-content: center; gap: 12px; height: calc(150px * var(--fs));
              padding: 18px; border-bottom: 1px solid var(--line); overflow: hidden; transition: filter .2s;
              background: radial-gradient(70% 100% at 50% 0%, rgba(52, 199, 123, .16), transparent 75%), var(--panel-2); }
  .home-tools .tile-art b { font-size: calc(64px * var(--fs)); font-weight: 700; letter-spacing: -0.04em; color: var(--text); line-height: 1; }
  .home-tools .tile-art small { font-size: calc(14px * var(--fs)); color: var(--muted); }
  .home-tools .tile-art s { text-decoration: none; display: grid; place-items: center; min-width: 54px; padding: 10px 14px;
                            border-radius: 12px; border: 1px solid var(--line-2); font-weight: 650;
                            font-size: calc(20px * var(--fs)); color: var(--text-2); background: rgba(9, 14, 11, .5); }
  .home-tools .tile-art s.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

  .art-live em { font-style: normal; font-size: calc(30px * var(--fs)); font-weight: 650; color: var(--accent); }
  .art-live { align-items: center; }
  .art-live em, .art-live small { align-self: center; margin-top: 18px; }
  .art-dict svg { height: 100%; width: auto; max-width: 100%; }
  .art-ear { flex-direction: column; gap: 5px; }
  .home-tools .art-ear s { width: 150px; padding: 5px 14px; place-items: center start; font-size: calc(17px * var(--fs)); }
  .art-runs { align-items: flex-start; }
  .art-runs s { margin-top: calc(var(--y) * 16px); }
  .art-hum { flex-direction: column; gap: 10px; }
  .art-hum svg { width: 100%; height: 50px; }
  .art-hum > span { display: flex; gap: 8px; }
  .art-voice { flex-direction: column; gap: 10px; }
  .home-tools .art-voice b { font-size: calc(40px * var(--fs)); font-weight: 600; }
  .art-range { display: flex; align-items: center; gap: 10px; width: 80%; }
  .art-range i { flex: 1; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
  .art-wave { display: flex; align-items: center; gap: 3px; height: 100%; width: 100%; }
  .art-wave i { flex: 1; border-radius: 2px; background: var(--accent); opacity: .8; }
  .art-tuner { flex-direction: column; gap: 12px; }
  .art-meter { position: relative; display: flex; justify-content: space-between; align-items: center; width: 70%; height: 26px; }
  .art-meter i { width: 2px; height: 12px; background: var(--line-2); }
  .art-meter i.mid { height: 22px; background: var(--muted); }
  .art-meter u { position: absolute; left: calc(50% + 10px); top: -4px; width: 4px; height: 34px; border-radius: 2px; background: var(--accent); }
  .art-metronome { align-items: center; gap: 10px; }
  .art-metronome small { margin-top: 22px; }
  .art-beats { display: flex; gap: 12px; margin-left: 28px; }
  .art-beats i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); }
  .art-beats i.on { border-color: var(--accent); background: var(--accent); }
}

@media (min-width: 1100px) {
  .hero { padding: 64px 0 12px; }
  .hero h1 { font-size: calc(76px * var(--fs)); }
  .recent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Rows: a wide card and a narrow one, three, three, then a narrow and a wide. */
  .home-tools .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .tile-art { height: calc(170px * var(--fs)); }
}
@media (min-width: 1400px) { .recent-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- Library and tool pages, roomier (2026-11-19), as Home: big light
 * titles, no outer box around a tool page (its practice area and settings are
 * the cards), and the Library's songs as cards. A phone keeps its layout. */
@media (min-width: 700px) {
  #dict, #prog, #ear, #loops, #runs, #hum, #voice, #tuner, #live, #metronome {
    background: transparent; border: 0; border-radius: 0; padding: 8px 0 0; }
  .trainer-head { margin-bottom: 6px; }
  .trainer-head h1, .metronome-page .trainer-head h1, .page-head h2 {
    font-size: calc(46px * var(--fs)); font-weight: 300; letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 10px; }
  .trainer-head p { font-size: calc(18px * var(--fs)); line-height: 1.5; max-width: 62ch; color: var(--text-2); margin: 0 0 26px; }
  .tuner .trainer-head p, .live .trainer-head p { margin-left: auto; margin-right: auto; }
  .dict > .trainer-head { margin-bottom: 0; }

  /* Library. */
  .page-head { margin: 8px 0 26px; align-items: flex-end; }
  .page-head .search { width: min(420px, 100%); }
  .page-head .search input { min-height: 48px; border-radius: 14px; }
  .library-page > .section-head { margin: 10px 0 18px; }
  .voice-page > .section-head { margin: 26px 0 16px; }
  .library-page > .section-head h3, .voice-page > .section-head h3 { font-size: calc(30px * var(--fs)); font-weight: 300; letter-spacing: -0.025em;
                                     text-transform: none; color: var(--text); }
  .library-list { gap: 12px; margin-bottom: 24px; }
  .library-item { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; min-height: 86px;
                  padding: 14px 14px 14px 14px; gap: 16px; }
  .library-item:hover { background: var(--panel-2); border-color: var(--line-2); }
  .library-item .thumb { width: 56px; height: 56px; border-radius: 14px; font-size: calc(17px * var(--fs)); }
  .library-item .lib-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                             font-size: calc(16.5px * var(--fs)); line-height: 1.25; }
  .setlist { border-radius: 18px; padding: 16px 18px; }

  /* Loop player: style names read as titles, each loop a card. */
  .lp-group > summary.section-head { padding: 10px 4px; }
  .lp-group > summary h3 { font-size: calc(21px * var(--fs)); font-weight: 400; letter-spacing: -0.01em;
                           text-transform: none; color: var(--text); }
  .lp-rows { gap: 8px; padding: 6px 0 14px; }
  .lp-row { background: var(--panel); border-color: var(--line); border-radius: 14px; padding: 10px 14px 10px 8px; }
  .lp-row:hover { background: var(--panel-2); border-color: var(--line-2); }
}

@media (min-width: 1100px) {
  /* With the page box gone, the reading on Tuner, Play live and the
   * Metronome, and the picker in Chords and scales, are cards of their own. */
  #tuner, #live { padding: 8px 0 0; }
  .tuner .tool-main, .live .tool-main, .metro .tool-main, .dict-pick {
    background: radial-gradient(70% 90% at 50% 0%, rgba(52, 199, 123, .10), transparent 75%), var(--panel);
    border: 1px solid var(--line); border-radius: 22px; padding: 30px; }
  .dict-pick { padding: 20px; top: 76px; }
  .tuner .tool-main, .live .tool-main { min-height: calc(320px * var(--fs)); align-content: center; }
  .metronome-page { max-width: none; }
}

/* ---- The song page in the roomier style (2026-11-19). It fills the screen
 * and only the chart scrolls, so the room comes from type and shape, not
 * padding: a large light title, larger figures, rounder bars, and the
 * keyboard panel as a card like the tool pages' cards. The larger sizes wait
 * for a large screen: on a 1280 x 800 laptop they left the chart under two
 * rows and the transport on two lines. */
@media (min-width: 1100px) {
  .stage-head { padding: 12px 24px; gap: 24px; }
  .title-block { min-width: 160px; }
  .title-block h2 { font-size: calc(24px * var(--fs)); font-weight: 300; letter-spacing: -0.03em; line-height: 1.15;
                    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .facts { gap: 22px; }
  .facts dd { font-size: calc(17px * var(--fs)); font-weight: 450; letter-spacing: -0.01em; }

  .pane-tabs { padding: 10px 24px 2px; gap: 8px; }
  .pane-tabs button { min-height: 36px; padding: 6px 16px; font-size: calc(14.5px * var(--fs)); }

  .stage { padding: 12px 24px 20px; }
  .chord-grid { gap: 10px; }
  .bar-cell { border-radius: 14px; }
  .bar-cell .beat { border-radius: 10px; }

  #keyboardDock { margin: 4px 24px 8px; border: 1px solid var(--line); border-radius: 22px; padding: 10px 20px;
    background: radial-gradient(60% 120% at 20% 0%, rgba(52, 199, 123, .10), transparent 70%), var(--panel); }
  #keyboardDock .dock-head { background: transparent; }
  #keyboardDock #chordDiagrams > .diagram { background: transparent; border: 0; }
  #currentChordName { font-size: calc(32px * var(--fs)); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
  .player-bar { padding: 6px 24px 10px; }
}
@media (min-width: 1400px) and (min-height: 860px) {
  .stage-head { padding: 14px 24px; gap: 28px; }
  .title-block h2 { font-size: calc(28px * var(--fs)); }
  .facts { gap: 26px; }
  .facts dd { font-size: calc(19px * var(--fs)); }
  .pane-tabs { padding: 12px 24px 4px; }
  .pane-tabs button { min-height: 40px; padding: 8px 18px; font-size: calc(15px * var(--fs)); }
  .bar-cell { padding: 7px 9px 8px; }
  #keyboardDock { margin: 6px 24px 10px; padding: 14px 22px; }
  #currentChordName { font-size: calc(40px * var(--fs)); }
  .player-bar { padding: 8px 24px 12px; }
  .play { width: 50px; height: 50px; }
  .tchip, button.loop { min-height: 38px; padding: 0 14px; font-size: calc(14px * var(--fs)); }
}
@media (min-width: 1100px) {
  /* The chord's notes beside its name, not under it: a line less in the card. */
  body:not(.dock-min):not([data-fall="1"]) #keyboardDock .dock-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: 14px; row-gap: 8px; }
  body:not(.dock-min):not([data-fall="1"]) #keyboardDock .dock-head > :not(#currentChordName):not(#chordNotes) { grid-column: 1 / -1; }
}
@media (min-width: 1100px) and (max-width: 1399px), (min-width: 1100px) and (max-height: 859px) {
  /* The transport on one line on a 13-inch laptop. */
  .transport { gap: 6px; }
  .tchip, button.loop { padding: 0 10px; }
}
@media (min-width: 1100px) { #keyboardDock #dockToggle { justify-self: start; } }

/* ---- Falling notes in the roomier style (2026-11-19): bigger part chips
 * and menus, the notes in a rounded card, and the chord strip under them
 * slimmer, since the falling notes bring their own keyboard. Laptops only. */
@media (min-width: 1100px) {
  .fall-view { gap: 12px; }
  .fall-opts { gap: 12px; }
  .fall-opts > label { font-size: calc(14px * var(--fs)); color: var(--text-2); }
  .fall-opts select { min-height: 38px; font-size: calc(14px * var(--fs)); border-radius: 999px; padding: 0 30px 0 14px; }
  .fall-parts { gap: 8px; }
  .fall-chip { min-height: 38px; padding: 0 16px; gap: 8px; font-size: calc(14px * var(--fs)); border-radius: 999px; }
  .fall-chip i { width: 10px; height: 10px; }
  .fall-more-btn { min-height: 38px; padding: 0 16px; font-size: calc(14px * var(--fs)); border-radius: 999px; }
  #fallCanvas { border-radius: 20px; border: 1px solid var(--line); }
  body[data-fall="1"] #keyboardDock { padding: 8px 22px; }
  body[data-fall="1"] #keyboardDock .dock-head { gap: 16px; align-items: baseline; }
  body[data-fall="1"] #currentChordName { font-size: calc(32px * var(--fs)); }
  body[data-fall="1"] #chordNotes { font-size: calc(15px * var(--fs)); }
}

/* ---- Type (2026-11-19). Inter throughout, with the optical sizes it
 * carries for large titles. Where chord numerals are written (I, II, IV,
 * vii), a serif on capital I and a tail on l keep them apart from l and 1;
 * elsewhere (song titles) the plain letters stay. Figures of even width
 * only where numbers change in place (times, tempos, bar numbers). */
body { font-optical-sizing: auto; text-rendering: optimizeLegibility; }
.deg, .dict-degree, .live-degree, .prog-numeral, .prog-step i, .ear-prompt, #trackMeta, .facts dd {
  font-feature-settings: "cv05" 1, "cv08" 1; }
.beat, .prog-chord, .live-chord, #currentChordName, .dict-head h2 { font-feature-settings: "case" 1; }
.bar-head, .time, .facts dd, #chordNotes, .bpm-readout, .lp-row .lp-text span { font-variant-numeric: tabular-nums; }

/* ---- How to use (2026-11-19): the guide. A list of topics beside it (along
 * the top on a phone) with a search, and each entry a card. */
.home-help { margin: 14px 0 0; font-size: calc(14px * var(--fs)); color: var(--muted); }
.home-help .link-btn { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; min-height: 30px;
                       color: var(--accent); font-weight: 600; font-size: inherit; }
.home-help .link-btn .ico { width: calc(15px * var(--fs)); height: calc(15px * var(--fs)); }
@media (min-width: 700px) { .home-help { text-align: center; } }

.help-page { display: grid; gap: 10px; }
.help-layout { display: grid; gap: 16px; }
.help-toc { display: grid; gap: 10px; align-content: start; min-width: 0; }
.help-search input { min-height: 46px; border-radius: 14px; }
.help-toc-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.help-toc-list::-webkit-scrollbar { display: none; }
.help-toc-list button { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
                        background: transparent; color: var(--text-2); font-size: calc(14px * var(--fs)); font-weight: 500; }
.help-toc-list button:hover { background: var(--panel-2); color: var(--text); }
.help-toc-list button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.help-toc-list button[hidden] { display: none; }
.help-main { min-width: 0; }
.help-body { display: grid; gap: 36px; max-width: 820px; }
.help-sec { display: grid; gap: 12px; scroll-margin-top: 84px; }
.help-sec[hidden], .help-item[hidden], .help-lead[hidden] { display: none; }
.help-sec h2 { font-size: calc(30px * var(--fs)); font-weight: 300; letter-spacing: -0.025em; margin: 0; }
.help-lead { margin: 0; font-size: calc(17px * var(--fs)); line-height: 1.55; color: var(--text-2); max-width: 66ch; }
.help-item { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; }
.help-item h3 { margin: 0 0 8px; font-size: calc(18px * var(--fs)); font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.help-item p, .help-item li { font-size: calc(15.5px * var(--fs)); line-height: 1.6; color: var(--text-2); }
.help-item p { margin: 0 0 8px; }
.help-item p:last-child { margin-bottom: 0; }
.help-item ul, .help-item ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help-item li::marker { color: var(--accent); }
.help-item b { color: var(--text); font-weight: 600; }
.help-item i { color: var(--text); }
.help-body kbd, .help-item kbd { display: inline-block; min-width: 1.6em; padding: 1px 7px; border-radius: 6px; text-align: center;
  border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--panel-2); color: var(--text);
  font: 600 calc(13px * var(--fs)) var(--sans); }
.help-none { padding: 20px 0; }

@media (max-width: 699px) {
  .help-toc { position: sticky; top: 56px; z-index: 5; background: var(--bg); padding: 6px 0 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .help-item { padding: 16px; }
  .help-sec { scroll-margin-top: 170px; }
}
@media (min-width: 700px) {
  .help-layout { grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); gap: 36px; align-items: start; }
  .help-toc { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
  .help-toc-list { flex-direction: column; overflow: visible; gap: 2px; }
  .help-toc-list button { justify-content: flex-start; text-align: left; border-color: transparent; border-radius: 10px;
                          min-height: 38px; padding: 0 12px; font-size: calc(15px * var(--fs)); }
  .help-toc-list button.on { border-color: transparent; }
}
@media (min-width: 700px) { .help-toc { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; } .help-body { max-width: 880px; } }
.help-item ul + p, .help-item ol + p { margin-top: 10px; }

/* ---- Key change (2026-11-20). The two keys and the common moves on one
 * line, the chosen way on the stage, the ways there as cards. Chords in the
 * old key are drawn quieter than the new key's; a chord in both, outlined. */
.keychange-page { display: grid; gap: 14px; }
.kc-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; }
.kc-key { display: grid; gap: 6px; flex: 0 1 220px; min-width: 150px; }
.kc-key select { width: 100%; min-height: 44px; font-size: calc(15px * var(--fs)); }
.kc-arrow { font-size: calc(22px * var(--fs)); color: var(--muted); padding-bottom: 8px; }
.kc-moves { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 320px; }
.kc-moves button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
                   background: transparent; color: var(--text-2); font-size: calc(14px * var(--fs)); }
.kc-moves button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.kc-setlist { margin: 0; }
.kc-setlist-body { display: grid; gap: 10px; }
.kc-setlist-body select { max-width: 360px; }
.kc-pairs { display: grid; gap: 6px; }
.kc-pair { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-start; text-align: left;
           padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.kc-pair:hover:not(:disabled) { border-color: var(--accent-line); }
.kc-pair i { font-style: normal; color: var(--muted); margin-left: 4px; }
.kc-pair-arrow { color: var(--accent); }
.prog-step.kc-old { opacity: .72; }
.prog-step.kc-both { border-style: dashed; }
.kc-ways-head { margin-top: 6px; }
.kc-routes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.kc-route { display: grid; gap: 8px; align-content: start; justify-items: start; text-align: left; padding: 16px 18px;
            border-radius: 18px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.kc-route:hover { border-color: var(--line-2); background: var(--panel-2); }
.kc-route.on { border-color: var(--accent); background: radial-gradient(80% 120% at 0% 0%, rgba(52, 199, 123, .12), transparent 70%), var(--panel); }
.kc-route > b { font-size: calc(17px * var(--fs)); font-weight: 600; }
.kc-route-about { font-size: calc(14px * var(--fs)); line-height: 1.45; color: var(--muted); }
.kc-route-chords { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.kc-chip { display: inline-grid; justify-items: center; padding: 5px 9px; border-radius: 10px; border: 1px solid var(--line-2); }
.kc-chip b { font-size: calc(14px * var(--fs)); } .kc-chip i { font-style: normal; font-size: calc(11.5px * var(--fs)); color: var(--muted); font-feature-settings: "cv05" 1, "cv08" 1; }
.kc-chip.old { opacity: .7; }
.kc-chip.both { border-style: dashed; border-color: var(--accent-line); }
@media (min-width: 700px) { #keychange { background: transparent; border: 0; border-radius: 0; padding: 8px 0 0; } }
.kc-setlist .kc-sum { flex: 1 1 auto; min-width: 0; font-size: calc(14px * var(--fs)); }
.kc-setlist[open] .ts-edit { visibility: hidden; }
@media (max-width: 699px) { .kc-arrow { display: none; } .kc-key { flex: 1 1 140px; } }

/* ---- Gospel it up (2026-11-20). The chart typed in a wide box, the moves
 * as switches, the two charts side by side as bars, a change tinted green. */
.gospel-page { display: grid; gap: 14px; }
@media (min-width: 700px) { #gospel { background: transparent; border: 0; border-radius: 0; padding: 8px 0 0; } }
.gu-input { display: grid; gap: 10px; }
.gu-chart { display: grid; gap: 6px; }
.gu-chart textarea { width: 100%; min-height: 76px; resize: vertical; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 500 calc(17px * var(--fs)) / 1.5 var(--sans);
  letter-spacing: .01em; }
.gu-chart textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gu-opts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.gu-opts label { display: grid; gap: 6px; }
.gu-opts select { min-height: 44px; min-width: 130px; }
.gu-opts .primary { min-height: 44px; padding: 0 20px; gap: 8px; }
.gu-examples, .gu-techs { display: flex; flex-wrap: wrap; gap: 6px; }
.gu-examples button, .gu-techs button { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text-2); font-size: calc(14px * var(--fs)); }
.gu-techs button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
/* A move that is off looks like any chip that is off (it was struck through). */
.gu-song { margin: 0; }
.gu-song-body { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.gu-song-body label { display: grid; gap: 6px; flex: 1 1 220px; }
.gu-side { justify-self: center; }
.gu-charts { display: grid; gap: 16px; }
@media (min-width: 1100px) { .gu-charts { grid-template-columns: 1fr 1fr; } }
.gu-bars { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(calc(170px * var(--fs)), 1fr)); }
.gu-bar { display: grid; gap: 4px; padding: 6px 8px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.gu-bar-n { font-size: calc(10.5px * var(--fs)); color: var(--muted); font-variant-numeric: tabular-nums; }
.gu-bar-chords { display: flex; gap: 4px; min-width: 0; }
.gu-c { flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: 0; padding: 6px 4px; border-radius: 9px;
        border: 1px solid transparent; background: var(--panel-2); color: var(--text); min-height: 0; }
.gu-c b { font-size: calc(14.5px * var(--fs)); font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-feature-settings: "case" 1; }
.gu-c i { font-style: normal; font-size: calc(11.5px * var(--fs)); color: var(--muted); font-feature-settings: "cv05" 1, "cv08" 1; }
.gu-c.changed { background: var(--accent-soft); border-color: var(--accent-line); }
.gu-c.changed i { color: var(--accent); }
.gu-c.now { outline: 2px solid var(--accent); outline-offset: 1px; }
.gu-save { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gu-save input { flex: 0 1 280px; min-height: 42px; }
.gu-song .kc-sum { flex: 1 1 auto; min-width: 0; font-size: calc(14px * var(--fs)); }
.gu-song[open] .ts-edit { visibility: hidden; }

/* ---- Sight-singing (2026-11-20). The line as syllables drawn at their
 * pitch, the one to sing outlined, sung ones green; a needle for in tune. */
.solfa-page { display: grid; gap: 14px; }
@media (min-width: 700px) { #solfa { background: transparent; border: 0; border-radius: 0; padding: 8px 0 0; } }
.ss-opts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.ss-opts > label:not(.check) { display: grid; gap: 6px; flex: 0 1 240px; }
.ss-opts select { min-height: 44px; width: 100%; }
.ss-stage { justify-items: center; gap: 16px; }
.ss-line { display: flex; gap: clamp(6px, 1.6vw, 18px); align-items: flex-start; justify-content: center; height: calc(150px * var(--fs));
           padding: 6px 0 0; width: 100%; }
.ss-note { display: grid; place-items: center; min-width: calc(56px * var(--fs)); height: calc(52px * var(--fs)); padding: 0 10px;
           margin-top: calc(var(--y) * 0.9px * var(--fs)); border-radius: 14px; border: 1.5px solid var(--line-2);
           background: var(--panel); cursor: pointer; transition: background .15s, border-color .15s; }
.ss-note b { font-size: calc(24px * var(--fs)); font-weight: 600; letter-spacing: -0.01em; }
.ss-note.now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ss-note.sung { background: var(--accent); border-color: var(--accent); }
.ss-note.sung b { color: var(--on-accent, #05140c); }
.ss-note.skipped { opacity: .45; border-style: dashed; }
.ss-live { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 26px; }
.ss-heard { display: grid; justify-items: center; gap: 2px; min-width: 110px; }
.ss-heard b { font-size: calc(30px * var(--fs)); font-weight: 600; }
.ss-meter { display: flex; align-items: center; gap: 10px; font-size: calc(12px * var(--fs)); color: var(--muted); }
.ss-track { position: relative; width: min(320px, 60vw); height: 28px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.ss-mid { position: absolute; left: 50%; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--muted); }
.ss-needle { position: absolute; top: 3px; bottom: 3px; width: 6px; margin-left: -3px; left: 50%; border-radius: 3px; background: var(--warn);
             opacity: 0; transition: left .08s linear, background .15s; }
.ss-needle.in { background: var(--accent); }

/* Score it (app.js, si*): sol-fa dictation in four steps. */
.si-steps { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.si-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); font-size: calc(14px * var(--fs)); font-weight: 600; min-width: 0; }
.si-steps li span { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--panel-3, var(--line)); color: var(--text-2); font-size: calc(13px * var(--fs)); }
.si-steps li.now { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
.si-steps li.now span { background: var(--accent); color: var(--on-accent); }
.si-steps li.done { color: var(--text-2); }
.si-steps li.done span { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 640px) { .si-steps li { padding: 7px 6px; gap: 5px; font-size: calc(12px * var(--fs)); } .si-steps li span { width: 20px; height: 20px; } }
.si-stage { display: grid; gap: 16px; }
.si-prompt { margin: 0; text-align: center; font-size: calc(17px * var(--fs)); line-height: 1.5; color: var(--text); }
.si-cands { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.si-cands button { display: grid; justify-items: center; gap: 4px; min-width: 104px; min-height: 76px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line-2, var(--line)); background: var(--panel); color: var(--text); font-weight: 650; }
.si-cands button .ico { width: 22px; height: 22px; color: var(--accent); }
.si-cands button.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.si-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.si-actions button .ico { width: 18px; height: 18px; }
.si-bpb { justify-self: center; }
.si-bpb button { min-width: 140px; min-height: 44px; }
.si-write { display: grid; gap: 12px; }
.si-write textarea { width: 100%; font-size: calc(18px * var(--fs)); font-family: inherit; }
.si-bars { display: flex; flex-wrap: wrap; gap: 8px; }
.si-bar { flex: 1 1 0; min-width: min(100%, 220px); display: grid; gap: 6px; align-content: start; padding: 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); }
.si-bar.extra { border-style: dashed; }
.si-bar-head { display: flex; align-items: center; gap: 8px; font-size: calc(13px * var(--fs)); }
.si-bar-head b { color: var(--text-2); }
.si-hear { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2, var(--line));
  background: var(--panel-2, var(--panel)); color: var(--accent); }
.si-hear .ico { width: 14px; height: 14px; }
.si-tally { margin-left: auto; color: var(--muted); }
.si-tally.full { color: var(--accent); font-weight: 650; }
.si-tally.over { color: var(--danger); font-weight: 650; }
.si-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.si-row-name { width: 3.8em; font-size: calc(11.5px * var(--fs)); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.si-row-name:empty { display: none; }
.si-row:has(.si-row-name:empty) { grid-template-columns: 1fr; }
.si-notes { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 3px; min-height: 40px; align-items: stretch;
  border-radius: 8px; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--cols) * 12 - 1px), var(--line) 0 calc(100% / var(--cols) * 12)); }
.si-chip { display: grid; place-items: center; min-width: 0; padding: 6px 2px; border-radius: 8px; border: 1px solid var(--line-2, var(--line));
  background: var(--panel-2, var(--panel)); color: var(--text); font-weight: 650; font-size: calc(15px * var(--fs)); overflow: hidden; white-space: nowrap; }
.si-chip.hold { background: transparent; border-style: dashed; color: var(--muted); }
.si-chip.rest { background: transparent; border-style: dotted; color: var(--muted); font-weight: 500; font-size: calc(12px * var(--fs)); }
.si-chip.bad { border-color: var(--danger); color: var(--danger); }
.si-chip.ok { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.si-chip.octave, .si-chip.length { background: rgba(232, 168, 92, .18); border-color: var(--warn); }
.si-chip.wrong { background: rgba(255, 123, 123, .16); border-color: var(--danger); color: var(--danger); }
.si-chip.missed { border-style: dashed; border-color: var(--danger); }
.si-chip.extra { border-style: dashed; border-color: var(--warn); color: var(--warn); }
.si-score { font-size: calc(19px * var(--fs)); }
.si-score.all b { color: var(--accent); }
.si-notes-list { margin: 0 auto; padding-left: 20px; color: var(--text-2); font-size: calc(14px * var(--fs)); }
.si-key { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0; }
.si-k { padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-2, var(--line)); }
.si-k.ok { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.si-k.octave, .si-k.length { background: rgba(232, 168, 92, .18); border-color: var(--warn); }
.si-k.wrong { background: rgba(255, 123, 123, .16); border-color: var(--danger); color: var(--danger); }
.si-k.missed { border-style: dashed; border-color: var(--danger); }
.si-k.extra { border-style: dashed; border-color: var(--warn); }
.si-trad-toggle { justify-self: center; }
.si-trad { display: grid; gap: 8px; }
.si-trad p { margin: 0; display: grid; gap: 2px; }
.si-trad code { font-size: calc(16px * var(--fs)); white-space: pre-wrap; word-break: break-word; }
.si-howto { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 0 14px; }
.si-howto summary { cursor: pointer; padding: 12px 0; font-weight: 650; }
.si-howto-body { padding-bottom: 12px; color: var(--text-2); }
.si-howto-body h4 { margin: 14px 0 4px; color: var(--text); }
.si-howto-body pre { margin: 6px 0; padding: 10px 12px; border-radius: 8px; background: var(--panel-2, var(--panel)); overflow-x: auto;
  font-size: calc(15px * var(--fs)); color: var(--text); }
.si-howto-body ul { margin: 6px 0; padding-left: 20px; }

/* Stay on key (app.js, ok*): the drift from the key, over time. */
.ok-stage { display: grid; gap: 14px; justify-items: center; }
.ok-guide { margin: 0; text-align: center; color: var(--text); font-size: calc(16px * var(--fs)); max-width: 52ch; }
.ok-line { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; max-width: 900px; }
.ok-syl { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-2, var(--line)); background: var(--panel); font-weight: 650;
  font-size: calc(17px * var(--fs)); }
.ok-syl.big { font-size: calc(30px * var(--fs)); padding: 10px 22px; }
.ok-word { display: grid; justify-items: center; gap: 1px; min-width: 2.6em; }
.ok-word b { font-size: calc(16px * var(--fs)); color: var(--accent); }
.ok-word span { font-size: calc(13px * var(--fs)); color: var(--text-2); }
.ok-any { color: var(--muted); }
.ok-live { display: flex; flex-wrap: wrap; gap: 12px 30px; align-items: center; justify-content: center; }
.ok-drift { display: grid; justify-items: center; gap: 2px; min-width: 150px; padding: 8px 16px; border-radius: 14px; border: 1px solid var(--line); }
.ok-drift b { font-size: calc(24px * var(--fs)); }
.ok-drift span { font-size: calc(13px * var(--fs)); color: var(--muted); }
.ok-drift.in { border-color: var(--accent); } .ok-drift.in b { color: var(--accent); }
.ok-drift.near { border-color: var(--warn); } .ok-drift.near b { color: var(--warn); }
.ok-drift.out { border-color: var(--danger); } .ok-drift.out b { color: var(--danger); }
.ok-graph-box { position: relative; width: 100%; max-width: 900px; }
.ok-graph { display: block; width: 100%; height: clamp(140px, 26vw, 220px); border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.ok-band { fill: var(--accent-soft); }
.ok-mid { stroke: var(--accent-line); stroke-width: 1.5; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.ok-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ok-dots circle { fill: var(--muted); opacity: .45; }
.ok-lbl { position: absolute; left: 10px; color: var(--muted); font-size: calc(12px * var(--fs)); pointer-events: none; }
.ok-lbl.top { top: 6px; } .ok-lbl.bottom { bottom: 6px; } .ok-lbl.mid { left: auto; right: 10px; top: calc(50% - 1.6em); }
.ok-result { display: grid; gap: 6px; justify-items: center; text-align: center; }
.ok-result p { margin: 0; }
.ok-sum { font-size: calc(17px * var(--fs)); }
.ok-sum b.good { color: var(--accent); } .ok-sum b.bad { color: var(--danger); }

/* Find their key (app.js, fk*): a one-octave keyboard to find the home note on, and Listen. */
.fk-stage { display: grid; gap: 14px; justify-items: center; }
.fk-clock { display: flex; gap: 16px; align-items: baseline; }
.fk-time { font-size: calc(28px * var(--fs)); font-weight: 700; font-variant-numeric: tabular-nums; }
.fk-streak { color: var(--brass-text, var(--accent)); font-weight: 650; }
.fk-keys { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); width: min(100%, 560px); height: clamp(150px, 34vw, 210px); }
.fk-key { position: relative; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 10px; border-radius: 0 0 10px 10px;
  font-weight: 650; font-size: calc(15px * var(--fs)); }
.fk-key.w { height: 100%; background: #fbfbf8; color: #1d2a22; border: 1px solid #b9c4bd; margin-right: -1px; }
.fk-key.b { position: absolute; top: 0; height: 60%; width: calc(100% / 7 * .62); left: calc(100% / 7 * var(--at) - 100% / 7 * .31);
  background: #1b221e; color: #e8efe9; border: 1px solid #000; z-index: 1; font-size: calc(12px * var(--fs)); padding-bottom: 8px; }
.fk-key.w:hover { background: #eef3ef; } .fk-key.b:hover { background: #2a332e; }
.fk-key.on.w { background: var(--accent-soft); box-shadow: inset 0 -6px 0 var(--accent); }
.fk-key.on.b { background: var(--accent); color: var(--on-accent); }
.fk-listen { display: grid; gap: 8px; justify-items: center; text-align: center; margin-top: 18px; padding: 18px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--panel); }
.fk-listen h3 { margin: 0; }
.fk-listen p { margin: 0; max-width: 56ch; }
.fk-guess { display: grid; gap: 8px; justify-items: center; font-size: calc(17px * var(--fs)); }
.fk-guess b { font-size: calc(26px * var(--fs)); color: var(--accent); }

/* One site (account.js, courseHome): on the website's front page, what's free and what a free account adds. */
.account-signup { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; margin-left: 6px; border-radius: 10px;
  background: var(--brass, #c4932b); color: #231a05; font-weight: 650; text-decoration: none; white-space: nowrap; }
.account-signup:hover { background: var(--brass-hover, #d8aa45); }
.course-join { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 0 0 22px; padding: 16px 20px; border-radius: 16px;
  background: var(--brass-soft, var(--accent-soft)); border: 1px solid var(--brass, var(--accent-line)); }
.course-join p { margin: 0; flex: 1 1 320px; color: var(--text); }
.course-join-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.course-join a, .course-extra-go a.primary { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 18px; border-radius: 10px;
  text-decoration: none; font-weight: 650; }
.course-join a.primary, .course-extra-go a.primary { background: var(--brass, #c4932b); color: #231a05; }
.course-join a.secondary { border: 1px solid var(--line-2, var(--line)); color: var(--text); background: var(--panel); }
.course-extra { margin-top: 28px; }
.course-extra-head { margin: 0 0 12px; }
.course-extra-head h2 { margin: 0; }
.course-extra-head p { margin: 4px 0 0; color: var(--muted); }
.course-extra .tile { text-decoration: none; color: inherit; }
.course-extra.locked .tile-ic { opacity: .75; }
.tile-lock { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 8px; border-radius: 999px; font-size: calc(12px * var(--fs));
  font-weight: 650; background: var(--brass-soft, var(--accent-soft)); color: var(--brass-text, var(--text)); border: 1px solid var(--brass, var(--accent-line)); width: max-content; }
.tile-lock::before { content: ""; width: 9px; height: 10px; border: 1.6px solid currentColor; border-radius: 2px; box-shadow: inset 0 0 0 0 transparent;
  background: linear-gradient(currentColor, currentColor) center 55% / 2px 3px no-repeat; }
.course-extra-go { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 14px 0 0; color: var(--muted); }
.course-extra-go .course-login { color: var(--accent); font-weight: 650; }
.home-tools .course-extra .tile-lock { color: var(--brass-text, var(--text)); font-size: calc(12px * var(--fs)); }

/* The Mac app's "a newer OneRoot is out" bar (app.js, updateCheck). */
.update-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 18px;
  background: var(--brass-soft, var(--accent-soft)); border-bottom: 1px solid var(--brass, var(--accent-line)); color: var(--text); }
.update-bar[hidden] { display: none; }
.update-bar p { margin: 0; flex: 1 1 280px; }
.update-bar a.primary { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 16px; border-radius: 10px; text-decoration: none;
  background: var(--brass, #c4932b); color: #231a05; font-weight: 650; }
.update-bar a.primary:hover { background: var(--brass-hover, #d8aa45); }

/* Young musicians (app.js, yg*): bright, big and simple. */
.young-page { display: grid; gap: 16px; }
.yg-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px; padding: 24px; border-radius: 22px;
  background: linear-gradient(135deg, var(--brass-soft, #f6ecd2), var(--accent-soft)); border: 2px solid var(--brass, #c4932b); }
.yg-hero-line { margin: 0; font-size: calc(19px * var(--fs)); font-weight: 650; color: var(--text); }
.yg-stats { display: flex; gap: 12px; }
.yg-stats span { display: grid; justify-items: center; padding: 10px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: calc(13px * var(--fs)); }
.yg-stats small { font-size: inherit; }
.yg-stats b { font-size: calc(30px * var(--fs)); color: var(--brass-text, var(--accent)); line-height: 1.1; }
.yg-today-box { padding: 18px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 10px; }
.yg-today-box h3, .yg-h { margin: 4px 0 0; font-size: calc(22px * var(--fs)); }
.yg-today { display: grid; gap: 10px; }
.yg-ch { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line-2, var(--line));
  background: var(--panel-2, var(--panel)); color: var(--text); }
.yg-ch:hover { border-color: var(--brass, var(--accent)); }
.yg-star { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--brass-soft, var(--accent-soft));
  color: var(--brass-text, var(--accent)); font-size: calc(22px * var(--fs)); font-weight: 800; }
.yg-ch.got { border-color: var(--brass, var(--accent)); }
.yg-ch.got .yg-star { background: var(--brass, #c4932b); color: #fff; }
.yg-ch-body { display: grid; gap: 2px; flex: 1; }
.yg-ch-body b { font-size: calc(18px * var(--fs)); }
.yg-ch-body span { color: var(--muted); font-size: calc(14px * var(--fs)); }
.yg-go { flex: none; padding: 8px 16px; border-radius: 999px; background: var(--brass, #c4932b); color: #231a05; font-weight: 700; }
.yg-ch.got .yg-go { background: var(--accent-soft); color: var(--accent); }
.yg-msg { margin: 0; font-weight: 600; color: var(--text-2); }
.yg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.yg-lessons-line { margin: -4px 0 12px; }
.yg-lesson small { color: var(--muted); }
.yg-lesson .yg-ic { font-weight: 800; }
.yg-tile { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 18px; border-radius: 20px; border: 2px solid var(--line); background: var(--panel); color: var(--text); }
.yg-tile:hover { border-color: var(--accent); }
.yg-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.yg-ic .ico { width: 28px; height: 28px; }
.yg-tile b { font-size: calc(18px * var(--fs)); }
.yg-tile span:not(.yg-ic) { color: var(--muted); font-size: calc(14px * var(--fs)); line-height: 1.4; }
.yg-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.yg-badge { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 14px 10px; border-radius: 18px; border: 2px dashed var(--line-2, var(--line)); color: var(--muted); }
.yg-badge.got { border-style: solid; border-color: var(--brass, #c4932b); background: var(--brass-soft, var(--accent-soft)); color: var(--text); }
.yg-medal { font-size: calc(30px * var(--fs)); color: var(--brass, #c4932b); }
.yg-badge small { font-size: calc(12px * var(--fs)); color: var(--muted); }
.yg-grown { max-width: 70ch; }
.yg-toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 14px; background: var(--brass, #c4932b);
  color: #231a05; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50; max-width: calc(100vw - 32px); }
.yg-toast.on { opacity: 1; transform: translate(-50%, 0); }
.home-tools .tile-young { background: var(--brass-soft); border-color: var(--brass); }
@media (prefers-reduced-motion: reduce) { .yg-toast { transition: none; } }
/* A star and a step done at once: the star sits above the step's banner, not under it. */
body:has(#ypBanner.on) .yg-toast { bottom: calc(var(--tab-h, 0px) + 120px + env(safe-area-inset-bottom)); }

/* The young path (app.js, yp*): a winding trail of six stops, Pip the note, steps as stepping stones. */
.yp-box { position: relative; padding: 20px 18px 8px; border-radius: 24px; overflow: hidden; border: 2px solid var(--line);
  background: radial-gradient(120% 60% at 0% 0%, rgba(242, 181, 58, .18), transparent 60%),
              radial-gradient(100% 50% at 100% 100%, rgba(58, 134, 207, .16), transparent 60%), var(--panel); }
.yp-head { display: grid; gap: 6px; }
.yp-head h3 { margin: 0; font-size: calc(24px * var(--fs)); }
.yp-sum { margin: 0; font-weight: 650; color: var(--text-2); }
.yp-hint { margin: 0; color: var(--muted); font-size: calc(13.5px * var(--fs)); }
.yp-progress { display: block; height: 12px; border-radius: 999px; background: var(--panel-3, var(--line)); overflow: hidden; max-width: 420px; }
.yp-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #f2b53a, #e4775c); transition: width .6s ease; }
.yp-map { position: relative; margin: 8px auto 0; max-width: 560px; }
.yp-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.yp-trail { fill: none; stroke: var(--line-2, var(--line)); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 2 16; }
.yp-trail.walked { stroke: #f2b53a; stroke-dasharray: none; stroke-width: 9; }
.yp-stop { position: absolute; width: 170px; margin-left: -85px; display: grid; justify-items: center; gap: 6px; }
.yp-node { position: relative; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.yp-disc { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; color: #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 60%);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 65%, #000), 0 10px 18px rgba(0,0,0,.18); transition: transform .15s; }
.yp-node:hover .yp-disc, .yp-node:focus-visible .yp-disc { transform: translateY(-3px); }
.yp-node:active .yp-disc { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 65%, #000); }
.yp-disc .ico { width: 38px; height: 38px; stroke-width: 2.2; }
.yp-num { font-size: calc(30px * var(--fs)); font-weight: 800; }
.yp-stop.later .yp-disc { background: var(--panel-3, #ddd); color: var(--muted); box-shadow: 0 6px 0 var(--line-2, var(--line)); }
.yp-stop.now .yp-node::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 4px solid var(--c); opacity: .5; animation: yp-pulse 1.8s ease-out infinite; }
.yp-stop.done .yp-disc { box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 65%, #000), 0 0 0 5px #f2b53a; }
.yp-medal { position: absolute; right: -6px; top: -6px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: #f2b53a; color: #fff; font-size: 19px; border: 3px solid var(--panel); }
.yp-label { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 4px 10px; border-radius: 12px; background: color-mix(in srgb, var(--panel) 85%, transparent); }
.yp-label b { font-size: calc(15.5px * var(--fs)); line-height: 1.2; }
.yp-stop.later .yp-label b { color: var(--muted); }
.yp-dots { display: flex; gap: 4px; }
.yp-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2, var(--line)); }
.yp-dots i.on { background: var(--c); }
.yp-node.shake { animation: yp-shake .4s; }
.yp-pip { position: absolute; top: 4px; width: 62px; padding: 0; border: 0; background: none; cursor: pointer; animation: yp-bob 2.6s ease-in-out infinite; }
.yp-pip.right { left: calc(50% + 50px); }
.yp-pip.left { right: calc(50% + 50px); }
.yp-pip.hop { animation: yp-hop .7s ease; }
.yp-pip-svg { width: 62px; height: 74px; display: block; }
.yp-pip-svg.small { width: 40px; height: 48px; flex: none; }
.yp-say { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 130px; padding: 6px 10px;
  border-radius: 12px; background: var(--text); color: var(--panel); font-size: calc(13px * var(--fs)); font-weight: 700; line-height: 1.25; }
.yp-say::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--text); }
.yp-deco { position: absolute; font-size: 28px; color: var(--c, #f2b53a); opacity: .35; pointer-events: none; animation: yp-float 6s ease-in-out infinite; }
.yp-deco.n1 { left: 4%; top: 18%; color: #e4775c; } .yp-deco.n2 { right: 6%; top: 36%; color: #3a86cf; animation-delay: -2s; }
.yp-deco.n3 { left: 8%; top: 62%; color: #3fa66a; animation-delay: -4s; } .yp-deco.n4 { right: 4%; top: 84%; color: #8a63d2; animation-delay: -1s; }

.yp-sheet { width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 760px); padding: 0; border: 0; border-radius: 24px; background: var(--panel); color: var(--text);
  box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.yp-sheet::backdrop { background: rgba(10, 14, 12, .55); }
.yp-sheet-head { display: flex; align-items: center; gap: 14px; padding: 18px 18px 16px; color: #fff;
  /* Darker from the start, so the white words read on every stage's colour: at least 4.9:1 (amber), where the light
     end was 2.4:1 (review AX-04). */
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 68%, #000), color-mix(in srgb, var(--c) 50%, #000)); }
.yp-sheet-head h3 { margin: 0; font-size: calc(24px * var(--fs)); color: #fff; }
.yp-sheet-head > div { flex: 1; }
.yp-sheet-ic { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 18px; background: rgba(255,255,255,.22); }
.yp-sheet-ic .ico { width: 32px; height: 32px; }
.yp-kicker { margin: 0; font-size: calc(12.5px * var(--fs)); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.yp-sheet-count { margin: 2px 0 0; font-weight: 600; }
.yp-x { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: inherit; }
.yp-stones { list-style: none; margin: 0; padding: 14px; display: grid; gap: 10px; }
.yp-stone { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: 18px;
  border: 2px solid var(--line); background: var(--panel-2, var(--panel)); }
.yp-stone.next { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); }
.yp-stone.got { background: color-mix(in srgb, #f2b53a 12%, var(--panel)); border-color: color-mix(in srgb, #f2b53a 55%, var(--line)); }
.yp-stone-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 800; background: var(--panel-3, var(--line)); color: var(--text-2); }
.yp-stone.got .yp-stone-n { background: #f2b53a; color: #fff; font-size: 18px; }
.yp-stone-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.yp-stone-ic .ico { width: 26px; height: 26px; }
.yp-stone-body { display: grid; gap: 2px; min-width: 0; }
.yp-stone-body b { font-size: calc(17px * var(--fs)); }
.yp-stone-body span { color: var(--muted); font-size: calc(13.5px * var(--fs)); line-height: 1.35; }
.yp-play { flex: none; padding: 10px 18px; border-radius: 999px; border: 0; font-weight: 800; color: #231a05; background: #f2b53a;
  box-shadow: 0 4px 0 #b9831c; cursor: pointer; }
.yp-play:active { transform: translateY(3px); box-shadow: 0 1px 0 #b9831c; }
.yp-stone.got .yp-play { background: var(--panel-3, var(--line)); color: var(--text-2); box-shadow: 0 4px 0 var(--line-2, var(--line)); }
.yp-play.big { padding: 14px 32px; font-size: calc(18px * var(--fs)); }
@media (max-width: 520px) {
  .yp-stone { grid-template-columns: auto 1fr auto; }
  .yp-stone-ic { display: none; }
  .yp-play { padding: 9px 14px; }
}

.yp-banner { position: fixed; left: 50%; bottom: calc(var(--tab-h, 0px) + 18px + env(safe-area-inset-bottom)); z-index: 950; display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100vw - 24px); padding: 10px 12px 10px 14px; border-radius: 20px; background: var(--panel); color: var(--text);
  border: 3px solid #f2b53a; box-shadow: 0 16px 40px rgba(0,0,0,.3); transform: translate(-50%, 160%); transition: transform .35s cubic-bezier(.2, 1.4, .4, 1); }
.yp-banner.on { transform: translate(-50%, 0); }
.yp-banner-text { display: grid; }
/* No microphone: a grown-up hears it sung (app.js, ypNoMicDone). */
.yp-nomic-link { grid-column: 1 / -1; justify-self: start; padding: 2px 0; border: 0; background: none; color: var(--accent); font: inherit;
  font-size: calc(13.5px * var(--fs)); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.yp-nomic-ask { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: calc(14.5px * var(--fs)); }
.yp-banner-text b { color: #c98a12; font-size: calc(17px * var(--fs)); }
.yp-banner .yp-x { background: var(--panel-3, var(--line)); width: 34px; height: 34px; }
@media (max-width: 520px) { .yp-banner .yp-pip-svg { display: none; } .yp-banner { gap: 8px; } }

.yp-cheer { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 12, .6); }
.yp-cheer[hidden] { display: none; }
.yp-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
.yp-cheer-card { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; width: min(400px, 100%); padding: 28px 22px 24px;
  border-radius: 28px; background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.4); animation: yp-pop .5s cubic-bezier(.2, 1.5, .4, 1); }
.yp-cheer-card h3 { margin: 0; font-size: calc(28px * var(--fs)); }
.yp-cheer-card p { margin: 0; }
.yp-cheer-card .yp-kicker { color: var(--c); }
.yp-cheer-medal { position: relative; display: grid; place-items: center; width: 110px; height: 110px; border-radius: 50%; color: #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 60%); box-shadow: 0 0 0 8px #f2b53a, 0 10px 30px rgba(0,0,0,.25); }
.yp-cheer-medal .ico { width: 52px; height: 52px; }
.yp-cheer-medal i { position: absolute; right: -8px; bottom: -6px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: #f2b53a; color: #fff; font-style: normal; font-size: 24px; border: 4px solid var(--panel); }

@keyframes yp-pulse { from { transform: scale(.92); opacity: .7; } to { transform: scale(1.25); opacity: 0; } }
@keyframes yp-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes yp-hop { 0% { transform: translateY(0); } 30% { transform: translateY(-22px) rotate(-8deg); } 60% { transform: translateY(0) rotate(4deg); } 80% { transform: translateY(-6px); } 100% { transform: none; } }
@keyframes yp-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
@keyframes yp-float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-10px) rotate(6deg); } }
@keyframes yp-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .yp-pip, .yp-deco, .yp-stop.now .yp-node::before, .yp-cheer-card, .yp-node.shake, .yp-pip.hop { animation: none; }
  .yp-banner, .yp-progress span { transition: none; }
}

/* Certificates (app.js, ypCert): a picture to print or save. */
.yp-head { position: relative; }
.yp-cert-btn { justify-self: start; margin-top: 4px; padding: 9px 16px; border-radius: 999px; border: 2px solid #f2b53a; background: color-mix(in srgb, #f2b53a 16%, var(--panel));
  color: var(--text); font-weight: 800; cursor: pointer; }
.yp-cert-btn:hover { background: color-mix(in srgb, #f2b53a 30%, var(--panel)); }
.yp-sheet-foot { display: flex; justify-content: center; padding: 0 14px 16px; }
.yp-link { border: 0; background: none; color: var(--text-2); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px; }
.yp-certbox { position: fixed; inset: 0; z-index: 2100; display: grid; place-items: center; padding: 12px; background: rgba(10, 14, 12, .6); overflow-y: auto; }
.yp-certbox[hidden] { display: none; }
.yp-cert-card { display: grid; gap: 12px; width: min(820px, 100%); padding: 16px 18px 18px; border-radius: 24px; background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.yp-cert-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.yp-cert-top h3 { margin: 0; font-size: calc(22px * var(--fs)); }
.yp-cert-top .yp-x { background: var(--panel-3, var(--line)); color: var(--text); }
.yp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.yp-chip { padding: 7px 13px; border-radius: 999px; border: 2px solid var(--line); background: var(--panel-2, var(--panel)); color: var(--text); font-weight: 700; cursor: pointer; }
.yp-chip.on { border-color: #f2b53a; background: color-mix(in srgb, #f2b53a 22%, var(--panel)); }
.yp-name { display: grid; gap: 6px; font-weight: 700; }
.yp-name input { font-size: calc(18px * var(--fs)); padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel-2, var(--panel)); color: var(--text); }
.yp-name input:focus { border-color: #f2b53a; outline: none; }
.yp-cert-img { width: 100%; aspect-ratio: 1600 / 1131; border-radius: 10px; background: #fffaf0; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.yp-cert-do { display: flex; flex-wrap: wrap; gap: 10px; }
.yp-cert-do .yp-play { display: inline-flex; align-items: center; gap: 8px; }
.yp-cert-do .ico { width: 20px; height: 20px; }
.yp-play.alt { background: var(--panel-3, var(--line)); color: var(--text); box-shadow: 0 4px 0 var(--line-2, var(--line)); }
.mp-ask { width: min(520px, 100%); padding: 20px 22px; }
.mp-ask h3, .mp-ask p { margin: 0; }
.mp-ask p { line-height: 1.5; }
.yp-cert-note { margin: 0; color: var(--muted); font-size: calc(13px * var(--fs)); }
@media print {
  body.yp-printing > :not(#ypCert) { display: none !important; }
  body.yp-printing { background: #fff !important; }
  body.yp-printing #ypCert { position: static; display: block; padding: 0; background: none; overflow: visible; }
  body.yp-printing .yp-cert-card { width: 100%; padding: 0; box-shadow: none; background: none; display: block; }
  body.yp-printing .yp-cert-card > :not(.yp-cert-img) { display: none !important; }
  body.yp-printing .yp-cert-img { display: block; width: auto; max-width: 100%; height: auto; max-height: 186mm; margin: 0 auto; aspect-ratio: auto; box-shadow: none; border-radius: 0; break-inside: avoid; }
  @page { size: A4 landscape; margin: 8mm; }
}

/* First keys, for young musicians (app.js, fs*). */
.fs-page { display: grid; gap: 16px; }
.fs-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.fs-lv { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--panel); color: var(--text); font-weight: 650; min-height: 52px; }
.fs-lv b { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: calc(16px * var(--fs)); }
.fs-lv.done b { background: var(--brass, #c4932b); color: #fff; }
.fs-lv.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.fs-stage { display: grid; gap: 12px; padding: 20px; border-radius: 22px; background: var(--panel); border: 2px solid var(--line); }
.fs-prompt { margin: 0; font-size: calc(19px * var(--fs)); font-weight: 600; line-height: 1.45; min-height: 2.9em; }
.fs-big { display: inline-grid; place-items: center; min-width: 1.6em; padding: 0 .3em; border-radius: 12px; background: var(--accent); color: var(--on-accent);
  font-size: 1.9em; line-height: 1.3; vertical-align: middle; }
.fs-dots { display: flex; flex-wrap: wrap; gap: 6px; min-height: 14px; }
.fs-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brass, #c4932b); }
.fs-dots span.on { background: var(--brass, #c4932b); }
.fs-dots .fs-count { width: auto; height: auto; border: 0; color: var(--muted); font-weight: 650; font-size: calc(14px * var(--fs)); }
.fs-tunes { display: flex; flex-wrap: wrap; gap: 8px; }
.fs-tunes button { padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--panel-2, var(--panel)); color: var(--text); font-weight: 650; }
.fs-tunes button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.fs-play { display: flex; align-items: flex-end; gap: 14px; }
.fs-hand { flex: none; width: 140px; }
.fs-hand svg { display: block; width: 100%; height: auto; }
.fs-hand rect { fill: var(--brass-soft, #f6ecd2); stroke: var(--brass, #c4932b); stroke-width: 1.5; }
.fs-hand .lit rect { fill: #fff0b3; stroke: var(--accent); stroke-width: 2.5; }
.fs-hand circle { fill: #fff; stroke: var(--brass, #c4932b); stroke-width: 1.2; }
.fs-hand .lit circle { fill: var(--accent); stroke: var(--accent); }
.fs-hand text { font: 700 11px/1 system-ui, sans-serif; text-anchor: middle; fill: #1d2a22; }
.fs-hand .lit text { fill: var(--on-accent); }
.fs-keys-wrap { flex: 1; min-width: 0; }
.fs-keys { position: relative; display: grid; grid-template-columns: repeat(var(--whites), 1fr); height: clamp(150px, 24vw, 210px); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.fs-key { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 0 8px; min-width: 0;
  border-radius: 0 0 9px 9px; font-weight: 750; font-size: calc(15px * var(--fs)); -webkit-tap-highlight-color: transparent; transition: background .15s; }
.fs-key.w { height: 100%; background: #fbfbf8; color: #1d2a22; border: 1px solid #b9c4bd; margin-right: -1px; }
.fs-key.b { position: absolute; top: 0; height: 60%; width: calc(100% / var(--whites) * .62); left: calc(100% / var(--whites) * var(--at) - 100% / var(--whites) * .31);
  background: #1b221e; color: #e8efe9; border: 1px solid #000; z-index: 1; padding-bottom: 6px; }
.fs-key span { display: grid; justify-items: center; line-height: 1.1; white-space: nowrap; }
.fs-key small { font-size: .72em; font-weight: 650; color: #5a6b60; }
.fs-key .fs-f { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brass-soft, #f6ecd2); color: #3b2a05;
  border: 1.5px solid var(--brass, #c4932b); font-style: normal; font-size: calc(12px * var(--fs)); }
.fs-key.b.two { background: #3a4a8f; border-color: #2a3670; }
.fs-key.w.next { background: #fff4c2; box-shadow: inset 0 -7px 0 var(--brass, #c4932b); animation: fs-glow 1.1s ease-in-out infinite; }
.fs-key.b.next { background: #8a6a12; }
.fs-key.w.got { background: #dff3e3; box-shadow: inset 0 -6px 0 #3fa66a; }
.fs-key.w.yes { background: #b9e8c4; }
.fs-key.b.yes { background: #3fa66a; }
.fs-key.w.no { background: #ffd9c4; }
.fs-key.b.no { background: #c4642f; }
@keyframes fs-glow { 50% { background: #ffe680; } }
.fs-msg { margin: 0; min-height: 1.5em; font-weight: 600; font-size: calc(16px * var(--fs)); color: var(--text-2, var(--text)); }
.fs-msg.good { color: var(--accent); }
.fs-msg.try { color: var(--warn); }
.fs-msg.big { font-size: calc(19px * var(--fs)); color: var(--text); padding: 12px 14px; border-radius: 16px; background: var(--brass-soft, var(--accent-soft)); border: 2px solid var(--brass, #c4932b); }
.fs-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fs-real { display: grid; gap: 10px; padding: 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.fs-real h3 { margin: 0; }
.fs-real p { margin: 0; }
@media (max-width: 560px) {
  .fs-play { flex-direction: column; align-items: stretch; }
  .fs-hand { width: 104px; align-self: center; }
  .fs-key { font-size: calc(12px * var(--fs)); padding-bottom: 6px; }
  .fs-key .fs-f { width: 18px; height: 18px; font-size: calc(10.5px * var(--fs)); }
  .fs-levels { grid-template-columns: 1fr 1fr; }
  .fs-stage { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .fs-key.w.next { animation: none; } .fs-key { transition: none; } }

/* Family profiles, on the Music path page (app.js, fam*). */
.fam-box { border: 2px solid var(--line); border-radius: 20px; background: var(--panel); }
.fam-box > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 16px 18px; cursor: pointer; list-style: none; }
.fam-box > summary::-webkit-details-marker { display: none; }
.fam-box > summary::before { content: "▸"; color: var(--muted); }
.fam-box[open] > summary::before { content: "▾"; }
.fam-sum-t { font-weight: 750; font-size: calc(19px * var(--fs)); }
.fam-sum-s { color: var(--muted); font-size: calc(14px * var(--fs)); }
.fam-body { display: grid; gap: 12px; padding: 0 18px 18px; }
.fam-body > p { margin: 0; max-width: 70ch; }
.fam-list { display: grid; gap: 10px; }
.fam-kid { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  border: 2px solid color-mix(in srgb, var(--c) 45%, var(--line)); background: color-mix(in srgb, var(--c) 7%, var(--panel)); }
.fam-av { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: calc(20px * var(--fs)); }
.fam-info { display: grid; gap: 3px; min-width: 0; }
.fam-info b { font-size: calc(17px * var(--fs)); }
.fam-info > span { color: var(--muted); font-size: calc(13.5px * var(--fs)); }
.fam-medals { display: flex; gap: 5px; }
.fam-medals i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c); opacity: .55; }
.fam-medals i.on { background: var(--c); opacity: 1; }
.fam-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.fam-acts button.danger { background: #b4442e; color: #fff; border-color: #b4442e; }
.fam-sure { flex-basis: 100%; text-align: right; font-weight: 600; font-size: calc(14px * var(--fs)); }
.fam-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding-top: 4px; border-top: 1px solid var(--line); }
.fam-add[hidden] { display: none; }
.fam-name { display: grid; gap: 4px; font-weight: 600; font-size: calc(14px * var(--fs)); }
.fam-name input { min-height: 42px; width: 16em; max-width: 100%; }
.fam-carer { display: flex; align-items: center; gap: 8px; min-height: 42px; font-weight: 600; }
.fam-carer input { width: 20px; height: 20px; }
.fam-msg { margin: 0; min-height: 1.4em; font-weight: 600; color: var(--muted); }
.fam-msg.good { color: var(--accent); }
.fam-msg.bad { color: var(--warn); }
@media (max-width: 600px) {
  .fam-kid { grid-template-columns: auto 1fr; }
  .fam-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .fam-sure { text-align: left; }
}

/* A child's device (app.js childNow, account.js grownUp). */
.child-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--c, #1f9e9a);
  color: #fff; font-weight: 700; white-space: nowrap; max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
.child-grownup { min-height: 36px; margin-left: 8px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--top-line, rgba(255,255,255,.35));
  background: none; color: var(--top-ink, #fff); font-weight: 600; white-space: nowrap; }
.child-grownup:hover { background: var(--top-hover, rgba(255,255,255,.12)); }
body.child-mode #addSongBtn, body.child-mode #toolsBtn, body.child-mode #toolsMenu { display: none !important; }
.grownup-form input[type=password] { min-height: 44px; width: 100%; }
@media (max-width: 600px) { .child-chip { max-width: 8em; } .child-grownup { padding: 0 10px; } }

/* Scales in 12 keys (app.js, sc*). */
.sc-stage { display: grid; gap: 14px; justify-items: center; }
.sc-head { display: grid; justify-items: center; gap: 2px; }
.sc-key { font-size: calc(30px * var(--fs)); }
.sc-fingers { display: grid; gap: 6px; justify-items: center; }
.sc-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.sc-n { display: grid; justify-items: center; min-width: 44px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.sc-n b { font-size: calc(17px * var(--fs)); }
.sc-n i { font-style: normal; font-weight: 700; font-size: calc(14px * var(--fs)); }
.sc-n i.rh, .sc-tag.rh { color: var(--rh, var(--accent)); }
.sc-n i.lh, .sc-tag.lh { color: var(--lh, var(--brass)); }
.sc-tag { font-weight: 700; }
.sc-opts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: center; }
.sc-tempo { display: flex; align-items: center; gap: 8px; }
#scBoard { width: 100%; max-width: 640px; }
#scBoard .th-keys { width: 100%; }
@media (max-width: 560px) {
  .sc-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; width: 100%; }
  .sc-n { min-width: 0; padding: 6px 2px; }
  .sc-n b { font-size: calc(15px * var(--fs)); }
  .sc-opts { flex-direction: column; }
  .sc-tempo { width: 100%; flex-wrap: wrap; justify-content: center; }
  .sc-tempo input { flex: 1 1 140px; }
}
.watch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 16px; }
.watch[hidden], body[data-young] .watch, body.young-visit .watch { display: none; }
/* A young musician's visit (app.js, youngVisitApply): My path in place of Log in and Sign up; a grown-up asked before
   a link leaves the site. */
.account-slot .account-young { display: none; }
body.young-visit .account-slot .account-login, body.young-visit .account-slot .account-signup { display: none; }
body.young-visit .account-slot .account-young { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .28); color: var(--top-ink); font-weight: 700; text-decoration: none; }
body.young-visit .account-slot .account-young:hover { background: var(--top-hover); }
.yg-grownup { display: none; }
body.young-visit .yg-grownup { display: block; }
/* …and no Contact (it asks for a name and an email), sign-up prompts or Mac app in the rest of the visit (review CH-01, CH-02). */
body.young-visit .site-foot .foot-adult, body.young-visit #home .course-join, body.young-visit #home .course-extra,
body.young-visit .ln-join, body.young-visit .ms-btns { display: none; }
.ms-young { display: none; }
body.young-visit .ms-young { display: block; }
.yg-grownup span { display: block; margin-top: 4px; }
.yg-ask { max-width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 24px; background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.yg-ask::backdrop { background: rgba(0, 0, 0, .5); }
.yg-ask h2 { margin: 0 0 8px; font-size: calc(22px * var(--fs, 1)); }
.yg-ask-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.watch.open { display: grid; gap: 6px; }
.watch-frame { width: 100%; max-width: 640px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.watch-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.watch a { color: var(--accent); }
.watch .linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.sc-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sc-list button { min-width: 48px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line-2, var(--line)); background: var(--panel); color: var(--text); font-weight: 650; }
.sc-list button.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sc-list button.done { background: var(--accent-soft); color: var(--accent); }

/* Music theory (app.js, th*). */
.th-track { margin: 6px 0 24px; }
/* /oneroot/theory: the three courses; on a course's page, the other two a line away. */
.th-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 6px 0 24px; }
.th-pick { display: grid; gap: 6px; align-content: start; justify-content: stretch; justify-items: start; text-align: left; padding: 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.th-pick:hover { border-color: var(--accent); }
.th-pick:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.th-pick b { font-size: calc(19px * var(--fs)); }
.th-pick span { color: var(--text-2, var(--text)); line-height: 1.5; }
.th-pick small { color: var(--muted); }
.th-also { margin: 4px 0 24px; }
.th-track-head h3 { margin: 0; font-size: calc(22px * var(--fs)); }
.th-track-head p { margin: 4px 0 12px; }
.th-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.th-card { display: flex; gap: 12px; align-items: flex-start; width: 100%; height: 100%; text-align: left; padding: 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.th-card:hover { border-color: var(--accent-line); background: var(--panel-2, var(--panel)); }
.th-n { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.th-card.done .th-n { background: var(--accent); color: var(--on-accent); }
.th-card-body { display: grid; gap: 4px; }
.th-card-body b { font-size: calc(16px * var(--fs)); }
.th-card-body span, .th-card-body small { color: var(--muted); font-size: calc(13.5px * var(--fs)); line-height: 1.45; }
.th-back { margin: 0 0 10px; }
.th-lesson { max-width: 760px; }
.th-lesson h3 { font-size: calc(26px * var(--fs)); margin: 4px 0 12px; }
.th-lesson p, .th-lesson li { font-size: calc(16px * var(--fs)); line-height: 1.6; color: var(--text); }
.th-lesson ul { padding-left: 20px; }
.th-crumb { color: var(--muted) !important; font-size: calc(13px * var(--fs)) !important; margin: 0; }
.th-w { display: grid; gap: 12px; margin: 14px 0 18px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.th-keypick { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.th-keypick select { min-height: 40px; }
.th-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.th-btns.col { display: grid; }
.th-btns.col button { text-align: left; justify-content: flex-start; }
.th-btns button span { color: var(--muted); font-weight: 400; }
.th-line code { font-size: calc(15px * var(--fs)); margin-right: 10px; }
.th-out p { margin: 0 0 8px; }
.th-num b, .th-prog b { color: var(--accent); }
.th-prog { display: flex; flex-wrap: wrap; gap: 8px; }
.th-prog span { padding: 6px 10px; border-radius: 10px; background: var(--panel-2, var(--panel)); border: 1px solid var(--line); }
.th-prog span b { margin-right: 6px; }
.th-partline span { display: inline-block; margin-right: 6px; }
.th-keys { position: relative; display: grid; grid-template-columns: repeat(var(--whites), 1fr); height: clamp(110px, 18vw, 150px); max-width: 720px; }
.th-key { position: relative; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 6px; border-radius: 0 0 7px 7px;
  font-size: calc(11px * var(--fs)); font-weight: 650; min-width: 0; }
.th-key.w { height: 100%; background: #fbfbf8; color: #1d2a22; border: 1px solid #b9c4bd; margin-right: -1px; }
.th-key.b { position: absolute; top: 0; height: 60%; width: calc(100% / var(--whites) * .62); left: calc(100% / var(--whites) * var(--at) - 100% / var(--whites) * .31);
  background: #1b221e; color: #e8efe9; border: 1px solid #000; z-index: 1; font-size: calc(9.5px * var(--fs)); padding-bottom: 4px; }
.th-key span { white-space: nowrap; }
.th-key.on.w { background: var(--accent-soft); box-shadow: inset 0 -5px 0 var(--accent); }
.th-key.on.b { background: var(--accent); color: var(--on-accent); }
.th-ivs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.th-ivs li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.th-iv-name { display: grid; gap: 2px; }
.th-iv-name span { color: var(--muted); }
.th-iv-name small { color: var(--muted); }
.th-iv-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.th-iv-btns .ico { width: 16px; height: 16px; }
.th-quiz { margin: 22px 0 14px; padding: 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); display: grid; gap: 10px; justify-items: start; }
.th-quiz h4 { margin: 0; }
.th-q { margin: 0; }
.th-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.th-opts button { min-width: 90px; }
.th-opts button.right { background: var(--accent); border-color: var(--accent); color: var(--on-accent); opacity: 1; }
.th-opts button.wrong { background: rgba(255,123,123,.16); border-color: var(--danger); color: var(--danger); opacity: 1; }
.th-res b.good, .th-score.good b { color: var(--accent); } .th-res b.bad { color: var(--danger); }
.th-res button { margin-left: 8px; }
.th-next { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 24px; }
/* Young musicians' lessons: bigger words and buttons, Pip beside the title, and the do re mi ladder. */
.th-young-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.th-young-head h3 { margin: 0; }
.th-young-head .yp-pip-svg { width: 48px; height: 58px; flex: none; }
.th-lesson.young p, .th-lesson.young li { font-size: calc(18px * var(--fs)); }
.th-lesson.young .th-big .th-btns button, .th-lesson.young .th-opts button { min-height: 54px; padding: 10px 20px; font-size: calc(17px * var(--fs)); font-weight: 650; }
.th-lesson.young .th-opts button { min-width: 130px; }
.th-lesson.young .th-q { font-size: calc(18px * var(--fs)); }
.th-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 360px; }
.th-rung { width: calc(100% - var(--i) * 11%); min-height: 48px; border-radius: 12px; font-size: calc(19px * var(--fs)); font-weight: 700;
  background: var(--panel-2, var(--panel)); border: 2px solid var(--line); color: var(--text); transition: background .15s, transform .15s; }
.th-rung:hover { border-color: var(--accent-line); }
.th-rung.lit { background: #f2b53a; border-color: #c4932b; color: #2d2a26; transform: scale(1.04); }
/* Reading music (app.js, thStaffFill): notes on a staff, dark ink on paper as the printed score is, in both themes.
   Each note's head is a button: tap it to hear it and see its name. */
.th-staff { position: relative; max-width: 560px; border-radius: 10px; background: #f7f4ec; color: #1b1b1b; }
.th-staff.small { max-width: none; background: none; }
.th-staff-svg svg { display: block; width: 100%; height: auto; }
.th-staff-wait { margin: 0; padding: 24px 12px; }
.th-sn { position: absolute; transform: translate(-50%, -50%); width: 40px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; }
.th-sn:hover { background: rgba(31, 92, 62, .12); }
.th-sn:focus-visible { outline: 3px solid #1f5c3e; outline-offset: -3px; }
.th-sn.lit { background: rgba(212, 160, 23, .38); }
.th-sn-name { position: absolute; transform: translate(-50%, -50%); display: none; font: 700 calc(15px * var(--fs)) var(--sans); color: #14432a; }
.th-staff.names .th-sn-name { display: block; }
.th-w[data-w="staff"] .th-btns button span { color: inherit; font-weight: inherit; }
.th-sn-say:empty { display: none; }
.th-lens { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.th-lens.wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.th-len { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 8px 10px 10px; border-radius: 12px; border: 1px solid var(--line-2);
  background: #f7f4ec; color: #1b1b1b; font: inherit; cursor: pointer; }
.th-len b { font-weight: 650; }
.th-len > span:not(.th-staff) { color: #4b5a51; font-size: calc(13.5px * var(--fs)); }
.th-len .th-staff { width: 100%; }
.th-len:hover { border-color: var(--accent); }
.th-len.on { box-shadow: 0 0 0 2px var(--accent); }
.th-len:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.th-tsig b { font-size: calc(17px * var(--fs)); }
.th-count { display: flex; gap: 8px; min-height: 44px; }
.th-count span { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line-2);
  font-weight: 700; color: var(--muted); transition: background .1s, color .1s; }
.th-count span.strong { border-color: var(--accent); }
.th-count span.lit { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
/* Name the note: the staff, a letter button each, a clock and a score. */
.nn-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.nn-stats { font-variant-numeric: tabular-nums; color: var(--muted); }
.nn-stats b { color: var(--text); }
.nn-stage { min-height: 150px; display: grid; align-items: center; }
.nn-stage .th-staff { width: 100%; max-width: 220px; margin: 0 auto; }
.nn-letters { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.nn-letters button { min-height: 48px; padding: 0; font-size: calc(17px * var(--fs)); font-weight: 700; }
.nn-letters button.right { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nn-letters button.wrong { background: rgba(255,123,123,.16); border-color: var(--danger); color: var(--danger); }
.nn-say { margin: 0; min-height: 1.5em; }
.nn-end { text-align: center; font-size: calc(18px * var(--fs)); }
.nn [data-nn-go] { justify-self: start; }
.th-fig .th-staff { max-width: 220px; }
.th-beats { display: flex; gap: 10px; }
.th-beats span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-size: calc(22px * var(--fs)); font-weight: 700;
  background: var(--panel-2, var(--panel)); border: 2px solid var(--line); color: var(--muted); transition: background .08s, transform .08s; }
.th-beats span.lit { background: #f2b53a; border-color: #c4932b; color: #2d2a26; transform: scale(1.12); }
.th-beats span[data-b="1"].lit { background: #e4775c; border-color: #b9553d; color: #fff; }
.th-ls { display: flex !important; align-items: center; gap: 14px; }
.th-ls code { font-size: calc(17px * var(--fs)); }
.th-blocks { display: inline-flex; gap: 6px; flex: none; }
.th-blocks i { display: block; height: 22px; width: calc(var(--n) * 26px + (var(--n) - 1) * 6px); border-radius: 6px; background: var(--accent); }
.th-blocks i.short { background: #f2b53a; }
.th-fig { width: 100%; max-width: 360px; }
.th-fig .th-keys { height: 110px; }
.th-fig .th-key.on.w { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .th-rung, .th-beats span { transition: none; } .th-rung.lit, .th-beats span.lit { transform: none; } }
.th-next .ico { width: 16px; height: 16px; }

/* Singer's path (app.js, sp*). */
.sp-sum { color: var(--muted); margin: 0 0 14px; }
.sp-next { display: flex; justify-content: space-between; align-items: center; gap: 14px 20px; flex-wrap: wrap; padding: 18px 20px; margin: 0 0 22px;
  border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.sp-next h3 { margin: 2px 0 4px; font-size: calc(22px * var(--fs)); }
.sp-next p { margin: 0; }
.sp-kicker { color: var(--accent) !important; font-weight: 650; font-size: calc(13px * var(--fs)); }
.sp-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.sp-stage { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 14px 16px; }
.sp-stage-head { display: flex; align-items: flex-start; gap: 12px; }
.sp-stage-head > div { flex: 1; min-width: 0; }
.sp-stage-head h3 { margin: 0; font-size: calc(18px * var(--fs)); }
.sp-stage-head p { margin: 2px 0 0; color: var(--muted); font-size: calc(14px * var(--fs)); }
.sp-n { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.sp-stage.done .sp-n { background: var(--accent); color: var(--on-accent); }
.sp-count { flex: none; color: var(--muted); font-size: calc(13px * var(--fs)); font-variant-numeric: tabular-nums; }
.sp-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.sp-steps button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel-2, var(--panel)); }
.sp-steps button:hover { border-color: var(--accent-line); }
.sp-tick { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); color: var(--on-accent); font-size: 13px; font-weight: 800; }
.sp-steps li.done .sp-tick { background: var(--accent); border-color: var(--accent); }
.sp-step-body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.sp-step-body span { color: var(--muted); font-size: calc(13.5px * var(--fs)); line-height: 1.4; }
.sp-go { flex: none; font-weight: 650; color: var(--accent); }
.sp-banner .yp-banner-text b { color: var(--accent); }

/* Voice warm-ups (app.js, wu*). */
.wu-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.wu-steps { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.wu-say { font-size: calc(26px * var(--fs)); font-weight: 700; color: var(--accent); }
@media (max-width: 640px) {
  .wu-steps { grid-template-columns: auto auto auto auto auto auto; justify-content: stretch; }
  .wu-steps li:not(.now) { font-size: 0; justify-content: center; gap: 0; }
  .wu-steps li:not(.now) span { font-size: calc(12px * var(--fs)); }
}
.wu-stage { display: grid; gap: 14px; justify-items: center; text-align: center; }
.wu-title { margin: 0; font-size: calc(22px * var(--fs)); }
.wu-tip { margin: 0; max-width: 56ch; color: var(--text-2); }
.wu-body { display: grid; gap: 14px; justify-items: center; width: 100%; }
.wu-pattern { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.wu-n { min-width: 52px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2, var(--line)); background: var(--panel);
  font-weight: 650; font-size: calc(19px * var(--fs)); transition: background .1s, border-color .1s; }
.wu-n.now { border-color: var(--brass, var(--accent)); box-shadow: 0 0 0 3px var(--brass-soft, var(--accent-soft)); }
.wu-n.now.sing { border-color: var(--accent); background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wu-rounds { display: grid; gap: 6px; }
.wu-round { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; }
.wu-round > .muted { min-width: 4.5em; text-align: right; margin-right: 4px; }
.wu-mark { min-width: 34px; padding: 3px 6px; border-radius: 7px; border: 1px solid var(--line); font-size: calc(13px * var(--fs)); color: var(--muted); }
.wu-mark.ok { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.wu-mark.low, .wu-mark.high { background: rgba(232, 168, 92, .18); border-color: var(--warn); color: var(--text); }
.wu-mark.none { border-style: dashed; }
.wu-live { display: flex; flex-wrap: wrap; gap: 12px 40px; justify-content: center; }
.wu-trace-box { position: relative; width: 100%; max-width: 900px; }
.wu-trace { display: block; width: 100%; height: clamp(170px, 30vw, 260px); border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.wu-yours { fill: var(--accent-soft); }
.wu-c { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.wu-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.wu-trace-labels span { position: absolute; left: 8px; transform: translateY(-50%); font-size: calc(11.5px * var(--fs)); color: var(--muted); }
.wu-actions { display: flex; gap: 10px; justify-content: center; }
.wu-hold { display: grid; gap: 4px; justify-items: center; }
.wu-secs { font-size: calc(56px * var(--fs)); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.ss-msg { margin: 0; font-size: calc(16px * var(--fs)); color: var(--text-2); text-align: center; min-height: 1.5em; }
.ss-controls { flex-wrap: wrap; }
.ss-controls .secondary, .ss-controls .ghost { min-height: 46px; }
@media (max-width: 600px) {
  .ss-line { gap: 4px; height: calc(130px * var(--fs)); }
  .ss-note { min-width: 0; flex: 0 1 46px; height: 44px; padding: 0 4px; border-radius: 11px; }
  .ss-note b { font-size: calc(18px * var(--fs)); }
  .ss-track { width: 52vw; }
}

/* ---- Practice journal (2026-11-20): the time, a quiet bar a day, ideas,
 * and what was practised grouped by tool with its keys or levels. */
.journal-page { display: grid; gap: 14px; }
@media (min-width: 700px) { #journal { background: transparent; border: 0; border-radius: 0; padding: 8px 0 0; } }
.jr-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.jr-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.jr-stat { display: grid; gap: 4px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.jr-stat span { font-size: calc(13px * var(--fs)); color: var(--muted); }
.jr-stat b { font-size: calc(26px * var(--fs)); font-weight: 400; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 12px 14px; border-radius: 18px;
            border: 1px solid var(--line); background: var(--panel); }
.jr-chart i { flex: 1 1 0; min-width: 2px; border-radius: 3px 3px 1px 1px; background: var(--accent); opacity: .85; }
.jr-chart i.none { background: var(--line-2); opacity: .6; }
.jr-ideas { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.jr-idea { display: grid; gap: 10px; align-content: space-between; justify-items: start; padding: 16px 18px; border-radius: 18px;
           border: 1px solid var(--line); background: radial-gradient(80% 120% at 0% 0%, rgba(52, 199, 123, .10), transparent 70%), var(--panel); }
.jr-idea p { margin: 0; font-size: calc(15px * var(--fs)); line-height: 1.5; color: var(--text-2); }
.jr-items { display: grid; gap: 16px; }
.jr-group { display: grid; gap: 8px; }
.jr-group h4 { display: flex; justify-content: space-between; gap: 10px; margin: 0; font-size: calc(17px * var(--fs)); font-weight: 600; }
.jr-group h4 span { font-weight: 400; color: var(--muted); font-size: calc(14px * var(--fs)); }
.jr-item { display: grid; gap: 8px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.jr-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.jr-item-head b { font-weight: 600; }
.jr-item-head span { color: var(--muted); font-size: calc(13.5px * var(--fs)); }
.jr-details { display: flex; flex-wrap: wrap; gap: 6px; }
.jr-details span { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: calc(13px * var(--fs)); color: var(--text-2); }
.jr-details i { font-style: normal; color: var(--muted); }
.jr-clear { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text-2); }
@media (min-width: 1100px) { .jr-items { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

/* ---- Home: the four new tools' cards (2026-11-20). Fourteen cards: on a
 * laptop a wide Play live and Chords and scales, then rows of three; on a
 * tablet two a row, the journal across the last row. */
.home-tools .art-keychange em, .home-tools .art-gospel em { font-style: normal; font-size: calc(26px * var(--fs)); color: var(--muted); }
.art-solfa { align-items: flex-start; }
.art-solfa s { margin-top: calc(var(--y) * 18px); }
.art-bars { display: flex; align-items: flex-end; gap: 6px; height: 100%; width: 88%; padding-bottom: 6px; }
.art-bars i { flex: 1 1 0; border-radius: 4px 4px 1px 1px; background: var(--accent); opacity: .85; min-height: 3px; }
@media (min-width: 700px) and (max-width: 1099px) { .home-tools .tile.wide-mid { grid-column: span 2; } }
.art-solfa { padding-top: 26px; }
.art-solfa s { margin-top: calc(var(--y) * 15px); }
@media (max-width: 600px) {
  .jr-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .jr-stat { padding: 10px 12px; border-radius: 14px; }
  .jr-stat b { font-size: calc(17px * var(--fs)); }
  .jr-stat span { font-size: calc(11.5px * var(--fs)); }
  .jr-chart { height: 80px; }
}

/* The "?" beside a page's name: opens How to use at that page's section. */
.crumbs .crumb-help {
  flex: none; display: inline-grid; place-items: center;
  width: calc(26px * var(--fs)); height: calc(26px * var(--fs)); min-height: 0; padding: 0; margin-left: 4px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2);
  font: 600 calc(13.5px * var(--fs)) / 1 var(--sans); cursor: pointer;
}
.crumbs .crumb-help:hover { color: var(--text); background: var(--panel-3); border-color: var(--text-2); }
.crumbs .crumb-help:focus-visible { outline: 2px solid var(--top-ink, #fff); outline-offset: 2px; }
@media (pointer: coarse) {
  .crumbs .crumb-help { position: relative; }
  .crumbs .crumb-help::after { content: ""; position: absolute; inset: -9px; }
}
/* "Back to <song>" on the guide: a long song title shortens rather than pushing the header wide. */
.crumbs #crumbHelpBack { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---- Choir parts (2026-11-20). The parts as a tonic sol-fa score: a row a
 * part, a column a beat, a dash where a note holds; your part bright, the
 * others quieter; the beat being sung lit down every part. */
.choir-page { display: grid; gap: 14px; }
@media (min-width: 700px) { #choir { background: transparent; border: 0; border-radius: 0; padding: 8px 0 0; } }
.choir-page .gu-chart textarea { font-size: calc(16px * var(--fs)); }
#chTune { min-height: calc(84px * var(--fs)); }
#chChart { min-height: calc(60px * var(--fs)); }
.choir-page .dict-view-label b { color: var(--text-2); font-weight: 650; }
.ch-who { display: grid; gap: 8px; }
/* Practise a hymn (the default) or write your own: practising hides what's only for writing parts (review: the
   singer's Play was 2,100 pixels down, under the arranging boxes). */
.ch-mode { margin: 2px 0 14px; }
#choir.ch-practise .ch-arrange { display: none !important; }
/* Practising, the hymn list scrolls in its own box, so the parts and Play stay near (a first visit had 30 hymns above them). */
#choir.ch-practise .ch-hymn-list { max-height: min(340px, 42vh); overflow-y: auto; overscroll-behavior: contain; }
/* A phone or a tablet held upright: the list is part of the page, not a small box scrolled inside it (a thumb gets
   caught in one); the row of letters jumps along it (review PX-03). */
@media (max-width: 900px) { #choir.ch-practise .ch-hymn-list { max-height: none; overflow: visible; } }
.ch-parts { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-parts button { display: grid; gap: 2px; justify-items: start; min-width: calc(120px * var(--fs)); padding: 10px 16px;
  border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); text-align: left; }
.ch-parts button b { font-size: calc(16px * var(--fs)); font-weight: 600; color: var(--text); }
.ch-parts button span { font-size: calc(13px * var(--fs)); color: var(--muted); font-feature-settings: "cv05" 1, "cv08" 1; }
.ch-parts button.on { border-color: var(--accent); background: var(--accent-soft); }
#chFit { margin: 0; }
.ch-controls { flex-wrap: wrap; }
.ch-score { display: grid; gap: 14px; font-size: calc(16px * var(--fs)); }
.ch-score:empty { display: none; }
.ch-system { display: grid; grid-template-columns: 2.2em repeat(var(--per), minmax(0, 1fr)); row-gap: 2px;
  padding: 10px 12px 12px 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.ch-lab { display: grid; place-items: center; color: var(--muted); font-weight: 650; font-size: .85em; }
.ch-lab.mine { color: var(--accent); }
.ch-bar { display: grid; grid-template-columns: repeat(var(--beats), minmax(0, 1fr)); border-left: 1px solid var(--line-2); }
.ch-cell { display: flex; align-items: center; justify-content: center; gap: 1px; min-height: 2.1em; min-width: 0;
  border-left: 1px dotted var(--line); border-radius: 4px; }
.ch-cell:first-child { border-left: 0; }
.ch-cell.now { background: rgba(52, 199, 123, .14); }
.ch-chord { min-height: 1.6em; justify-content: flex-start; padding-left: 4px; font-size: .78em; font-weight: 600; color: var(--muted);
  white-space: nowrap; overflow: hidden; font-feature-settings: "case" 1; }
.ch-n { min-width: 0; padding: 2px 3px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit;
  font-weight: 500; cursor: pointer; white-space: nowrap; }
.ch-n:hover { background: var(--panel-3); color: var(--text); }
.ch-n.hold { color: var(--muted); }   /* the "hold" dash carries meaning: readable (review AX-09; --line-2 was 1.7:1) */
.ch-bar.mine .ch-n { color: var(--text); font-weight: 650; }
.ch-bar.mine .ch-n.hold { color: var(--muted); }
.ch-bar.mine { background: rgba(52, 199, 123, .06); }
.ch-dot { font-style: normal; color: var(--muted); opacity: .6; }
.ch-rest { display: block; width: .35em; height: 1px; background: var(--line-2); }
@media (max-width: 600px) {
  .ch-score { font-size: calc(14px * var(--fs)); }
  .ch-system { padding: 8px 6px 10px 2px; }
  .ch-parts button { min-width: 0; flex: 1 1 calc(50% - 8px); }
}
/* Home: its card, four parts stacked. */
.art-choir { flex-direction: column; gap: 6px !important; }
.art-choir > span { display: flex; gap: 8px; align-items: center; }
.art-choir i { width: 22px; font-style: normal; font-weight: 700; color: var(--muted); font-size: calc(14px * var(--fs)); }
.home-tools .art-choir s { min-width: 64px; padding: 3px 12px; font-size: calc(15px * var(--fs)); border-radius: 9px; }
.ch-hint { font-size: calc(13.5px * var(--fs)); color: var(--muted); line-height: 1.5; }
.ch-hint b { color: var(--text-2); font-weight: 650; }
@media (min-width: 700px) {
  .art-choir { gap: 7px !important; }
  .home-tools .art-choir s { min-width: 84px; padding: 4px 14px; font-size: calc(17px * var(--fs)); }
  .art-choir i { font-size: calc(15px * var(--fs)); }
}
/* Choir parts, polish (2026-11-20): the words under the parts, the check's marks. */
.ch-actions { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.ch-actions .secondary { min-height: 44px; padding: 0 18px; gap: 8px; }
.ch-actions p { margin: 0; flex: 1 1 260px; }
.ch-words-bar { border-left-color: transparent; }
.ch-words { min-height: 1.6em; gap: 4px; border-left: 0; }
.ch-words i { font-style: italic; font-size: .82em; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ch-n.good, .ch-bar.mine .ch-n.good { color: var(--accent); }
.ch-n.high, .ch-n.low, .ch-bar.mine .ch-n.high, .ch-bar.mine .ch-n.low { color: #e8b04a; text-decoration: underline dotted; text-underline-offset: 4px; }
/* A different note (review MU-06): red and struck through, so it reads without colour too. */
.ch-n.wrong, .ch-bar.mine .ch-n.wrong { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 2px; }
/* A word runs on under the beats it is held for, as in a hymn book, rather than being cut. */
.ch-words { justify-content: flex-start; overflow: visible; padding-left: 3px; }
.ch-words i { overflow: visible; text-overflow: clip; position: relative; z-index: 1; }
@media (max-width: 600px) { .ch-words i { font-size: .74em; } }
/* Choir parts: the hymns (2026-11-20). */
.ch-hymns { margin: 0; }
.ch-hymn-body { display: grid; gap: 10px; }
.ch-hymn-body input[type="search"] { min-height: 44px; max-width: 520px; }
/* Which hymns: the most sung, all A to Z, Christmas, Easter (app.js, chHymnList). */
.ch-hymn-show { justify-self: start; flex-wrap: wrap; }
.ch-hymn-show button { min-height: 40px; }
.ch-hymn-letter { margin: 12px 2px 6px; font-weight: 700; color: var(--muted); font-size: calc(13px * var(--fs)); letter-spacing: .04em; scroll-margin-top: 8px; }
.ch-hymn-letter:first-child { margin-top: 2px; }
/* Each letter's hymns (or the one list) are a grid of their own: the box around them only scrolls (review AX-09). */
.ch-hymn-list { display: block; max-height: calc(330px * var(--fs)); overflow-y: auto; padding: 2px; }
.ch-hymn-group { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(250px * var(--fs))), 1fr)); }
.ch-hymn-az { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px; }
.ch-hymn-az button { min-width: 32px; min-height: 32px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-weight: 600; font-size: calc(13px * var(--fs)); }
.ch-hymn-az button:hover { border-color: var(--line-2); background: var(--panel-3); }
.ch-hymn-count:empty { display: none; }
.ch-hymn-count { margin: 0; }
.ch-hymn-none .linkish { font-size: inherit; }
/* The hymn being practised, named on its page (app.js, chHymnTitle; review PX-01). */
.ch-hymn-title { margin: 4px 0 10px; font-size: calc(21px * var(--fs)); line-height: 1.25; }
.ch-hymn-title span { display: inline-block; font-size: calc(14px * var(--fs)); font-weight: 500; }
.ch-hymn-list button { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); min-width: 0; }
.ch-hymn-list button b { font-size: calc(15px * var(--fs)); font-weight: 600; }
.ch-hymn-list button span { font-size: calc(12.5px * var(--fs)); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ch-hymn-list button:hover { border-color: var(--line-2); background: var(--panel-3); }
.ch-hymn-list button.on { border-color: var(--accent); background: var(--accent-soft); }
.ch-hymn-list button.on b { color: var(--accent); }
.ch-hymns[open] .ts-edit { visibility: hidden; }
.ch-credit { margin: -6px 0 0; }
.ch-credit:empty { display: none; }
#chChart[readonly] { opacity: .7; }
.ch-hymn-list button { height: auto; min-height: calc(58px * var(--fs)); justify-content: stretch; align-content: center; line-height: 1.3; }
.ch-hymn-list button b, .ch-hymn-list button span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Choir parts: singing a tune in, and the sol-fa keypad (2026-11-20). */
.ch-sing { margin: 0; }
.ch-sing[open] .ts-edit { visibility: hidden; }
.ch-sing-body { display: grid; gap: 12px; }
.ch-sing-body .ch-hint { margin: 0; }
.ch-sing-opts { align-items: center; }
.ch-sing-opts .prog-tempo { flex: 1 1 260px; }
.ch-sing-opts .secondary { min-height: 44px; padding: 0 16px; }
.ch-sing-go { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.ch-sing-go .primary { min-height: 48px; padding: 0 22px; gap: 8px; }
.ch-sing-go .secondary { min-height: 44px; padding: 0 16px; gap: 8px; }
.ch-sing-beat { font-size: calc(18px * var(--fs)); font-weight: 600; color: var(--accent); font-feature-settings: "tnum" 1; }
#chSingState { margin: 0; }
.ch-pad { display: grid; gap: 8px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.ch-pad-row { display: grid; gap: 6px; }
.ch-pad-main { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ch-pad-colour { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ch-pad-marks { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ch-pad button { height: auto; min-height: 48px; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-size: calc(17px * var(--fs)); font-weight: 600; min-width: 0; }
.ch-pad-colour button { min-height: 40px; font-size: calc(15px * var(--fs)); color: var(--text-2); }
.ch-pad-marks button { font-size: calc(13px * var(--fs)); font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.ch-pad button:active { background: var(--accent-soft); border-color: var(--accent); }
@media (max-width: 600px) {
  .ch-pad-marks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ch-pad { padding: 8px; }
}
/* Choir parts: opening a file (2026-11-20). */
.ch-file { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel-2); }
.ch-file .secondary { min-height: 44px; padding: 0 18px; gap: 8px; flex: none; }
.ch-file .ch-hint { flex: 1 1 300px; }
.ch-file p { margin: 0; flex: 1 1 100%; }
.ch-file p:empty { display: none; }
.ch-hymn-item { position: relative; display: grid; min-width: 0; }
.ch-hymn-item.mine > button[data-id] { padding-right: 40px; border-style: dashed; }
.ch-hymn-list .ch-hymn-remove { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); font-size: calc(18px * var(--fs)); line-height: 1; }
.ch-hymn-list .ch-hymn-remove:hover { background: var(--panel-3); color: var(--text); }
/* Choir parts: parts as written, and reading a photo (2026-11-20). */
.ch-written { margin: 0; }
.ch-written-body { display: grid; gap: 10px; }
.ch-written-body .ch-hint { margin: 0; }
#chWritten { width: 100%; min-height: calc(130px * var(--fs)); resize: vertical; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 500 calc(15px * var(--fs)) / 1.6 var(--sans); }
#chWritten:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ch-written-go { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ch-written-go .primary, .ch-written-go .secondary { min-height: 44px; padding: 0 18px; gap: 8px; }
#chWrittenState { margin: 0; }

/* Home: the tool cards' pictures (2026-11-20; photographs of modern church gear since the second
 * set). Each is 16:9, wider than tall but taller than any card, so a card shows its whole width and
 * crops only top and bottom: the height each subject sits at is set per card at the end. */
@media (min-width: 700px) {
  .home-tools .tile-art.tile-photo { display: block; position: relative; padding: 0; background: #0b120e; }
  .tile-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
  /* A soft fall into the card below, so the picture and the words read as one card. */
  .tile-photo::after { content: ""; position: absolute; inset: auto 0 0 0; height: 38%; pointer-events: none;
    background: linear-gradient(to bottom, rgba(11, 18, 14, 0), rgba(11, 18, 14, .55)); }
}

/* Home on a phone: the same pictures as a short strip across the top of each card (2026-11-20).
 * The cards sit two to a row here, so the strip is half as tall as it is wide. */
@media (max-width: 699px) {
  .home-tools .tile-art.tile-photo { display: block; position: relative; aspect-ratio: 2 / 1; background: #0b120e; }
  .home-tools .tile-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .home-tools .tile-photo::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; pointer-events: none;
    background: linear-gradient(to bottom, rgba(11, 18, 14, 0), rgba(11, 18, 14, .55)); }
  .home-tools .tile-body { padding: 12px 14px 14px; }
}

/* Where each picture's subject sits, top to bottom (0% shows the top of the picture, 100% the bottom). */
.home-tools .tile .tile-photo img { object-position: 50% var(--art-y, 50%); }
.home-tools .tile[data-go="live"]      { --art-y: 50%; }
.home-tools .tile[data-go="dict"]      { --art-y: 55%; }
.home-tools .tile[data-go="prog"]      { --art-y: 35%; }
.home-tools .tile[data-go="keychange"] { --art-y: 45%; }
.home-tools .tile[data-go="gospel"]    { --art-y: 40%; }
.home-tools .tile[data-go="choir"]     { --art-y: 22%; }
.home-tools .tile[data-go="ear"]       { --art-y: 50%; }
.home-tools .tile[data-go="solfa"]     { --art-y: 50%; }
.home-tools .tile[data-go="runs"]      { --art-y: 55%; }
.home-tools .tile[data-go="hum"]       { --art-y: 75%; }
.home-tools .tile[data-go="voice"]     { --art-y: 45%; }
.home-tools .tile[data-go="loops"]     { --art-y: 45%; }
.home-tools .tile[data-go="tuner"]     { --art-y: 60%; }
.home-tools .tile[data-go="metronome"] { --art-y: 55%; }
.home-tools .tile[data-go="journal"]   { --art-y: 80%; }

/* ---- Tidy pass (2026-11-20) ---------------------------------------------------------------- */
/* Play live before it listens: a line saying what to do, not an empty dash and level bar. */
.live-chord:empty::before { content: "Press Start listening, then play a chord"; display: block; max-width: 18ch;
  margin: 0 auto; font-size: calc(22px * var(--fs)); font-weight: 400; line-height: 1.35; letter-spacing: 0; color: var(--muted); }
.live:not(.listening) .live-level { visibility: hidden; }
@media (min-width: 700px) {
  /* Every tool page's title and introduction sit on the left, as on the others. */
  .tuner > .trainer-head, .live > .trainer-head { justify-self: stretch; text-align: left; }
  .tuner .trainer-head p, .live .trainer-head p { margin-left: 0; margin-right: 0; }
  .tuner .tool-side, .live .tool-side { text-align: left; }
}
/* Song header: a key, a tempo never breaks over two lines; while fixing, the extra buttons (undo,
 * redo, Re-run) take their room from the other buttons' words, not from the song's title. */
.facts dd { white-space: nowrap; }
.title-block { min-width: 10ch; }
@media (min-width: 700px) and (max-width: 1599px) {
  body.fixing .head-actions button:not(#fixBtn) .lbl { display: none; }
}
@media (min-width: 1100px) {
  /* Hide keys sits in the keyboard's bottom corner, beside the hands' colours, instead of taking a
   * line of its own under the shapes: the chart above gets that height back. */
  body:not(.dock-min):not([data-fall="1"]) #keyboardDock { position: relative; }
  body:not(.dock-min):not([data-fall="1"]) #keyboardDock #dockToggle { position: absolute; right: 18px; bottom: 8px; }
}
@media (min-width: 1100px) {
  /* On the piano the line under the keys is only the hands' colours: one line, not the two kept
   * for other views, and the panel is that much shorter, so the chart above shows more bars. */
  body[data-layer="chord"]:not([data-fall="1"]) #keyboardDock { --diagram-h: calc(156px * var(--fs)); }
  body[data-layer="chord"] #chordDiagrams .dlabel { height: 1.5em; }
}
@media (min-width: 700px) {
  /* "Open ›" at the foot of every card, level across a row whatever the description's length. */
  .home-tools .tile .tile-body { grid-template-rows: auto auto 1fr; }
  .home-tools .tile .tile-go { align-self: end; }
}
/* Your key, before a range is set: the songs' titles get the whole row. */
.voice-songs.unset .voice-song { grid-template-columns: minmax(0, 1fr); }
.voice-songs.unset .voice-song-key:empty, .voice-songs.unset .voice-song-open:empty { display: none; }
.voice-songs-note { margin: 0 0 8px; }
/* Search boxes in the same size of type as the page, not a smaller one. */
input[type=search] { font-size: calc(15px * var(--fs)); }
/* On a touch screen a box under 16 px makes an iPhone zoom the page when it is tapped. A box the sheet gives no size
 * of its own (the browser default is 13.3 px) takes 16 px, and the few set smaller are raised. */
@media (pointer: coarse) {
  :where(input, select, textarea) { font-size: max(16px, 1em); }
  .bar-tools select, .fall-opts select, .fall-opts > label select, .prog-build-chip select,
  label.rate.tchip select, .mix-panel select { font-size: max(16px, calc(13px * var(--fs))); }
}
/* The button that starts a tool's main thing is the same size on every page. */
button.go-big { min-height: 46px; min-width: 120px; padding: 0 20px; gap: 8px; font-size: calc(15px * var(--fs)); }
/* Phone: no page wider than the screen. Choir parts' grid took the width of its widest row (the
 * four "what to hear" buttons); the column now stays the screen's width and those rows wrap. */
.choir-page { grid-template-columns: minmax(0, 1fr); }
.choir-page > * { min-width: 0; }
@media (max-width: 699px) {
  #chHear { flex-wrap: wrap; }
  #chHear button { flex: 1 1 auto; }
  /* The tool's mode tabs (Notes / Song chords / Find the key) share the width, and wrap at large text. */
  .dict-mode { display: flex; flex-wrap: wrap; justify-self: stretch; max-width: 100%; }
  .dict-mode button { flex: 1 1 auto; padding: 0 12px; }
}
/* Phone, song page. The song's name keeps its room in the breadcrumb; "Section A · bar 1" gives
 * way first. The More (⋯) button is never pushed off the screen or against its edge. */
@media (max-width: 699px) {
  .crumbs .crumb.song { flex: 0 1 auto; min-width: 6ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crumbs .crumb.where { flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .transport-more { padding-right: 10px; box-sizing: border-box; }
  .transport-more > select, .transport-more > label, .transport-more > .rate { flex: 0 1 auto; min-width: 0; }
  #transportMoreBtn { flex: none; margin-left: auto; }
  /* At the large text sizes Loop and Mix show their icons only, so the row still fits. */
  :root[data-text-size="large"] #loopBtn > span, :root[data-text-size="larger"] #loopBtn > span,
  :root[data-text-size="large"] #mixBtn > span, :root[data-text-size="larger"] #mixBtn > span { display: none; }
}
@media (max-width: 600px) {
  /* At the large text sizes the part tabs fill the first line, and the chord, its notes and the fold
   * arrow share the second, rather than the arrow taking a line to itself and pushing the keys down
   * behind the player. */
  :root[data-text-size="large"] #layerTabs, :root[data-text-size="larger"] #layerTabs { flex: 1 1 100%; }
  :root[data-text-size="large"] #chordNotes, :root[data-text-size="larger"] #chordNotes { order: 2; flex: 1 1 0; min-width: 0; }
  :root[data-text-size="large"] .dock-toggle, :root[data-text-size="larger"] .dock-toggle { order: 3; }
}
@media (max-width: 600px) {
  /* Larger text on a phone: the breadcrumb drops "Section A · bar 1" rather than show a sliver of it,
   * and the header keeps key and tempo whole, leaving out the beats a bar. */
  :root[data-text-size="large"] .crumb-sep:has(+ .crumb.where), :root[data-text-size="large"] .crumbs .crumb.where,
  :root[data-text-size="larger"] .crumb-sep:has(+ .crumb.where), :root[data-text-size="larger"] .crumbs .crumb.where { display: none; }
  :root[data-text-size="larger"] .facts div:has(#factMeter) { display: none; }
}
.play-strip .toggle { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 699px) {
  /* Play along on a phone: a compact strip, and no part tabs while playing along, so the keys to tap
   * stay above the player. */
  body.practicing #layerTabs { display: none; }
  .play-strip { padding: 8px 10px; gap: 4px; }
  .play-strip .prow.small { gap: 4px 14px; }
  .play-strip .psource { flex: 1 1 100%; line-height: 1.35; }
  .play-strip .toggle, #practiceMic { min-height: 36px; }
}
/* Gospel it up: a chord's chip is as wide as its name needs, and a crowded bar wraps to a second line
 * rather than cutting a short name to "D…". */
.gu-bar-chords { flex-wrap: wrap; }
.gu-c { flex: 1 1 auto; min-width: max-content; }
/* Metronome: every switch straight after its words, as on the other pages. */
.ramp .row-label { justify-content: flex-start; gap: 12px; }
.metro-row .toggle { display: inline-flex; align-items: center; gap: 12px; }
/* Export: each choice's name, then its description in readable type; the note under them no bigger. */
.export-panel button b { font-size: calc(15px * var(--fs)); }
.export-panel button span { font-size: calc(13.5px * var(--fs)); line-height: 1.4; }
.export-panel > p { font-size: calc(13px * var(--fs)); }
@media (max-width: 699px) {
  /* Sight-singing on a phone: each choice takes the full width rather than 240px of it. */
  .ss-opts > label:not(.check) { flex: 1 1 100%; }
}
@media (max-width: 699px) {
  /* A crumb that gives way is cut at its end ("Section A · b…"), not in the middle. */
  .crumbs .crumb.where, .crumbs .crumb.song { text-align: left; display: block; }
  /* Playing along on a phone, the keys and the strip matter more than seeing many bars. */
  body.practicing .dock { max-height: 58dvh; }
}
/* Progressions tab: rows in columns across a laptop's width, each name with room for its words. */
.prog-row { grid-template-columns: 56px minmax(0, 1.2fr) minmax(0, 1fr); font-size: calc(15px * var(--fs)); }
.prog-row .what { color: var(--text); }
@media (min-width: 900px) {
  #progList.prog-list { grid-template-columns: repeat(auto-fill, minmax(calc(420px * var(--fs)), 1fr)); gap: 6px 18px; }
  .prog-row { border: 1px solid var(--line); background: var(--panel); padding: 10px 14px; border-radius: 12px; }
}
/* Chords used: no names on the small keys (they were 5px); the notes are a line of text instead. */
.chord-card svg text { display: none; }
.chord-card .cc-notes { font-size: calc(13.5px * var(--fs)); color: var(--text-2); }
.chord-card .cc-count { font-family: inherit; font-size: calc(13px * var(--fs)); }
.chord-card .deg { font-size: calc(14px * var(--fs)); }
/* Parts: the part's name gets the room it needs ("Aux keys" touched its slider). */
.stem { grid-template-columns: minmax(calc(76px * var(--fs)), max-content) 1fr auto auto; column-gap: 14px; }
/* Practice journal: the chart's first and last day under it; a long "most time on" wraps. */
.jr-axis { display: flex; justify-content: space-between; font-size: calc(13px * var(--fs)); color: var(--muted); margin-top: 4px; }
.jr-stat b { white-space: normal; overflow-wrap: anywhere; }
/* Loop player: a folder's name is the list's heading, so it reads as one, not as a small caps label. */
.lp-group > summary.section-head h3 { text-transform: none; letter-spacing: 0; font-size: calc(17px * var(--fs)); font-weight: 600; color: var(--text); }
.lp-group > summary.section-head { min-height: 44px; }
@media (min-width: 900px) {
  /* On a wide screen the hymns sit in columns on the page itself, no box scrolling inside the page,
   * and each hymn's first line and key show in full. */
  .ch-hymn-list { max-height: none; overflow: visible; }
  .ch-hymn-list button span { white-space: normal; }
}
/* Gospel it up: what changed sits under its heading as a sentence, not squeezed beside it. */
.gu-after-head { flex-wrap: wrap; row-gap: 4px; }
.gu-after-head #guCount { flex: 1 1 100%; font-size: calc(14px * var(--fs)); line-height: 1.45; }
@media (max-width: 699px) {
  /* Falling notes on a phone: Notes and View on the first line, the parts sharing the second
   * (they wrapped, Bass alone on a line, with View floating beside them). */
  .fall-opts { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; overflow: visible; }
  .fall-opts > label { grid-column: 1; grid-row: 1; justify-self: start; }
  #fallMoreBtn { grid-column: 2; grid-row: 1; margin-left: 0; }
  .fall-parts { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: nowrap; gap: 6px; overflow: visible; }
  .fall-parts .fall-chip { flex: 1 1 0; min-width: 0; justify-content: center; white-space: nowrap; padding: 0 8px; }
}

/* One look for "selected" (tidy pass, 2026-11-20). Choosing one from a set (tabs, the part shown,
 * a voicing, a root, a move, your choir part) is a solid green fill everywhere, as the segmented
 * switches already were; the lime fill, the grey tab and the outline-only chips said the same
 * thing three other ways. A switch that is simply on (No vocals, Follow) keeps an outline with a
 * green tint, and so do the chips where several can be on at once (Gospel it up's moves). */
.pane-tabs button.on, .layer-tabs button.on,
.voicing-tabs button.on, .voicing-tabs button:first-child.on,
.dict-chips button.on, .kc-moves button.on, .ch-parts button.on, .notes-levels button.on {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.ch-parts button.on *, .kc-moves button.on * { color: inherit; }
#vocalsBtn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.lp-styles button.on { background: var(--accent-soft); }
@media (max-width: 699px) {
  /* Library on a phone: each song a card, as on Home (they were bare rows). */
  .library-list { gap: 8px; }
  .library-item { background: var(--panel); border-color: var(--line); min-height: 66px; padding: 10px 6px 10px 10px; }
}

/* Falling notes: putting a note right (Edit notes). */
#fallMoreBtn { margin-left: 0; }
.fall-edit-btn { margin-left: auto; }
.fall-edit-btn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.fall-edit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px;
  border: 1px solid var(--accent-line); border-radius: 14px; background: var(--panel); }
.fall-edit-bar[hidden] { display: none; }
.fall-edit-bar .fe-hint { flex: 1 1 260px; color: var(--text-2); font-size: calc(14px * var(--fs)); line-height: 1.4; }
.fall-edit-bar .fe-what { flex: 1 1 auto; font-size: calc(15px * var(--fs)); color: var(--text-2); }
.fall-edit-bar .fe-what b { font-size: calc(18px * var(--fs)); color: var(--text); margin-right: 4px; }
.fall-edit-bar .fe-group { display: inline-flex; align-items: center; gap: 6px; }
.fall-edit-bar .fe-label { font-size: calc(13px * var(--fs)); color: var(--muted); }
.fall-edit-bar button { min-height: 38px; padding: 0 12px; gap: 6px; font-size: calc(14px * var(--fs)); }
.fall-edit-bar .fe-group > button:not(.fall-chip) { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 10px; }
.fall-edit-bar .danger-ghost { color: var(--danger); border: 1px solid rgba(255, 123, 123, .35); background: transparent; border-radius: 10px; }
body.fall-editing #fallCanvas { cursor: crosshair; touch-action: none; }
@media (max-width: 699px) {
  .fall-opts { grid-template-columns: minmax(0, 1fr) auto auto; }
  #fallEditBtn { grid-column: 2; grid-row: 1; margin-left: 0; }
  #fallMoreBtn { grid-column: 3; }
  .fall-edit-bar .fe-hint { flex-basis: 100%; }
}
.fall-edit-bar .fe-actions { display: contents; }
@media (max-width: 699px) {
  /* On a phone: the note on one line, its actions in one row that slides sideways. */
  .fall-edit-bar { gap: 8px; padding: 8px 10px; }
  .fall-edit-bar .fe-what { flex: 1 1 100%; }
  .fall-edit-bar .fe-actions { display: flex; flex: 1 1 100%; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .fall-edit-bar .fe-actions::-webkit-scrollbar { display: none; }
  .fall-edit-bar .fe-actions > * { flex: none; }
}

/* ---- Layer recorder (2026-11-20) ---------------------------------------------------------- */
#layers { display: grid; gap: 14px; }
@media (min-width: 700px) { #layers { background: transparent; border: 0; border-radius: 0; padding: 8px 0 0; } }
.home-tools .tile[data-go="layers"] { --art-y: 62%; }
.ly-projects { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.ly-projects label { display: grid; gap: 6px; flex: 1 1 260px; }
.ly-projects select { min-height: 44px; width: 100%; }
.ly-projects button { min-height: 44px; }
#lyWork[hidden], #lyEmpty[hidden] { display: none; }
.ly-transport { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ly-rec.recording { background: var(--danger); border-color: var(--danger); color: #fff; }
.ly-time { font: 600 calc(26px * var(--fs)) var(--sans); font-variant-numeric: tabular-nums; color: var(--text); margin-left: auto; }
.ly-state { margin: 0; min-height: 1.4em; }
.ly-layers { display: grid; gap: 10px; }
.ly-none { margin: 8px 0; }
.ly-layer { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.ly-layer.muted { opacity: .55; }
.ly-layer.solo { border-color: var(--accent); }
.ly-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ly-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: calc(13px * var(--fs)); }
.ly-name { flex: 1 1 auto; min-width: 0; font-size: calc(16px * var(--fs)); font-weight: 600; background: transparent;
  border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; color: var(--text); min-height: 36px; }
.ly-name:hover, .ly-name:focus { border-color: var(--line-2); background: var(--panel-2); }
.ly-len { font-size: calc(13px * var(--fs)); font-variant-numeric: tabular-nums; flex: none; }
.ly-top .tchip { min-height: 34px; padding: 0 12px; flex: none; }
.ly-top .icon { flex: none; width: 38px; min-height: 38px; display: inline-grid; place-items: center; }
.ly-wave { width: 100%; height: 44px; display: block; border-radius: 8px; background: var(--panel-2); }
.ly-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: calc(14px * var(--fs)); color: var(--text-2); }
.ly-level { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; }
.ly-level input { flex: 1 1 auto; }
.ly-level output { width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.ly-nudge { display: inline-flex; align-items: center; gap: 6px; }
.ly-nudge button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 9px; }
.ly-nudge output { min-width: 96px; text-align: center; font-variant-numeric: tabular-nums; }
.ly-download { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; }
.ly-download button { min-height: 44px; gap: 8px; }
.ly-settings { display: grid; gap: 12px; }
.ly-settings label { display: grid; gap: 6px; }
.ly-settings select { min-height: 40px; }
.ly-toggle { display: flex !important; align-items: center; justify-content: flex-start; gap: 12px; }
.ly-toggle input { -webkit-appearance: none; appearance: none; width: 40px; height: 24px; margin: 0; border-radius: 999px;
  position: relative; background: var(--switch-off, var(--line-2)); cursor: pointer; flex: none; }
.ly-toggle input::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--switch-knob, #dfe8e3); transition: transform .18s var(--ease); }
.ly-toggle input:checked { background: var(--accent); }
.ly-toggle input:checked::before { transform: translateX(16px); background: #fff; }
.ly-delay { display: grid; gap: 8px; margin-top: 6px; }
.ly-delay p { margin: 0; }
@media (max-width: 699px) {
  .ly-time { font-size: calc(22px * var(--fs)); }
  .ly-transport .go-big { flex: 1 1 140px; }
  .ly-top { flex-wrap: wrap; }
  .ly-name { flex: 1 1 60%; }
}
.ly-delay button { justify-self: start; min-height: 42px; }
.ly-top a.icon { color: var(--text-2); }
.ly-top a.icon:hover { color: var(--accent); }

/* ======================================================================
   The shared look (2026-11-23): one design for OneRoot and the course site.
   The course site's deep green and brass with Bitter headings and Figtree text;
   light and dark, following the device unless Settings › Theme says
   otherwise (theme.js sets <html data-theme>). The left hand is brass and
   the right hand green on every keyboard, in both apps.
   Everything above keeps its layout work; this block re-colours it, so a
   later colour belongs here, as a token where it can be one.
   ====================================================================== */

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

/* Dark: the default, and what the page is before theme.js has run. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  /* Inter stays behind Figtree for the signs Figtree lacks (the top of this file). */
  --sans: "Figtree", "Inter var", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --display: "Bitter", Georgia, "Times New Roman", serif;
  --bg: #0e1612;
  --panel: #16211b;
  --panel-2: #1c2a22;
  --panel-3: #22332a;
  --line: #2a3d32;
  --line-2: #3f5a49;
  --text: #e6f0ea;
  --text-2: #c9dbcf;
  --muted: #a3b6aa;
  --accent: #8fd3ac;
  --focus: #8fd3ac;        /* the keyboard's ring (review AX-02) */
  --accent-hover: #a8e0c0;
  --accent-soft: rgba(143, 211, 172, .13);
  --accent-line: rgba(143, 211, 172, .45);
  --on-accent: #0e1612;
  --accent-2: #c99a32;
  --warn: #e8a85c;
  --danger: #ff8a80;
  --brass: #c99a32;
  --brass-hover: #d8aa45;
  --on-brass: #16241d;
  --brass-soft: #2e2614;
  --brass-text: #e6c77e;
  --top: #0f2219;
  --top-ink: #e6f0ea;
  --top-muted: #b6c9bd;
  --top-hover: rgba(230, 240, 234, .1);
  --lh: #c99a32;
  --on-lh: #16241d;
  --rh: #2c7352;
  --on-rh: #ffffff;
  --key-white: #e6efe9;
  --key-black: #0b120e;
  --key-line: #3f5a49;
  --part-piano: #6fd2e8;
  --part-guitar: #ff8fa3;
  --part-other: #c79bff;
  --part-bass: #ffb86b;
  --hot: #16301f;
  --wave: #4b6656;
  --wave-played: rgba(143, 211, 172, .22);
  --hot-2: #1b3a29;
  --shadow-pop: 0 18px 48px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
}

:root[data-theme="light"] {
  /* A switch that's off, seen against the panel (3.7:1) and its knob against it (3.9:1): it was 1.6:1 (review AX-05). */
  --switch-off: #6f8577; --switch-knob: #fff;
  color-scheme: light;
  --bg: #f4f7f3;
  --panel: #ffffff;
  --panel-2: #f0f5f1;
  --panel-3: #e3ece6;
  --line: #d8e3db;
  --line-2: #b5ccbd;
  --text: #16241d;
  --text-2: #31443a;
  --muted: #55655b;
  --accent: #2d6a4f;
  --focus: #1f5a40;        /* the keyboard's ring (review AX-02) */
  --accent-hover: #1b4332;
  --accent-soft: rgba(45, 106, 79, .1);
  --accent-line: rgba(45, 106, 79, .42);
  --on-accent: #ffffff;
  --accent-2: #8a6414;
  --warn: #9a5b00;
  --danger: #b3261e;
  --brass: #c4932b;
  --brass-hover: #b4841f;
  --on-brass: #16241d;
  --brass-soft: #f6ecd2;
  --brass-text: #6f500f;
  --top: #1b4332;
  --top-ink: #ffffff;
  --top-muted: #cfe3d6;
  --top-hover: rgba(255, 255, 255, .12);
  --lh: #c4932b;
  --on-lh: #16241d;
  --rh: #2d6a4f;
  --on-rh: #ffffff;
  --key-white: #ffffff;
  --key-black: #16241d;
  --key-line: #a3b6aa;
  --part-piano: #0e7490;
  --part-guitar: #be185d;
  --part-other: #7e3fb8;
  --part-bass: #b45309;
  --hot: #dcefe3;
  --wave: #9db3a5;
  --wave-played: rgba(45, 106, 79, .16);
  --hot-2: #cbe6d5;
  --shadow-pop: 0 18px 40px rgba(22, 36, 29, .16), 0 2px 6px rgba(22, 36, 29, .1);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355655b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

body { font-family: var(--sans); background: var(--bg); color: var(--text); }

/* Headings in Bitter: the page and section titles, not the small capitals labels. */
.hero h1, .trainer-head h1, .home-group-head h2, .sheet-head h3, .help-sec > h2, #help h2, .page-title,
.home .section-head h3, .library-page > .section-head h3, .voice-page > .section-head h3 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.01em;
}

/* One main action a screen, in brass; everything selected, in green. */
button.primary, .add-song { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
button.primary:hover, .add-song:hover { background: var(--brass-hover); border-color: var(--brass-hover); }

/* The top bar: deep green in both themes, as the course site's. */
.topbar, :root[data-theme] .topbar {
  background: var(--top); color: var(--top-ink); border-bottom-color: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.topbar .crumbs, .topbar button.crumb, .topbar .crumb-sep { color: var(--top-muted); }
.topbar button.crumb:hover { color: var(--top-ink); background: var(--top-hover); }
.topbar .crumb.song { color: var(--top-ink); }
.topbar .help-crumb, .topbar .crumbs button.icon { color: var(--top-ink); }
@media (min-width: 901px) {
  .appnav button { color: var(--top-muted); }
  .appnav button:hover { color: var(--top-ink); background: var(--top-hover); }
  .appnav button.on { color: var(--top-ink); background: var(--top-hover); box-shadow: inset 0 -3px 0 var(--brass); border-radius: 9px 9px 0 0; }
  .appnav button.on .ico { color: var(--brass); }
  .appnav button.here { color: var(--top-ink); background: var(--top-hover); box-shadow: inset 0 -3px 0 var(--brass); border-radius: 9px 9px 0 0; }
  .appnav button.here .ico { color: var(--brass); }
}
/* Phones and tablets: the tab bar along the bottom is a card, not the top bar. */
@media (max-width: 900px) {
  .appnav { background: var(--panel); border-top: 1px solid var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .appnav button { color: var(--muted); }
  .appnav button.on { color: var(--accent); }
  .topbar { background: var(--top); }
}
.theme-btn { flex: none; width: 38px; min-height: 38px; padding: 0; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .28);
  background: transparent; color: var(--top-ink); }
.theme-btn:hover { background: var(--top-hover); }
.theme-btn .ico { width: calc(18px * var(--fs)); height: calc(18px * var(--fs)); }
@media (max-width: 600px) { .theme-btn { display: none; } }
/* Text size (Aa) beside Light or dark: a small menu of the same four sizes as Settings. On a phone it is the first
   row of the Tools sheet instead, as the top bar has no room. */
.text-btn > span { font-size: calc(15px * var(--fs)); font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.text-btn[aria-expanded="true"] { background: var(--top-hover); }
.text-menu { position: absolute; top: calc(100% + 6px); right: 20px; z-index: 1200; width: min(380px, calc(100vw - 32px));
  padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.text-menu[hidden], .tools-text { display: none; }
.text-menu-h, .tools-text > p { margin: 0 0 8px; font-weight: 600; color: var(--text); }
@media (max-width: 600px) {
  .tools-text { display: block; grid-column: 1 / -1; padding: 0 4px 10px; }
}
/* Two by two where four in a row would squeeze Standard. */
@media (max-width: 440px) {
  .tools-text .segmented { flex-wrap: wrap; }
  .tools-text .segmented button { flex: 1 1 calc(50% - 2px); }
}

/* ---- Signed in to the course site (account.js, when the tools sit inside it): the person's name in
   the top bar, with My progress, Practice log and Log out; or Log in. */
.account-slot { position: relative; flex: none; display: flex; align-items: center; }
.account-login { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .28); color: var(--top-ink); font-weight: 600; text-decoration: none; }
.account-login:hover { background: var(--top-hover); }
.account-btn { min-height: 38px; padding: 0 12px 0 4px; gap: 8px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28);
  background: transparent; color: var(--top-ink); font-weight: 600; }
.account-btn:hover { background: var(--top-hover); }
.account-initial { width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brass); color: var(--on-brass); font-weight: 700; font-size: calc(14px * var(--fs)); }
.account-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 950; min-width: 220px; padding: 8px;
  display: flex; flex-direction: column; gap: 2px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-pop); color: var(--text); }
.account-menu[hidden] { display: none; }
.account-who { margin: 4px 10px 8px; font-size: calc(12.5px * var(--fs)); color: var(--muted); overflow-wrap: anywhere; }
.account-kept { margin: -4px 10px 8px; font-size: calc(12px * var(--fs)); line-height: 1.4; color: var(--muted); }
.account-kept:empty { display: none; }

/* The desktop app's Log in with the course site (account.js). */
.lk-login { width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-pop); }
.lk-login::backdrop { background: rgba(10, 18, 14, .55); }
.lk-login-form { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.lk-login-form h2 { margin: 0; font: 700 calc(22px * var(--fs))/1.2 var(--display); }
.lk-login-form p { margin: 0; font-size: calc(14px * var(--fs)); line-height: 1.5; }
.lk-login-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: calc(14px * var(--fs)); }
.lk-login-form input { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--text); font: inherit; font-weight: 400; }
.lk-login-error { color: var(--danger); min-height: 1.2em; }
.lk-login-error:empty { min-height: 0; }
.lk-login-row { display: flex; gap: 10px; }
.lk-login-row button { min-height: 44px; padding: 0 20px; }
.lk-login-alt { color: var(--muted); }
.lk-login-alt a { color: var(--accent); }
.account-menu a, .account-menu button { display: flex; align-items: center; justify-content: flex-start; min-height: 40px; padding: 0 10px;
  border-radius: 8px; border: 0; background: none; color: var(--text); font-weight: 500; text-decoration: none; text-align: left; }
.account-menu a:hover, .account-menu button:hover { background: var(--panel-3); }
@media (max-width: 600px) {
  .account-name { display: none; }
  .account-btn { padding: 0 4px; }
  .account-login { min-height: 36px; padding: 0 10px; }
  /* Logged out, Log in and Sign up take the room: the trail keeps its way back and its help button, and drops the
   * page's own name (the page's heading says it). */
  body:not(.stage-mode) .topbar:has(.account-login) .crumbs > span.crumb,
  body:not(.stage-mode) .topbar:has(.account-login) .crumbs > .crumb-sep { display: none; }
  body:not(.stage-mode) .topbar:has(.account-login) .crumbs > .crumb.back { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body:not(.stage-mode) .topbar:has(.account-login) .crumbs .crumb-help { flex: none; }
  .account-signup { padding: 6px 10px; margin-left: 4px; }
}
/* On the narrowest phones the top bar keeps the text size it had before 16 px body text (session 1 of the where-next
   plan): Log in and Sign up grown by an eighth left the way back no room at 320 px. */
@media (max-width: 389px) {
  .topbar > .crumbs, .topbar .account-login, .topbar .account-signup, .topbar .account-btn {
    --fs: min(var(--fs-user), 1.2); font-size: calc(14px * var(--fs)); }
}

/* What was hard-wired for the dark page. */
.bar-cell:hover { background: var(--panel-3); }
.bar-cell.playing, .lyric-line.now { background: var(--hot); }
.bar-cell.looped { background: var(--accent-soft); }
.bar-cell.looped.playing { background: var(--hot-2); }
.beat.change { background: var(--panel-3); }
.stack-row[data-voice="piano"] b, .prog.solo[data-part="piano"] { color: var(--part-piano); }
.stack-row[data-voice="guitar"] b, .prog.solo[data-part="guitar"] { color: var(--part-guitar); }
.stack-row[data-voice="other"] b, .stack-row[data-voice="lead"] b, .prog.solo, .prog.solo[data-part="other"] { color: var(--part-other); }
.stack-row[data-voice="bass"] b, .mnote.tech > i { color: var(--part-bass); }
.stack-row[data-voice="chord"] .skey.on { fill: var(--rh); }
.stack-row[data-voice="chord"] .skey.on.lh { fill: var(--lh); }
.stack-row[data-voice="chord"] b { color: var(--accent); }
.skey.w { fill: var(--key-white); stroke: var(--key-line); }
.skey.b { fill: var(--key-black); stroke: var(--key-line); }
.stage-list li.active::before { box-shadow: 0 0 0 4px var(--accent-soft); }
.ls-bar:hover { fill: var(--accent-soft); }
.ls-bar.playing { fill: var(--hot-2); }
.notes-streak { color: var(--brass-text); }

:root[data-theme="light"] .beat.nc, :root[data-theme="light"] .lyric-time { color: var(--muted); }
:root[data-theme="light"] .beat .deg, :root[data-theme="light"] .mnote > i { color: var(--text-2); }
:root[data-theme="light"] input::placeholder { color: #6b7b71; }
:root[data-theme="light"] .hero .loader input { background: var(--panel); }
:root[data-theme="light"] .player-bar { background: rgba(244, 247, 243, .97); }
:root[data-theme="light"] .play:hover { background: var(--text-2); }
:root[data-theme="light"] .play-strip.ok, :root[data-theme="light"] .play-strip .tone.hit { border-color: #1d7a4a; }
:root[data-theme="light"] .play-strip .tone.hit { background: #1d7a4a; color: #fff; }
:root[data-theme="light"] .play-strip.ok .phint { color: #1d7a4a; }
:root[data-theme="light"] .ch-n.high, :root[data-theme="light"] .ch-n.low { color: #9a5b00; }
:root[data-theme="light"] .ch-n.wrong { color: #b42318; }
:root[data-theme="light"] .notes-levels button i, :root[data-theme="light"] .notes-stars { color: #a87a12; }
:root[data-theme="light"] .key-notes button { border-color: var(--line-2); }
:root[data-theme="light"] .key-notes button.black { background: var(--key-black); color: #fff; }
:root[data-theme="light"] .hero { background: var(--panel); border-color: var(--line); }
/* Bitter's titles were set light for Inter; Bitter reads best at its own weight. */
.home .section-head h3, .library-page > .section-head h3, .voice-page > .section-head h3 { font-weight: 700; letter-spacing: -0.01em; }
/* Every page title in Bitter at its own weight, the Metronome's and the Library's too. */
.trainer-head h1, .metronome-page .trainer-head h1, .page-head h2 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
/* The song's own name, at the top of its page. */
#trackTitle { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }

/* ---- Home in three groups (2026-11-23): Keys, Voice and choir, Practice kit. Each opens with
   one of the room photographs and a deep-green label; the tools are compact cards with an icon. */
.home-tools { display: flex; flex-direction: column; gap: 40px; }
.home-group { display: flex; flex-direction: column; gap: 14px; }
.home-group-head { position: relative; height: clamp(150px, 19vw, 230px); border-radius: 16px; overflow: hidden; background: var(--top); }
.home-group-head img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-group-label { position: absolute; left: 18px; bottom: 18px; max-width: calc(100% - 36px); box-sizing: border-box;
  padding: 12px 18px; border-radius: 12px; background: var(--top); color: var(--top-ink); }
.home-group-label h2 { margin: 0; font: 700 calc(26px * var(--fs))/1.15 var(--display); letter-spacing: -0.01em; color: var(--top-ink); }
.home-group-label p { margin: 3px 0 0; font-size: calc(14.5px * var(--fs)); line-height: 1.35; color: var(--top-muted); }
.home-group .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.home-tools .home-group .tile {
  display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 14px;
  min-height: 0; padding: 16px; border-radius: 12px; grid-column: auto; aspect-ratio: auto;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); text-align: left; text-decoration: none;
}
.home-tools .home-group .tile:hover { background: var(--panel-2); border-color: var(--line-2); }
.home-tools .home-group .tile span.tile-ic { flex: none; width: calc(42px * var(--fs)); height: calc(42px * var(--fs)); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.home-tools .home-group .tile .tile-ic .ico { width: calc(21px * var(--fs)); height: calc(21px * var(--fs)); }
.home-tools .home-group .tile-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0; }
.home-tools .home-group .tile b { font-size: calc(16px * var(--fs)); font-weight: 650; color: var(--text); }
.home-tools .home-group .tile-desc { font-size: calc(13.5px * var(--fs)); line-height: 1.45; color: var(--muted); }
.home-tools .home-group .tile-course, .home-tools .home-group .tile-young { background: var(--brass-soft); border-color: var(--brass); }
.home-tools .home-group .tile-course:hover, .home-tools .home-group .tile-young:hover { background: var(--brass-soft); border-color: var(--brass-hover); }
.home-tools .home-group .tile-course span.tile-ic, .home-tools .home-group .tile-young span.tile-ic { background: var(--brass); color: var(--on-brass); }
.tile-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; vertical-align: 2px;
  background: var(--brass); color: var(--on-brass); font-size: calc(11.5px * var(--fs)); font-weight: 650; }
@media (max-width: 600px) {
  .home-tools { gap: 30px; }
  .home-group-head { height: 128px; border-radius: 12px; }
  .home-group-label { left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 8px 12px; border-radius: 9px; }
  .home-group-label h2 { font-size: calc(20px * var(--fs)); }
  .home-group-label p { font-size: calc(13px * var(--fs)); }
  .home-group .tiles { grid-template-columns: 1fr; gap: 8px; }
  .home-tools .home-group .tile { padding: 12px 14px; }
}

/* The course spans two columns where there are several, so its sentence has room. */
.home-tools .home-group .tile .tile-tag { color: var(--on-brass); font-size: calc(11.5px * var(--fs)); }

/* OneRoot for Mac, advertised online (index.html .mac-panel; online.css shows it, account.js points it at the
   course's own page inside the website). The desktop and Mac app are it, so there it stays hidden. */
.mac-panel { display: none; }
.mac-panel { flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 40px; padding: 18px; border-radius: 16px;
  background: var(--top); color: var(--top-ink); text-decoration: none; }
.mac-panel img { flex: 1 1 300px; max-width: 420px; min-width: 0; width: 100%; height: auto; aspect-ratio: 1200 / 670; object-fit: cover; border-radius: 12px; }
.mac-panel-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mac-panel-text b { font: 700 calc(24px * var(--fs))/1.2 var(--display); }
.mac-panel-text > span { color: var(--top-muted); font-size: calc(15.5px * var(--fs)); line-height: 1.5; }
.mac-panel-text > span.mac-panel-go { color: var(--brass); font-weight: 700; }

/* The Tools menu, in the same groups. */
.tools-menu .tools-group { grid-column: 1 / -1; margin: 10px 8px 2px; font-size: calc(11.5px * var(--fs)); font-weight: 650;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tools-menu .tools-group:first-child { margin-top: 2px; }

/* ---- Each tool page opens with its own room photograph (2026-11-23): beside the title on a wide
   screen, a short banner above it on a phone. The pictures are the ones Home used to carry. */
.trainer-head.with-art { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 380px); column-gap: 32px; align-items: center; }
.trainer-head.with-art > h2, .trainer-head.with-art > p { grid-column: 1; }
.trainer-head.with-art > .head-art { grid-column: 2; grid-row: 1 / span 2; width: 100%; height: auto; aspect-ratio: 1200 / 670;
  object-fit: cover; border-radius: 16px; display: block; margin-bottom: 18px; background: var(--top); }
@media (max-width: 699px) {
  .trainer-head.with-art { grid-template-columns: minmax(0, 1fr); }
  .trainer-head.with-art > .head-art { grid-column: 1; grid-row: 1; aspect-ratio: auto; height: 120px; border-radius: 12px; margin: 0 0 14px; }
}

/* ---- Inside the website, the course's menu in OneRoot's top bar (account.js, courseNav): links that look
   like their neighbours, the short label on phones. */
.appnav a.nav-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 11px;
  border-radius: 9px; font-size: calc(13.5px * var(--fs)); font-weight: 500; text-decoration: none; color: var(--top-muted);
}
.appnav a.nav-link:hover { color: var(--top-ink); background: var(--top-hover); }
.appnav a.nav-link .ico { width: calc(17px * var(--fs)); height: calc(17px * var(--fs)); }
.appnav a.nav-link .short { display: none; }
@media (max-width: 900px) {
  .appnav a.nav-link { flex-direction: column; gap: 3px; min-height: 0; height: 54px; padding: 0; border-radius: 12px;
    font-size: calc(12px * var(--fs)); font-weight: 600; color: var(--muted); background: none; }
  .appnav a.nav-link .ico { width: calc(23px * var(--fs)); height: calc(23px * var(--fs)); }
  .appnav a.nav-link .long { display: none; }
  .appnav a.nav-link .short { display: inline; }
}
/* The course's tools in OneRoot's Tools menu: laid out as its own buttons are. */
.tools-menu a.course-tool, .tools-menu a.menu-course { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 10px 12px;
  border-radius: 10px; color: var(--text); text-decoration: none; text-align: left; }
.tools-menu a.course-tool:hover, .tools-menu a.menu-course:hover { background: var(--panel-3); }
.tools-menu a.course-tool > i, .tools-menu a.menu-course > i { grid-column: 1; grid-row: 1 / span 2; display: grid; place-items: center; }
.tools-menu a.course-tool > b, .tools-menu a.menu-course > b { grid-column: 2; font-size: calc(14px * var(--fs)); font-weight: 600; }
.tools-menu a.course-tool > span, .tools-menu a.menu-course > span { grid-column: 2; font-size: calc(12px * var(--fs)); color: var(--muted); }
/* Inside the website, OneRoot's Practice journal steps aside: the course's Practice log counts this practice too. */
.in-course #toolsMenu [data-go="journal"], .in-course .tiles [data-go="journal"] { display: none !important; }
/* Inside the website the menu is the course's: OneRoot's own Home and guide buttons step aside (the guide stays on the ? beside the trail). */
.in-course .appnav .nav-home, .in-course .appnav [data-go="help"], .in-course .appnav .nav-course { display: none !important; }

/* ---- The piano course in the top bar, a link that looks like its neighbours. */
.appnav a.nav-course {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 11px;
  border-radius: 9px; font-size: calc(13.5px * var(--fs)); font-weight: 500; text-decoration: none; color: var(--top-muted);
}
.appnav a.nav-course:hover { color: var(--top-ink); background: var(--top-hover); }
.appnav a.nav-course .ico { width: calc(17px * var(--fs)); height: calc(17px * var(--fs)); color: var(--brass); }
.appnav a.nav-course .short { display: none; }
@media (max-width: 900px) {
  /* The tab bar takes as many tabs as there are (five in the app, four online). */
  .appnav { grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .appnav a.nav-course { flex-direction: column; gap: 3px; min-height: 0; height: 54px; padding: 0; border-radius: 12px;
    font-size: calc(12px * var(--fs)); font-weight: 600; color: var(--muted); background: none; }
  .appnav a.nav-course .ico { width: calc(23px * var(--fs)); height: calc(23px * var(--fs)); }
  .appnav a.nav-course .long { display: none; }
  .appnav a.nav-course .short { display: inline; }
}

/* A page opened by its address (#warmup, #young) starts with its heading in view, not under the top bar. */
main > section.panel { scroll-margin-top: 80px; }

/* The website's footer (account.js shows it on the website only; on a child's device, without Contact or the Mac app). */
.site-foot { padding: 20px 16px 32px; text-align: center; color: var(--muted); font-size: calc(13.5px * var(--fs)); }
.site-foot a { color: inherit; }
body.child-mode .site-foot .foot-adult { display: none; }
body.has-tabbar .site-foot, html.bars-fit .site-foot { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* The website's front door for visitors (index.html #landing; account.js shows it). The rest of Home steps aside. */
body.landing-on #home > :not(#landing) { display: none !important; }
body.landing-on #home { gap: 0; }
.landing { display: grid; gap: 56px; padding-bottom: 24px; }
.landing h2, .landing h3, .landing .ln-door-body > b { font-family: var(--display, var(--sans)); }
.ln-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 40px 48px; padding-top: 24px; }
.ln-hero-text { flex: 1 1 380px; min-width: 0; display: grid; gap: 16px; justify-items: start; }
.ln-hero h1 { margin: 0; font-size: calc(54px * var(--fs)); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.ln-lead { margin: 0; font-size: calc(19px * var(--fs)); line-height: 1.55; color: var(--text-2, var(--text)); max-width: 36rem; }
.ln-small { margin: 0; font-size: calc(14px * var(--fs)); color: var(--muted); max-width: 34rem; }
/* "Which is you?": the four people OneRoot is for, on the first screen; each goes to its card. */
.ln-which { margin: 4px 0 -4px; font-weight: 700; color: var(--text); }
.ln-whos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.ln-who { min-height: 50px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--accent-line); background: var(--panel); color: var(--text);
  font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.ln-who:hover { border-color: var(--accent); background: var(--accent-soft); }
.ln-who:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
/* One next step (app.js, homeNextRender): Carry on, then a returning visitor's own three tools. */
.ln-next { display: grid; gap: 12px; width: 100%; max-width: 520px; }
.home-next { max-width: 560px; width: 100%; margin-inline: auto; }
.next-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 14px 16px;
  border-radius: 14px; background: var(--accent-soft); border: 1.5px solid var(--accent-line); color: var(--text); text-decoration: none; }
.next-card:hover { border-color: var(--accent); }
.next-card:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.next-kicker { grid-column: 1; font-size: calc(12.5px * var(--fs)); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.next-card > b { grid-column: 1; font-size: calc(17px * var(--fs)); overflow-wrap: anywhere; }
.next-sub { grid-column: 1; color: var(--muted); font-size: calc(13.5px * var(--fs)); }
.next-card .next-go { grid-column: 2; grid-row: 1 / span 3; width: calc(22px * var(--fs)); height: calc(22px * var(--fs)); color: var(--accent); }
.mine-tools { display: grid; gap: 8px; }
.mine-tool { display: grid; gap: 2px; justify-content: stretch; justify-items: start; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--accent-line);
  background: var(--panel); color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.mine-tool b { font-weight: 650; }
.mine-tool span { color: var(--muted); font-size: calc(13.5px * var(--fs)); }
.mine-tool:hover { border-color: var(--accent); background: var(--accent-soft); }
.mine-tool:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.ln-again { justify-self: start; min-height: 44px; padding: 0 2px; }
.ln-door.ln-flash { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow .3s; }
.ln-door { scroll-margin-top: 80px; }        /* clear of the top bar when a "Which is you?" button brings it up */
.ln-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 12px; font-weight: 700;
  font-size: calc(16px * var(--fs)); text-decoration: none; cursor: pointer; border: 1px solid transparent; font-family: inherit; }
.ln-primary { background: var(--brass, #c4932b); color: var(--on-brass, #231a05); }
.ln-primary:hover { filter: brightness(1.06); }
.ln-secondary { background: var(--panel); color: var(--text); border-color: var(--line-2, var(--line)); }
.ln-dark { background: var(--top, #1b4332); color: #fff; justify-self: start; }
.ln-shot { flex: 1 1 420px; min-width: 0; margin: 0; padding: 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.12); }
.ln-shot figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 0 4px 10px; color: var(--muted); font-size: calc(14px * var(--fs)); }
.ln-shot figcaption b { color: var(--text); }
.ln-shot img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.ln-shot p { margin: 10px 4px 0; color: var(--muted); font-size: calc(14px * var(--fs)); }
.ln-section { display: grid; gap: 22px; scroll-margin-top: 80px; }
.ln-h { margin: 0; font-size: calc(32px * var(--fs)); font-weight: 700; color: var(--text); }
.ln-doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
/* A door is a box: its lines open their own tools, its last line (.ln-go) the part of the page it names, and a tap
   anywhere else on it does what .ln-go does (app.js, the landing's click handler). */
.ln-door { display: flex; flex-direction: column; padding: 0; text-align: left; overflow: hidden; border-radius: 16px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.ln-door:hover { border-color: var(--accent); }
.ln-door img { display: block; width: 100%; aspect-ratio: 1200 / 670; object-fit: cover; }
.ln-door-body { display: flex; flex-direction: column; gap: 8px; padding: 18px; flex: 1; }
.ln-door-body > b { font-size: calc(21px * var(--fs)); }
.ln-door-body > span:not(.ln-list):not(.ln-go) { color: var(--text-2, var(--text)); line-height: 1.5; }
.ln-list { display: grid; gap: 4px; margin-top: 4px; color: var(--muted); font-size: calc(14.5px * var(--fs)); line-height: 1.45; }
.ln-list > * { position: relative; padding-left: 16px; }
.ln-list > *::before { content: "•"; position: absolute; left: 0; color: var(--brass, #c4932b); }
/* A door's summary for phones, where its lines are hidden (below); wider screens show its description and lines. */
.ln-sum { display: none; }
.ln-pick { display: block; min-height: 0; padding: 0 0 0 16px; border: 0; border-radius: 0; background: none; color: inherit; font: inherit;
  text-align: left; cursor: pointer; }
@media (pointer: coarse) { .ln-pick { padding-block: 5px; } }
.ln-pick:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.ln-go { margin-top: auto; padding: 8px 0 0; display: inline-flex; align-items: center; align-self: flex-start; gap: 4px; border: 0; background: none;
  font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; }
.ln-pick:focus-visible, .ln-go:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; border-radius: 4px; }
.ln-band { display: grid; gap: 18px; padding: 36px clamp(18px, 4vw, 40px); border-radius: 22px; background: var(--accent-soft); scroll-margin-top: 80px; }
.ln-band-lead { margin: -8px 0 0; color: var(--text-2, var(--text)); font-size: calc(17px * var(--fs)); }
/* How a choir gets ready: who does what, as plain ruled lines (no numbered cards). */
.ln-week { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--accent-line, var(--line)); }
.ln-week li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 2px 24px; padding: 14px 0; border-bottom: 1px solid var(--accent-line, var(--line)); }
.ln-week b { color: var(--text); }
.ln-week span { color: var(--text-2, var(--text)); line-height: 1.5; }
.ln-song { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.ln-song > div { flex: 1 1 300px; min-width: 0; }
.ln-song b { font-size: calc(17px * var(--fs)); }
.ln-song p { margin: 4px 0 0; color: var(--muted); }
.ln-song-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.ln-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.ln-group { display: grid; gap: 12px; align-content: start; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); scroll-margin-top: 80px; }
.ln-group h3 { margin: 0; font-size: calc(20px * var(--fs)); color: var(--text); }
.ln-group.ln-flash { box-shadow: 0 0 0 3px var(--brass, #c4932b); transition: box-shadow .3s; }
/* The tools: plain links, one a line (no chips); a small note says which listen ("mic") or how big ("139 videos"). */
.ln-tools-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.ln-links { list-style: none; margin: 0; padding: 0; display: grid; }
.ln-links li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ln-link { padding: 5px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: calc(16px * var(--fs)); text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--line-2, var(--line)); text-underline-offset: 4px; }
@media (pointer: coarse) { .ln-link { padding-block: 9px; } }
.ln-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.ln-link:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; border-radius: 4px; }
.ln-note { font-size: calc(13px * var(--fs)); color: var(--muted); letter-spacing: .02em; }
/* Accounts: one plain line above the footer (it was a dark banner). */
.ln-join { margin: 0; max-width: 48rem; color: var(--text-2, var(--text)); line-height: 1.6; }
.ln-join a { color: var(--accent); font-weight: 700; text-underline-offset: 3px; }
@media (max-width: 600px) {
  .landing { gap: 40px; }
  .ln-hero { padding-top: 8px; gap: 28px; }
  .ln-hero h1 { font-size: calc(40px * var(--fs)); }
  .ln-lead { font-size: calc(17px * var(--fs)); }
  .ln-h { font-size: calc(26px * var(--fs)); }
  .ln-week li { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .ln-group.ln-flash { transition: none; } }
/* !important, to beat [hidden] { display: none !important } above: without it the front door waited for the scripts. */
html.landing-early #landing[hidden] { display: grid !important; }
/* A link to another page of the site: Home stays out of sight until app.js has opened that page (theme.js). */
html.deep #home { display: none; }
html.landing-early #home > :not(#landing) { display: none !important; }
.ln-door img { height: auto; }
@media (max-width: 600px) {
  /* Phones: each door a compact row (a small picture beside its words), so all four fit in about one screen. */
  .ln-doors { gap: 12px; }
  .ln-door { flex-direction: row; align-items: stretch; }
  .ln-door img { width: 108px; height: auto; aspect-ratio: auto; object-fit: cover; flex: none; }
  .ln-door-body { padding: 14px; gap: 4px; }
  .ln-door-body > b { font-size: calc(18px * var(--fs)); }
  .ln-door .ln-list { display: none; }
  .ln-door .ln-desc { display: none; }
  .ln-door .ln-sum { display: block; }
  .ln-go { padding-top: 4px; }
  .ln-shot { padding: 10px; }
}

/* A request that failed for want of a connection (app.js, netTrouble): a bar with Try again, above the tab bar. */
.net-bar { position: fixed; z-index: 1200; left: 50%; transform: translateX(-50%); bottom: 20px; width: max-content; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); font-size: calc(14px * var(--fs)); }
.net-bar span { flex: 1 1 auto; }
.net-bar button { flex: none; }
@media (max-width: 900px) { .net-bar { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); } }

/* The young path's tools (review CH-07): the step chose the settings, so they're put away, with the key's name and the
   long introduction; Pip and the step's one sentence sit at the top instead (app.js, ypStepCard). */
body[data-young] :is(#solfa, #warmup, #onkey, #scoreit, #findkey) .ss-opts,
body[data-young] :is(#solfa, #warmup, #onkey, #scoreit, #findkey) .trainer-head p.muted,
body[data-young] :is(#ssKeyName, #okKey, #wuFit, #ssRange) { display: none; }
.yp-step { display: none; }
body[data-young] .yp-step { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; padding: 14px 16px;
  border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--line-2); }
.yp-step-text { flex: 1 1 220px; display: grid; gap: 2px; font-size: calc(17px * var(--fs)); line-height: 1.4; }
.yp-step-text b { font-size: calc(19px * var(--fs)); }
.yp-read { flex: none; }
.yp-mic-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.yp-mic-head h2 { margin: 0; }

/* The score (review AX-05): taller notes to tap on a phone, and the one the arrows are on clearly marked. */
.ch-n { min-height: 24px; min-width: min(24px, 100%); }
.ch-n:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 0; background: var(--accent-soft); color: var(--text); }
.ss-note[aria-current="step"] b { text-decoration: underline; text-underline-offset: 4px; }

/* High-contrast mode (review AX-06): the browser draws its own colours, so the chosen button, the current step and the
   switches are marked with borders and system colours, not only the page's own colours. */
@media (forced-colors: active) {
  button[aria-pressed="true"], .prog-step.now, .ss-note[aria-current="step"] {
    outline: 3px solid Highlight; outline-offset: 1px; forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .switch, .toggle input, input[type="checkbox"], input[type="radio"] { forced-color-adjust: auto; border: 1px solid CanvasText; }
  .ch-n.good, .ch-n.high, .ch-n.low, .ch-n.wrong { text-decoration: underline; }
  .fs-key.got { outline: 3px solid Highlight; outline-offset: -4px; }
}

/* The tabs' hubs (app.js, HUBS; review PX-07): everything for keys players, or for singers, as a list of cards. */
.hub-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 8px; }
.hub-item { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); text-decoration: none; font: inherit; cursor: pointer; min-height: 64px; }
.hub-item:hover { background: var(--panel-3); }
.hub-item > i { grid-row: 1 / span 2; width: calc(24px * var(--fs)); height: calc(24px * var(--fs)); color: var(--accent); display: grid; place-items: center; }
.hub-item > b { font-size: calc(16px * var(--fs)); font-weight: 650; }
.hub-item > span { grid-column: 2; font-size: calc(13.5px * var(--fs)); color: var(--muted); }

/* All tools (the Tools menu): a search box at its top; Close and the top bar's search button on phones only. */
.tools-find { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; padding: 4px 4px 8px; }
.tools-find input { flex: 1 1 auto; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font: inherit; }
.tools-close, .find-btn { display: none; }
.tools-none { grid-column: 1 / -1; padding: 8px 12px; }
.tools-menu [hidden] { display: none !important; }
@media (max-width: 900px) {
  body:not(.child-mode) .find-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border-radius: 10px; border: 1px solid rgba(255, 255, 255, .28); background: none; color: var(--top-ink); }
  .find-btn .i { width: 20px; height: 20px; }
  #appnav #toolsBtn { display: none; }
  /* On a phone the menu is a sheet over the page, from under the top bar to the bottom. */
  #toolsMenu:not([hidden]) { position: fixed !important; top: 0 !important; left: 0 !important; right: 0; bottom: 0 !important;
    width: auto !important; max-width: none !important; max-height: none !important; border-radius: 0; overflow-y: auto; z-index: 1300;
    padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); grid-template-columns: 1fr;
    align-content: start; grid-auto-rows: min-content; }
  .tools-find { position: sticky; top: -12px; z-index: 1; background: inherit; padding: 12px 4px 10px; margin: -12px 0 0; }
  .tools-close { display: inline-flex; }
}

/* A tool on a phone (review PX-06): its Play or Start in reach without scrolling. The row of controls stays at the
   bottom of the screen, above the tabs, while its tool is on screen; the photo is a short strip; the introduction
   is two lines, with More (app.js, introMore); Watch it done is just its button. */
@media (max-width: 700px) {
  body:not(.stage-mode) .panel > .prog-controls, body:not(.stage-mode) #findkey .fk-stage > .si-actions {
    position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px); z-index: 6;
    top: 62px;                                       /* and under the top bar while the score below it is read (PX-04) */
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
  /* One line: the main button first, the others along it (it scrolls sideways when they don't all fit). */
  body:not(.stage-mode) .panel > .prog-controls { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; scrollbar-width: none; }
  body:not(.stage-mode) .panel > .prog-controls::-webkit-scrollbar { display: none; }
  body:not(.stage-mode) .panel > .prog-controls > * { flex: none; white-space: nowrap; min-height: 44px; width: auto; }
  body:not(.stage-mode) .panel > .prog-controls > .primary { order: -1; }
  /* Its right edge fades while more controls are off to the side (app.js, wireStripCue; review PX-04). The fade is
     the bar's own colour over its last control, not a see-through edge: under the top bar, what scrolls beneath
     the bar showed through. */
  body:not(.stage-mode) .panel > .prog-controls.more-right::after {
    content: ""; flex: none; align-self: stretch; position: sticky; right: -8px; width: 44px; margin: -8px -8px -8px -44px;
    background: linear-gradient(to right, transparent, var(--panel) 85%); pointer-events: none; border-radius: 0 14px 14px 0; }
  .trainer-head.with-art .head-art { height: 84px; width: 100%; object-fit: cover; border-radius: 14px; }
  .trainer-head p.intro:not(.open) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .watch .watch-by { display: none; }
  .watch.open .watch-by { display: block; }
}
.intro-more { display: none; }
/* A hymn's credit on a phone: one line, with More for the rest (app.js). */
.ch-credit-more { display: none; }
@media (max-width: 700px) {
  #choir .ch-credit:not(.open):not(:empty) { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0; }
  #choir.ch-practise .ch-credit:not(.open):not(:empty) + .ch-credit-more { display: inline-flex; justify-self: start; align-self: start; align-items: center; min-height: 44px; padding: 0 8px; margin: -4px 0 2px -8px; }
}
@media (max-width: 700px) { .intro-more { display: inline-flex; justify-self: start; align-self: start; margin: -2px 0 6px; } .intro.open + .intro-more { display: none; } }
/* A tablet held upright gets the same two-line introduction with More (the where-next plan: fewer words above the tool). */
@media (min-width: 701px) and (max-width: 900px) {
  .trainer-head p.intro:not(.open) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .intro-more { display: inline-flex; justify-self: start; align-self: start; margin: -2px 0 6px; min-height: 44px; padding: 0 8px; }
  .intro.open + .intro-more { display: none; }
}
/* First-time hint (app.js, hintShow): one line where the tool is, with a close button. */
.first-hint { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 6px 10px 12px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--text); }
.first-hint > span { flex: 1 1 auto; min-width: 0; padding-top: 2px; }
.first-hint .hint-ico { flex: none; width: calc(18px * var(--fs)); height: calc(18px * var(--fs)); margin-top: 3px; color: var(--accent); }
.hint-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -10px 0 -10px 0;
  padding: 0; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.hint-x:hover { color: var(--text); background: var(--panel-3); }
.hint-x .ico { width: 18px; height: 18px; }

/* A tablet held upright (701 to 900 px, with the tab bar): the row of controls stays in reach too, wrapped onto two lines
   if it needs them, so Play doesn't scroll away above the score (review PX-04). */
@media (min-width: 701px) and (max-width: 900px) {
  body:not(.stage-mode) .panel > .prog-controls {
    position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px); top: 66px; z-index: 6;
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
}
/* What the keyboard reaches is scrolled clear of that row as well as the tabs (review AX-02). */
@media (max-width: 700px) {
  html:has(.panel:not(.hidden) > .prog-controls) { scroll-padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 92px); scroll-padding-top: 140px; }
}
@media (min-width: 701px) and (max-width: 900px) {
  html:has(.panel:not(.hidden) > .prog-controls) { scroll-padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 140px); scroll-padding-top: 190px; }
}
/* A short screen (a phone on its side, a laptop zoomed to 200% or more): the top bar and the row of controls scroll
   with the page, so what's being read isn't squeezed between three bars (review AX-02). */
@media (max-height: 500px) {
  .topbar { position: static; }
  html { scroll-padding-top: 8px; }
  body:not(.stage-mode) .panel > .prog-controls { position: static; box-shadow: none; }
  html:has(.panel:not(.hidden) > .prog-controls) { scroll-padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); scroll-padding-top: 8px; }
}
/* Room kept for what arrives a moment after the page (review EN-03): the hymn's parts and score, and a course page,
   so the rest doesn't jump down when they come. */
#chParts:empty { min-height: 44px; }
/* Practising a hymn, its credit line and how the part fits a voice always come: their lines are kept (these rules
   come after .panel > p:empty and .ch-score:empty, which hide empty ones). */
#choir.ch-practise #chCredit:empty, #choir.ch-practise #chFit:empty { display: block; min-height: 1.5em; }
#choir.ch-practise #chScore:empty { display: block; }
#progAbout:empty { display: block; min-height: 1.5em; }   /* the progression's line, before it's written */
/* The scrollbar's room kept from the start, so a long page arriving doesn't narrow everything by its width. */
html { scrollbar-gutter: stable; }
#choir.ch-practise #chScore:empty { min-height: 420px; }
#cview .c-main:has(> .page-loading) { min-height: 100dvh; }
/* "Loading…" as the course's look (course.css) will place it, before that has come: its own top margin otherwise ran
   out through the course's page and pushed it 14 px down until then. */
#cview .page-loading { margin: 0; padding: 15vh 0; text-align: center; color: var(--muted); }
/* A course page keeps a screen's height, so a short one (Log in) doesn't pull its footer up into view as it draws. */
#cview .c-main { min-height: calc(100dvh - 120px); }

/* Keyboards a finger wide on a phone (review CH-03, MU-07, AX-06). First keys shows an octave or so there (app.js,
   fsRange), and its black keys are a little wider; the lessons' keyboards keep both octaves, each key at least 44 px,
   in a strip that scrolls sideways to the marked keys (thKeysInView). */
.th-keys-scroll { max-width: 720px; min-width: 0; }
.th-w > *, #scBoard, #scBoard > * { min-width: 0; max-width: 100%; }      /* a lesson's parts may shrink, so a wide keyboard scrolls in its strip, not the page */
@media (max-width: 499px) {
  .fs-key.b { width: calc(100% / var(--whites) * .78); left: calc(100% / var(--whites) * var(--at) - 100% / var(--whites) * .39); }
  .th-keys-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .th-keys-scroll .th-keys { min-width: calc(var(--whites) * 44px); }
  .th-key.b { width: calc(100% / var(--whites) * .64); left: calc(100% / var(--whites) * var(--at) - 100% / var(--whites) * .32); }
  .th-fig .th-keys-scroll .th-keys { min-width: 0; }      /* a quiz's one octave fits as it is */
}

/* Buttons a child taps on the young path, 48 px at least (review CH-06): the stage's steps, the microphone card and
   "Ask a grown-up". */
.yp-sheet button, .yp-sheet .yp-play, .yp-nomic-link, #ypMic button, .yg-ask button { min-height: 48px; }
.yp-x { width: 48px; height: 48px; }
/* On a touch screen, the small links get room for a finger (review PX-07, AX-10): the footer's (Privacy, Contact),
   More under an introduction, and the theory courses' "Also:" line. */
@media (pointer: coarse) {
  .site-foot a, #cview .footer a, #cview .footer .linkish { display: inline-block; padding: 10px 4px; }
  .intro-more { min-height: 44px; padding: 0 8px; }
  .th-also button, .th-also a { min-height: 44px; padding: 0 6px; }
}
#chFit .linkish { min-height: 24px; }
.prog-tempo input[type=range] { min-height: 24px; }

/* A hymn on a staff (app.js, chStaff): dark ink on paper as the printed score is; the bar playing shaded. */
.ch-view { width: fit-content; margin: 4px 0 -4px; }
.ch-view button { min-height: 40px; padding: 0 18px; }
.ch-staff { background: #f7f4ec; color: #1b1b1b; border-radius: 12px; padding: 10px 6px 4px; }
.chs-line svg { display: block; width: 100%; height: auto; }
.chs-line + .chs-line { margin-top: 2px; }
.chs-bar { fill: transparent; }
.chs-bar.now { fill: rgba(212, 160, 23, .2); }

/* Singer games on the sight-singing page (app.js, ssModeSet): Tune of the day and Echo. */
.ss-mode { width: fit-content; max-width: 100%; }
.ss-mode button { min-height: 40px; padding: 0 14px; }
.ss-game { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.ss-game p { margin: 0; }
.ss-game [data-echo-again] { justify-self: start; }
.ss-card { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.ss-card > b { font-size: calc(20px * var(--fs)); letter-spacing: .12em; color: var(--accent); }
.ss-card button { margin-left: auto; }
/* The tune of the day is read, not chosen: no notes, length or line-first; Echo keeps its notes but sings from memory. */
#solfa[data-mode="tune"] .ss-opts, #solfa[data-mode="tune"] #ssNext { display: none; }
#solfa[data-mode="echo"] .ss-opts label:has(#ssLen), #solfa[data-mode="echo"] .ss-opts label:has(#ssEcho), #solfa[data-mode="echo"] #ssNote { display: none; }
.ss-note.hid b { color: var(--muted); }
@media (max-width: 420px) { .ss-mode button { padding: 0 10px; } }

/* The live pitch line while you sing your part (app.js, chTraceDraw). */
.ch-trace { display: grid; gap: 4px; padding: 10px 12px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.ch-trace canvas { width: 100%; height: 120px; display: block; }
.ch-trace p { margin: 0; }
.ch-trace-bar, .ch-trace-line { display: inline-block; width: 18px; vertical-align: middle; border-radius: 4px; }
.ch-trace-bar { height: 8px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.ch-trace-line { height: 3px; background: var(--accent); }

/* Small moments (the where-next plan, session 6): a tick that pops when a practice is finished, a young star that pops
   when it's earned, and the folds (Change, More options) that open smoothly. None of it moves where motion is turned down. */
.pop-tick { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: 8px; border-radius: 50%; vertical-align: -0.3em;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .95em; }
@keyframes pop-in { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); } }
@keyframes star-pop { 0% { transform: scale(.2) rotate(-40deg); opacity: 0; } 55% { transform: scale(1.45) rotate(12deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@media (prefers-reduced-motion: no-preference) {
  .pop-tick { animation: pop-in .55s cubic-bezier(.2, 1.6, .4, 1) both; }
  .yg-ch.new .yg-star { animation: star-pop .8s cubic-bezier(.2, 1.4, .4, 1) both; }
  #ygStars.bump { display: inline-block; animation: pop-in .6s cubic-bezier(.2, 1.6, .4, 1) .3s both; }
  :root { interpolate-size: allow-keywords; }
  details.tool-settings::details-content, details.prog-all::details-content {
    block-size: 0; overflow: clip; transition: block-size .28s ease, content-visibility .28s allow-discrete; }
  details.tool-settings[open]::details-content, details.prog-all[open]::details-content { block-size: auto; }
}

/* A song worked out online (app.js, renderMix): the chart plays in the browser; the Mac's sound pickers make way for a line. */
body.mix-browser #mixVoiceRow, body.mix-browser .mix-part { display: none !important; }
.mix-mac { margin: 2px 0 6px; grid-column: 1 / -1; }
.mix-mac a, #chordNotes a, #melodySource a { color: var(--accent); }
