/* TabbyGato layout C (Nikhil chose it on November 9, 2026) in the Desk look (Nikhil chose it on November 10):
   the music across the full width, the song's sections as a strip across the top, every practice control in
   its own fixed slot along the bottom, and every option on one of five tabs in a shelf attached above those
   controls (one Options button opens the shelf; Nikhil, November 12). Nothing floats over the music and using one control never moves another.

   The Desk look: the paper is the brightest surface and the bars around it are a cooler, deeper color, so the
   eye can tell the music from the controls. Controls have no outlined boxes. Play is the one filled control.
   A control that is on fills with the accent's soft color and its words turn the accent color, with no
   underline (Nikhil, November 10: the underline added weight). Color never works alone: a picked choice
   also gets a tick, and a button that is on also changes a word or its icon. A choice that is not picked
   sits back in grey. Only a value you can type or pick from a menu has an underline. Text in the controls comes in two sizes: 15px for values and 12px for labels.
   One green accent is for controls; the blue stays with the playing marks in the music, so "where the music
   is" and "what you can press" never share a color. */
/* Every color, size and time comes from tokens.css, the one file the app and the website share
   (docs/DESIGN_SYSTEM.md). The app's rules keep their short names, and each short name points at the shared
   name, so the dark look needs no second list here: tokens.css switches every shared value. */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/Geist-Variable.woff2") format("woff2"); /* SIL Open Font License: fonts/OFL.txt */
}
@font-face {
  font-family: "Tabbygato Display"; font-style: normal; font-weight: 900; font-display: swap;
  src: url("../fonts/TabbygatoDisplay-Heavy.woff2") format("woff2"); /* the first-open welcome headline only */
}
:root {
  --bg: var(--tg-paper);          /* the music's paper: the brightest surface on the screen */
  --chrome: var(--tg-desk);       /* the desk: the bars around the music */
  --surface: var(--tg-card);      /* a light face on the desk: section blocks, part lanes, key caps */
  --hover: var(--tg-hover);       /* the soft face of a choice, and of a control under the pointer */
  --ink: var(--tg-ink);
  --muted: var(--tg-ink-soft);
  --line: var(--tg-line);         /* quiet dividers only */
  --edge: var(--tg-edge);         /* underlines, slider tracks and lane edges: at least 3 to 1 against the desk */
  --field: var(--tg-field);
  --accent: var(--tg-accent);
  --accent-ink: var(--tg-accent-ink);
  --accent-soft: var(--tg-accent-soft);  /* the fill of a control that is on */
  --off: var(--tg-off);           /* the quiet face of a choice that is not picked */
  --play: var(--tg-play);         /* the playing marks: the line, the shaded bar, the marker on the song map */
  --cursor-bar: var(--tg-play-bar);
  --cursor-beat: var(--tg-play-beat); /* darker than the staff lines, lighter than the notes: 3.1 to 1 on the paper in the light look */
  --shade-now: var(--tg-play-shade);
  --home-ink: var(--tg-home-note); /* the home-note mark (RD-2): amber notes, apart from the blue playing marks */
  --mute-on: var(--tg-mute); --mute-soft: var(--tg-mute-soft); --solo-on: var(--tg-solo); --solo-soft: var(--tg-solo-soft); /* mixing-desk colors */
  /* Song map section colors: one soft color for each section name (verse, chorus...) */
  --sec-0: var(--tg-section-1); --sec-1: var(--tg-section-2); --sec-2: var(--tg-section-3); --sec-3: var(--tg-section-4); --sec-4: var(--tg-section-5); --sec-5: var(--tg-section-6);
  --selection: var(--tg-selection);
  --warn: var(--tg-problem); --warn-soft: var(--tg-problem-soft); /* a problem: amber words on a warm amber face, with a warning icon */
  --done: var(--tg-done); --done-soft: var(--tg-done-soft);       /* good news: teal green words on a cool face, with a tick */
  --status-h: 48px;
  /* On a very wide screen the app stops growing (Nikhil, November 10): the music keeps a page 1600px wide in the
     middle, like a sheet on the desk, and every bar's contents line up with that page. The bars' color still
     runs the full width. --gutter is the room on each side of the contents. */
  --page-max: var(--tg-page-max);
  --gutter: max(16px, calc((100vw - var(--page-max)) / 2 + 16px));
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: flex; flex-direction: column;
  background: var(--chrome); color: var(--ink);
  font: 15px/1.4 var(--tg-font-text);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2 { margin: 0; font-weight: 700; }
::selection { background: var(--accent-soft); color: var(--ink); }
.sprite { position: absolute; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.s { width: 16px; height: 16px; }
.icon.l { width: 26px; height: 26px; }
.fine { color: var(--muted); font-size: var(--tg-type-note); margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- One control for the whole app: an icon over a short label, with no box around it ---------- */
.cell {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 44px; margin: 0; padding: 2px 8px;
  font: inherit; font-size: var(--tg-type-label); font-weight: 600; line-height: 1.15; white-space: nowrap; color: var(--ink);
  background: transparent; border: 1px solid transparent; border-radius: 10px; cursor: pointer;
}
.cell small { font-size: var(--tg-type-caption); font-weight: 500; color: var(--muted); }
.cell:hover:not(:disabled) { background: var(--hover); }
.cell:disabled { color: var(--muted); opacity: 0.5; cursor: default; }
.cell.row { flex-direction: row; gap: 6px; padding: 0 12px; }
.cell.small { min-height: 32px; padding: 0 10px; }
/* Play, and Open file on the start screen: the one filled control on its screen. */
.cell.primary { background: var(--accent); color: var(--accent-ink); }
.cell.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.cell.primary:disabled { background: transparent; color: var(--muted); }
/* The count-in's count (1 2 3 4) takes the icon's place on the Play button, one number a click. */
.count-num { height: 26px; font-size: var(--tg-type-count); line-height: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.play.counting .icon { display: none; }
.count-num.tick { animation: count-tick var(--tg-time-pop) var(--tg-ease-out); }
@keyframes count-tick { from { transform: scale(1.3); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .count-num.tick { animation: none; } }
/* On: the accent's soft fill and the accent color for the words. The button also changes a word or its icon
   ("Loop on", "Muted", an open eye), or opens its panel, so "on" never rests on color alone. */
.cell:not(.primary)[aria-pressed="true"], .cell[aria-expanded="true"], .cell.on { background: var(--accent-soft); color: var(--accent); }
.cell[aria-pressed="true"] small, .cell.on small { color: var(--accent); }

/* A row of choices: the picked one fills with the accent's soft color and gets a tick; the others sit back in grey. */
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; margin: 0; padding: 0 10px;
  font: inherit; font-size: var(--tg-type-chip); font-weight: 500; color: var(--muted); white-space: nowrap;
  background: var(--off); border: 1px solid transparent; border-radius: 8px; cursor: pointer;
}
.chip:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.chip:disabled { opacity: 0.5; background: transparent; cursor: default; }
.chip[aria-pressed="true"], .chip[aria-pressed="true"]:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.chip[aria-pressed="true"]::before {
  content: ""; width: 9px; height: 5px; margin: 0 2px 3px 0; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
}
/* Pressed (build 146): for as long as a press lasts, the control under the pointer takes the accent's soft fill at
   three-quarter strength, with no movement, so a press answers at the spot of the press. Play and the other
   filled buttons darken instead. A number box (.cell.num) is typed into, so it has no pressed look.
   These two rules sit after the button's and the chip's own rules, so the pressed look wins over the hover look. */
.cell:active:not(:disabled):not(.primary):not(.num), .chip:active:not(:disabled), .chip[aria-pressed="true"]:active:not(:disabled) { background: color-mix(in srgb, var(--accent-soft) 75%, transparent); }
.cell.primary:active:not(:disabled) { filter: brightness(0.92); }
.seg-note { align-self: center; font-size: var(--tg-type-note); color: var(--muted); margin: 0 4px; }
/* A set of choices that belong together, such as the twelve notes: closer, narrower, and kept on one line. */
.seg-set { display: inline-flex; flex-wrap: nowrap; gap: 2px; margin-left: 4px; }
.seg-set .chip { min-width: 30px; padding: 0 7px; justify-content: center; }

/* Sliders, and the values you can type or pick. A slider is a thin track with a plain dot. A typed or picked
   value has an underline in place of a box. */
input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1 1 auto; min-width: 60px; height: 44px; margin: 0; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: var(--tg-corner-round); background: var(--edge); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: var(--tg-corner-round); background: var(--edge); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7.5px; border: 0; border-radius: 50%; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--accent); }
input[type="range"]:focus-visible { outline-offset: -4px; border-radius: 8px; }
input[type="number"] {
  font: inherit; font-size: var(--tg-type-value); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); text-align: center;
  width: 44px; height: 24px; padding: 0; border: 0; border-bottom: 2px solid var(--edge); border-radius: 0; background: transparent;
  -moz-appearance: textfield; appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"]:focus { outline: none; border-bottom-color: var(--accent); }
.cell.num { cursor: text; padding: 2px 4px; gap: 3px; }
.cell.num:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.cell.num:has(input:disabled) { opacity: 0.5; cursor: default; }
.cell.num:has(input:disabled):hover { background: transparent; }
select {
  font: inherit; font-size: var(--tg-type-chip); color: var(--ink); background: var(--hover);
  border: 0; border-bottom: 2px solid var(--edge); border-radius: 6px 6px 0 0; padding: 0 6px; min-height: 32px; max-width: 100%;
}

/* ---------- Top bar ----------
   Three groups on one 4px scale. The app's name stands first, with the Home button beside it in the slot Open
   file had (Nikhil, November 13); the next slot, where Recent was, stays empty. The song's name sits in the
   middle. The shelf's buttons sit on the right. Every button has the same 72px slot with 4px between slots, so
   the icons keep one even step. 32px sets the app's name apart from Home, and at least 24px sets the song's
   name apart from the buttons.
   Text climbs in steps of 3px: 12px for labels, 15px for the artist, 18px for the song's name. The song's name
   shares a row with the icons, and the line under the name shares a row with the labels.
   The bar leaves 6px above and below its buttons, and the song map starts right under the bar. */
.topbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 4px; height: 56px;
  padding: 0 var(--gutter); background: var(--chrome);
}
/* The logo is a button that shows Home. The button's face reaches 8px past the drawing on every side, and the
   margins take those 8px back, so the drawing sits where it sat while it was a picture. */
.app-name {
  display: inline-flex; align-items: center; margin: 0 20px 0 -8px; padding: 8px; color: var(--ink);
  font: inherit; background: transparent; border: 0; border-radius: 10px; cursor: pointer;
}
.app-name:hover:not(:disabled) { background: var(--hover); }
.app-name:disabled { cursor: default; } /* before a song opens, the start screen is Home already */
/* The logo's box. logo-fx.css draws the logo and its effects inside the box, and the box needs a set width for them. */
.app-logo { --logo-h: 28px; height: var(--logo-h); width: calc(var(--logo-h) * 1552 / 439); flex: none; }
.topbar .cell { width: 72px; padding: 2px 0; }
/* The song's name is a button that opens the song's details (Nikhil chose this on November 10). The button is
   as wide as its words, a small arrow after the artist says the name opens, and the arrow turns over while
   the details are open. The first button after the name takes the spare room, so the right-hand group stays right. */
.song {
  flex: 0 1 auto; min-width: 0; height: 44px; margin: 0 auto; padding: 0 10px 0 8px;
  display: flex; align-items: center;
  font: inherit; color: inherit; text-align: left; background: transparent; border: 0; border-radius: 10px; cursor: pointer;
}
/* The song's name, artist, tempo and key sit in the middle of the window (Nikhil, November 12), kept clear of
   the logo and Home on the left by the same room on the right. A window 900px wide or narrower centers them in
   the room right of Home instead. */
@media (min-width: 901px) {
  .topbar { position: relative; }
  .song { position: absolute; left: 50%; transform: translateX(-50%); max-width: calc(100% - 2 * var(--top-side, 250px)); }
  /* The tempo and the key each keep a set width (build 144), so the song's name holds its place when a speed
     press takes the tempo from three digits to two, or a new key has a longer name. 89px holds "125 BPM", and
     118px holds the longest key, "B flat minor". The tempo sits against its right edge, so "BPM" stays put too. */
  #songTempo { min-width: 89px; text-align: right; }
  /* Share (build 330) hangs just right of the centered name, so the name keeps its place: main.mjs writes the name's
     half width into --song-half whenever the name's width changes. */
  .top-share { position: absolute; top: 6px; left: calc(50% + var(--song-half, 0px) + 8px); }
  #songKey { min-width: 118px; }
}
.song:hover:not(:disabled) { background: var(--hover); }
.song:disabled { cursor: default; }
.song[aria-expanded="true"] { background: var(--accent-soft); }
.song[aria-expanded="true"] .icon { transform: rotate(180deg); }
.song-title { display: flex; align-items: baseline; max-width: 100%; min-width: 0; font-size: var(--tg-type-beside); color: var(--muted); line-height: 22px; }
.song-title strong, .song-title > span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-title strong { color: var(--ink); font-size: var(--tg-type-song); font-weight: 700; letter-spacing: -0.01em; margin-right: 8px; }
.song-title .icon { align-self: center; margin-left: 4px; color: var(--muted); }
.song-title { flex: 0 1 auto; }
/* The tempo and the key sit on the title's line, each after a thin upright divider (Nikhil, November 12).
   A narrow window stacks them under the title instead (see max-width: 900px). */
.song-sub { flex: 0 0 auto; display: flex; align-items: center; margin-left: 12px; white-space: nowrap; font-size: var(--tg-type-beside); line-height: 22px; color: var(--muted); }
/* A double-click edits either one; a dotted underline on hover says so. */
.song-edit { padding: 0 12px; border-left: 1px solid var(--edge); cursor: text; font-variant-numeric: tabular-nums; }
.song-edit:hover { color: var(--ink); text-decoration: underline dotted; text-underline-offset: 3px; }
.title-edit { position: absolute; z-index: 60; }
.title-edit input.title-tempo { width: 92px; height: 24px; padding: 0 7px; font-size: var(--tg-type-value); font-weight: 700; text-align: left;
  background: var(--field); border: 1px solid var(--accent); border-radius: var(--tg-corner-mark); }
.title-keys { display: grid; gap: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; box-shadow: 0 0 0 2px var(--accent-soft); }
.title-key-ideas, .title-key-notes, .title-key-mode { display: grid; gap: 4px; }
.title-key-ideas, .title-key-mode { grid-template-columns: 1fr 1fr; }
.title-key-notes { grid-template-columns: repeat(6, 1fr); }
.title-keys button { padding: 4px 8px; font: inherit; font-size: var(--tg-type-chip); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: var(--tg-corner-mark); cursor: pointer; white-space: nowrap; }
.title-keys button:hover, .title-keys button:focus-visible { border-color: var(--accent); }
.title-key-marks { display: flex; align-items: center; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.title-key-marks span { flex: 1 1 auto; font-size: var(--tg-type-note); color: var(--muted); padding-right: 8px; white-space: nowrap; }
.title-keys button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* ---------- The song map (RD-13): the song's sections as a strip across the top. Each section is a block:
   its name on top and, under the name, how busy the part on the page is in each bar. ---------- */
.song-map { flex: 0 0 auto; position: relative; padding: 0 var(--gutter) 8px; background: var(--chrome); user-select: none; touch-action: none; }
.map-body { position: relative; }
.map-track { position: relative; height: 54px; cursor: pointer; } /* build 297: the section row (21), the loop lane (16), the busy row (13) */
.map-num { position: absolute; top: 3px; transform: translateX(-50%); font-size: var(--tg-type-badge); color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.map-section {
  position: absolute; top: 0; bottom: 0; margin: 0; padding: 0; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  font: inherit; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid transparent; border-radius: 6px;
}
.map-section .map-head-row { display: flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; font-size: var(--tg-type-map); font-weight: 700; white-space: nowrap; }
.map-section[data-hue="0"] .map-head-row { background: var(--sec-0); } .map-section[data-hue="1"] .map-head-row { background: var(--sec-1); }
.map-section[data-hue="2"] .map-head-row { background: var(--sec-2); } .map-section[data-hue="3"] .map-head-row { background: var(--sec-3); }
.map-section[data-hue="4"] .map-head-row { background: var(--sec-4); } .map-section[data-hue="5"] .map-head-row { background: var(--sec-5); }
/* Build 297: the section the music is in gets a 2 pixel blue underline at the foot of its name row, so blue always
   means where the music is. A chosen section gets an ink outline, dashed with Loop off and solid with Loop on. Green
   stays for loops alone. */
.map-section.now .map-head-row { box-shadow: inset 0 -2px 0 var(--play); }
.map-section.chosen { border: 2px dashed var(--ink); }
.map-section.chosen.looping { border-style: solid; }
.map-name { overflow: hidden; text-overflow: ellipsis; }
.map-bar { flex: none; font-size: var(--tg-type-badge); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.map-same { flex: none; font-size: var(--tg-type-badge); font-weight: 500; color: var(--muted); border: 1px solid currentColor; border-radius: var(--tg-corner-mark); padding: 0 3px; line-height: 13px; }
.map-section:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 2; }
.map-busy { position: absolute; left: 0; bottom: 2px; width: 100%; height: 13px; fill: var(--ink); pointer-events: none; }
/* The busy meter (Nikhil, November 9): one height, deeper shades for busier bars. */
.busy-0 { opacity: 0.07; } .busy-1 { opacity: 0.22; } .busy-2 { opacity: 0.45; } .busy-3 { opacity: 0.75; }
.map-rest {
  position: absolute; bottom: 2px; height: 13px; margin: 0; padding: 0; border: 0; border-top: 1px dashed var(--edge);
  background: transparent; color: var(--muted); font: inherit; font-size: var(--tg-type-badge); line-height: 12px; cursor: pointer; overflow: hidden; white-space: nowrap;
}
.map-rest::after { content: ""; position: absolute; inset: -6px 0; } /* a taller place to click */
.map-rest:hover, .map-rest:focus-visible { color: var(--accent); background: var(--accent-soft); }
/* Build 297: the loop lane. Every loop is an open green bracket (a line with two short ends) on its own lane under the
   section row, so a loop never looks like a section and may cross a section's edge. The open range is a bold bracket,
   dashed while Loop is off and solid, over a soft green wash, while Loop is on. A saved loop that isn't open is a faint
   thin bracket. Two rows of 8 pixels hold loops that overlap. The brackets are marks to look at, not buttons. */
.map-lane { position: absolute; left: 0; right: 0; top: 23px; height: 16px; pointer-events: none; }
.map-pick, .map-loop, .map-ghost { position: absolute; top: 25px; height: 6px; box-sizing: border-box; border: 2.5px dashed var(--accent); border-bottom: 0; border-radius: 0; background: none; pointer-events: none; }
.map-loop { border-style: solid; background: var(--accent-soft); }
.map-ghost { border: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent); border-bottom: 0; }
.map-pick.row-1, .map-loop.row-1, .map-ghost.row-1 { top: 33px; }
.map-lane > .map-ghost { top: 2px; } .map-lane > .map-ghost.row-1 { top: 10px; } /* a recording's saved loops sit inside the lane itself */
/* Build 297: on a phone, when a section's name doesn't fit its block, one row under the map names the section the
   music is in, with a short blue line that matches the blue underline on its block. */
.map-name-row { display: flex; align-items: center; gap: 6px; height: 20px; padding-top: 2px; font-size: var(--tg-type-note); color: var(--ink); white-space: nowrap; overflow: hidden; }
.map-name-row[hidden] { display: none; }
.map-name-row::before { content: ""; flex: none; width: 12px; height: 2px; background: var(--play); }
.map-name-row span { overflow: hidden; text-overflow: ellipsis; }
.map-now { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; border-radius: var(--tg-corner-round); background: var(--play); pointer-events: none; }

/* ---------- Music area ---------- */
main { position: relative; flex: 1 1 auto; min-height: 0; display: flex; overflow: hidden; background: var(--bg); width: min(100%, var(--page-max)); align-self: center; }
body.no-song main { width: 100%; } /* the start screen keeps the whole window */
/* isolation keeps everything drawn in the music (bar shading, cursor) under the drop target */
.score-wrap { position: relative; isolation: isolate; flex: 1 1 auto; overflow: auto; padding: 12px 16px 24px; scrollbar-color: var(--edge) transparent; }
#score { position: relative; min-height: 300px; }
/* The Focus view swaps the drawing: the music fades out, redraws unseen, and fades in (main.mjs, drawFocus). */
#score { transition: opacity var(--tg-time-quick) linear; }
#score.swap { opacity: 0; }
@media (prefers-reduced-motion: reduce) { #score { transition: none; } }
/* RD-15: while the Moving score glides, the music gets its own layer, so the browser can slide it by a
   fraction of a pixel without redrawing it. */
body.gliding #score { will-change: transform; }
/* PM-5: a soft band behind the part the student follows, with "Yours" up the left margin */
.follow-bands { position: absolute; inset: 0; pointer-events: none; }
.follow-band { position: absolute; border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, transparent); }
.follow-tag { position: absolute; left: -30px; top: 50%; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl; padding: 7px 1px;
  border-radius: var(--tg-corner-mark); font: 700 var(--tg-type-badge)/16px var(--tg-font-text); color: var(--accent-ink); background: var(--accent); white-space: nowrap; }
/* The Moving score is one long line, so "Yours" rides along at the left edge of the view instead. */
.follow-band.moving { display: flex; align-items: center; }
.follow-band.moving .follow-tag { position: sticky; left: 4px; top: auto; transform: rotate(180deg); }
/* Home, the start screen: the logo, the headline and Open file in the middle; under them the shelves, three
   across (Nikhil chose shelves on November 13; see "Home's shelves" below). */
.empty {
  margin: auto; width: 100%; max-width: 1240px; max-height: 100%; overflow: auto; padding: 32px 20px; text-align: center;
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px 40px; justify-items: center; align-items: start;
}
.empty > * { grid-column: 1 / -1; }
.empty h1 { font-size: 24px; letter-spacing: -0.01em; text-wrap: balance; }
/* The first-open welcome is the one headline in the app set in the Tabbygato font (Nikhil, November 12: very
   selective use). The everyday headline, every control, every number and every message stay in Geist. */
.empty h1.welcome { font-family: var(--tg-font-display); font-size: var(--tg-text-display-s); font-weight: 900; line-height: 1.15; letter-spacing: 0; font-synthesis: none; }
.empty p { margin: 0; color: var(--muted); }
.empty .cell.primary { min-height: 48px; padding: 0 22px; font-size: 15px; }
/* Open file and Add a folder, side by side (song labels plan, step 6). Open file keeps the strong look. */
.home-open { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.home-open .cell { min-height: 48px; padding: 0 16px; font-size: 15px; }
.home-open #folderBtn { background: var(--off); }
.home-open #folderBtn:hover { background: var(--hover); }
.empty .empty-error { display: flex; align-items: center; gap: 6px; max-width: 560px; padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 15px; font-weight: 600; text-align: left; }
.empty .empty-error[hidden] { display: none; }
.empty-error .icon { flex: none; }
.empty-error .empty-update { flex: none; margin-left: auto; } /* a .tabbygato file from a newer TabbyGato */
.drawing-note { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 15px; pointer-events: none; }
.drawing-note[hidden] { display: none; }
.drop {
  position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 14px;
  background: color-mix(in srgb, var(--accent-soft) 88%, transparent); display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; pointer-events: none;
}

/* alphaTab's playback marks */
.at-cursor-bar { background: var(--cursor-bar); opacity: var(--box-k); }
.at-cursor-beat { background: var(--cursor-beat); }
/* The playing line sits in front of the staff and string lines but behind the notes and fret numbers
   (Nikhil, November 6, RD-4). alphaTab draws its marks in a layer on top of the music, so the layer
   keeps whichever color is darker (light theme) or lighter (dark theme) at each spot: the line covers
   the staff lines, and the notes and fret numbers stay their own color on top of it. */
.at-cursors { mix-blend-mode: darken; }
/* The playing line's shape (option G, Nikhil, November 17, 2026): alphaTab's full-height beat line hides,
   and a short line on the strings with a round head above the top string takes its place. Nikhil asked
   for the line a little lighter; the head keeps the full blue, so the mark still stands out at 3 to 1. */
#score .at-cursor-beat { visibility: hidden; }
.play-pin { position: absolute; left: 0; top: 0; width: 0; pointer-events: none; will-change: transform; transition-property: transform; transition-timing-function: linear; }
.play-pin[hidden] { display: none; }
.play-pin-line { position: absolute; left: -1.5px; top: 0; bottom: 0; width: 3px; background: var(--cursor-beat); opacity: calc(0.65 * var(--pin-k)); }
.play-pin-head { position: absolute; left: calc(var(--head) / -2); top: var(--head-top, calc(var(--head) * -1.5)); width: var(--head); height: var(--head); border-radius: 50%; background: var(--play); opacity: var(--pin-k); }
#score.resting .play-pin { visibility: hidden; }
:root[data-theme="dark"] .at-cursors { mix-blend-mode: lighten; }
/* Bar shading (RD-5, Nikhil chose this look on November 9, 2026). Each bar has a box; the playing bar's
   is marked "now", the next bar's "next". The playing bar gets a blue shade. While the music plays, every
   other bar sits under a veil in the page's own color: 20% over the next bar, 38% over the rest. While the
   music is paused nothing fades, so the whole page reads at full strength (design layout, November 9).
   The shade replaces alphaTab's own lighter shading of the playing bar. */
.shade-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 999; pointer-events: none; }
.shade { position: absolute; pointer-events: none; transition: opacity var(--tg-time-quick) linear, background-color var(--tg-time-quick) linear; }
#score[data-shade="on"] .shade { background: var(--bg); opacity: 0; }
body.playing #score[data-shade="on"] .shade { opacity: 0.38; }
body.playing #score[data-shade="on"] .shade[data-step="next"] { opacity: 0.2; }
#score[data-shade="on"] .shade[data-step="now"], body.playing #score[data-shade="on"] .shade[data-step="now"] { background: var(--shade-now); opacity: var(--box-k); }
#score[data-shade="on"] .at-cursor-bar { visibility: hidden; }
/* Written count (RD-1): "1 e & a" under each line of music, one picture per bar under the bar shading.
   Beat numbers are darker and bold, the words between them lighter. */
.count-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 998; pointer-events: none; }
.count { position: absolute; overflow: visible; pointer-events: none; }
.count-word { fill: var(--muted); text-anchor: middle; font-family: inherit; }
.count-word.strong { fill: var(--ink); font-weight: 700; }
.at-highlight *, .lead-lit * { fill: var(--play); stroke: var(--play); }
/* The playing marks' strength (Nikhil, November 18, 2026, build 203): the blue box over the playing bar and the
   line with its dot show at 70 percent of their earlier strength, "far less distracting". The test switch can
   change both for one browser. */
:root { --box-k: 0.7; --pin-k: 0.7; }
/* The test switch (build 202): only an address with ?leadtest=1 shows it. */
.lead-test { position: fixed; top: 100px; right: 16px; z-index: 2000; display: grid; gap: 4px; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.lead-test-row { display: flex; align-items: center; gap: 4px; }
/* The switch's title row and its Hide button (November 24). Folded, the switch shows the title row alone. */
.lead-test-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 6px; }
.lead-test-title { font-size: 11px; font-weight: 600; color: var(--muted); }
.lead-test .lead-test-min { min-width: 48px; min-height: 32px; font-size: 12px; font-weight: 600; color: var(--accent); }
.lead-test.small > :not(.lead-test-head) { display: none; }
.lead-test-name { width: 84px; font-size: 11px; color: var(--muted); }
.lead-test-delay { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.lead-test button { font: inherit; min-width: 48px; min-height: 40px; padding: 2px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; line-height: 1.1; }
.lead-test button b { display: block; font-size: 12px; }
.lead-test button span { display: block; font-size: 11px; color: var(--muted); }
.lead-test button:hover { background: var(--hover); }
.lead-test button[aria-pressed="true"] { background: var(--accent-soft); }
/* The home note disc (build 139): a pale amber disc behind an amber fret number in the tab, 12 percent solid
   in both looks (Nikhil compared 12 and 20 percent on November 16). A tab that steps back (Favor notation)
   gets a paler disc. The disc stays amber while its number plays blue, and a press passes through it. */
.home-disc { fill: var(--home-ink); fill-opacity: 0.12; stroke: none; pointer-events: none; }
.home-disc.pale { fill-opacity: 0.05; }
.at-highlight .home-disc, .lead-lit .home-disc { fill: var(--home-ink); stroke: none; }
/* Held notes (build 251): the test switch's Held notes row. A tail is a pale blue line along a string, from a
   ringing fret number to the playing line, as strong as the playing line itself. Under "Tail and soft" a ringing
   note eases to 75% of full blue after it starts; the home disc keeps its own faint fill. From build 255 the tail
   fades like a comet's: clear at the note, where the sound started, and full at the playing line (Nikhil). */
.held-tails { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.held-tail { position: absolute; left: 0; top: -1px; height: 2px; width: 0; border-radius: var(--tg-corner-round); background: linear-gradient(to right, transparent, var(--play) 90%); opacity: calc(0.8 * var(--pin-k)); transform-origin: 0 50%; }
.held-tail[hidden] { display: none; }
/* Build 258: the Glow tail is the string itself, 1 pixel like a staff line and fainter; the Glint is a short
   fade just behind the playing line (main.mjs sets its length). */
.held-tails[data-look="glow"] .held-tail { height: 1px; top: -0.5px; opacity: calc(0.6 * var(--pin-k)); }
.lead-lit[data-held] *:not(.home-disc) { fill-opacity: var(--held, 1); stroke-opacity: var(--held, 1); }
.at-selection div { background: var(--selection); }
/* The loop's own buttons float over the music (builds 71 to 75). main.mjs places them right under the looped
   bars, where the student just looked, with a pointer up to those bars (placePill); when the looped bars are
   out of view the buttons wait just above the bottom bar. An accent outline, the bars' name and a short rise
   as the buttons arrive tie them to the loop (Nikhil, November 13: easier to see in context). */
.loop-pill { position: fixed; left: 0; top: 0; z-index: 20; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--accent); animation: pill-arrive var(--tg-time-pop) var(--tg-ease-out); }
@keyframes pill-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .loop-pill { animation: none; } }
.loop-pill.anchored::before { content: ""; position: absolute; left: var(--caret-x, 50%); top: -6px; width: 10px; height: 10px; margin-left: -5px; background: var(--surface); border-left: 1px solid var(--accent); border-top: 1px solid var(--accent); transform: rotate(45deg); }
.pill-name { padding: 0 6px 0 10px; font-size: var(--tg-type-passage); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.loop-pill[hidden], .pill-row[hidden], body.no-song .loop-pill { display: none; }
.pill-row { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.pill-say { padding: 0 4px 0 8px; font-size: var(--tg-type-label); font-weight: 600; color: var(--muted); }
.pill-num { display: inline-flex; align-items: center; gap: 2px; border-radius: 10px; background: var(--off); }
.pill-num b { min-width: 28px; text-align: center; font-size: var(--tg-type-value); font-weight: 700; font-variant-numeric: tabular-nums; }
.pill-num .cell { min-width: 44px; padding: 0 6px; }
/* Build 4 of the sections-and-loops plan: the loop's name and its save slot each keep one width, so Save loop, Saved
   and Edited, and a loop's name in place of its bars, move nothing (docs/DESIGN_SYSTEM.md, set widths for words that
   change). The name ends in three dots when it runs long, and its whole name is in the tip. */
#pillLoop .pill-name { flex: none; width: 128px; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; }
#pillSave { flex: none; width: 104px; justify-content: center; }
#pillSave[data-state="saved"] { cursor: default; color: var(--muted); }
#pillSave[data-state="saved"]:hover { background: none; }
#pillSave[data-state="edited"] { color: var(--accent); }
.pill-tray { display: flex; flex-wrap: wrap; gap: 4px; }

/* Bar numbers you can pick, laid over the ones alphaTab draws */
.bar-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 1001; }
.bar-pick { position: absolute; padding: 0; margin: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; }
.bar-pick::after { content: ""; position: absolute; inset: -6px; } /* a 24 pixel place to click around a small number */
.bar-pick:hover { border-color: var(--accent); background: var(--accent-soft); }
.bar-pick[aria-pressed="true"] { border-color: var(--accent); }
/* RD-13: a section name in the music, to jump to that section or loop it */
.label-pick { position: absolute; padding: 0; margin: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; }
.label-pick[hidden] { display: none; }
/* only a border on hover, so the name itself stays readable */
.label-pick:hover, .label-pick:focus-visible { border-color: var(--accent); }
/* RD-13: naming bars in the song map. The text box sits on the name row of the strip, with a tip under it. */
.map-edit-box { position: absolute; top: 0; z-index: 5; }
.map-edit { user-select: text; display: block; width: 100%; height: 21px; padding: 0 7px; font: inherit; font-size: var(--tg-type-map); font-weight: 700; color: var(--ink);
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--tg-corner-mark); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
.map-edit-tip { margin-top: 4px; padding: 4px 8px; width: max-content; max-width: 360px; font-size: var(--tg-type-note); color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--tg-shadow-tip); }
.map-edit-reset { margin-left: 4px; padding: 0; font: inherit; color: var(--accent); background: none; border: 0; text-decoration: underline; cursor: pointer; }
/* Build 158: a name box that opens beside the pressed control, where the student is looking. Under the loop's
   buttons the box is part of those buttons, so the two move together; .above puts the box over the buttons when
   the room under them runs out. Over Name bars in the status line the box is fixed to the window (main.mjs places it). */
.map-edit-box.beside { top: auto; z-index: 30; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--tg-shadow-lift); white-space: normal; }
.loop-pill > .map-edit-box.beside { position: absolute; top: calc(100% + 8px); left: -1px; width: min(420px, max(260px, calc(100% + 2px))); }
.loop-pill > .map-edit-box.beside.above { top: auto; bottom: calc(100% + 8px); }
body > .map-edit-box.beside { position: fixed; width: 300px; max-width: calc(100vw - 16px); }
.map-edit-box.beside .map-edit { height: 36px; font-size: var(--tg-type-passage); }
.map-edit-box.beside .map-edit-tip { margin-top: 6px; padding: 0 2px; width: auto; max-width: none; background: transparent; border: 0; box-shadow: none; }
@media (pointer: coarse) { .map-edit-box.beside .map-edit { height: 44px; } }
/* Picked bars wear a dashed outline with no fill, and looping bars keep the filled shading, so a glance tells
   "picked" from "looping". The song map draws the same pair: a dashed pick and a solid loop. */
.pick-shade { position: absolute; pointer-events: none; border-top: 2px dashed var(--accent); border-bottom: 2px dashed var(--accent); }
.pick-shade.first { border-left: 2px dashed var(--accent); border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
.pick-shade.last { border-right: 2px dashed var(--accent); border-top-right-radius: 5px; border-bottom-right-radius: 5px; }

/* Rest box: the rest beats between times round, drawn as empty beats the playing line moves through */
.rest-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 1002; pointer-events: none; }
.rest-box {
  position: absolute; display: flex; box-sizing: border-box; overflow: hidden;
  border: 1px dashed var(--muted); border-radius: 6px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); opacity: 0.7;
}
.rest-box.now { opacity: 1; border-style: solid; border-color: var(--play); }
.rest-beat { flex: 1 1 0; display: flex; justify-content: center; padding-top: 6px; font-size: var(--tg-type-label); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rest-beat + .rest-beat { border-left: 1px dotted var(--line); }
.rest-beat.on { color: var(--play); background: var(--cursor-bar); }
.rest-line { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--cursor-beat, var(--play)); }
#score.resting .at-cursor-beat, #score.resting .at-cursor-bar { visibility: hidden; }

/* ---------- Auto-hide (Nikhil, November 10): a bar set to "Hide while playing" on the App tab ----------
   While the music plays, the bar leaves the page's flow, so the music gets the bar's room, and waits just
   past its edge of the window. main.mjs adds "peek" when the pointer reaches that edge, when keyboard focus
   moves into the bar, or while a panel is open; the bar then slides back over the music and does not push
   the music. On Pause the bar returns to its place in the flow. */
.top-area { flex: 0 0 auto; }
body.playing.hide-top .top-area, body.playing.hide-bottom .strip {
  position: fixed; left: 0; right: 0; z-index: 30; transition: transform var(--tg-time-move) ease-out, box-shadow var(--tg-time-move) ease-out;
}
body.playing.hide-top .top-area { top: 0; transform: translateY(-100%); }
body.playing.hide-bottom .strip { bottom: 0; transform: translateY(100%); }
body.playing.hide-top .top-area.peek { transform: none; box-shadow: 0 1px 0 var(--line), var(--tg-shadow-lift); }
body.playing.hide-bottom .strip.peek { transform: none; box-shadow: 0 -1px 0 var(--line), var(--tg-shadow-lift-up); }
/* A finger can't rest at the window's edge the way a pointer does, so on a touch screen a small tab waits at the
   edge while a bar hides (build 101). The tab belongs to the bar and slides with it: while the bar is away, the
   tab peeks in from the edge, and a tap brings the bar back. While the bar shows, the same tab sends it away. */
.bar-tab { display: none; }
@media (pointer: coarse) {
  body.playing.hide-top .top-area > .bar-tab, body.playing.hide-bottom .strip > .bar-tab {
    display: grid; place-items: center; position: absolute; left: 50%; width: 64px; height: 24px; margin-left: -32px; padding: 0;
    border: 1px solid var(--line); background: var(--chrome); color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  /* Round on the side that faces the music, square where the tab meets the bar. */
  .top-area > .bar-tab { top: 100%; border-top: 0; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }
  .strip > .bar-tab { bottom: 100%; margin-bottom: env(safe-area-inset-bottom, 0px); border-bottom: 0; border-top-left-radius: 10px; border-top-right-radius: 10px; }
  .bar-tab::after { content: ""; position: absolute; inset: -10px -14px; } /* a bigger place to tap than the tab shows */
  .bar-tab .icon { transition: transform var(--tg-time-move) ease-out; }
  .top-area.peek > .bar-tab .icon, .strip:not(.peek) > .bar-tab .icon { transform: rotate(180deg); }
  /* A finger held on the music picks bars (touch.mjs), so the phone's own text picking and its press-and-hold menu stay away from the music. */
  #score { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  /* A double tap on the tempo or the key edits it, so the browser doesn't zoom on that double tap. */
  .song-edit { touch-action: manipulation; }
}

/* ---------- Quick taps and typing on a phone never zoom the page (build 289) ----------
   Nikhil saw the whole screen zoom on an iPhone after quick taps. Safari zooms on a double tap, and it zooms into
   any text box whose words are under 16 pixels the moment the keyboard opens; the page then stays zoomed after the
   keyboard closes. touch-action: manipulation turns off the double-tap zoom and keeps pinch zoom and scrolling,
   so every tap lands as its own tap (tap tempo counts each one). :where() gives the rule no weight, so a drag
   surface's touch-action: none (the song map, the waveform) still wins. Never turn off pinch zoom in the viewport tag. */
:where(html, button, a, input, select, textarea, label, summary, [role="button"], [role="tab"], .cell, .chip) { touch-action: manipulation; }
/* On a touch screen every box a student types or picks in shows 16 pixels or more, the size below which Safari
   zooms. The metronome's big tempo number is larger already. */
@media (pointer: coarse) {
  :is(input:not([type="range"], [type="checkbox"], [type="radio"], [type="file"]), select, textarea):not(.fm-read input) { font-size: var(--tg-type-value-touch) !important; }
}

/* ---------- The bottom: the shelf (when open), the practice controls, the status line ---------- */
.strip { position: relative; flex: 0 0 auto; background: var(--chrome); padding-bottom: env(safe-area-inset-bottom); }
/* While the start screen (Home) shows, the top bar holds the app's name: Home has Open file and the recent
   songs. With a song open behind Home, the Home button stays too, lit, as a way back to the song (Nikhil,
   November 13). Options stays within reach on Home, because the theme and the list of keys apply there too;
   its Parts, Loop and Metronome tabs wait for a song on screen. */
body.no-song .topbar .cell:not(#homeBtn):not(#accountBtn):not(#metroDoor):not(#emporiumBtn) { display: none; } /* the metronome (build 271) and the Emporium (build 273) show on Home too */
body.no-song .song { visibility: hidden; }
body.no-song .song-map { display: none; } /* Home over an open song: the song map waits with the music */
body.no-song .status-row > :not(.say) { display: none !important; }
/* On Home the practice controls are away. Options stays, as a small row button at the right end of the bottom
   strip: the same corner it has on the practice screen. The status line runs under that corner and comes later in
   the page, so the bar's z-index keeps Options on top of the status line and of every link in the status line
   (build 175). Without the z-index, a recording's status line (position: relative, for the comment box) took the press. */
body.no-song .strip { position: relative; }
body.no-song .bar { position: absolute; z-index: 1; right: var(--gutter); bottom: calc(2px + env(safe-area-inset-bottom)); padding: 0; }
body.no-song .bar > :not(.panels), body.no-song #partsBtn, body.no-song #sectionsBtn { display: none !important; }
body.no-song .tray.panels { height: auto; padding: 0; background: transparent; }
body.no-song #optionsBtn { flex-direction: row; gap: 6px; width: auto; min-height: 36px; padding: 0 12px; }
body.no-song #optionsBtn .icon { width: 16px; height: 16px; }
/* Home's status line stops 124 pixels short of the right edge at every width, so no message and no link reaches under
   Options (build 176; a phone has had the stop since builds 98 and 99). Options is 93 pixels wide and sits 16 pixels from the edge. */
body.no-song .status-row { display: block; height: auto; padding: 10px 124px 10px 16px; }
body.no-song .say { justify-content: center; }

/* The practice controls, in six groups: Restart and Play; Speed; Loop; Count-in and Metronome; Volume; Parts and
   Options. Each group sits on a soft tray: the card's face at half strength, with no outline, so a group
   reads as a unit and the bar stays one desk (Nikhil, November 13: the trays' grouping with a softer look).
   A tray keeps 4px of its face above and below its controls, so a lit button never touches the tray's edge.
   Every tray but Volume has a set width, and Volume takes the room that is left, so nothing can push anything.
   Every control reads the same way: the icon or the value on top, a 12px label underneath. */
.bar { display: flex; align-items: stretch; justify-content: space-between; gap: 6px 8px; padding: 6px var(--gutter) 4px; }
.bar-break { display: none; }
.tray {
  flex: none; display: flex; align-items: stretch; gap: 6px; min-width: 0; height: 68px; padding: 4px 6px;
  border-radius: 14px; background: color-mix(in srgb, var(--surface) 50%, transparent);
}
.cell.big { min-height: 0; padding: 2px 4px; }
#restartBtn { width: 64px; } #playBtn { width: 92px; }
#countBtn { width: 84px; } #metroBtn { width: 92px; }
#partsBtn { width: 64px; } #optionsBtn { width: 72px; } #sectionsBtn { width: 72px; }
/* A value over its name: "100% \00b7 124 BPM" over "Speed". The width is set, so a longer value never pushes the slider. */
.stack { display: grid; grid-template-rows: 22px 16px; align-content: center; gap: 1px; min-width: 0; }
.stack .readout { font-size: var(--tg-type-value); font-weight: 700; line-height: 22px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stack .cap { font-size: var(--tg-type-caption); font-weight: 500; line-height: 16px; color: var(--muted); }
/* Speed: Slower, the two numbers you can type over, Faster, then four quick speeds in a block of two by two. */
.speed { display: flex; align-items: stretch; gap: 6px; }
.speed .stack { width: 136px; flex: none; align-self: center; grid-template-rows: 24px 16px; }
.speed .readout { display: flex; align-items: baseline; gap: 2px; line-height: 24px; }
.speed .readout input { width: 36px; }
.speed .readout input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: var(--tg-corner-mark); }
.speed .readout .sep { margin: 0 3px; }
.presets { display: grid; grid-template-columns: repeat(2, 48px); grid-auto-rows: 28px; gap: 3px; flex: none; align-self: center; margin-left: 4px; }
.presets .chip { min-height: 0; padding: 0; justify-content: center; font-variant-numeric: tabular-nums; }
.presets .chip[aria-pressed="true"]::before { content: none; } /* the typed number beside the block already states the speed */
.cell.step { width: 54px; flex: none; padding: 2px 0; }
.tray.loop { gap: 2px; }
.loop .cell.big { width: 84px; flex: none; }
.loop .cell.num { width: 68px; flex: none; }
/* Volume: Mute, then the slider with the level under it as its caption. The slider keeps a 44px tall place to
   press, and the caption sits in the lowest part of that place, under the track. */
.tray.volume { flex: 1 1 148px; }
.vol { position: relative; flex: 1 1 auto; min-width: 0; }
.vol input[type="range"] { display: block; width: 100%; min-width: 0; height: 44px; }
.vol-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 6px; font-size: var(--tg-type-caption); line-height: 16px; font-weight: 500; color: var(--muted); white-space: nowrap; pointer-events: none; }
.vol-cap b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
/* Parts and Options sit in the bottom bar, right under the shelf they open (Nikhil, November 13; before that
   day the bar held only what a student does while playing, and both buttons sat in the top bar).
   The count of choices a student may have set and forgotten (Nikhil, November 11) sits on the Loop button
   and the Metronome button, and again on the Loop tab and the Metronome tab that hold those choices. */
#loopBtn, #metroBtn { position: relative; }
.cell .badge {
  position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--tg-corner-round);
  background: var(--accent); color: var(--accent-ink); font-size: var(--tg-type-badge); font-weight: 700; line-height: 18px; text-align: center;
  pointer-events: none;
}
.shelf-tab .badge { top: -5px; right: -5px; }
.cell .badge[hidden] { display: none; }

/* The status line. Play bars and Clear bars show only while bars are picked; Follow, and Play past loop or Cancel,
   show only while they have a job. Their room is always kept, so nothing beside them moves. */
.status-row {
  display: grid; align-items: center; gap: 0 2px; height: var(--status-h); padding: 0 var(--gutter) 4px;
  grid-template-columns: 330px 96px 100px 100px 116px 128px minmax(0, 1fr); /* one column for each of the seven parts (build 89 gave Name bars its own) */
}
/* These buttons look 36px tall and take a click across the full 44px of the line. */
.status-row .cell { position: relative; min-height: 36px; height: 36px; width: 100%; padding: 0 6px; }
.status-row .cell::after { content: ""; position: absolute; inset: -4px 0; }
.slot[hidden] { display: inline-flex !important; visibility: hidden; }
.slot-stack { display: grid; }
.slot-stack > * { grid-area: 1 / 1; }
/* The bar text fills its slot and the time sits at the slot's right end, so a longer section name never shifts the time. */
.where { display: flex; align-items: center; gap: 6px; min-width: 0; padding-right: 12px; }
.where .icon { width: 16px; height: 16px; color: var(--muted); }
.where > div { flex: 1 1 auto; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.where b { flex: 1 1 auto; min-width: 0; font-size: var(--tg-type-value); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where small { flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: var(--tg-type-note); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* (Build 125: a chosen section's 60-letter name here pushed a 390 pixel page sideways; the name gives way first.) */
.say { display: flex; justify-content: flex-end; align-items: baseline; gap: 12px; min-width: 0; }
.say p { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--tg-type-message); }
.status { flex: 0 1 auto; color: var(--ink); font-weight: 600; }
.status.warn { color: var(--warn); }
/* An error stands out: a soft amber face, an icon, and the value size (15px) on up to two lines, so the
   student sees the message without hunting in the corner. It stays until the student's next action. */
.say.warn { justify-self: end; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px; border-radius: 8px; background: var(--warn-soft); }
.say.warn .status { font-size: var(--tg-type-sentence); line-height: 1.25; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.say.warn .picked, .say.warn .round, .say.warn .loop-note { display: none; }
.warn-icon { flex: none; color: var(--warn); }
/* Good news (Nikhil's pick 4, November 12): teal green words on a cool face, with a tick. The line after the
   tour's Done is the first message to use it (build 68); the speed trainer's "You reached 100%" line would
   be the next (R1 polish finding 15, not picked). */
.status.done { color: var(--done); }
.say.done { justify-self: end; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px; border-radius: 8px; background: var(--done-soft); }
.say.done .picked, .say.done .round, .say.done .loop-note { display: none; }
.done-icon { flex: none; color: var(--done); }
.warn-icon[hidden] { display: none; }
.say .picked.said { display: none; }
.picked { flex: 0 100 auto; color: var(--muted); }
.loop-note { flex: 0 100 auto; font-weight: 600; color: var(--muted); } /* a fact, not a warning, so no warning color */
.say .round { flex: none; font-weight: 600; color: var(--accent); }
/* The close button beside the note that names the waiting song on Home (build 288; Nikhil, November 22). An X on a
   28 pixel face that takes a press across 44 by 44. The face reaches 4 pixels past the line above and below, so the
   line is as tall with the button as without it, and a close moves nothing. It shows beside that note alone. */
.say .wait-close { flex: none; position: relative; align-self: center; width: 28px; height: 28px; min-height: 28px; margin: -4px 0; padding: 0; border-radius: 8px; color: var(--muted); }
.say .wait-close::after { content: ""; position: absolute; inset: -8px; }
.say .wait-close:hover:not(:disabled) { color: var(--ink); }
.say .wait-close[hidden] { display: none; }
/* The message may take two lines (build 147 from 1280px wide; build 154 at every width), so a longer message shows
   whole where one line cut it off ("Focused on bars 9 to 10. Close, or Escape, brings the w..."). Everything in the
   line centers on its row, so a second line moves nothing beside the message. Each layout below keeps the height of
   two lines for the message at all times: 44px in the one-row line, and a 30px row under the position in the narrower
   layouts. An error or good news keeps its own face and rules (above). */
.say { align-items: center; }
.say p { line-height: 1.25; }
.say:not(.warn):not(.done) .status { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* From 1280px wide the lines sit against the right edge, beside the two links. */
/* A status line with three fixed places (build 212, idea 8; Nikhil chose tip choice A on November 18, 2026): the position,
   the Comment button and one message. From 1280px wide the message starts at one place, right after the line's buttons,
   and the two links keep the right end, so a short answer and a long one start at the same word. Before build 212 the
   words ended at the right edge, and the first word started anywhere from 1,026 to 1,368 pixels on a tab at 1,512.
   The message's box keeps two lines' height and centers its words on the line's middle. The round count, the loop's
   note and the picked bars follow the message. */
@media (min-width: 1280px) {
  body:not(.no-song) .say { justify-content: flex-start; height: 30px; align-self: center; }
  body:not(.no-song) .say .feedback-foot { margin-left: auto; }
  body:not(.no-song) .say .round, body:not(.no-song) .say .loop-note, body:not(.no-song) .say .picked { order: 2; }
  body:not(.no-song) .say .feedback-foot, body:not(.no-song) .say .coffee-foot { order: 3; }
  body:not(.no-song) .say.warn, body:not(.no-song) .say.done { justify-self: start; }
}
/* While a song plays, Give feedback and Buy me a coffee step back and keep their room, so nothing slides into it. A
   phone already hides both while a tab plays (build 100). */
body.playing:not(.no-song) .say .feedback-foot, body.playing:not(.no-song) .say .coffee-foot { visibility: hidden; }
/* A tip: the quieter gray at the message's own size, so an answer to a press reads stronger (build 212). */
.status.tip { color: var(--muted); font-weight: 400; }

/* ---------- The shelf: one attached area for the five Options tabs, Keys and moves and Credits ---------- */
/* Three layers (build 242; Nikhil, November 19: "The menu should be at top and at a different color to indicate a
   difference between the menu, its options and the transport bar"): the row of tabs is a band on the desk across the
   window at the shelf's top edge, the settings sit on the card's face, and the bottom bar keeps the desk and its trays.
   A quiet line runs along the band's top and lower edges and along the shelf's lower edge, so the three read apart in
   the dark look too, where the card is one step lighter than the desk. The five Options tabs share one height, the
   tallest live tab's (main.mjs, fitShelf), so the band stays put when the student picks another tab.
   Option C (build 171; Nikhil chose it on November 17): the shelf is as tall as the open panel's rows. Builds 171 to
   241 kept the row of tabs at the shelf's lower edge, right above the bottom bar. Before build 171 the shelf had one height for every
   panel, 36% of the window and 312 pixels at most, with the tabs on top. An Options tab stops at 46% of the window's
   height, or at the whole area if that is less, and the open panel's rows then scroll inside the panel. The 46% is
   Claude's measured choice, and Nikhil kept it over the old 36% on November 17 ("Keep 46%"). --area-h is the height the music or
   the recording has while the shelf is shut; main.mjs keeps it current. */
.shelf { --shelf-side: var(--gutter); position: relative; display: flex; flex-direction: column; max-height: min(var(--area-h, 100vh), 46vh); overflow: hidden; padding: 0 var(--shelf-side) 10px; background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); }
/* A reading page stops at the whole area (build 173): Keys and moves, Credits, What's new and a license are lists and
   pages of words, which a student opens to read, so the page may cover the music or the recording up to the song map.
   An Options tab keeps the 46% stop, because a student changes a choice there and looks at the music. main.mjs sets
   the class while Keys and moves or Credits shows. */
.shelf.reading, body.recording:not(.no-song) .shelf.reading { max-height: var(--area-h, 100vh); }
.shelf > .panel:not([hidden]) { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; }
/* Each part of the open panel scrolls when the shelf has reached its stop. The 4 pixels of padding, taken back by the
   margin, leave room for a focus line around a control at the part's edge; the part's place and size stay the same. */
.shelf > .panel > * { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin: -4px; padding: 4px; scrollbar-color: var(--edge) transparent; }
.shelf > .panel > .keys-table { width: auto; }
/* The row of tabs (Nikhil, November 12): Music, Parts, Loop, Metronome and count-in, App. A tab reads like a panel
   title: a 20px icon and a 15px name. The tab that shows takes the "on" look and a heavier weight, so the mark never
   rests on color alone. Each tab keeps the width of its name in the heavier weight, so picking a tab moves no other
   tab. The row keeps its place at the shelf's top edge whichever tab shows.
   The band (build 242) runs edge to edge: the negative side margins take back the shelf's side padding, and 6 pixels
   of desk sit above and below the tabs. Builds 174 to 241 put the row on a tray like the bottom bar's. */
.shelf-tabs { flex: none; display: flex; align-items: flex-start; gap: 4px; min-height: 32px; margin: 0 calc(-1 * var(--shelf-side)) 10px; padding: 6px var(--shelf-side); background: var(--chrome); box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
.tab-list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.shelf-tab { position: relative; flex-direction: row; gap: 8px; min-height: 32px; padding: 0 12px; font-size: var(--tg-type-tab); font-weight: 600; color: var(--muted); }
.shelf-tab > span { display: inline-grid; }
.shelf-tab > span::after { content: attr(data-name); height: 0; overflow: hidden; visibility: hidden; font-weight: 700; }
.shelf-tab:hover:not(:disabled) { color: var(--ink); }
.shelf-tab[aria-selected="true"], .shelf-tab[aria-selected="true"]:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); font-weight: 700; } /* the picked tab stays green under the pointer and after a tap, as a picked chip does (build 242) */
#shelfClose { flex: none; margin-left: auto; width: 32px; min-height: 32px; padding: 0; }
/* A tab's own buttons and note sit at the right end of the band, before the close button. A narrower window has no
   room there, so they take a row of their own right under the band. */
.shelf > .panel > .panel-tools { position: absolute; top: 6px; right: calc(var(--shelf-side) + 46px); flex: none; display: flex; align-items: center; gap: 4px; min-height: 32px; margin: 0; padding: 0; overflow: visible; }
.panel-tools small { font-size: var(--tg-type-note); font-weight: 400; color: var(--muted); margin-right: 8px; }
.panel-tools .toggle[aria-pressed="false"] .icon { visibility: hidden; } /* no tick beside a switch that is off; its room stays, so the words don't move */
@media (max-width: 1279px) { .shelf > .panel > .panel-tools { position: static; flex-wrap: wrap; justify-content: flex-end; margin: -4px 0 6px; } }
/* Rows under the lower edge (build 169): a box that scrolls fades its last 28 pixels while rows wait below, so the cut
   reads as "more below" and never as the end of the list. main.mjs sets the class and takes it off at the last row.
   A mask reads only how solid its color is, so the ink color stands for "show" in the light look and the dark look. */
.more-below { -webkit-mask-image: linear-gradient(to bottom, var(--ink) calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, var(--ink) calc(100% - 28px), transparent); }
.panel:focus { outline: none; }
.panel-title { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: 0 0 8px; font-size: var(--tg-type-group); }
.panel-title small { font-weight: 400; font-size: var(--tg-type-note); color: var(--muted); margin-left: 6px; }
.panel-title .cell { margin-left: auto; }
.panel-title .cell + .cell { margin-left: 4px; }
.panel-title .toggle[aria-pressed="false"] .icon { visibility: hidden; } /* no tick beside a switch that is off; its room stays, so the words don't move */
/* Keys and moves, Credits and Saved Sections: the title and its buttons sit in the band at the shelf's top edge, in the
   place of the row of tabs (build 242; the shelf's lower row from build 171). */
.shelf > .panel > .panel-title { flex: none; overflow: visible; margin: 0 calc(-1 * var(--shelf-side)) 10px; padding: 6px var(--shelf-side); background: var(--chrome); box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); } /* the same band as the row of tabs */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 28px; }
.fields.one { grid-template-columns: 1fr; gap: 6px; }
.field { display: grid; grid-template-columns: 1fr; gap: 4px; min-width: 0; align-content: start; }
.field.wide { grid-column: span 2; }
.fields.one .field { grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 8px; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: var(--tg-type-note); color: var(--muted); }
/* The account (build 142): a button at the right end of the top bar, and the small card it opens. The card
   uses the song details card's face. The button shows a person until someone signs in, and then the first
   letter of their email address in a filled circle. An amber dot marks a sign-in that needs attention. */
.account-btn { margin-left: auto; position: relative; }
.account-initial { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; line-height: 1; }
.account-initial[hidden] { display: none; }
.account-btn.warn::after { content: ""; position: absolute; top: 6px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--chrome); }
.account-btn[aria-expanded="true"] { background: var(--accent-soft); }
.details-card.account-card { width: min(340px, calc(100vw - 24px)); }
.account-box { display: grid; gap: 2px; min-width: 0; }
.account-box p { margin: 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.account-box .account-who { font-size: 15px; font-weight: 700; color: var(--ink); }
.account-method, .account-note { color: var(--muted); }
.account-line.done { color: var(--done); }
.account-line.warn { color: var(--warn); }
.account-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.account-buttons:not(:has(button:not([hidden]))) { display: none; }
/* The sentence about the Terms and the Privacy page, under each button that leads to the sign-in page (build 198). */
.account-agree, .account-box .account-agree { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.account-agree[hidden] { display: none; }
.account-agree a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.account-agree a:hover { color: var(--ink); }
.account-links { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 36px; }
#metroPanel .two-col { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr); } /* the metronome rows, then the count-in rows */
/* The Loop tab and the App tab have longer names, so "After the last time round" and "Hear notes while paused" stay on one line. */
@media (min-width: 1100px) { #loopPanel .two-col .field, #settingsPanel .two-col .field { grid-template-columns: 190px minmax(0, 1fr); } }
/* A recording's two pause rows get the same 190 pixel label slot (build 170), so "Pause before each repeat" stays on one line. */
@media (min-width: 1100px) { #loopPanel .rec-pauses .field { grid-template-columns: 190px minmax(0, 1fr); } }
.inline { display: flex; align-items: center; gap: 10px; min-width: 0; }
.inline input[type="range"] { height: 32px; max-width: 220px; }
.inline .readout { font-size: var(--tg-type-value); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3em; }
.details-line { margin: 0; font-size: var(--tg-type-sentence); line-height: 1.6; max-width: 80ch; }
/* The App tab's Version row (build 166): a fact to read, in the size and color of a note. */
.field .version-line { font-size: var(--tg-type-note); color: var(--muted); font-variant-numeric: tabular-nums; }
/* The Backup row and the note under it (item 4a, build 292). The note answers a press where the student pressed: the
   win color with a tick, or the problem's amber with the warning icon. It keeps clear of the shelf's 28 pixel fade. */
.backup-buttons { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.backup-note { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: var(--tg-type-sentence); font-weight: 600; line-height: 1.35; color: var(--done); scroll-margin-bottom: 32px; overflow-wrap: anywhere; }
.backup-note[hidden] { display: none; }
.backup-note.warn { color: var(--warn); }
.backup-note .icon { flex: none; margin-top: 2px; }
#electricSoundsStatus { font-size: var(--tg-type-note); } /* a note under a field: 12, where the browser's own small size made it 12.5 (build 206) */

/* Parts (Nikhil, November 9): one row for each part, with Show, Mute, Solo, its volume and sound, and that
   part's own busy lane lined up under the section names, so a student sees who plays where. */
.parts-grid { display: grid; grid-template-columns: minmax(96px, 150px) 76px 76px 76px minmax(120px, 190px) minmax(0, 150px) minmax(160px, 1fr); gap: 4px 6px; align-items: center; }
.parts-grid .cell { min-height: 32px; width: 100%; padding: 0 4px; gap: 5px; }
.part-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--tg-type-group); font-weight: 600; }
.part-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-name.shown { color: var(--accent); font-weight: 700; }
/* PM-5: a shown part's name picks the part to follow, when two or more parts show */
.part-follow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; font: inherit; color: inherit;
  background: none; border: 0; cursor: pointer; text-align: left; }
.part-follow:hover { text-decoration: underline; }
.part-yours { flex: 0 0 auto; padding: 1px 7px; border-radius: var(--tg-corner-mark); font-size: var(--tg-type-badge); font-weight: 700; color: var(--accent-ink); background: var(--accent); }
.part-silent { display: none; flex: none; font-size: var(--tg-type-label); font-weight: 600; color: var(--muted); border: 1px solid var(--edge); border-radius: var(--tg-corner-mark); padding: 0 4px; }
.part-name.silent .part-silent { display: inline; }
.parts-grid [data-act="mute"][aria-pressed="true"] { background: var(--mute-soft); color: var(--mute-on); }
.parts-grid [data-act="solo"][aria-pressed="true"] { background: var(--solo-soft); color: var(--solo-on); }
.part-vol { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); }
.part-vol input[type="range"] { height: 32px; }
.part-vol output { width: 40px; text-align: right; font-size: var(--tg-type-label); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.part-sound { min-width: 0; }
.part-sound select { width: 100%; }
.part-lane { position: relative; height: 30px; border: 1px solid var(--edge); border-radius: 6px; background: var(--surface); cursor: pointer; overflow: hidden; }
.part-lane.shown { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.part-lane.silent { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--line) 6px 7px); }
.part-lane.silent .lane-busy { opacity: 0.45; }
.lane-busy { position: absolute; left: 0; top: 5px; width: 100%; height: calc(100% - 10px); fill: var(--ink); pointer-events: none; }
.lane-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--play); pointer-events: none; }
.lane-pick { position: absolute; top: 0; bottom: 0; background: var(--selection); pointer-events: none; }
.lane-head { position: relative; height: 17px; }
.lane-head span {
  position: absolute; top: 0; height: 17px; padding: 0 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: var(--tg-type-label); font-weight: 700; line-height: 17px; border-radius: var(--tg-corner-mark);
}
.lane-head span[data-hue="0"] { background: var(--sec-0); } .lane-head span[data-hue="1"] { background: var(--sec-1); }
.lane-head span[data-hue="2"] { background: var(--sec-2); } .lane-head span[data-hue="3"] { background: var(--sec-3); }
.lane-head span[data-hue="4"] { background: var(--sec-4); } .lane-head span[data-hue="5"] { background: var(--sec-5); }

/* What every panel shares (November 10 review): a 15px title 32px tall with a 20px icon; 15px for names and
   sentences, 12px for labels and notes; choices 32px tall; one field per row with its label on the left; and
   three corner sizes: 10px for buttons, 8px for choices, rows and pattern bars, 6px for lanes, key caps and menus. */

/* Home's shelves (song labels plan, step 3). A shelf is a card with one label's name, its count and its songs.
   Keep practicing runs the full width with its songs three across; every other shelf takes one of three columns. */
/* Each row is as tall as its tallest shelf, and Home scrolls when the shelves need more room than the window has. */
.song-shelves { width: 100%; margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 16px; align-items: start; text-align: left; }
.song-shelves[hidden] { display: none; }
/* One shelf alone keeps the middle: the sample songs on a first open. */
.song-shelves.one { grid-template-columns: minmax(0, 440px); justify-content: center; }
.song-shelf { display: grid; gap: 4px; align-content: start; min-width: 0; padding: 12px; border-radius: 14px; background: var(--tg-card); box-shadow: inset 0 0 0 1px var(--line); }
.song-shelf[hidden] { display: none; }
.song-shelf.wide { grid-column: 1 / -1; order: 0; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 8px; }
.shelf-head h2 { font-size: var(--tg-type-heading); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-head .fine { flex: none; color: var(--muted); font-size: var(--tg-type-note); }
.song-shelf.wide .recent-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 16px; }
.shelf-all { justify-self: start; min-height: 44px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--accent); font: inherit; font-size: var(--tg-type-label); font-weight: 600; cursor: pointer; }
.shelf-all:hover { background: var(--hover); }
.shelf-all[hidden] { display: none; }
/* A song's row: the name, then one quiet line with its other labels, where the student left it and its last practice. */
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; text-align: left; }
.recent-list li { display: flex; align-items: center; gap: 2px; min-width: 0; border-radius: 8px; }
.recent-open {
  flex: 1 1 auto; min-width: 0; min-height: 44px; display: grid; gap: 1px; text-align: left;
  font: inherit; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; cursor: pointer;
}
.recent-open:hover { background: var(--hover); }
.recent-open strong { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-open span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A song that needs its file: a page with a line through it leads the row's small line (build 190). */
.recent-open span .nofile-icon { width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }
/* Two songs with one title each add their file name. That name wraps, so a narrow row still tells them apart. */
.recent-open strong.repeat { white-space: normal; overflow-wrap: anywhere; }
/* The kind icon (build 137) stands left of the two lines, so a tab, an audio file and a video tell apart at a glance. */
.recent-open.has-kind { grid-template-columns: 20px minmax(0, 1fr); column-gap: 10px; }
.recent-open .kind-icon { grid-row: 1 / span 2; align-self: center; color: var(--muted); }
li.open-now .recent-open .kind-icon { color: var(--accent); }
/* The More button, three dots, ends each row and opens the song's box: the song's labels, and Remove (build 162). */
.song-more { flex: none; width: 44px; min-height: 44px; color: var(--muted); }
/* The open song is in the "on" look: the soft fill and green words, plus the words "Open now" and a Back button. */
.recent-list li.open-now { background: var(--accent-soft); }
li.open-now .recent-open span { color: var(--accent); font-weight: 600; }
.recent-back { flex: none; width: 56px; min-height: 44px; color: var(--accent); }
/* Sample songs use the same rows. A song's small line says what the song teaches, and wraps so no word is cut. */
.sample-list .recent-open span { white-space: normal; }

/* The Buy me a coffee link (coffee.mjs). The yellow button is Buy Me a Coffee's own picture, so its colors stay
   the same in the light look and the dark look. The card sits in the same corner as the label card. */
.coffee-link { display: inline-flex; flex: none; border-radius: 8px; transition: transform var(--tg-time-pop) var(--tg-ease-out); }
.coffee-link img { display: block; }
.coffee-link:hover { transform: translateY(-1px); }
.coffee-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel-tools .coffee-link { margin-left: 4px; }
/* The same link as plain words at the end of the status line, from 30 minutes of use on. An error or good news has the line to itself. */
.coffee-foot { flex: none; display: inline-flex; align-items: center; gap: 5px; align-self: center; padding: 2px 8px; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-size: var(--tg-type-label); font-weight: 600; text-decoration: none; white-space: nowrap; }
.coffee-foot[hidden], .say.warn .coffee-foot, .say.done .coffee-foot { display: none; }
.coffee-foot:hover { text-decoration: underline; }
.coffee-foot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coffee-foot img { display: block; }
/* The Give feedback link in the status line (feedback.mjs, build 89). The link is always on screen, in the same
   quiet shape as the Buy me a coffee link beside it. A warning or a done note takes the line to itself. */
.feedback-foot { flex: none; display: inline-flex; align-items: center; gap: 5px; align-self: center; min-height: 20px; margin: 0; padding: 2px 8px; border: 0; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: inherit; font-size: var(--tg-type-label); font-weight: 600; white-space: nowrap; cursor: pointer; position: relative; }
.reload-foot[hidden] { display: none; } /* the Reload button shows only after a new version arrives (build 292) */
.feedback-foot::after { content: ""; position: absolute; inset: -8px -2px; } /* a taller target than the link looks */
.feedback-foot .icon { width: 13px; height: 13px; color: var(--accent); }
.feedback-foot:hover { background: var(--hover); }
.feedback-foot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.say.warn .feedback-foot, .say.done .feedback-foot { display: none; }
/* The Reload button (build 292) leads the two links when it shows, with the line's usual gap, and the right end stays theirs. */
body:not(.no-song) .say .reload-foot:not([hidden]) + .feedback-foot { margin-left: 0; }
/* The Give feedback panel wears the label picker's card (.label-dialog) and adds its own rows. */
.feedback-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.feedback-dialog h2 { line-height: 1.25; outline: none; }
.feedback-ask { display: grid; gap: 12px; }
.feedback-ask[hidden], .feedback-scale[hidden], .feedback-box[hidden] { display: none; }
/* The "Add my account" tick box on the last step (build 226): the whole line is the target, at least 44px tall. */
.feedback-account { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 12px; color: var(--ink); cursor: pointer; }
.feedback-account[hidden] { display: none; }
.feedback-account input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.feedback-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.feedback-scale .fine:empty { display: none; }
.feedback-scale .chip { min-width: 48px; justify-content: center; }
.feedback-box { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.feedback-box textarea, .feedback-preview { min-height: 88px; margin: 0; padding: 8px 10px; font: inherit; font-size: 15px; line-height: 1.4; color: var(--ink); background: var(--field); border: 0; border-bottom: 2px solid var(--tg-edge, var(--line)); border-radius: 6px 6px 0 0; }
.feedback-box textarea { resize: vertical; }
.feedback-box textarea:focus-visible, .feedback-preview:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.feedback-preview { display: grid; gap: 2px; max-height: 240px; overflow: auto; padding: 8px 4px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; border-bottom: 0; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.feedback-dialog .feedback-preview p { margin: 0 0 4px; padding: 0 8px; font-size: 12px; color: var(--ink); }
/* Each answer in the last step is a button that goes back to its question (build 91). */
.feedback-answer { display: block; width: 100%; margin: 0; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; line-height: 1.4; text-align: left; white-space: pre-wrap; cursor: pointer; }
.feedback-answer b { display: block; font-weight: 600; }
.feedback-answer:hover { background: var(--hover); }
.feedback-answer:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* The row of steps: one for each question and one for the last step. The steps are small outlined circles joined
   by a thin line, so they read as a path through the panel and never as answers; the answer buttons under them
   are large filled squares (Nikhil, November 13: the two rows looked too similar; build 93). The step in use
   fills with the accent, and a step with an answer gets an accent ring and the accent's soft fill. */
.feedback-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 2px 0 4px; }
.feedback-steps[hidden] { display: none; }
.feedback-step { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 26px; height: 26px; margin: 0; padding: 0; border: 0; border-radius: var(--tg-corner-round); background: transparent; box-shadow: inset 0 0 0 1px var(--tg-edge, var(--line)); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; cursor: pointer; }
.feedback-step::after { content: ""; position: absolute; inset: -6px; } /* a 38px target around a 26px circle */
.feedback-step + .feedback-step::before { content: ""; position: absolute; right: 100%; top: 50%; width: 14px; height: 1px; background: var(--tg-edge, var(--line)); }
.feedback-step.send { padding: 0 12px; }
.feedback-step:hover { background: var(--hover); color: var(--ink); }
.feedback-step.answered { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
.feedback-step[aria-current="step"], .feedback-step[aria-current="step"]:hover { background: var(--accent); box-shadow: none; color: var(--accent-ink); }
.feedback-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.feedback-acts { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.feedback-dialog .label-foot .cell[hidden] { display: none; }
#feedbackHint.warn { color: var(--warn); }
@media (max-width: 700px) { .feedback-foot span, .say .coffee-foot span { display: none; } } /* the coffee cup alone on a narrow window (build 95) */
/* Build 154: while a song is open, the two links in the status line show their icons alone at every width, so the
   message has the 184 pixels the words took (Nikhil, November 16). Home keeps the words. A screen reader still hears
   "Give feedback" and "Buy me a coffee". */
body:not(.no-song) .say .feedback-foot span, body:not(.no-song) .say .coffee-foot span { display: none; }
.coffee-card { position: fixed; inset: 72px 16px auto auto; z-index: 40; display: grid; gap: 12px; width: min(360px, calc(100vw - 32px)); padding: 16px; border-radius: 14px; background: var(--tg-card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), var(--tg-shadow-lift); animation: pill-arrive var(--tg-time-pop) var(--tg-ease-out); }
.coffee-card[hidden] { display: none; }
.coffee-card h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.coffee-card p { margin: 0; color: var(--muted); font-size: 15px; }
.coffee-actions { display: flex; align-items: center; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .coffee-card { animation: none; } .coffee-link { transition: none; } }

/* The label picker (song labels plan, step 2): a panel over Home, or a small card in the corner after Open file. */
.label-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; border: 0; border-radius: 14px; background: var(--tg-card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), var(--tg-shadow-lift); }
.label-dialog[open] { display: grid; gap: 12px; }
.label-dialog h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.label-dialog h3 { margin: 4px 0 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.label-dialog h3[hidden] { display: none; }
.label-dialog h3.label-head { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); } /* "Labels", under the song's name (build 162) */
.label-dialog p { margin: 0; color: var(--muted); font-size: 15px; }
.label-hint { font-size: 12px; min-height: 17px; margin: 0; color: var(--muted); }
/* Add a folder (song labels plan, step 6): the label picker's card, a little wider, with one row for each tick. */
.folder-dialog { width: min(600px, calc(100vw - 32px)); }
.folder-step { display: grid; gap: 12px; }
.folder-step[hidden], .folder-dialog h3[hidden], .folder-rows[hidden] { display: none; }
.folder-rows { display: grid; gap: 2px; }
.folder-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 48px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.folder-row:hover { background: var(--hover); }
.folder-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.folder-row b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.folder-row small, .folder-row em { font-size: 12px; color: var(--muted); }
.folder-row small { display: block; overflow-wrap: anywhere; }
.folder-row em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.folder-notes { margin: 0; padding: 10px 12px; list-style: none; display: grid; gap: 6px; border-radius: 8px; background: var(--off); color: var(--ink); font-size: 12px; }
.folder-notes:empty { display: none; }
.folder-dialog progress { width: 100%; height: 8px; accent-color: var(--accent); }
.folder-dialog .folder-problem { padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.folder-problem[hidden] { display: none; }
.folder-dialog .label-foot { justify-content: flex-start; }
/* Add, Cancel and the promise stay at the bottom of the panel while the ticks scroll under them (build 97). The
   foot stops one pixel short of the panel's edge, so the panel's outline still shows. */
.folder-foot { position: sticky; bottom: -23px; display: grid; gap: 8px; margin: 0 -23px -23px; padding: 12px 23px 19px; background: var(--tg-card); border-top: 1px solid var(--line); }
/* The song's details: a card right under the song's name, with the song's labels to change in place (build 79). */
.details-card { position: fixed; z-index: 50; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 96px); overflow: auto; padding: 16px; border-radius: 14px; background: var(--tg-card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), var(--tg-shadow-lift); display: grid; gap: 10px; }
.details-card[hidden] { display: none; }
.details-card .panel-title { margin: 0; }
.details-labels { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.details-labels[hidden] { display: none; }
.details-labels h3 { margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
/* A label is the app's own choice chip (.chip, above), a size larger so a finger or a quick pointer lands on it. */
.label-chips .chip { min-height: 44px; padding: 0 14px; font-size: 15px; font-weight: 600; }
.label-chips .chip[aria-pressed="true"] { font-weight: 700; }
.label-new { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.label-new input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 10px; font: inherit; font-size: 15px; color: var(--ink); background: var(--field); border: 0; border-bottom: 2px solid var(--tg-edge, var(--line)); border-radius: 6px 6px 0 0; }
.label-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.label-foot .cell { min-height: 44px; }
.label-foot .cell.primary { padding: 0 22px; }
.label-foot .cell[hidden] { display: none; }
.label-remove { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.label-remove[hidden] { display: none; }
.label-remove .cell { min-height: 44px; }
/* The line after Open file adds a new song: one quiet row just above the bottom controls. */
.label-offer { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); padding: 4px 6px 4px 14px; border-radius: 10px; background: var(--tg-card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), var(--tg-shadow-tip); font-size: 15px; white-space: nowrap; }
.label-offer[hidden] { display: none; }
/* The usage question for visitors in Europe (November 19, 2026): it wraps, since its sentence is long. */
.label-offer.usage-ask { white-space: normal; width: min(560px, calc(100% - 24px)); padding: 8px 8px 8px 14px; z-index: 6; }
.label-offer.usage-ask a { color: inherit; }
/* Find on Home (song labels plan, step 4): one wide box under the top row, and the songs it finds in place of the shelves. */
.home-find { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 10px; background: var(--field); box-shadow: inset 0 0 0 1px var(--edge); color: var(--muted); cursor: text; }
.home-find[hidden] { display: none; }
.home-find:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-find input { flex: 1 1 auto; min-width: 0; min-height: 44px; border: 0; outline: 0; background: none; font: inherit; font-size: 15px; color: var(--ink); }
.find-results { width: 100%; display: grid; gap: 8px; text-align: left; }
.find-results[hidden] { display: none; }
.find-results h2 { font-size: 18px; padding: 0 8px; }
.find-results p { padding: 0 8px; }
.find-results p[hidden] { display: none; }
.find-results .recent-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 16px; }
/* The full list (step 5): one label's songs in place of Home's top row, Find and shelves. */
.empty.listing > h1, .empty.listing .home-open, .empty.listing > .fine, .empty.listing #homeFind, .empty.listing .find-results, .empty.listing .song-shelves { display: none; }
.full-list { width: 100%; display: grid; gap: 12px; text-align: left; }
.full-list[hidden] { display: none; }
.list-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.list-head .cell { flex: none; min-height: 44px; padding: 0 12px 0 6px; color: var(--accent); }
.list-head h2 { min-width: 0; font-size: 24px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.full-list .chip small { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.list-sort { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.list-sort[hidden] { display: none; }
.list-sort select { min-height: 44px; font-size: 15px; }
.home-find.list-find { flex: 1 1 220px; width: auto; max-width: 360px; min-height: 44px; }
.list-tools .fine { margin-left: auto; color: var(--muted); font-size: 12px; }
.full-list > p { padding: 0 8px; font-size: 15px; }
.full-list > p[hidden] { display: none; }
.full-list .recent-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 16px; }
/* The line after Remove, with Undo. */
.empty .home-note { display: flex; align-items: center; gap: 12px; justify-self: start; padding: 4px 6px 4px 12px; border-radius: 8px; background: var(--off); color: var(--ink); font-size: 15px; text-align: left; }
.empty .home-note[hidden], .home-note .cell[hidden] { display: none; }
/* Home once the library holds a song: one row with the headline and Open file, then the shelves (Nikhil chose
   this on November 13, after the big logo took almost half the window). The big logo shows on a first visit. */
.empty.has-songs { margin: 0 auto; padding-top: 20px; grid-template-columns: minmax(0, 1fr) auto; align-content: start; align-items: center; gap: 8px 16px; text-align: left; }
.empty.has-songs #startLogo, .empty.has-songs #emptyHow { display: none; }
.empty.has-songs h1 { grid-column: 1; justify-self: start; }
.empty.has-songs h1.welcome { font-family: inherit; font-size: 24px; font-weight: 700; line-height: inherit; letter-spacing: -0.01em; }
.empty.has-songs .home-open { grid-column: 2; justify-self: end; }
.empty.has-songs > .fine { justify-self: end; }
/* A narrow window has no room for the headline beside two buttons, so the buttons take the next row. */
@media (max-width: 600px) { .empty.has-songs h1, .empty.has-songs .home-open { grid-column: 1 / -1; justify-self: start; } }
.empty.has-songs .empty-error { justify-self: start; }
.empty.has-songs .song-shelves { margin-top: 8px; }
/* Give feedback and Buy me a coffee on Home (build 95): one quiet line under "Your file stays on this computer",
   with the same two small links the status line ends with. The link names stay on a narrow window. */
.empty .home-support { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 12px; }
.home-support .feedback-foot span { display: inline; }
.empty.has-songs .home-support { justify-self: end; justify-content: flex-end; }
.empty.listing .home-support { display: none; }
/* The Home Screen tip (build 108): a quiet card under the feedback line, in Safari on an iPhone or iPad, with the
   three steps to add TabbyGato to the Home Screen. The full song list hides it, like the feedback line. */
.add-icon { width: 100%; max-width: 560px; display: grid; gap: 8px; justify-items: start; padding: 14px 16px; border-radius: 14px; background: var(--tg-card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.add-icon[hidden] { display: none; }
.add-icon h2 { font-size: 18px; letter-spacing: -0.01em; }
.add-icon p { font-size: 15px; }
.add-icon ol { margin: 0; padding-left: 22px; display: grid; gap: 4px; font-size: 15px; }
.add-icon .cell { min-height: 44px; padding: 0 16px; background: var(--off); } /* a soft face, like Add a folder, so Got it reads as a button on the card */
.add-icon .cell:hover { background: var(--hover); }
.empty.has-songs .add-icon { justify-self: start; }
.empty.listing .add-icon { display: none; }

/* Keys and moves: every key, then the four mouse moves. The list reads down each column, and each column packs
   its own rows, so one long description doesn't stretch the rows beside it. The first column holds the longest
   set of keys, "Shift + ← or →", on one line (133 pixels). The rows sit close, so all 16 show without scrolling in a
   window 1440 by 900; a narrower window has fewer columns and scrolls. */
.keys-table { display: block; width: 100%; margin: 0; font-size: 15px; } /* a block, so the rows can run in columns across the shelf */
.keys-table tbody { display: block; columns: 380px; column-gap: 32px; }
.keys-table tr { display: grid; grid-template-columns: 140px 1fr; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.keys-table kbd { line-height: 16px; } /* a key cap stands no taller than a line of words, so a row with keys and a row with a mouse move match */
.keys-table th { text-align: left; font-weight: 600; white-space: nowrap; }
/* A label made of words names a place on the screen or a move. Three of a recording's labels are wider than the
   140 pixel slot ("Pinch, or hold Control and scroll" is 228 pixels). A label of words wraps inside the slot and
   stays 12 pixels clear of its description. A label made of key caps stays on one line. (build 161) */
.keys-table th:not(:has(kbd)) { white-space: normal; padding: 0 12px 0 0; text-wrap: balance; }
.keys-table td { color: var(--ink); }
/* Credits: a list that reads down each column, like Keys and moves. Each entry leads with the work's name, says
   what the work does and who made it, and ends with the buttons that open its license. */
.credits-list { list-style: none; margin: 0; padding: 0; columns: 380px; column-gap: 32px; font-size: 15px; }
.credits-list li { padding: 4px 0 2px; border-bottom: 1px solid var(--line); break-inside: avoid; }
.credits-list strong { font-weight: 600; margin-right: 8px; }
.credit-files { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 0 -10px; } /* the first button's words line up with the entry's words */
.license-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 15px; }
.license-head .cell { margin-left: -10px; }
.license-text { margin: 0; max-width: 90ch; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); }
.license-text.plain { font: inherit; font-size: 15px; line-height: 1.5; max-width: 80ch; } /* What's new reads in the app's everyday font */
.license-view[hidden], .credits-list[hidden] { display: none; }
.letters-off tr[data-letter] { color: var(--muted); }
.letters-off tr[data-letter] td { color: var(--muted); text-decoration: line-through; }
kbd {
  font: inherit; font-size: 12px; display: inline-block; min-width: 1.7em; text-align: center;
  padding: 1px 6px; border: 1px solid var(--edge); border-bottom-width: 2px; border-radius: 6px; background: var(--surface);
}

/* Metronome options: the click pattern strip */
.metro-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.metro-bar { border: 1px solid transparent; border-radius: 8px; padding: 4px 4px 3px; background: var(--surface); }
.metro-bar.silent { border: 1px dashed var(--edge); background: transparent; }
.metro-bar .dots { display: flex; align-items: center; justify-content: space-around; min-height: 24px; gap: 2px; }
.metro-bar .name { display: block; text-align: center; font-size: var(--tg-type-note); line-height: 14px; color: var(--muted); }
.metro-dot { position: relative; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: var(--muted); width: 14px; height: 14px; min-height: 0; }
button.metro-dot::after { content: ""; position: absolute; inset: -6px; } /* a 26 pixel place to tap around a small dot */
.metro-dot.accent { width: 22px; height: 22px; background: var(--accent); }
button.metro-dot.accent::after { inset: -2px; }
.metro-dot.between { width: 5px; height: 5px; cursor: default; opacity: 0.7; }
.metro-bar.silent .metro-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.metro-bar.silent .metro-dot.accent { box-shadow: inset 0 0 0 1.5px var(--accent); }
.metro-dot.now { outline: 3px solid var(--play); outline-offset: 2px; opacity: 1; }
.metro-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Narrower windows: the same trays, in rows ---------- */
/* Under 1360px the six trays need two rows: Restart and Play, Speed and Loop on the first; Count-in and
   Metronome, Volume, and Parts and Options on the second. */
@media (max-width: 1359px) {
  .bar { flex-wrap: wrap; row-gap: 3px; }
  .bar-break { display: block; flex: 0 0 100%; height: 0; }
  .tray.volume { max-width: 440px; }
}
/* From 840px to 1359px a score's trays pack together from the left, so Restart and Play, Speed and Loop hold the
   places they have in a wider window, and Parts and Options keep the right end of the second row (build 143).
   Before build 143 each row spread across the bar, and Play sat 938 pixels from Loop at 1,280 wide. */
@media (min-width: 840px) and (max-width: 1359px) {
  body:not(.recording) .bar { justify-content: flex-start; }
  body:not(.recording) .tray.panels { margin-left: auto; }
}
@media (max-width: 1279px) {
  /* The position and the message share the left end, one above the other, so the line stays one line of buttons. */
  :root { --status-h: 60px; } /* 52px before build 154: the message's row grew from 22px to 30px, for two lines */
  .status-row { grid-template-columns: minmax(0, 1fr) 62px 64px 64px 80px 90px; grid-template-rows: 22px 30px; padding-bottom: 6px; }
  /* The two links keep the right end of the message's row, so a longer or shorter message never slides them (build 154). */
  body:not(.no-song) .say .feedback-foot { margin-left: auto; }
  .status-row > .where { grid-area: 1 / 1; max-width: 340px; } .status-row > .say { grid-area: 2 / 1; justify-content: flex-start; }
  .status-row > .cell, .status-row > .slot-stack { grid-row: 1 / 3; }
  /* The buttons turn into the same "icon over label" shape as the controls above them, which leaves the position its room. */
  .status-row .cell.row { flex-direction: column; gap: 1px; height: 44px; padding: 0 2px; }
  .status-row .cell::after { inset: 0; }
  .say .picked { display: none; }
}
@media (max-width: 1239px) {
  /* The top bar tightens before anything wraps: 64px slots, and 20px and 16px between the groups. */
  .topbar .cell { width: 64px; }
  .app-name { margin-right: 8px; }
  .song { padding: 0 8px 0 4px; }
}
@media (max-width: 1099px) {
  .fields.one .field { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 900px) {
  .topbar { padding: 0 10px; gap: 2px; }
  .topbar .cell { width: auto; min-width: 50px; padding: 2px 4px; }
  .app-logo { --logo-h: 22px; } .app-name { padding: 4px; margin: 0 2px 0 -4px; }
  /* Home in a narrower window: the shelves two across, and Keep practicing's songs two across. */
  .empty { grid-template-columns: minmax(0, 1fr); }
  .song-shelves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .find-results .recent-list, .full-list .recent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .song-shelf.wide .recent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .song { padding: 0 6px; } .song-title { font-size: var(--tg-type-beside-narrow); } .song-title strong { font-size: var(--tg-type-song-narrow); margin-right: 6px; }
  .song { display: grid; grid-template-rows: 22px 16px; align-content: center; justify-items: center; }
  .song-sub { margin-left: 0; font-size: var(--tg-type-beside-narrow); line-height: 16px; }
  .song-edit { padding: 0 8px; } .song-edit:first-child { padding-left: 0; border-left: 0; }
  .song-map { padding: 0 10px 8px; } .map-section .map-head-row { padding: 0 5px; font-size: var(--tg-type-map-narrow); } .map-bar { display: none; }
  .score-wrap { padding: 8px 8px 16px; }
  .bar { padding: 6px 10px 4px; }
  .status-row { padding: 0 10px 6px; } .shelf { --shelf-side: 10px; }
  .where .icon { display: none; }
  .two-col { grid-template-columns: 1fr; gap: 14px; }
  .parts-grid { grid-template-columns: minmax(64px, 100px) 64px 64px 64px minmax(104px, 1fr) minmax(0, 100px) minmax(110px, 1fr); gap: 4px; }
  .part-vol output { width: 36px; }
  .field.wide { grid-column: auto; }
}
/* An upright iPad (build 167): from 701 to 900 pixels wide the Options tabs keep two columns of rows, with each label
   over its choices. One column of rows there ran well past the shelf's lower edge. The twelve key chips wrap inside
   their column. Under 701 pixels the rows keep one column. */
@media (min-width: 701px) and (max-width: 900px) {
  .two-col, #metroPanel .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; }
  .seg-set { flex-wrap: wrap; }
}
/* Under 840px (an upright iPad) the trays keep the order of the page: Restart and Play, Speed, Loop, then Count-in and
   Metronome, Volume, and Parts and Options at the right end (build 159; Nikhil chose this first row on November 16).
   Restart and Play are 14 pixels narrower here, so the first row holds Play, Speed and Loop down to 809px wide.
   Before build 159 Volume sat beside Play on the first row and Loop dropped to the second. */
@media (max-width: 839px) {
  .bar { row-gap: 6px; justify-content: flex-start; }
  .bar-break { display: none; }
  .tray.volume { max-width: none; }
  .tray.panels { margin-left: auto; }
  .bar #restartBtn, .bar #recRestart { width: 56px; } .bar #playBtn, .bar #recPlay { width: 86px; } /* .bar, so the rule also wins over a recording's own widths further down */
}
/* Under 809px the first row cannot hold Loop, so Volume takes the room after Speed, and Loop starts the second row.
   Play and Speed keep their places. A style rule sets this order, so the Tab key reaches Loop before Volume here. */
@media (max-width: 808px) {
  .tray.transport { order: 1; } .tray.speed { order: 2; } .tray.volume { order: 3; }
  .tray.loop { order: 4; } .tray.click { order: 5; } .tray.panels { order: 6; }
}
/* A recording's Loop tray is 68 pixels wider than a tab's (the range in words, and Loop options), so a recording's
   first row holds Loop only from 960px. From 809px to 959px a recording takes the same narrower order: Play, Speed
   and Volume on the first row, then Loop, with Options at the right end. Before build 159 the two rows spread apart
   from 840px to 959px. */
@media (min-width: 809px) and (max-width: 959px) {
  body.recording .bar { justify-content: flex-start; }
  body.recording .tray.transport { order: 1; } body.recording .tray.speed { order: 2; } body.recording .tray.volume { order: 3; max-width: none; }
  body.recording .tray.loop { order: 4; } body.recording .tray.panels { order: 6; margin-left: auto; }
}
@media (max-width: 700px) {
  .seg-set { flex-wrap: wrap; }
  :root { --status-h: 112px; }
  .topbar { height: auto; min-height: 56px; flex-wrap: wrap; padding: 4px 10px; }
  .song { order: 10; flex-basis: 100%; margin: 0 0 4px; }
  .status-row { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: 22px 30px 44px; gap: 2px 4px; }
  .status-row > .where { grid-area: 1 / 1 / 2 / 6; } .status-row > .say { grid-area: 2 / 1 / 3 / 6; }
  .status-row > .cell, .status-row > .slot-stack { grid-row: 3; }
}
/* A short window, such as a browser zoomed to 200%: the page scrolls as one piece, so the music keeps
   a readable height instead of being squeezed between the bars. */
@media (max-height: 600px) {
  html, body { height: auto; min-height: 100%; }
  main { min-height: 260px; flex: 1 0 260px; }
  .shelf, .shelf.reading { max-height: none; } /* no stop in a short, wide window: the page scrolls there, so the panel shows whole, as before build 171 */
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media (forced-colors: active) {
  .cell[aria-pressed="true"], .cell[aria-expanded="true"], .chip[aria-pressed="true"] { border-width: 3px; }
}

/* Home in a narrow window: one shelf across, and one song across. */
@media (max-width: 600px) {
  .song-shelves { grid-template-columns: minmax(0, 1fr); }
  .find-results .recent-list, .full-list .recent-list { grid-template-columns: minmax(0, 1fr); }
  .song-shelf.wide .recent-list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Phones (builds 99 and 100, November 13, 2026) ----------
   Nikhil's iPhone showed the practice controls in five rows that filled about 60% of the screen (build 95).
   Build 99 cut them to two rows. On build 99 Nikhil asked for still more room for the tab: a simple transport
   bar, and the other buttons in a second bar that hides itself (build 100). On a phone:
   - Top bar: the logo, Home and the song's name share one row. The name and the line under it start at the left.
   - The transport bar sits at the bottom edge: Restart, Play, and the speed as one control (minus, the speed
     you can type, plus). Nothing under it ever hides, so Play and Pause stay in one place under the thumb.
   - The tools bar sits above it: Loop with From and To, Count-in and Metronome, Parts and Options. While the
     music plays, the tools bar hides and the music takes its room. Pause brings it back.
   - The status line sits above the bars: where the music is, then the app's message. While the music plays,
     only the message shows, and an empty message takes no room.
   - Left out on a phone: the Volume tray (the phone's own buttons set the volume) and the four quick speeds.
   - Play bars, Follow music and the other buttons in the status line take a line only while they show, where
     a computer keeps their room.
   A phone turned sideways (a touch screen 500px tall or less) takes the same rules, and then the changes in
   the sideways block below. */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  .topbar { flex-wrap: nowrap; height: 52px; min-height: 0; padding: 0 8px; gap: 2px; }
  .app-logo { --logo-h: 18px; } .app-name { margin: 0; padding: 6px; }
  .topbar .cell { min-width: 44px; padding: 2px; }
  /* Home, Emporium and Metronome show their icons alone (Nikhil, November 20, 2026, build 277), so the song's name keeps
     its room: their three words had left it about 123 pixels at 375 wide. Each word stays for a screen reader. */
  .topbar .cell#homeBtn, .topbar .cell#emporiumBtn, .topbar .cell#metroDoor, .topbar .cell#topShare { flex: none; width: 44px; min-width: 44px; }
  .topbar :is(#homeBtn, #emporiumBtn, #topShare) .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .song { order: 0; flex: 1 1 auto; flex-basis: auto; min-width: 0; margin: 0 0 0 4px; padding: 0 4px; justify-items: start; }
  .song-title { max-width: 100%; } .song-title strong { font-size: var(--tg-type-song-narrow); }
  .song-map { padding: 0 8px 6px; }

  /* From the top: the shelf when it is open, the status line, the tools bar, the transport bar. */
  .strip { display: flex; flex-direction: column; }
  .strip > .shelf { order: 0; } .strip > .status-row { order: 1; } .strip > .bar { order: 2; }
  .bar { flex-wrap: wrap; justify-content: space-between; gap: 0 4px; padding: 0 8px 4px; }
  .tray { flex: none; height: 48px; padding: 0; gap: 2px; background: transparent; }
  .tray.volume, .presets { display: none; }
  .tray.loop, .tray.click, .tray.panels { order: 1; margin-left: 0; }
  .bar-break { display: block; order: 2; flex: 0 0 100%; height: 0; } /* the transport bar always starts a line of its own */
  .tray.transport { order: 3; flex: 1 0 auto; height: 52px; }
  #restartBtn { width: 56px; } #restartSub { display: none; }
  #playBtn { flex: 1 1 auto; width: auto; min-width: 72px; }
  /* The speed as one control: minus, the speed, plus, on one soft face. Slower and Faster keep their names for a screen reader. */
  .tray.speed { order: 4; align-self: center; height: 44px; margin-left: 6px; padding: 0 2px; gap: 0; border-radius: 14px; background: var(--hover); }
  .speed .cell.step { width: 44px; min-height: 0; } /* 40 before build 218, under the 44 pixel floor for a finger */ .speed .cell.step .lbl, .speed .cap { display: none; }
  .bar .speed .cell.step .icon { width: 20px; height: 20px; }
  .speed .stack { width: auto; min-width: 56px; grid-template-rows: auto; }
  /* Build 217 (Adam's note 5): From, To and the typed speed each take a finger across 44 by 44 or more. From and To
     were 34 by 48 to a tap, the typed speed 36 by 24. The typed speed's box fills the speed control's 44 pixels, and
     its line is drawn where the old 24 pixel box drew it, so the look stays the same. */
  .loop .cell.big { width: 52px; } .loop .cell.num { width: 44px; padding: 2px 0; }
  .loop .cell.num input { width: 40px; }
  .speed .stack { align-self: stretch; }
  .bar .speed .readout input { width: 44px; height: 44px; border-bottom: 0; background: linear-gradient(var(--edge), var(--edge)) no-repeat 0 calc(50% + 12px) / 100% 2px; }
  .bar .speed .readout input:focus { background-image: linear-gradient(var(--accent), var(--accent)); }
  /* Safari on an iPhone zooms the whole page into a box whose words are under 16 pixels, and the student then has to
     pinch back out (seen in the iPhone 17 simulator on build 217). The bar's number boxes use 16 pixels here. */
  .bar input[type="number"] { font-size: var(--tg-type-value-touch); }
  #countBtn { width: 58px; } #metroBtn { width: 68px; }
  #partsBtn { width: 44px; } #optionsBtn { width: 52px; } #sectionsBtn { width: 56px; }
  .bar .cell { font-size: var(--tg-type-tight); } .bar .cell small { font-size: var(--tg-type-tight); }
  .bar .cell .icon { width: 18px; height: 18px; } .bar #playBtn .icon { width: 24px; height: 24px; }
  .cell .badge { top: 0; right: 0; }
  /* While the music plays (the count-in included), the tools bar and the line that says where the music is step aside. */
  body.playing .tray.loop, body.playing .tray.click, body.playing .tray.panels { display: none; }
  body.playing .status-row > .where, body.playing .feedback-foot, body.playing .coffee-foot { display: none; }
  body.playing .say { min-height: 0; }
  /* Nikhil, November 19, 2026: on a phone, Give feedback and Buy me a coffee live in Options, on the App tab, so the
     status line keeps its room for the message. The tour's last stop still lights the two links while it shows. */
  body:not([data-tour-stop="support"]) #feedbackFoot, body:not([data-tour-stop="support"]) #coffeeFoot { display: none; }

  /* "Hide while playing" for the bottom bar (build 101): on a phone the transport bar stays under the thumb, as
     build 100 promised, and only the message line above it steps aside. The tab is not needed there. */
  body.playing.hide-bottom .strip, body.playing.hide-bottom .strip.peek { position: relative; transform: none; box-shadow: none; }
  body.playing.hide-bottom .strip > .status-row, body.playing.hide-bottom .strip > .bar-tab { display: none; }

  :root { --status-h: auto; }
  .status-row { height: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: auto; gap: 0 4px; padding: 2px 10px 2px; }
  .status-row > .where, .status-row > .say { grid-column: 1 / -1; grid-row: auto; max-width: none; }
  .status-row > .where { order: 0; min-height: 22px; } .status-row > .say { order: 1; }
  .status-row > .cell, .status-row > .slot-stack { order: 2; grid-row: auto; }
  .slot[hidden] { display: none !important; }
  .slot-stack:not(:has(> :not([hidden]))) { display: none; }
  .say { justify-content: flex-start; min-height: 30px; align-items: center; } /* room for two lines at all times (build 154; 22px before) */
  body.no-song .say { justify-content: flex-start; }
  .feedback-foot::after { inset: -4px -2px; } /* its taller press area reached past the screen's bottom edge, and the page could scroll by 3px */

  /* Options and Parts: the tabs stay on one line and slide sideways. The shelf is as tall as its rows, up to 46% of the
     screen (build 171; before, a set height of half the screen, 360 pixels at most). */
  .shelf { --shelf-side: 10px; max-height: min(var(--area-h, 100vh), 46vh); padding-bottom: 8px; } /* a phone keeps the stop in a short window too */
  .shelf-tabs { gap: 2px; }
  .tab-list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tab-list::-webkit-scrollbar { display: none; }
  .shelf-tab { flex: none; padding: 0 10px; gap: 6px; }
  /* Parts on a phone: each part's name on a line of its own, then Show, Mute, Solo and its volume, then its sound.
     The song-wide lane picture, which needs a wide screen to read, stays on a computer. */
  .parts-grid { grid-template-columns: auto auto auto minmax(0, 1fr); gap: 2px 4px; }
  .parts-grid > div:empty, .parts-grid .lane-head, .parts-grid .part-lane { display: none; }
  .part-name { grid-column: 1 / -1; margin-top: 10px; }
  .part-sound { grid-column: 1 / -1; }
  .parts-grid .cell { width: auto; padding: 0 8px; }

  /* The loop's buttons and the Focus view's buttons over the music (build 103). On Nikhil's iPhone the Focus
     view's row ran past the screen's right edge and hid Close, and the loop's row was 433 pixels wide on a
     402-pixel screen. On a phone both rows fit 375 pixels (an iPhone SE): the buttons sit closer, Loop options
     and Loop off each show their icon alone (a screen reader still hears each name), and the Focus view drops
     "Focused on bars", which the status line says. Build 145 gave Loop off its words in a wider window; here
     the words would push the row to 370 pixels with a short name, and past the screen with "Bars 10 to 12". */
  .loop-pill .cell.row.small { padding: 0 7px; gap: 4px; }
  .pill-name { padding: 0 4px 0 6px; }
  #pillOptions, #pillOff { position: relative; }
  #pillOptions .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #pillOff .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* Build 210: Save section shows its tag alone here too, so the row stays 291 pixels wide, and the Focus view's
     Whole song shows its X alone, so that row stays 316 pixels wide where the words would make it 390. */
  #pillTag, #focusClose { position: relative; }
  #pillTag .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #focusClose .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #pillFocus > .pill-say:first-child { display: none; }
  /* Build 268 (Adam's note 5, second pass): Save section, Loop options and Loop off were 32 by 44 here, too narrow for
     a finger. Each is now 44 by 44, and the three sit edge to edge, so the row grows 28 pixels, not 36: 309 pixels
     with "Bars 1 to 4", and 347 with "Bars 100 to 104", inside a 375 pixel screen's 359 pixels of room. */
  #pillTag, #pillOptions, #pillOff { width: 44px; padding: 0; justify-content: center; }
  #pillOptions, #pillOff { margin-left: -4px; }
  /* Build 4 of the sections-and-loops plan: Save loop joins the row. Focus shows its icon alone, the name keeps 108
     pixels, and the save slot keeps its words without the icon, since Saved and Edited need their words. */
  #focusBtn { position: relative; width: 44px; padding: 0; justify-content: center; }
  #focusBtn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #pillLoop .pill-name { width: 108px; }
  #pillSave { width: 78px; padding: 0 4px; }
  #pillSave .icon { display: none; }
}
@media (max-width: 389px) {
  #pillLoop .pill-name { width: 72px; } /* an iPhone SE's 375 pixels */
}
@media (max-width: 389px) {
  #speedSep, #speedBpm, #speedBpmUnit { display: none !important; }
}
/* A phone turned sideways: short and wide. Before build 99 the page scrolled as one piece there (see
   max-height: 600px), and Play sat below the bottom of the screen. Build 99 kept the page still, but on
   Nikhil's iPhone (874px wide) a computer rule for windows 840px to 1359px wide put a hidden line break into
   the controls, which squeezed Restart, Play and the speed on top of each other and pushed the tools off the
   screen. Build 100: the transport bar and the tools share one line, with no break; the top bar also steps
   aside while the music plays, and the song map stays to show where the music is. The sides keep clear of the
   iPhone's camera cutout, which sits at one side of the screen in this position. */
@media (max-height: 500px) and (pointer: coarse) {
  html, body { height: 100%; min-height: 0; }
  main { flex: 1 1 auto; min-height: 0; }
  .topbar { height: 44px; }
  .topbar, .song-map, .bar, .status-row, .shelf, .score-wrap {
    padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right));
  }
  .bar { flex-wrap: nowrap; justify-content: flex-start; gap: 0 4px; }
  .bar-break { display: none; }
  .tray.transport { order: 1; flex: none; height: 48px; } .tray.speed { order: 2; }
  .tray.loop { order: 3; margin-left: auto; } .tray.click { order: 4; } .tray.panels { order: 5; }
  #playBtn { flex: none; width: 80px; }
  #countBtn { width: 56px; } #metroBtn { width: 64px; }
  .status-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .status-row > .where { grid-column: 1; grid-row: 1; } .status-row > .say { grid-column: 2; grid-row: 1; justify-content: flex-end; min-height: 22px; }
  .say:not(.warn):not(.done) .status { -webkit-line-clamp: 1; } /* a phone turned sideways has no height to spare: one line */
  body.playing .topbar { display: none; }
  body.no-song .status-row { padding-right: max(124px, env(safe-area-inset-right)); }
  .feedback-foot span, .say .coffee-foot span { display: none; } /* the two icons alone, so the message keeps its room */
}
/* A narrow phone turned sideways, such as an iPhone SE: the speed shows its percent alone, so one line holds every control. */
@media (max-height: 500px) and (pointer: coarse) and (max-width: 760px) {
  #speedSep, #speedBpm, #speedBpmUnit { display: none !important; }
}

/* ---------- A recording (recording-view.mjs; the recording integration plan, November 14, 2026) ----------
   body.recording marks the mode, set by main.mjs while a recording is open. The score's trays, Parts, the loop's
   floating buttons and the picked-bar buttons in the status line step aside, and the recording's own overview,
   screen and trays take their places. Every color, size and corner here is one the score screen already uses
   (work/recording-integration/DESIGN-SPEC.md), so the dark look needs nothing of its own. */
.tray.rec { display: none; }
body.recording .bar > .tray.rec { display: flex; }
body.recording .bar > .tray:not(.rec):not(.panels), body.recording .bar-break, body.recording #partsBtn, body.recording #sectionsBtn { display: none; }
body.recording #songMap, body.recording .loop-pill { display: none !important; }
/* Build 217 (Adam's note 5): on a phone held upright the quick speeds come back, as 48 by 44 buttons right above the
   speed control, on all three practice screens. On a tab they take the empty right end of the Sections row, and the
   transport row's basis of 0 keeps the wider speed control beside Play. A recording's first row is full, so the
   line break under it becomes a 48 pixel row for them. While the music plays they step aside with the other tools. */
@media (max-width: 600px) {
  body:not(.recording) .tray.transport { flex-basis: 0; }
  .tray.speed { position: relative; }
  .bar .tray.speed .presets { display: grid; position: absolute; right: 0; bottom: calc(100% + 6px); margin: 0; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 48px; grid-auto-rows: 44px; gap: 4px; }
  body.recording .bar-break { display: block; order: 2; flex: 0 0 100%; height: 48px; }
  body.playing .bar .tray.speed .presets { display: none; }
  body.playing.recording .bar-break { height: 0; }
}
@media (max-width: 389px) { .bar .tray.speed .presets { grid-auto-columns: 44px; } } /* clear of Options on a 375 pixel iPhone */
/* The status line keeps the position and the message, with none of the picked-bar buttons' room between them. */
body.recording .status-row > .cell, body.recording .status-row > .slot-stack { display: none !important; }
body.recording .status-row { grid-template-columns: 330px minmax(0, 1fr); }
@media (max-width: 1279px) { body.recording .status-row { grid-template-columns: minmax(0, 1fr); } }
body.recording .say .round, body.recording .say .loop-note, body.recording .say .picked { display: none; }
#recRestart { width: 64px; } #recPlay { width: 92px; }
.speed.rec .stack { width: 72px; }
/* From 1140px wide, where the three quick speeds show, the typed speed's place is 13 pixels wider (build 148), so a
   recording's Loop starts 583 pixels from the left edge, where a score's Loop starts. Before build 148 it started at 570. */
@media (min-width: 1140px) { .speed.rec .stack { width: 85px; } }
.speed.rec .presets { grid-template-columns: repeat(3, 48px); }
.loop.rec .stack { width: 112px; flex: none; align-self: center; padding-left: 6px; }
/* Build 123: a recording's bottom bar stays one row down to 960px wide, so it never covers the range row. The volume
   slider shrinks first; under 1140px the 50%, 75% and 100% buttons step aside (Slower, Faster and the typed speed
   remain). A score's bar keeps its own rows. */
@media (min-width: 960px) and (max-width: 1359px) { body.recording .bar { flex-wrap: nowrap; } }
@media (min-width: 960px) and (max-width: 1139px) {
  body.recording .speed.rec .presets { display: none; }
  body.recording #recVolumeReadout { display: none; } /* the slider's 58px at 960 wide hold the word Volume, not the word and the level */
}
/* A short window scrolls as one page (max-height: 600px below); on a recording the page still fills the window, so the
   editor gets the room under the bar's one row instead of leaving it empty under the status line. */
@media (max-height: 600px) { body.recording { min-height: 100vh; } }
/* The top bar's line under a recording's title: "Recording · 3:18", after the same thin divider as a score's tempo. */
.rec-line { padding: 0 12px; border-left: 1px solid var(--edge); font-variant-numeric: tabular-nums; }

/* The overview in the song map's slot: the section blocks on a 21px band, the waveform 30px tall under them. */
.rec-map-track { position: relative; height: 57px; cursor: pointer; touch-action: none; } /* build 297: the section row, the loop lane (16), the waveform (18) */
.rec-map-band { position: absolute; left: 0; right: 0; top: 0; height: 21px; }
.rec-map-wave { position: absolute; left: 0; top: 39px; display: block; width: 100%; height: 18px; background: var(--surface); border-radius: 6px; pointer-events: none; }
.rec-map-band .map-section, .rec-band .map-section { height: 21px; }
/* The part of the recording the editor shows while zoomed in: a quiet box on the overview's waveform. */
#recMapRange { background: none; } /* build 121: the overview shows the music inside the range, with the outline alone */
.rec-map-view { position: absolute; top: 39px; height: 18px; border: 1px solid var(--edge); border-radius: 6px; pointer-events: none; }
/* The waveform's three bands (recording-view.mjs, build 115). Set 1 is the app's. The bands-2 and bands-3 classes,
   which ?bands=2 and ?bands=3 put on the page, show the other two sets for review only. */
:root { --band-bass: var(--tg-band-bass); --band-mid: var(--tg-band-mid); --band-treble: var(--tg-band-treble); }
:root.bands-2 { --band-bass: var(--tg-band2-bass); --band-mid: var(--tg-band2-mid); --band-treble: var(--tg-band2-treble); }
:root.bands-3 { --band-bass: var(--tg-band3-bass); --band-mid: var(--tg-band3-mid); --band-treble: var(--tg-band3-treble); }
/* A recording's Loop tab shows its two pauses alone, and a score's Loop tab never shows them. The Loop button wears
   the count of pauses set, as a score's Loop button wears the count of its loop options. */
body.recording #loopPanel > .two-col, body:not(.recording) .rec-pauses { display: none; }
/* On a recording the shelf lies over the lower part of the recording's area (build 172, option C). The area keeps its
   size, so the waveform, the trays under it, the video and the saved list stay where they are, as a tab's music stays
   under an open shelf. Before build 172 an open shelf took its height from the area: the waveform shrank, the trays
   moved, and the saved list showed one row. The shelf hangs from the top of the bottom strip, on the card's face, with
   the band's line along its upper edge (build 242; the desk's color before). Home over an open recording keeps the shelf in the page's flow. The stop is
   written here again, so the shelf never reaches past the top of the area in a short window. */
body.recording:not(.no-song) .shelf {
  position: absolute; left: 0; right: 0; bottom: 100%; z-index: 5; max-height: min(var(--area-h, 100vh), 46vh);
  background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); /* the band's own line runs along the upper edge (build 242) */
}
#recLoop { position: relative; }
#recLoopOptions { width: auto; padding: 2px 8px; }

/* The screen: Saved Sections on the left, on the paper with a quiet line on its right, and the editor. */
.rec-wrap { flex: 1 1 auto; min-width: 0; min-height: 0; display: grid; grid-template-columns: 264px minmax(0, 1fr); overflow: hidden; }
.rec-side { min-height: 0; overflow: auto; padding: 16px 12px; background: var(--bg); border-right: 1px solid var(--line); scrollbar-color: var(--edge) transparent; }
.rec-side h2 { margin: 0 8px 12px; font-size: var(--tg-type-heading); }
.rec-group + .rec-group { margin-top: 24px; }
.rec-side .shelf-head h3 { margin: 0; font-size: var(--tg-type-group); }
.rec-none { padding: 4px 8px; }
.rec-side .recent-open strong { white-space: normal; overflow-wrap: anywhere; } /* a long name wraps rather than cuts */
.rec-side .recent-open span { font-variant-numeric: tabular-nums; }
.rec-side li.open-now .recent-open span { color: var(--ink); font-weight: 600; } /* ink, not the accent: 4.31 to 1 on the soft fill in the dark look was under 4.5 (QA of build 113) */
.rec-swatch { display: inline-block; flex: none; box-sizing: border-box; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: var(--tg-corner-mark); border: 1px solid var(--edge); background: var(--surface); } /* no part: the neutral square (build 120) */
.rec-swatch[data-hue="0"] { background: var(--sec-0); } .rec-swatch[data-hue="1"] { background: var(--sec-1); }
.rec-swatch[data-hue="2"] { background: var(--sec-2); } .rec-swatch[data-hue="3"] { background: var(--sec-3); }
.rec-swatch[data-hue="4"] { background: var(--sec-4); } .rec-swatch[data-hue="5"] { background: var(--sec-5); }
.rec-act { flex: none; width: 44px; min-height: 44px; padding: 0; color: var(--muted); }
.rec-side .map-edit-box { position: static; flex: 1 1 auto; min-width: 0; padding: 4px 8px; }
.rec-side .map-edit { height: 28px; font-size: var(--tg-type-passage); }
.rec-note { display: flex; align-items: center; gap: 12px; margin: 24px 0 0; padding: 4px 6px 4px 12px; border-radius: 8px; background: var(--off); color: var(--ink); font-size: var(--tg-type-sentence); }
.rec-note .cell[hidden] { display: none; }
/* "Added to your library": with a recording open, main.mjs moves the line into the editor, under the range row, so it
   never covers the range row or the sidebar. A score keeps its own placement. */
body.recording .rec-edit > .label-offer { position: static; transform: none; align-self: flex-start; max-width: 100%; white-space: normal; }

.rec-edit { min-width: 0; min-height: 0; overflow: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.rec-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 32px; } /* never squeezed: with the tools on a second line it keeps its height (build 115) */
.rec-head h2 { min-width: 0; font-size: var(--tg-type-passage); overflow-wrap: anywhere; }
.rec-head .fine { font-variant-numeric: tabular-nums; }
/* The passage's group (build 210, idea 3): the same face as the loop's buttons on a tab, the card color, a 1 pixel
   accent line, 14 pixel corners and 4 pixels inside, with no shadow. The name, in the accent like "Bars 9 to 12",
   and its times share the room before Focus and end in three dots when they run long, the times first. The group's width follows
   the window alone, never the name, so Focus holds the group's right end for every name. The group is 540 pixels
   at most and leaves 342 beside it for the band chips and the zoom buttons (330 on a touch screen, plus the gap),
   so the heading stays one line from an upright iPad to a wide computer. On a phone the group takes the whole row. */
.rec-passage { display: flex; align-items: center; gap: 4px 8px; width: min(540px, max(300px, calc(100% - 342px))); max-width: 100%; box-sizing: border-box; padding: 4px; margin-block: -5px; border: 1px solid var(--accent); border-radius: 14px; background: var(--surface); }
.rec-says { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; }
.rec-says h2 { flex: 0 1 auto; min-width: 0; margin: 0; padding-left: 2px; color: var(--accent); line-height: 32px; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.rec-says .fine { flex: 0 1000 auto; min-width: 0; margin: 0; line-height: 32px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .rec-passage { width: 100%; } }
.rec-edited { font-size: var(--tg-type-label); font-weight: 700; color: var(--accent); }
.rec-head .rec-edited { display: none; } /* the Save tray says Edited beside the button that saves it (build 131) */
/* The waveform's tools on the right of the heading row (build 115): All, Bass, Mid, Treble, then Zoom out, Zoom in, Focus. */
.rec-tools { margin-left: auto; align-self: center; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rec-show { display: inline-flex; gap: 4px; margin-right: 6px; }
.rec-tools > .cell.small:not(.row) { width: 32px; padding: 0; }
/* The waveform is a fixed band, with the range row right under its time marks. The paper below stays empty; notes
   will live there in a later milestone (design lead, after Nikhil's first real song, November 14). */
.rec-wave-block { flex: none; display: flex; flex-direction: column; gap: 4px; }
/* The band and the time marks keep the browser from scrolling or zooming the page under a two-finger pinch, as the
   waveform and the scroll bar already do (build 122). The page still scrolls with one finger beside the block. */
.rec-band { position: relative; flex: none; height: 21px; touch-action: none; }
.rec-wave { position: relative; flex: none; height: clamp(112px, 16vh, 148px); cursor: pointer; touch-action: none; user-select: none; }
/* A finger held on the waveform, the sections over it, the comment lane or the song map moves the playing line or picks
   a range, so an iPhone's own text picking, its blue handles, its magnifier and its press-and-hold menu stay away
   (build 182, change 23). Safari needs the -webkit- words. A name box opened in the sections keeps its typing. */
.rec-wave-block, .rec-map-track { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rec-wave-block .map-edit { -webkit-user-select: text; user-select: text; }
#recCanvas { display: block; width: 100%; height: 100%; background: var(--surface); border-radius: 8px; }
/* The range (build 121, after Nikhil asked for much lighter bookends): nothing covers the music inside it. A light veil
   of the page color lies over the music outside it. Each edge is a bracket: a 2px line the full height of the waveform
   with an 8px tick at the top and the bottom pointing into the range, so the start reads "[" and the end "]". Along the
   top and bottom runs a 1px dashed line with Loop off and a 2px solid one with Loop on, as on the overview. A bracket is
   grabbed in an invisible place 24px wide (44px on a touch screen) centered on its line. recording-view.mjs sets
   --tick, which shrinks the ticks on a range a few pixels wide so the two never cross. */
.rec-veil { position: absolute; top: 0; bottom: 0; left: 0; background: var(--bg); opacity: 0.45; border-radius: 8px; border-top-right-radius: 0; border-bottom-right-radius: 0; pointer-events: none; }
.rec-veil.after { left: auto; right: 0; border-radius: 8px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.rec-range { --tick: 8px; --half: 12px; position: absolute; top: 0; bottom: 0; pointer-events: none; }
.rec-range::before, .rec-range::after { content: ""; position: absolute; left: 0; right: 0; border-top: 1px dashed var(--accent); }
.rec-range::before { top: 0; }
.rec-range::after { bottom: 0; }
.rec-range.looping::before, .rec-range.looping::after { border-top: 2px solid var(--accent); }
.rec-handle { position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--half)); width: calc(2 * var(--half)); pointer-events: auto; cursor: ew-resize; touch-action: none; }
.rec-handle.end { left: auto; right: calc(-1 * var(--half)); }
/* The line has a 1px edge of the surface color on each side, so it stands clear of the violet, orange and pink bars. */
.rec-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--half) - 2px); width: 2px; background: var(--accent); border: solid var(--surface); border-width: 0 1px; box-sizing: content-box; }
.rec-handle:hover::before, .rec-handle.dragging::before { left: calc(var(--half) - 2.5px); width: 3px; }
.rec-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--half) - 1px); width: var(--tick); border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); box-sizing: border-box; }
.rec-handle.end::after { left: auto; right: calc(var(--half) - 1px); }
/* (Build 127: Nikhil asked for no box around a range edge. The edge that has the keyboard shows a heavier bracket.) */
.rec-handle:focus-visible { outline: none; }
.rec-handle:focus-visible:not(.dragging)::before { left: calc(var(--half) - 3px); width: 4px; }
.rec-handle:focus-visible:not(.dragging)::after { border-top-width: 4px; border-bottom-width: 4px; }
@media (pointer: coarse) { .rec-range { --half: 22px; } }
.rec-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--play); pointer-events: none; }
/* The playing line's head (build 126): a small tab in the line's color at the top of the waveform, and of the overview's
   waveform, so it never covers a section's name. It shows the line can be dragged. The press itself reaches 6px either
   side of the line over its full height (12px for a finger); recording-view.mjs decides with lineGrab. The head lies
   over the marks, so it always takes the line. */
.rec-now-head { position: absolute; top: 0; left: 50%; z-index: 2; width: var(--tg-space-12); height: var(--tg-space-12); margin-left: calc(-1 * var(--tg-space-6));
  border-bottom-left-radius: var(--tg-corner-small); border-bottom-right-radius: var(--tg-corner-small); background: var(--play); box-shadow: 0 0 0 1px var(--surface); pointer-events: auto; cursor: ew-resize; touch-action: none; }
#recMapNow .rec-now-head { top: 44px; } /* the overview's line starts 5px above its band; the waveform starts 39px down (build 297) */
.rec-wave.line-hover, .rec-map-track.line-hover { cursor: ew-resize; }
.rec-wave.line-dragging, .rec-map-track.line-dragging, .line-dragging .rec-now-head, .line-dragging .rec-handle { cursor: grabbing; }
.rec-ticks { position: relative; flex: none; height: 16px; touch-action: none; font-size: var(--tg-type-note); line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rec-tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.rec-tick.first { transform: none; } .rec-tick.last { transform: translateX(-100%); } /* the marks at the two ends stay inside the strip */
/* The scroll bar under the time marks (build 121): an 8px track in --off with a handle in --edge (--muted under the
   pointer and while dragged), fully rounded. The place to press reaches 6px above and below the track (20px in all), over
   the gap and the foot of the time marks, so the bar adds 12px to the page. Under a video the strip block's gaps and time
   marks are 2px tighter each, so 1280 by 720 still fits the range row above the bottom bar. On a touch screen the bar
   is 20px tall with a 44px place to press. Hidden, it keeps its place, so zooming never moves the range row. */
.rec-scroll { position: relative; flex: none; height: 8px; cursor: pointer; touch-action: none; user-select: none; border-radius: var(--tg-corner-round); }
.rec-scroll[hidden] { display: block !important; visibility: hidden; }
.rec-scroll::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; border-radius: var(--tg-corner-round); background: var(--off); }
.rec-scroll::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }
.rec-scroll-thumb { position: absolute; z-index: 1; top: -6px; bottom: -6px; left: 0; width: 0; cursor: grab; }
.rec-scroll-thumb::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 8px; border-radius: var(--tg-corner-round); background: var(--edge); }
.rec-scroll-thumb:hover::before, .rec-scroll.dragging .rec-scroll-thumb::before { background: var(--muted); }
.rec-scroll.dragging, .rec-scroll.dragging .rec-scroll-thumb { cursor: grabbing; }
.rec-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rec-wrap.video .rec-wave-block { gap: 2px; }
.rec-wrap.video .rec-ticks { height: 14px; line-height: 14px; }
@media (pointer: coarse) {
  .rec-scroll { height: 20px; }
  .rec-scroll::before { top: 6px; }
  .rec-scroll::after, .rec-scroll-thumb { top: -16px; bottom: -8px; }
  .rec-scroll-thumb::before { top: 22px; }
}
/* The pause's seconds left, large, on the range (build 118): the accent on the surface, in a round pill with the edge
   color's line, so it reads on a busy waveform in both looks. 44px type on a file's waveform, 32px on a video's 56px strip.
   recording-view.mjs sets `left`; the height is fixed, so the count-in's pulse can use `transform` alone. */
.rec-pause-count { position: absolute; top: 50%; left: 0; z-index: 2; box-sizing: border-box; height: 58px; margin-top: -29px; min-width: 58px; padding: 0 16px;
  display: grid; place-items: center; font-size: var(--tg-text-display-m); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent);
  background: var(--surface); border: 1px solid var(--edge); border-radius: var(--tg-corner-round); pointer-events: none; }
.rec-pause-count[hidden] { display: none; }
.rec-pause-count.tick { animation: count-tick var(--tg-time-pop) var(--tg-ease-out); }
@media (prefers-reduced-motion: reduce) { .rec-pause-count.tick { animation: none; } }
/* The range row: Start and End, each with a minus and a plus, then Start here and End here, the save buttons, Clear. */
.rec-range-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
/* The trays under the waveform (build 131): the range and its edges, the Save tray, and the playing line. Each is a
   quiet face, as the bottom bar's trays are, so the eye reads three groups in place of fifteen loose buttons. On a
   wide editor the playing line's tray comes first, in the order a student works; on a narrower one it drops to the
   second line, so the Save tray always sits on the first line beside the range it saves. (Build 150 gave an audio
   file's trays a fixed grid, below; the wrapping rules here still serve a video outside its column.) */
.rec-tray { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; padding: 4px 6px; border-radius: 14px; background: var(--off); transition: background-color var(--tg-time-quick) linear; } /* the quiet wash, so each group shows on the editor's pale face (build 132) */
.rec-tray-line { order: 3; }
/* Build 150: under an audio file's waveform the three trays sit on a fixed grid, so a save or an edit moves no other
   control. Before it the trays wrapped as they fit: the Save tray is 63 pixels wide when it says Saved and 463 when it
   says Edited, so the playing line's tray, with Mark, jumped 717 pixels up beside a saved range and back down after an
   edit. Now the Save tray has a place 468 pixels wide, a little wider than its widest state, and its face still hugs
   its buttons.
   - Under 1064px: one tray on each row. The Save tray keeps the height of its buttons while it shows one word.
   - From 1064px: the range on the first row; Save and the playing line on the second.
   - From 1448px: the range and Save on the first row; the playing line on the second.
   (Build 153 made each minus and plus 6 pixels wider, so the range's tray is 662 pixels and the playing line's 280,
   and the three widths here each moved up a little: they were 1060, 1440 and, for an iPad, 764.)
   Build 131 put the playing line first on one row from 1580px. That row held a Save tray of 325 pixels and wrapped when
   the tray said Edited, so build 150 keeps the two rows at every wider size.
   A video keeps its own column (below).
   Build 152 took the grid down to 701px, for an upright iPad: from 776px to 900px the range has the first row, and
   Save and the playing line share the second, on an audio file and on a video (a video's column needs a window
   wider than 900px). At 700px or narrower the trays stack full width (below), and the Save tray keeps its height. */
@media (min-width: 701px) and (max-width: 900px) {
  .rec-range-row { display: grid; grid-template-columns: minmax(0, max-content); grid-template-areas: "range" "keep" "line"; justify-content: start; justify-items: start; }
  .rec-tray-range { grid-area: range; } .rec-tray-keep { grid-area: keep; } .rec-tray-line { grid-area: line; }
}
@media (min-width: 776px) and (max-width: 900px) {
  .rec-range-row { grid-template-columns: 468px max-content; grid-template-areas: "range range" "keep line"; }
  .rec-tray { flex-wrap: nowrap; }
}
@media (max-width: 900px) { .rec-tray-keep { min-height: 52px; } }
@media (min-width: 901px) {
  .rec-wrap:not(.video) .rec-range-row { display: grid; grid-template-columns: minmax(0, max-content); grid-template-areas: "range" "keep" "line"; justify-content: start; justify-items: start; }
  .rec-wrap:not(.video) .rec-tray-range { grid-area: range; }
  .rec-wrap:not(.video) .rec-tray-keep { grid-area: keep; min-height: 52px; }
  .rec-wrap:not(.video) .rec-tray-line { grid-area: line; }
}
@container rec-wrap (min-width: 1064px) {
  .rec-wrap:not(.video) .rec-range-row { grid-template-columns: 468px max-content; grid-template-areas: "range range" "keep line"; }
  .rec-wrap:not(.video) .rec-tray { flex-wrap: nowrap; }
}
@container rec-wrap (min-width: 1448px) { .rec-wrap:not(.video) .rec-range-row { grid-template-columns: max-content 468px; grid-template-areas: "range keep" "line line"; } }
.rec-time, .rec-edge { display: inline-flex; align-items: center; gap: 2px; }
.rec-edge { gap: 4px; }
.rec-edge + .rec-edge { margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--line); }
.rec-step { width: 44px; padding: 0; } /* build 153: one stepper size, 44 pixels, where the trays had 38 and the Focus view 32 */
.rec-tray-range #recClear { margin-left: 6px; color: var(--muted); }
.rec-tray-range #recClear:hover:not(:disabled) { color: var(--ink); }
/* The Save tray. `live` (a range that is not saved, or a saved one with a moved edge): the accent's soft wash, and the
   button that saves wears the accent's line and a larger label. Play stays the only filled control on the screen. */
/* The Save tray sits directly after the range's tray, beside End here and Clear (build 132). With nothing in it but
   the word Saved it has no face. */
.rec-tray-keep.bare { background: transparent; }
.rec-tray-keep.live { background: var(--accent-soft); }
.rec-tray-keep .cell.go { font-size: var(--tg-type-action); }
.rec-tray-keep .cell.go { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.rec-tray-keep .cell.go:hover:not(:disabled) { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); }
.rec-tray-keep.live .cell:not(.go) { color: var(--ink); }
.rec-keep-word { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px 0 8px; font-size: var(--tg-type-label); font-weight: 700; color: var(--muted); }
.rec-tray-keep.live .rec-keep-word { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .rec-tray { transition: none; } }
.rec-num { width: 92px; flex: none; }
.rec-num input { width: 84px; height: 24px; padding: 0; font: inherit; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); text-align: center;
  background: transparent; border: 0; border-bottom: 2px solid var(--edge); border-radius: 0; }
.rec-num input:focus { outline: none; border-bottom-color: var(--accent); }

/* Under 900px the screen is one column that scrolls as a whole: the editor first, Saved Sections under it. */
@media (max-width: 900px) {
  .rec-line { padding-left: 0; border-left: 0; }
  .rec-wrap { grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; align-content: start; overflow: auto; }
  .rec-edit { order: 1; overflow: visible; padding: 16px 10px; }
  .rec-side { order: 2; overflow: visible; border-right: 0; border-top: 1px solid var(--line); }
}
/* A narrow screen stacks the trays full width: the range, the Save tray, then the playing line. */
@media (max-width: 700px) {
  .rec-tray { flex: 1 1 100%; }
  .rec-edge + .rec-edge { margin-left: 0; padding-left: 0; border-left: 0; }
  .rec-tray-keep .cell { flex: 1 1 auto; }
}
/* A range's end bracket at the very end keeps its grab place half outside the strip; in the one-column layout that
   half would reach past the window and scroll the screen 12px sideways (newcomer review, finding 20). */
@media (max-width: 900px) { .rec-edit { overflow-x: clip; } }
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  body.recording .bar > .tray.volume.rec { display: none; } /* as for a score: the phone's own buttons set the volume */
}

/* ---------- A YouTube video on the recording screen (build 117; work/recording-integration/YOUTUBE-PLAN.md, Part 2) ----------
   The editor shows YouTube's own player at the top left, 16 by 9, at min(640px, 100%) wide: never under 480 by 270 unless
   the window is narrower, never under 200 by 200 (YouTube's rule). Nothing is drawn over it. Under the player, the same
   strip as a file's waveform, 56px tall, carries the TabbyGato strip (recording-view.mjs) in place of the waveform.
   Build 118: the heading row, the strip and the range row keep their own height, and the player takes the height left
   over, so the range row stays above the bottom bar (Nikhil could not find Save practice loop at 1440 by 815). The player
   stays 16 by 9, at most 640 by 360 and at least 200 tall; only a window too short for that scrolls the editor. */
.rec-wrap.video .rec-edit { container-type: inline-size; padding-top: 8px; padding-bottom: 8px; gap: 8px; } /* tighter, so 1280 by 720 keeps a 200px player */
.rec-video-box { flex: 0 1 min(360px, 100cqw * 9 / 16); min-height: 200px; container-type: size; }
.rec-video-box[hidden] { display: none; }
.rec-video { position: relative; width: min(640px, 100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9; min-height: 200px; border-radius: 8px; overflow: hidden; background: var(--surface); }
.rec-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rec-video-slot:empty { display: none; } /* each service's own spot (build 335): a YouTube spot and an Apple Music spot */
.rec-wrap.video .rec-wave { height: 56px; }
.rec-wrap.video .rec-pause-count { height: 44px; margin-top: -22px; min-width: 44px; padding: 0 12px; font-size: var(--tg-text-display-s); }
.rec-wrap.video .rec-show { display: none; } /* All, Bass, Mid and Treble describe sound TabbyGato never receives from YouTube */
/* Build 123 (newcomer review, findings 1, 3 and 4). In a window wider than 900px the recording screen is a size
   container, so the editor can ask how much room it has.
   - Beside the video: with an editor at least 680px wide and 440px tall, the Playing line, Start and End boxes, the
     here buttons and the save buttons stand in a 336px column beside the player, and the strip runs under both. The
     player takes the height the rows used to take: 16 by 9, at most 640 by 360, never under 200 tall. The 205px are
     the editor's padding, the heading row, three gaps, the strip and the comment lane (build 135). "Added to your library" sits under the column.
   - A short editor (under 440px, such as 150% zoom on a 1440 by 815 screen): tighter padding and gaps. A file's
     waveform shrinks toward 48px. A video's strip is 44px tall and the player moves under the save buttons, so the
     strip, the range row and the save buttons stay in view and the player is what scrolls. */
@media (min-width: 901px) { .rec-wrap { container: rec-wrap / size; } }
/* The build 123 and 160 block for a video (the control column beside the player, from 992 pixels wide) left in build 300:
   the one layout for every recording, at the end of this file, places the player and its tools. */
@container rec-wrap (max-height: 439.98px) {
  .rec-wrap .rec-edit, .rec-wrap.video .rec-edit { padding-top: 4px; padding-bottom: 4px; gap: 6px; }
  .rec-wrap:not(.video) .rec-wave-block { flex: 0 1 auto; min-height: 105px; }
  .rec-wrap:not(.video) .rec-wave { flex: 0 1 auto; min-height: 48px; }
  .rec-wrap.video .rec-wave { height: 44px; }
}
/* The six string lines' strength: muted, so the range wash and the blue playing line stay the loudest things. */
:root { --strip-alpha: 0.45; }
:root[data-theme="dark"] { --strip-alpha: 0.55; }
/* A video's speed box is a plain readout: YouTube plays only its own speeds. */
.tray.speed.rec.video #recSpeedPct { pointer-events: none; }

/* Marks and comments (Mark this spot, build 117; comments, build 135; Nikhil, November 16, 2026). A lane under the
   strip holds them, with no line through the music: a mark is a small dot and a comment is a round chip with the
   writer's initial. The words pop out beside the chip. The whole-song overview shows a small dot for each. */
.rec-lane { position: relative; flex: none; height: 28px; margin-top: -2px; }
.rec-marks { position: absolute; inset: 0; pointer-events: none; }
.rec-mark { position: absolute; top: 3px; width: 22px; height: 22px; margin-left: -11px; padding: 0; display: grid; place-items: center; border: 0; border-radius: var(--tg-corner-round);
  background: none; color: var(--ink); font: inherit; font-size: var(--tg-type-badge); font-weight: 700; line-height: 1; cursor: pointer; pointer-events: auto; }
.rec-mark::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: var(--tg-corner-round); background: var(--edge); }
.rec-mark.words { background: var(--accent-soft); }
.rec-mark.words::before { display: none; }
.rec-mark.words .icon { width: 12px; height: 12px; }
.rec-mark:hover::before, .rec-mark.lit::before, .rec-mark.on::before { background: var(--accent); }
.rec-mark.words:hover, .rec-mark.words.lit, .rec-mark.words.on { box-shadow: 0 0 0 var(--tg-focus-width) var(--accent); }
.rec-mark.words.on { z-index: 1; }
.rec-mark:focus-visible { outline: var(--tg-focus-width) solid var(--accent); outline-offset: var(--tg-focus-gap); }
/* A finger gets 44 pixels: the press place reaches down over the time marks, never up onto the strip. */
@media (pointer: coarse) { .rec-mark::after { content: ""; position: absolute; left: -11px; right: -11px; top: -3px; bottom: -19px; } }
.rec-lane-pop { position: absolute; top: 1px; z-index: 4; box-sizing: border-box; height: 26px; max-width: calc(50% - 20px); margin: 0 0 0 16px; padding: 0 var(--tg-space-8);
  border-radius: 6px; background: var(--surface); box-shadow: var(--tg-shadow-tip); color: var(--ink); font-size: var(--tg-type-note); line-height: 26px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.rec-lane-pop[hidden] { display: none; }
.rec-lane-pop.left { margin: 0 16px 0 0; }
.rec-lane-pop.full { height: auto; min-height: 26px; padding: var(--tg-space-4) var(--tg-space-8); line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.rec-lane-pop b { margin-right: var(--tg-space-6); font-weight: 700; }
.rec-lane-pop i { margin-right: var(--tg-space-6); font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
/* On a phone the lane is too short for words beside a chip, so the words take the lane's whole width. */
@media (max-width: 600px) { .rec-lane-pop, .rec-lane-pop.left { left: 0 !important; right: 0 !important; max-width: none; margin: 0; } }
.rec-map-track .rec-marks { top: auto; bottom: 0; height: 6px; }
.rec-dot { position: absolute; top: 0; width: 6px; height: 6px; margin-left: -3px; border-radius: var(--tg-corner-round); background: var(--edge); }
.rec-dot.words { background: var(--accent); }
/* A chip's face outside the lane: in a row of the Comments group and beside the Write a comment box. */
.rec-chip-face { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: var(--tg-corner-round); background: var(--accent-soft); color: var(--ink);
  font-size: var(--tg-type-badge); font-weight: 700; font-style: normal; line-height: 1; }
.rec-chip-face .icon { width: 12px; height: 12px; }
.rec-chip-face.bare { background: none; }
.rec-comments li.open-now .rec-chip-face:not(.bare) { background: var(--bg); } /* the chosen row has the chip's own fill, so the chip takes the paper */
.rec-chip-face.bare::before { content: ""; width: 10px; height: 10px; border-radius: var(--tg-corner-round); background: var(--edge); }
.rec-comments .recent-open { display: flex; flex-direction: row; align-items: flex-start; gap: var(--tg-space-8); }
/* The chosen row keeps its words at the row's full width, with the pencil and the remove button on a line under them. */
.rec-comments li.open-now { flex-wrap: wrap; justify-content: flex-end; }
.rec-comments li.open-now .recent-open, .rec-comments li .map-edit-box { flex: 1 1 100%; }
.rec-comment-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; white-space: normal; }
.rec-side .rec-comments .recent-open strong { font-weight: 600; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.rec-side .rec-comments li.open-now .recent-open strong { -webkit-line-clamp: none; display: block; }
.rec-side .rec-comments .recent-open strong.bare { font-weight: 400; color: var(--muted); }
.rec-side .rec-comment-edit { height: auto; min-height: 72px; padding: var(--tg-space-4) 7px; font-weight: 400; line-height: 1.35; resize: none; }
/* Write a comment, in the status line beside the position (build 135). In a window 1280 pixels wide or wider the box
   shows; in a narrower one the Comment button opens the box over the status line. */
.rec-write { display: none; }
body.recording .rec-write:not([hidden]) { display: flex; align-items: center; min-width: 0; }
body.recording.no-song .rec-write { display: none !important; }
.rec-write-open { display: none; }
.rec-write-box { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--tg-space-8); margin: 0; }
.rec-write-box input { flex: 1 1 auto; min-width: 0; height: var(--tg-size-choice); padding: 0 var(--tg-space-8); border: 1px solid var(--edge); border-radius: 6px;
  background: var(--field); color: var(--ink); font: inherit; font-size: var(--tg-type-sentence); user-select: text; }
.rec-write-box input::placeholder { color: var(--muted); opacity: 1; }
.rec-write-box input:focus { outline: var(--tg-focus-width) solid var(--accent); outline-offset: var(--tg-focus-gap); border-color: var(--accent); }
.rec-write-at, .rec-write-left { flex: none; font-size: var(--tg-type-note); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-write-at[hidden], .rec-write-left[hidden] { display: none; }
.rec-write-left { color: var(--ink); font-weight: 600; }
body.recording .status-row { grid-template-columns: minmax(180px, 330px) minmax(220px, 400px) minmax(0, 1fr); gap: 0 var(--tg-space-16); }
@media (max-width: 1279px) {
  body.recording .status-row { position: relative; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--tg-space-8); }
  body.recording .status-row > .rec-write { grid-area: 1 / 2 / 3 / 3; }
  body.recording .status-row .rec-write-open { display: inline-flex; flex-direction: row; gap: var(--tg-space-6); width: auto; height: 36px; padding: 0 var(--tg-space-12); }
  .rec-write-box { display: none; }
  .rec-write.open .rec-write-box { display: flex; position: absolute; z-index: 6; inset: 0; padding: 0 var(--gutter) 4px; background: var(--tg-desk); }
  .rec-write.open .rec-write-open { visibility: hidden; }
}
/* On a phone the Comment button shares the position's line, at the right, and adds no line of its own. */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  body.recording .status-row > .where, body.recording .status-row > .say { grid-column: 1; grid-row: auto; }
  body.recording .status-row > .rec-write { grid-area: 1 / 2 / span 2 / 3; align-self: center; }
}
@media (pointer: coarse) { .rec-write-box input { height: var(--tg-size-target); } body.recording .status-row .rec-write-open { height: var(--tg-size-target); } }
.name-field { width: 100%; max-width: 280px; min-height: var(--tg-size-choice); padding: 0 var(--tg-space-8); border: 0; border-bottom: 2px solid var(--edge); border-radius: 6px 6px 0 0;
  background: var(--field); color: var(--ink); font: inherit; font-size: var(--tg-type-sentence); user-select: text; }
.name-field:focus { outline: none; border-bottom-color: var(--accent); }

/* Add a YouTube link: the label picker's card, with one box and a line for a link that does not work. */
.youtube-dialog .label-new span { white-space: nowrap; }
.youtube-dialog .label-new input { width: 100%; }
.youtube-problem { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.youtube-problem[hidden] { display: none; }
/* Apple Music (item 6, build 335; work/apple-music/DESIGN.md). The shared box's Search Apple Music sits under the
   field as a full-size row button, 44 pixels tall for a finger. A search result row is one press target, at least 56
   pixels tall, with the album picture, the title, the artist, the length and the album, and "Add" as its word. */
.youtube-dialog [data-view][hidden] { display: none; }
.am-search-open { justify-self: start; }
.am-search-say { margin: 0; color: var(--muted); font-size: 15px; }
.am-search-say[hidden] { display: none; }
/* What a screen reader hears about a search (build 339): on the page, out of sight, and no part of the box's layout. */
.am-live { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.am-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: min(340px, 50vh); overflow: auto; }
.am-results[hidden] { display: none; }
.am-row { all: unset; box-sizing: border-box; width: 100%; min-height: 56px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.am-row:hover { background: var(--hover); }
.am-row:active { background: color-mix(in srgb, var(--accent-soft) 75%, transparent); }
.am-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.am-thumb { width: 44px; height: 44px; border-radius: 4px; overflow: hidden; background: var(--off); }
.am-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.am-meta { display: grid; min-width: 0; }
.am-meta b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.am-meta span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-row:is(:hover, :active) .am-meta span { color: color-mix(in srgb, var(--ink) 35%, var(--muted)); } /* the hovered row's darker ground needs stronger words: 4.21 to 1 before, in the dark look (build 339) */
.am-add { font-size: 15px; font-weight: 600; color: var(--accent); padding: 0 6px; }
/* The sign-in step (build 336; work/apple-music/mock336/): one centered column. The song the student asked for sits
   on top (the song mark from Search), then the heading, one line, two buttons at the box's width, and the two notes
   under a rule. The step shows whole when it opens, so nothing in it moves afterward. No Apple logo: Apple's marks
   are Apple's, and Apple's own window follows this one. */
.youtube-dialog.am-in { width: min(400px, calc(100vw - 32px)); padding: 32px 28px 20px; gap: 0; justify-items: center; text-align: center; }
.am-who { display: grid; justify-items: center; gap: 10px; margin-bottom: 20px; }
.am-who.none { display: none; } /* Apple gave no facts for the song: the heading leads */
/* The picture's frame. A song with no picture, or a picture that fails, leaves the plain frame; nothing is drawn in
   it, since a drawn note would stand for Apple Music (build 339). */
.am-who-art { display: block; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--off); box-shadow: var(--tg-shadow-lift), inset 0 0 0 1px var(--line); }
.am-who-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.am-who-name { display: grid; gap: 2px; max-width: 100%; }
.am-who-name[hidden] { display: none; }
.am-who-name b { font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.am-who-name span { font-size: 15px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.youtube-dialog.am-in h2 { font-size: 24px; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.youtube-dialog.am-in #amSignInLine { margin-top: 8px; line-height: 1.4; text-wrap: balance; }
.youtube-dialog.am-in #amSubLine { margin-top: 8px; line-height: 1.4; text-wrap: balance; } /* body text above the button, since it is a fact to weigh before the press (build 339) */
.youtube-dialog.am-in .youtube-problem { margin-top: 12px; width: 100%; }
.youtube-dialog.am-in .label-foot { width: 100%; margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 4px; }
.youtube-dialog.am-in .label-foot .cell { width: 100%; }
.youtube-dialog.am-in #amSignIn { min-height: 48px; }
.youtube-dialog.am-in #amSignIn .lbl { font-size: 15px; }
.youtube-dialog.am-in #amSignInBack { color: var(--accent); }
.am-notes { width: 100%; margin-top: 12px; padding-top: 8px; display: grid; justify-items: center; } /* space sets the lock note apart; build 336's rule went in build 339 */
.am-notes .fine { font-size: 12px; line-height: 1.4; text-wrap: balance; }
/* The lock sits in the note's own line of words, so it stays beside the first word when a phone wraps the note to two lines (build 339). */
.am-lock .icon { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
/* The album panel takes the video's spot at the video's own height, so every control keeps the place it has for a
   YouTube song. A video has to stay 16 by 9, and a short window then leaves an empty band beside it; the panel has
   no such shape to keep, so from build 336 it takes its column's whole width, and the time strip under it grows to
   match (the rules sit with the video screen's grid, further down). Its message area has a set height, so a message
   that comes or goes moves nothing. */
.rec-video-box.apple .rec-video { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); container-type: size; }
.am-panel { --am-pad: clamp(12px, 3cqw, 28px); position: absolute; inset: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(12px, 4cqw, 32px); align-items: center; padding: var(--am-pad); color: var(--ink); }
.am-art { width: min(320px, calc(100cqh - 2 * var(--am-pad)), 38cqw); aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--off); box-shadow: var(--tg-shadow-lift), inset 0 0 0 1px var(--line); }
.am-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.am-text { display: grid; gap: 6px; align-content: center; min-width: 0; }
.am-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } /* a long title takes two lines at most, so the panel's words never spill (build 336) */
.am-line { margin: 0; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
/* Apple's "Listen on Apple Music" badge (build 339; Apple Music Identity Guidelines, section 1): Apple's own file,
   unchanged, 40 pixels tall (34 on a phone; Apple's floor is 30) inside a 44-pixel press area. Apple asks for clear
   space of a tenth of the badge's height: the link's own padding and the focus ring's offset keep 4 pixels clear. */
.am-badge { --am-badge-h: 40px; justify-self: start; display: inline-grid; place-items: center; min-height: var(--tg-size-target, 44px); padding: 0 4px; margin-left: -4px; border-radius: 10px; }
.am-badge img { display: block; height: var(--am-badge-h); width: auto; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.2; } /* the type styles only show if the picture fails: its alt words, kept tidy */
.am-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.am-say { margin: 8px 0 0; height: 100px; display: grid; gap: 8px; align-content: start; font-size: 15px; line-height: 1.4; }
.am-say p { margin: 0; }
.am-say .cell { justify-self: start; }
@container (min-width: 700px) {
  .am-text { gap: 8px; }
  .am-title { font-size: 24px; letter-spacing: -0.02em; }
  .am-line { font-size: 15px; }
  .am-badge { margin-top: 2px; }
}
@container (max-width: 520px) { .am-panel { gap: 12px; } .am-art { width: min(30cqw, calc(100cqh - 2 * var(--am-pad))); } .am-badge { --am-badge-h: 34px; } } /* a phone keeps build 335's picture, so its words keep their width */
@container (max-height: 260px) {
  .am-panel { --am-pad: 12px; }
  .am-text { gap: 6px; }
  .am-title { font-size: 15px; letter-spacing: 0; }
  .am-line { font-size: 12px; -webkit-line-clamp: 1; }
  .am-badge { --am-badge-h: 34px; margin-top: 0; } /* a short panel takes the phone's badge size */
  .am-say { margin-top: 4px; height: 82px; font-size: 12px; }
}
@container (max-height: 210px) { .am-title { -webkit-line-clamp: 1; } }
body.apple-music #coffeeFoot { visibility: hidden; }
.am-row-say { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (pointer: coarse) { #amSignOut { min-height: var(--tg-size-target, 44px); } } /* a finger's press area (build 339) */
.home-open #youtubeBtn { background: var(--off); }
.home-open #youtubeBtn:hover { background: var(--hover); }

/* Type song sections and Type practice loops (build 119): a plus at the end of each group's head row in the sidebar opens
   the label picker's card with one box and a list, under the box, of what each line adds or why it does not. */
.rec-side .shelf-head { align-items: center; padding-right: 0; }
.rec-side .shelf-head .fine { margin-left: auto; }
.rec-type { margin: -6px 0; }
.type-box { display: grid; gap: 4px; font-size: var(--tg-type-note); color: var(--muted); }
.type-box textarea { min-width: 0; padding: 8px 10px; font: inherit; font-size: var(--tg-type-sentence); line-height: 1.4; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--field);
  border: 0; border-bottom: 2px solid var(--tg-edge, var(--line)); border-radius: 6px 6px 0 0; resize: vertical; }
.type-box textarea::placeholder { color: var(--muted); }
.type-list { max-height: 240px; overflow: auto; }
.type-list:empty { display: none; }
.type-list li { display: grid; gap: 1px; padding: 4px 8px; }
.type-list strong { font-size: var(--tg-type-passage); font-weight: 700; overflow-wrap: anywhere; }
.type-list span { color: var(--muted); font-size: var(--tg-type-note); font-variant-numeric: tabular-nums; }
.type-list li.bad strong { font-weight: 500; color: var(--muted); }
.type-list li.bad span { color: var(--warn); font-weight: 600; }

/* ---------- Song parts (build 120, work/recording-integration/SONG-PARTS-SPEC.md) ----------
   A palette of chips under the "Song sections" head row: Intro to Outro, the student's own parts, then a dashed "New
   part". A section's color is its part's (data-hue), and a section with no part is neutral: the surface with the edge
   color's line, so the block and the square read in both looks. No new color, font, corner, shadow or motion. */
.rec-side .rec-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.rec-side .rec-side-head h2 { margin: 0 0 0 8px; }
.rec-palette { display: grid; gap: 4px; padding: 4px 8px 8px; }
.rec-palette-at { margin: 0; font-size: var(--tg-type-note); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* "After NAME, at 0:58.5" (build 125) carries a section's name, up to 60 characters: it wraps in the sidebar, and on the
   one-line palette under 900 pixels it stops at 45% of the window. */
.rec-palette:not(.inline) .rec-palette-at { white-space: normal; overflow-wrap: anywhere; }
.rec-palette.inline .rec-palette-at { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; }
.rec-chips { display: flex; flex-wrap: wrap; gap: 4px; }
/* A part's chip wears the part's wash on its whole face, with the edge color's line and ink words, like its blocks on
   the strip (design lead, build 120 QA). Under the pointer the line turns ink; a chosen one in the Part and color box
   keeps its wash and takes the accent's line with the check mark. */
.rec-chip { --wash: var(--surface); padding: 0 8px; color: var(--ink); background: var(--wash); border-color: var(--edge); }
.rec-chip[data-hue="0"] { --wash: var(--sec-0); } .rec-chip[data-hue="1"] { --wash: var(--sec-1); }
.rec-chip[data-hue="2"] { --wash: var(--sec-2); } .rec-chip[data-hue="3"] { --wash: var(--sec-3); }
.rec-chip[data-hue="4"] { --wash: var(--sec-4); } .rec-chip[data-hue="5"] { --wash: var(--sec-5); }
.rec-chip:hover:not(:disabled) { background: var(--wash); color: var(--ink); border-color: var(--ink); }
.rec-chip:disabled { background: var(--wash); }
.rec-chip[aria-pressed="true"], .rec-chip[aria-pressed="true"]:hover:not(:disabled) { background: var(--wash); color: var(--ink); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
/* A long name of the student's own (up to 60 characters) wraps inside the sidebar and the popover instead of pushing
   them sideways (QA of build 120). The one line under the time marks keeps every chip on one line and scrolls. */
.rec-palette:not(.inline) .rec-chip, .rec-pop-parts .rec-chip { max-width: 100%; padding-top: 4px; padding-bottom: 4px; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.rec-chip.new { background: var(--surface); border: 1px dashed var(--edge); color: var(--muted); }
/* The loop button (build 128): a chip with the loop sign, where the parts sit for the song sections. While a loop is
   being marked it wears the accent's line, as a pressed chip does. */
.rec-loop-chip { display: inline-flex; align-items: center; gap: 6px; }
/* Build 151: three controls whose words change each keep one width, sized for their longest words, so the change
   pushes nothing beside them. Focus says "Focus" or "Whole song" (112 pixels, build 210), and its
   icon stays at the left edge. The loop chip says "Start a loop", "End the loop" or "Save as a loop" (125 pixels).
   On an audio file, Save practice loop grows to 182 pixels when a range waits to be saved. */
#recFocus { flex: none; min-width: 112px; justify-content: flex-start; }
/* Build 156: Focus sits first in the heading above the waveform, beside the range's name, and centers on the row. */
#recLoopNew { min-width: 125px; }
.rec-wrap:not(.video) #recSaveLoop { min-width: 182px; }
.rec-loop-maker { padding-bottom: 4px; }
/* While a loop is being marked (build 132) the button wears the accent's line, and a dashed line on the waveform shows
   where the loop starts. */
.rec-loop-chip.marking { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); font-weight: 700; }
.rec-loop-from { position: absolute; top: 0; bottom: 0; width: 0; margin-left: -1px; border-left: 2px dashed var(--accent); pointer-events: none; }
/* A chosen row's Start and End boxes (build 128), on their own line under the name. */
.rec-side li.has-times { flex-wrap: wrap; }
/* Build 155: a row whose name box just opened shows an accent outline that fades in 900 milliseconds, so the eye finds
   the new row after a save (Save sits up to 900 pixels from the saved list). The row does not move or change size.
   A computer set to reduce motion shows no outline. */
@keyframes rec-new-row { 0%, 35% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
.rec-side li:has(.map-edit:focus) { animation: rec-new-row var(--tg-time-find) linear 1; } /* full for the first third, so the eye has time to find the row, then a steady fade */
@media (prefers-reduced-motion: reduce) { .rec-side li:has(.map-edit:focus) { animation: none; } }
.rec-row-times { flex: 1 0 100%; display: flex; align-items: center; gap: 6px; padding: 0 8px 8px 12px; color: var(--ink); font-size: var(--tg-type-label); font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-side li.has-part-btn .rec-row-times { padding-left: 12px; }
.rec-row-time { width: 68px; height: 28px; padding: 0 4px; font: inherit; font-size: var(--tg-type-value); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); text-align: center; background: var(--surface); border: 1px solid var(--edge); border-radius: 6px; }
.rec-row-time:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rec-chip.new:hover:not(:disabled) { background: var(--hover); color: var(--ink); border-color: var(--ink); }
/* Pressed (build 146): a part chip keeps its section color under a thin wash of the ink color, which darkens the
   chip in the light look and lifts it in the dark look. A dashed chip takes the same pressed fill as every other button. */
.rec-chip:active:not(:disabled), .rec-chip[aria-pressed="true"]:active:not(:disabled) { background-image: linear-gradient(color-mix(in srgb, var(--ink) 10%, transparent), color-mix(in srgb, var(--ink) 10%, transparent)); }
.rec-chip.new:active:not(:disabled) { background: color-mix(in srgb, var(--accent-soft) 75%, transparent); }
@media (pointer: coarse) { .rec-chip { min-height: 44px; } }
/* Under 900px: one line under the editor's time marks that scrolls sideways and never wraps. */
.rec-palette.inline { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 0; }
.rec-palette.inline .rec-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--edge) transparent; }
.rec-palette.inline .rec-newpart { flex: none; min-width: 240px; }
/* New part: a name box with the six colors under it. */
.rec-newpart { flex: 1 1 100%; display: grid; gap: 4px; }
.rec-newpart .map-edit { height: 32px; font-size: var(--tg-type-passage); border-radius: 6px; }
.rec-hues { display: flex; flex-wrap: wrap; gap: 4px; }
.rec-hue { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; }
.rec-hue:hover { background: var(--hover); }
.rec-hue[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.rec-hue .rec-swatch { width: 16px; height: 16px; margin: 0; }
.rec-hue:focus-visible, .rec-part-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Section blocks in both bands carry the edge color's line, so a neutral block still reads. */
.rec-map-band .map-section:not(.now), .rec-band .map-section:not(.now) { border-color: var(--edge); }
/* The chosen row's square is a button, "Part and color", lying over the square in front of the name. */
.rec-side li.has-part-btn { position: relative; }
.rec-side .recent-open .rec-swatch { width: 14px; height: 14px; vertical-align: -2px; border-radius: 50%; } /* a row's dot, a size up so the color shows; round since build 124, as a square read as an unticked box */
.rec-part-btn { position: absolute; left: 1px; top: 0; z-index: 1; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.rec-part-btn:hover, .rec-part-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
/* The popover: the key list's look under the song's title (.title-keys). */
.rec-pop { position: fixed; z-index: 80; display: grid; gap: 4px; width: max-content; max-width: min(300px, calc(100vw - 16px)); padding: 8px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; box-shadow: 0 0 0 2px var(--accent-soft); }
.rec-pop[hidden], .rec-pop [hidden] { display: none; }
.rec-pop-label { margin: 0; font-size: var(--tg-type-note); color: var(--muted); }
.rec-pop-parts { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
/* A drag's preview: a block in the part's color with a dashed line, from the drop time to where the part would end. */
.rec-drop { position: absolute; top: 0; z-index: 3; height: 21px; box-sizing: border-box; display: flex; align-items: center; padding: 0 6px; overflow: visible;
  font-size: var(--tg-type-label); font-weight: 700; color: var(--ink); white-space: nowrap; background: var(--surface); border: 1px dashed var(--ink); border-radius: 6px; pointer-events: none; }
.rec-drop span { padding-right: 4px; border-radius: 6px; background: inherit; }
.rec-drop[data-hue="0"] { background: var(--sec-0); } .rec-drop[data-hue="1"] { background: var(--sec-1); }
.rec-drop[data-hue="2"] { background: var(--sec-2); } .rec-drop[data-hue="3"] { background: var(--sec-3); }
.rec-drop[data-hue="4"] { background: var(--sec-4); } .rec-drop[data-hue="5"] { background: var(--sec-5); }
/* The copy of the chip under the pointer during a drag. */
.rec-ghost { position: fixed; z-index: 90; pointer-events: none; }
.rec-ghost[hidden] { display: none; }

/* ---------- Touch sizes on the practice screens (build 157) ----------
   On a touch screen the small controls on the three practice screens are 44 pixels tall: the loop's buttons and the
   Focus view's buttons, the chips and buttons in the heading above the waveform, the small buttons in the saved list,
   and the shelf's tabs, chips and small buttons. With a mouse they keep 32. The two icons in the status line keep their
   look and take a tap across 44 by 44 pixels. On a phone, Loop options and Loop off stayed 32 pixels wide, because the
   loop's row must fit a 375 pixel screen with a name such as "Bars 100 to 104"; build 268 made them 44, edge to edge. */
@media (pointer: coarse) {
  .loop-pill .cell { min-height: 44px; }
  .rec-head .chip, .rec-head .cell.small { min-height: 44px; }
  .rec-head .chip { min-width: 44px; justify-content: center; }
  .rec-head .cell.small:not(.row) { width: 44px; }
  .rec-side .cell.small { min-height: 44px; }
  #shelf .chip, #shelf .cell.small, #shelf .shelf-tab { min-height: 44px; }
  #shelfClose { min-width: 44px; min-height: 44px; }
  /* Build 168: the controls build 157 left under 44 pixels in the shelf. A part's Show, Mute and Solo, its volume slider and
     its sound menu; the two sliders in a row (the click's volume); the name box; and Buy me a coffee, whose picture keeps
     its 32 pixels and takes a tap across 44. */
  .parts-grid .cell, .part-vol input[type="range"], .part-sound select, .inline input[type="range"], #commentName, #coffeeLink { min-height: 44px; }
  #coffeeLink { align-items: center; }
  .say { gap: 18px; }
  .say .feedback-foot, .say .coffee-foot { position: relative; }
  .say .feedback-foot::after, .say .coffee-foot::after { content: ""; position: absolute; inset: -13px -9px; }
}

/* ---------- Comments and Saved Sections on a tab (build 178; Nikhil, November 17) ----------
   A tab gets the jobs an audio file and a video have. The lane has its own 28 pixels of paper under each line of a
   song that holds a comment or a mark (main.mjs adds the paper), so no chip touches the music and the loop's buttons
   sit under the lane. The chips, the dots and the words reuse the recording screen's rules above (.rec-mark,
   .rec-dot, .rec-lane-pop), so a comment looks the same on all three practice screens. */
/* In front of the playing bar's blue shade (999), so a comment in the bar that plays reads at full strength (build 187). */
.tab-lanes { position: absolute; inset: 0; z-index: 1000; pointer-events: none; }
.tab-lane { position: absolute; height: 28px; }
.tab-lane .rec-mark, .tab-pop-tools, .tab-pop.edit { pointer-events: auto; } /* the words take no press, so a chip under them still does */
.tab-pop.full { display: flex; align-items: flex-start; gap: var(--tg-space-6); max-width: min(480px, calc(100% - 20px)); padding-right: var(--tg-space-4); }
.tab-pop.full b, .tab-pop.full i { flex: none; margin-right: 0; }
.tab-pop.full .tab-pop-words { flex: 1 1 auto; min-width: 0; }
.tab-pop-tools { flex: none; display: flex; gap: 2px; margin: -2px 0; }
.tab-pop-tools .cell { width: 26px; height: 26px; min-height: 26px; padding: 0; }
.tab-pop.edit { width: min(420px, calc(100% - 20px)); max-width: none; height: auto; padding: 2px; overflow: visible; }
.tab-pop-box, .notes-box { box-sizing: border-box; width: 100%; height: var(--tg-size-choice); padding: 0 var(--tg-space-8); border: 1px solid var(--edge); border-radius: 6px;
  background: var(--field); color: var(--ink); font: inherit; font-size: var(--tg-type-note); }
.tab-pop-box:focus, .notes-box:focus { outline: var(--tg-focus-width) solid var(--accent); outline-offset: var(--tg-focus-gap); border-color: var(--accent); }
.tab-pop-box::placeholder, .notes-box::placeholder { color: var(--muted); opacity: 1; }
/* The dots on the song map sit in the 8 pixels under the busy marks, and take no press. */
.tab-map-dots { position: absolute; left: 0; right: 0; top: 55px; height: 6px; pointer-events: none; } /* under the busy row: the track grew from 38 to 54 pixels in build 297 */

/* The Comment button, at the right end of the position, at every width. The box opens in the lane, beside the beat (build 194). */
.status-row .cell.row.tab-write-open { flex: none; width: auto; flex-direction: row; gap: var(--tg-space-6); margin-left: auto; padding: 0 var(--tg-space-12); }
.tab-write-open[hidden], body.recording .tab-write-open, body.no-song .tab-write-open { display: none; }
@media (min-width: 1280px) { body:not(.recording):not(.no-song) .status-row { grid-template-columns: 446px 96px 100px 100px 116px 128px minmax(0, 1fr); } }
/* Under 1,280 pixels the position has a row 22 pixels tall, so the button is that tall and takes a press across 44. */
@media (max-width: 1279px) {
  body:not(.recording) .status-row > .where { max-width: 470px; }
  .status-row .cell.row.tab-write-open { height: 22px; min-height: 22px; padding: 0 var(--tg-space-8); }
  .status-row .cell.row.tab-write-open::after { inset: -11px 0; }
}
@media (pointer: coarse) { .tab-pop-box, .notes-box { height: var(--tg-size-target); } .tab-pop-tools .cell { width: 44px; height: 44px; min-height: 44px; } }

/* The Sections button adds 78 pixels to a tab's bottom bar. With it, the Volume slider had 3 pixels at 1,360 wide, so
   a tab's bar keeps its two rows up to 1,439 pixels, where 1,359 was the mark before build 178. The rows are the ones
   the rules above give a tab from 840 to 1,359. A recording has no Sections button and keeps one row from 1,360. */
@media (min-width: 1360px) and (max-width: 1439px) {
  body:not(.recording) .bar { flex-wrap: wrap; row-gap: 3px; justify-content: flex-start; }
  body:not(.recording) .bar-break { display: block; flex: 0 0 100%; height: 0; }
  body:not(.recording) .tray.volume { max-width: 440px; }
  body:not(.recording) .tray.panels { margin-left: auto; }
}

/* Saved Sections, in the shelf: Song sections with the part chips on the left, Comments on the right. */
.notes-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
@media (max-width: 700px) { .notes-cols { grid-template-columns: minmax(0, 1fr); gap: 16px 0; } }
.notes-group h3 { margin: 0 0 8px; font-size: var(--tg-type-group); }
.notes-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 8px; }
.notes-palette-at { width: 104px; font-size: var(--tg-type-note); color: var(--muted); font-variant-numeric: tabular-nums; } /* a set width for "For bars 128 to 130" */
.notes-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.notes-rows li { display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 4px 0 0; border-radius: 8px; }
.notes-rows li.on { background: var(--accent-soft); }
.notes-row { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 2px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: var(--tg-type-note); text-align: left; cursor: pointer; }
button.notes-row:hover { background: var(--hover); }
.notes-rows li.on button.notes-row:hover { background: none; }
.notes-row:focus-visible { outline: var(--tg-focus-width) solid var(--accent); outline-offset: -2px; }
.notes-sq { flex: none; width: 12px; height: 12px; border: 1px solid var(--edge); border-radius: 4px; background: var(--surface); }
.notes-sq[data-hue="0"] { background: var(--sec-0); } .notes-sq[data-hue="1"] { background: var(--sec-1); } .notes-sq[data-hue="2"] { background: var(--sec-2); }
.notes-sq[data-hue="3"] { background: var(--sec-3); } .notes-sq[data-hue="4"] { background: var(--sec-4); } .notes-sq[data-hue="5"] { background: var(--sec-5); }
.notes-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.notes-text b { font-weight: 700; overflow-wrap: anywhere; }
.notes-text span { font-size: var(--tg-type-note); color: var(--muted); font-variant-numeric: tabular-nums; }
.notes-rows li.on .notes-text span { color: var(--ink); }
.notes-rows li.on .rec-chip-face:not(.bare) { background: var(--bg); }
/* The pencil and the remove button show on the chosen row. Their room is kept on every row, so a press moves nothing. */
.notes-tools { flex: none; display: flex; gap: 2px; visibility: hidden; }
.notes-rows li.on .notes-tools, .notes-rows li:focus-within .notes-tools { visibility: visible; }
.notes-tools .cell { width: 32px; height: 32px; min-height: 32px; padding: 0; }
.notes-empty { margin: 0 0 4px; font-size: var(--tg-type-note); color: var(--muted); }
.notes-empty[hidden] { display: none; }
/* Practice loops on a tab (build 4 of the sections-and-loops plan): the group's head holds the count and the plus that
   types loops, as on a recording, and each row starts with the green bracket a loop wears on the song map. */
.notes-head { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: -6px 0 2px; }
.notes-head h3 { margin: 0; }
.notes-head .fine { font-variant-numeric: tabular-nums; }
.notes-type { flex: none; width: 44px; min-height: 44px; margin: -6px 0 -6px auto; padding: 0; color: var(--muted); }
.notes-loop { flex: none; width: 12px; height: 6px; box-sizing: border-box; border: 2px solid var(--accent); border-bottom: 0; }
@media (pointer: coarse) { .notes-rows li, .notes-row { min-height: 44px; } .notes-tools .cell { width: 44px; height: 44px; min-height: 44px; } #sectionsPanel .rec-chip { min-height: 44px; } }

/* Build 191: three fixes from the design clarity pass on the tab's comments.
   A recording's Write a comment box has a close button while K, Mark or the Comment button holds it open. */
.rec-write-box .cell { display: none; flex: none; width: 36px; height: 36px; min-height: 36px; padding: 0; }
.rec-write.open .rec-write-box .cell { display: inline-flex; }
@media (pointer: coarse) { .rec-write.open .rec-write-box .cell { width: 44px; height: 44px; min-height: 44px; } }
/* After a remove on a tab, Undo shows for 10 seconds in the lane, where the removed chip sat. */
.tab-lane .tab-undo { position: absolute; top: 1px; height: 26px; min-height: 26px; width: auto; margin-left: -11px; padding: 0 var(--tg-space-8); flex-direction: row; gap: var(--tg-space-4);
  border-radius: 6px; background: var(--surface); box-shadow: var(--tg-shadow-tip); color: var(--ink); font-size: var(--tg-type-note); pointer-events: auto; }
@media (pointer: coarse) { .tab-lane .tab-undo { top: -8px; height: 44px; min-height: 44px; } }

/* Build 195: on an audio file and a video the comment box opens in the lane, beside the chip, as on a tab (Nikhil,
   November 17: "Yes, match the tab"). The status line keeps the Comment button at every width, and the box that lay
   in the status line is gone from view. */
body.recording .status-row .rec-write-box, body.recording .status-row .rec-write.open .rec-write-box { display: none; }
body.recording .status-row .rec-write-open, body.recording .status-row .rec-write.open .rec-write-open { display: inline-flex; visibility: visible; flex-direction: row; gap: var(--tg-space-6); width: auto; height: 36px; padding: 0 var(--tg-space-12); }
@media (min-width: 1280px) { body.recording .status-row { grid-template-columns: minmax(180px, 330px) auto minmax(0, 1fr); } }
@media (pointer: coarse) { body.recording .status-row .rec-write-open { height: var(--tg-size-target); } }


/* ---------- Build 299: one layout for every recording (the blend of options a and d, work/sections-and-loops/) ----------
   Nikhil, November 23, 2026: rare controls one press deeper, the video bigger and at the left, and the same controls on
   every song type. The rule: boxed media (a video, later Apple Music's album panel) sits at the left, with the loop's
   tools and the lists to its right; wide media (an audio file's waveform) runs across the area, with the loop's tools
   in one row under it and the lists under them. The editor and its heading lend their children to one grid. */
body.recording #recWrap { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; gap: 10px 16px; padding: 8px 10px 12px; box-sizing: border-box; align-content: start; overflow: auto; }
body.recording #recWrap .rec-edit, body.recording #recWrap .rec-head { display: contents; }
body.recording #recWrap .rec-edit { container-type: normal; }
body.recording #recWrap .rec-edit > *, body.recording #recWrap .rec-head > *, body.recording #recWrap > .rec-side { order: 0; grid-column: auto; grid-row: auto; }
body.recording #recWrap .rec-video-box { grid-area: video; container-type: normal; flex: none; width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 9; align-self: start; justify-self: start; }
body.recording #recWrap .rec-video { width: 100%; height: 100%; min-height: 0; }
body.recording #recWrap .rec-wave-block { grid-area: strip; min-width: 0; }
body.recording #recWrap .rec-tools { grid-area: tools; margin-left: 0; justify-self: end; align-self: start; }
body.recording #recWrap .rec-passage { grid-area: pass; width: auto; max-width: none; margin-block: 0; align-self: start; flex-wrap: nowrap; align-items: flex-start; padding: 8px 6px 8px 12px; }
body.recording #recWrap .rec-range-row { grid-area: trays; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 8px; max-width: none; }
body.recording #recWrap > .rec-side { grid-area: lists; min-height: 0; overflow: auto; padding: 4px 0 0; border: 0; border-top: 1px solid var(--line); background: transparent; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; column-gap: 20px; }
body.recording #recWrap > .rec-side > * { min-width: 0; }
body.recording #recWrap > .rec-side > .rec-side-head, body.recording #recWrap > .rec-side > .rec-note { grid-column: 1 / -1; }
body.recording #recWrap > .rec-side .rec-group + .rec-group { margin-top: 0; }
body.recording #recWrap > .rec-side .rec-group { margin-bottom: 16px; }
body.recording #recWrap { position: relative; }
body.recording #recWrap .rec-edit > .label-offer { position: absolute; left: auto; right: 12px; bottom: 12px; transform: none; z-index: 5; max-width: min(420px, calc(100% - 24px)); grid-area: auto; } /* it floats over the area, so it never moves the player or the strip (review findings 1 and 15) */
/* The band of section names over the strip shows only while the strip shows part of the song: the song map at the top
   names every section, and a second band of the same names was half of Nikhil's clutter. */
body.recording #recWrap:not(.zoomed) .rec-band { visibility: hidden; } /* the band keeps its room, so Zoom and Focus move nothing (review finding 4) */
body.recording #recWrap .rec-band:has(.rec-drop), body.playing.hide-top #recWrap .rec-band { visibility: visible; } /* a chip drag's preview, and the names while the top bar hides */
/* The trays: Start here and End here, then Mark, then the Save tray on a row of its own. */
body.recording #recWrap .rec-tray { flex: none; }
body.recording #recWrap .rec-tray { order: 0; } body.recording #recWrap .rec-tray-keep { flex: 1 1 100%; min-height: 44px; } /* the page's order: Start here and End here, Mark, then Save */
body.recording #recWrap .rec-edge { display: contents; }
/* The card: the kind's mark and the name, then the times and their length, then the sections the range touches. */
body.recording #recWrap .rec-says { flex-direction: column; align-items: flex-start; gap: 0; white-space: normal; }
body.recording #recWrap .rec-says h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-width: 100%; line-height: 22px; white-space: normal; overflow-wrap: normal; }
body.recording #recWrap .rec-says .fine { line-height: 18px; max-width: 100%; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
/* The card keeps one height whatever its words, so a longer name never moves the lists under it. */
body.recording #recWrap .rec-passage { height: 98px; } /* every width, so a name or an empty line never moves the trays (review finding 11) */
body.recording #recWrap .rec-where:empty { display: none; }
.rec-passage[data-kind="section"] #recRangeName { color: var(--ink); }
.rec-passage[data-kind="loop"] #recRangeName::before, .rec-passage[data-kind="range"] #recRangeName::before, body.recording #positionTime[data-kind="loop"]::before { content: ""; flex: none; display: inline-block; margin-right: 6px; vertical-align: 3px; width: 10px; height: 5px; box-sizing: border-box; border: 2px solid var(--accent); border-bottom: 0; }
.rec-passage[data-kind="section"] #recRangeName::before, body.recording #positionTime[data-kind="section"]::before { content: ""; flex: none; display: inline-block; margin-right: 6px; vertical-align: 1px; width: 12px; height: 8px; box-sizing: border-box; border: 1px solid var(--edge); border-radius: var(--tg-corner-mark); background: var(--surface); }
body.recording #positionTime[data-kind]::before { margin-right: 6px; vertical-align: 1px; }
/* The bottom bar's range in words goes: the card holds the open range's times (build 299). */
body.recording .loop.rec .stack { display: none; }
/* Exact times in Loop options: the playing line, the start and the end as typed times with their steppers, and Clear. */
body:not(.recording) .rec-exact { display: none; }
.rec-exact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.rec-exact-row .rec-time { display: inline-flex; align-items: center; }
.rec-exact-row .rec-step { width: 44px; }
@media (min-width: 1100px) { #loopPanel .rec-exact .field { grid-template-columns: 190px minmax(0, 1fr); } }

/* Wide media, an audio file: the waveform across the area, 150 pixels tall (140 on a phone), Nikhil's "the waveform
   shouldn't be so tall". The waveform's tools sit at the right end of the card's row. */
body.recording #recWrap:not(.video) .rec-wave { height: 150px; }
@media (max-width: 600px) { body.recording #recWrap:not(.video) .rec-wave { height: 140px; } }
body.recording #recWrap:not(.video) { grid-template-areas: "strip" "tools" "pass" "trays" "lists"; }
@media (min-width: 601px) { body.recording #recWrap:not(.video) { grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "strip strip" "pass tools" "trays trays" "lists lists"; } }
@media (min-width: 1100px) {
  body.recording #recWrap:not(.video) { grid-template-columns: 300px minmax(0, 1fr) max-content; grid-template-areas: "strip strip strip" "pass trays tools" "lists lists lists"; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; } /* a fixed card column, so a long name never moves the trays (review finding 3) */
  body.recording #recWrap:not(.video) > .rec-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Boxed media, a video: the player at the left and as big as the window allows, with the strip under it. */
body.recording #recWrap.video { grid-template-areas: "video" "strip" "tools" "pass" "trays" "lists"; }
@media (min-width: 601px) { body.recording #recWrap.video { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "video video" "strip strip" "tools tools" "pass lists" "trays lists"; } }
@media (min-width: 1100px) {
  body.recording #recWrap.video { grid-template-columns: minmax(0, 1fr) 300px 300px; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "video pass trays" "video lists lists" "strip lists lists"; overflow: hidden; }
  /* The player's width comes from the area's height, with the strip block (about 137 pixels, the band's room included) under it, so the window
     binds it and Hide while playing, which leaves the area's size alone, never makes it grow on Play. */
  body.recording #recWrap.video .rec-video-box { width: min(100%, (100cqh - 149px) * 16 / 9); min-width: 356px; }
  body.recording #recWrap.video .rec-wave-block { width: min(100% - 44px, (100cqh - 149px) * 16 / 9 - 44px); justify-self: start; }
  body.recording #recWrap.video .rec-tools { grid-area: strip; flex-direction: column; justify-self: start; margin-left: min(100% - 36px, (100cqh - 149px) * 16 / 9 - 36px); }
  body.recording #recWrap.video > .rec-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense; }
  body.recording #recWrap.video > .rec-side > .rec-group:nth-child(2) { grid-column: 1; grid-row: 2 / span 3; }
  body.recording #recWrap.video > .rec-side > .rec-group:nth-child(n+3) { grid-column: 2; }
}
/* An Apple Music song from 901 wide (build 336): the album panel and the strip take the column's whole width, at the
   video's own height. The card, the trays, the lists and the bottom bar keep the places a YouTube song gives them;
   only the strip's two zoom buttons move, with the strip's end. Nikhil, December 3, 2026: "let's make better use of
   the screen real-estate instead of large white space between the album and the right-side controls". */
@media (min-width: 901px) {
  body.apple-music.recording #recWrap.video .rec-video-box { width: 100%; max-height: calc(100cqh - 149px); }
  body.apple-music.recording #recWrap.video .rec-wave-block { width: calc(100% - 44px); }
  body.apple-music.recording #recWrap.video .rec-tools { margin-left: calc(100% - 36px); }
}
/* A video from 901 to 1,099 wide: the player at the left with its tools beside it, as from 1,100 (review finding 7). */
@media (min-width: 901px) and (max-width: 1099px) {
  body.recording #recWrap.video { grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: "video pass" "video trays" "video lists" "strip lists"; overflow: hidden; }
  body.recording #recWrap.video .rec-video-box { width: min(100%, (100cqh - 149px) * 16 / 9); min-width: 300px; }
  body.recording #recWrap.video .rec-wave-block { width: min(100% - 44px, (100cqh - 149px) * 16 / 9 - 44px); justify-self: start; }
  body.recording #recWrap.video .rec-tools { grid-area: strip; flex-direction: column; justify-self: start; margin-left: min(100% - 36px, (100cqh - 149px) * 16 / 9 - 36px); }
}
/* A finger takes each typed time in Exact times across 44 pixels, as it did in the trays (build 299). */
@media (pointer: coarse) { .rec-exact-row .rec-num { min-height: 44px; display: inline-flex; flex-direction: column; justify-content: center; } .rec-exact-row .rec-num input { min-height: 32px; } }
/* The waveform's tools left the card's heading in build 300, so they keep their 44 pixel tap on a touch screen here. */
@media (pointer: coarse) { body.recording #recWrap .rec-tools .chip, body.recording #recWrap .rec-tools .cell.small { min-height: 44px; } body.recording #recWrap .rec-tools .chip { min-width: 44px; justify-content: center; } body.recording #recWrap .rec-tools .cell.small:not(.row) { width: 44px; } }

/* ---------- Build 5: a tab's docked loop card ---------- */
/* work/sections-and-loops/BUILD_5_PLAN.md. The loop's buttons stop floating under the looped bars. One card docks at the
   foot of a tab's music, across the music's width, with a recording's tools in a recording's order: the loop's name and
   facts, Focus, Start here and End here (the bar steppers in the Focus view), Mark, then Save. The card shows while a tab
   is open, loop or no loop, and every slot keeps a set width, so nothing moves when a loop starts, stops, saves or opens.
   One row from 1,100 pixels wide, two rows on an iPad, three on a phone. The music area shrinks by the card's height
   (main.mjs takes it off --area-h too). The old .loop-pill rules above no longer match anything on the page. */
body:not(.no-song):not(.recording) main:has(> .tab-card:not([hidden])) { flex-direction: column; }
.tab-card { position: relative; z-index: 4; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) 124px 276px max-content; grid-template-areas: "says focus edges line" "keep keep keep keep"; align-items: center; justify-items: start; gap: 6px 8px; margin: 0 10px 8px; padding: 6px 6px 6px 12px; box-sizing: border-box; border: 1px solid var(--accent); border-radius: 14px; background: var(--surface); }
body.no-song .tab-card, body.recording .tab-card { display: none; }
@media (min-width: 1100px) { .tab-card { grid-template-columns: minmax(0, 1fr) 124px 276px max-content max-content; grid-template-areas: "says focus edges line keep"; } }
.tc-says { grid-area: says; width: 100%; min-width: 0; height: 58px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.tc-name { min-width: 0; margin: 0; font-size: var(--tg-type-passage); font-weight: 700; line-height: 22px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-card[data-kind="loop"] .tc-name::before { content: ""; display: inline-block; margin-right: 6px; vertical-align: 3px; width: 10px; height: 5px; box-sizing: border-box; border: 2px solid var(--accent); border-bottom: 0; }
.tc-facts, .tc-where { min-height: 18px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tc-focus { grid-area: focus; width: 124px; display: flex; justify-content: flex-end; }
.tc-tray { display: flex; align-items: center; gap: 4px; min-width: 0; height: 52px; padding: 4px 6px; box-sizing: border-box; border-radius: 14px; background: var(--off); transition: background-color var(--tg-time-quick) linear; }
@media (prefers-reduced-motion: reduce) { .tc-tray { transition: none; } }
.tc-edges { grid-area: edges; width: 276px; }
.tc-here, .tc-steps { display: flex; align-items: center; gap: 4px; width: 100%; }
.tc-here[hidden], .tc-steps[hidden] { display: none; }
.tc-here .cell { flex: 1 1 0; }
.tc-steps { justify-content: center; }
.tc-steps .pill-say { padding: 0 4px; }
.tc-line { grid-area: line; }
.tc-keep { grid-area: keep; }
.tc-keep.live { background: var(--accent-soft); }
#tabCard #pillSave { flex: none; width: 120px; padding: 0 8px; justify-content: center; }
#tabCard .cell.go { border-color: var(--accent); color: var(--accent); background: var(--surface); }
#tabCard .cell.go:hover:not(:disabled) { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); }
/* The name box after Save loop and Save section, and the Edited tray, hang above the pressed slot over the foot of the
   music, so the card never grows. main.mjs sets the left edge (placeNameBox). */
.tab-card > .map-edit-box.beside { position: absolute; top: auto; bottom: calc(100% + 6px); width: min(420px, max(260px, 50%)); }
.tab-card > .map-edit-box.beside.pill-tray { width: max-content; max-width: calc(100% - 12px); }
/* Loop options in the bottom bar's Loop tray, with a recording's face (#recLoopOptions). */
#loopOptionsBtn { width: auto; padding: 2px 8px; }
/* Exact bars, the first row of a tab's Loop tab: From and To, one press deeper. A recording shows Exact times instead. */
body.recording .tab-exact { display: none; }
.tab-exact { margin-bottom: 14px; }
.tab-exact-row { display: flex; align-items: center; gap: 8px; }
.tab-exact-row .cell.num { width: 68px; flex: none; }
@media (min-width: 1100px) { #loopPanel .tab-exact .field { grid-template-columns: 190px minmax(0, 1fr); } }
/* A phone: the name and Focus; then Start here and End here; then Mark and Save. The facts and the sections share one
   line, the trays drop their wash, and the save slot and Save section show their words alone, so the card fits 375. */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  .tab-card { grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "says focus" "edges edges" "line keep"; gap: 4px 6px; margin: 0 6px 6px; padding: 4px 6px 4px 10px; }
  .tc-says { height: 44px; display: block; }
  .tc-facts, .tc-where { display: inline; }
  .tc-where:not(:empty)::before { content: " · "; }
  .tc-focus { width: 116px; justify-self: end; } /* Focus and Whole song share one width here too */
  .tc-tray { height: 44px; padding: 0; background: transparent; }
  .tc-edges { width: 100%; }
  .tc-keep { justify-self: end; }
  .tc-keep.live { background: transparent; }
  #tabCard #focusBtn, #tabCard #focusClose, #tabCard #pillTag { width: auto; padding: 0 10px; }
  #tabCard #focusBtn .lbl, #tabCard #focusClose .lbl, #tabCard #pillTag .lbl { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  #tabCard #pillSave { width: 96px; padding: 0 4px; }
  #tabCard #pillTag .icon, #tabCard #pillSave .icon { display: none; }
  .tab-card > .map-edit-box.beside { width: calc(100% - 12px); }
}
/* A finger takes each of the card's buttons across 44 pixels. */
@media (pointer: coarse) { #tabCard .cell { min-height: 44px; } }
/* While the music plays, a phone hides the tools bar (build 100). The card has no Loop off of its own, so the Loop tray,
   with Loop and Loop options, stays in view and keeps its place: a playing loop can still be turned off (Codex's review). */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  body.playing .tray.loop { display: flex; }
}

/* ---------- Short link (gameplan item 2a) ----------
   Share (short links; work/youtube-short-link/mockups/, the tab share chat's pattern). The Share
   view takes the place of the card's own rows, in the same card. Every row keeps its height in every state, so a
   press changes the words and never the card's size. A touch screen makes every button 44 pixels tall. */
.share-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; } /* one column as wide as the card, never as wide as a long title */
.share-view[hidden] { display: none; }
.share-host-hidden { display: none !important; }
.share-title { display: flex; align-items: center; gap: 8px; }
.share-title .share-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-back { min-height: 32px; }
.share-view h3 { margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.share-list { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 4px; font-size: 15px; color: var(--ink); }
.share-list li { min-height: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-list .off { color: var(--muted); }
.share-list .spacer { list-style: none; }
.share-field { display: flex; align-items: center; gap: 8px; }
.share-label, .share-view .label-new > span { width: 96px; flex: none; font-size: 12px; color: var(--muted); }
.share-view .is-quiet { visibility: hidden; }
.share-view .share-hint { height: 20px; margin: -4px 0 0; overflow: hidden; }
.share-view .share-link-preview { margin: -4px 0 0 104px; height: 34px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; overflow: hidden; }
.share-link-preview b { font-weight: 600; color: var(--ink); }
.share-r3 { height: 42px; }
.share-view .share-line { margin: 0; font-size: 12px; color: var(--ink); }
.share-view .share-line.youtube-problem { display: flex; gap: 8px; align-items: center; padding: 4px 10px; height: 42px; box-sizing: border-box; color: var(--warn); }
.share-made { flex: 1 1 auto; min-width: 0; min-height: 44px; display: flex; align-items: center; padding: 2px 10px; font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--ink); background: var(--field); border-bottom: 2px solid var(--tg-edge, var(--line)); border-radius: 6px 6px 0 0; overflow-wrap: anywhere; user-select: all; }
.share-foot { justify-content: flex-start; flex-wrap: nowrap; }
.share-foot .set-copy { width: 128px; justify-content: center; }
.share-foot .cell.on { background: var(--accent-soft); color: var(--accent); }
.share-foot .push-right { margin-left: auto; }
.share-foot .set-note { min-width: 136px; justify-content: center; }
/* Share in the top bar (build 330). A recording's Share shows dimmed until gameplan 2c, and a press says why. */
.top-share[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.top-share[aria-disabled="true"]:hover { background: transparent; }
.top-share[aria-expanded="true"] { background: var(--accent-soft); }
/* On a phone's song screen the logo steps aside, so the song's name keeps its room beside Share (Nikhil chose this on
   November 26, 2026). Home, right beside it, does the logo's job. The logo stays on Home and on every window over 600 wide. */
@media (max-width: 600px) { body:not(.no-song) #homeLogo { display: none; } }
/* From 601 to 900 wide the name sits in the row, centered by its two side margins: Share takes the right one, so it
   stays right beside the name and the pair stays centered between Emporium and Metronome. */
@media (min-width: 601px) and (max-width: 900px) {
  .song:has(+ .top-share:not([hidden])) { margin-right: 0; }
  .song + .top-share { margin-right: auto; margin-left: 4px; }
} /* "Copied" keeps the button's width (2b) */
.label-dialog .share-held { margin: 8px 0 0; color: var(--muted); } /* Home's song box: why Share is off for a tab with no file (2b, S7) */
@media (pointer: coarse) {
  .share-back, .share-view .chip, .share-title .cell { min-height: 44px; }
  .share-title > .cell:last-child { min-width: 44px; }
  .share-foot .push-right { width: 44px; padding: 0; justify-content: center; }
  .share-foot .push-right .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.label-dialog .share-view .label-new input { width: 100%; }
.label-dialog .share-view p { font-size: 12px; }
/* The account's other live links for this video (Codex's review, M5): a short list under the buttons, scrolling past five. */
.share-others { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.share-others[hidden] { display: none; }
.share-others-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; max-height: 180px; overflow: auto; }
.share-others-list li { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 12px; }
.share-others-list .share-other-link { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.share-others-list li.gone .share-other-link { color: var(--muted); text-decoration: line-through; }
.share-others-list .cell { flex: none; min-height: 36px; }
@media (pointer: coarse) { .share-others-list .cell { min-height: 44px; min-width: 44px; } } /* Home's song box sets 15 pixels on every line; the view keeps its own sizes */
/* The question for a link to a video the library already holds: the answers stack as rows, the filled one first. */
.share-ask-list { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 4px; font-size: 15px; }
.share-ask-answers { display: grid; gap: 8px; margin-top: 8px; }
.share-ask-answers .cell { min-height: 44px; justify-content: center; }
.share-ask-answers .cell[hidden] { display: none; }

/* ---------- Build 6: practice screen polish ---------- */
/* work/sections-and-loops/BUILD_6_PLAN.md. Three fixes for "nothing moves unless the student moves it". */
/* 1. A phone's tab card holds still. Play past loop and Cancel (one slot) sit in the card after Mark (main.mjs,
   placeLoopSlot), so Loop on adds no status line row. The slot keeps its room while empty, and Mark and the slot show
   the icon over the word, so the third row holds Mark, the slot and the Save tray at 375 wide. While the music plays,
   the place line hides but keeps its room and the message line keeps its 30 pixel floor, so the status line stays
   56 pixels tall and the card's top stays put on Loop on, Loop off, Play and Pause. */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  #tabCard .tc-line .slot-stack { display: grid; }
  #tabCard .slot[hidden] { display: inline-flex !important; visibility: hidden; }
  #tabCard .tc-line .cell.row { flex-direction: column; gap: 1px; height: 44px; min-width: 44px; padding: 0 4px; }
  body.playing:not(.recording):not(.no-song) .status-row > .where { display: flex; visibility: hidden; }
  body.playing:not(.recording):not(.no-song) .say { min-height: 30px; }
  /* The tools bar keeps its rows while playing: Count-in, the Click track, Sections, Parts and Options hide but keep
     their room, and the Loop tray stays (build 305). Build 305's rule also showed a recording's Loop tray on a tab. */
  body.playing:not(.recording) .bar > .tray.click, body.playing:not(.recording) .bar > .tray.panels { display: flex; visibility: hidden; }
  body.playing:not(.recording) .bar > .tray.loop.rec { display: none; }
}
/* 2. An upright iPad's video shows its tools. From 601 to 900 wide the player's height leaves room for the strip block
   (145), the tools row (44), the card (98) and the trays (104), with the top area (121), the bottom strip (212) and the
   area's padding and gaps (60): 784 pixels in all. The lists take what's left and scroll inside, so they no longer
   stretch the card's row and the trays' row. A short window keeps a player at least 356 pixels wide and scrolls. A
   phone turned sideways (500 pixels tall or less) keeps its full-width player. */
@media (min-width: 601px) and (max-width: 900px) and (min-height: 501px) {
  body.recording #recWrap.video { grid-template-rows: auto auto auto auto minmax(0, 1fr); }
  body.recording #recWrap.video .rec-video-box { width: min(100%, max(356px, (100cqh - 784px) * 16 / 9)); }
  /* An Apple Music song's panel takes the width here too, at the height a video would have (build 336). */
  body.apple-music.recording #recWrap.video .rec-video-box { width: 100%; max-height: max(200px, calc(100cqh - 784px)); }
}
/* 3. Loop options leaves the strip in view on a wide video. From 1,100 wide an Options tab lies over the two right-hand
   columns only (300 + 16 + 300, the area's 10 pixel padding and the 16 pixel gap before them), so the player, the strip
   and the strip's tools stay in view while the student types exact times. A reading page keeps the full width. */
@media (min-width: 1100px) {
  body.recording:not(.no-song):has(#recWrap.video:not([hidden])) .shelf:not(.reading) { left: auto; right: max(0px, (100% - var(--page-max)) / 2); width: 642px; --shelf-side: 16px; box-shadow: inset 1px 0 0 var(--line), inset 0 -1px 0 var(--line); }
  /* In 642 pixels the shelf takes an upright iPad's arrangement: the tabs on one line (sliding sideways if they must),
     the App tab's buttons on a row of their own under the band, and each label over its choices. */
  body.recording:not(.no-song):has(#recWrap.video:not([hidden])) .shelf:not(.reading) .tab-list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  body.recording:not(.no-song):has(#recWrap.video:not([hidden])) .shelf:not(.reading) .shelf-tab { padding: 0 8px; }
  body.recording:not(.no-song):has(#recWrap.video:not([hidden])) .shelf:not(.reading) > .panel > .panel-tools { position: static; flex-wrap: wrap; justify-content: flex-end; margin: -4px 0 6px; }
  body.recording:not(.no-song):has(#recWrap.video:not([hidden])) .shelf:not(.reading) .two-col { gap: 0 24px; }
  body.recording:not(.no-song):has(#recWrap.video:not([hidden])) .shelf:not(.reading) .two-col .field { grid-template-columns: minmax(0, 1fr); }
  body.recording:not(.no-song):has(#recWrap.video:not([hidden])) .shelf:not(.reading) .seg-set { flex-wrap: wrap; }
}

/* ---------- Build 7: the big strip matches the song map (work/sections-and-loops/, Nikhil: "Yes, add it") ----------
   The band of section names over the strip shows at all times again (it kept its room since build 300, so nothing moves).
   A thin line marks where each section starts. Every saved loop is a faint green bracket along the strip's top edge,
   the open loop is the range itself, and a chosen section's range draws in ink, never green. */
body.recording #recWrap:not(.zoomed) .rec-band { visibility: visible; }
.rec-sec-edges, .rec-strip-loops { position: absolute; left: 0; right: 0; pointer-events: none; }
.rec-sec-edges { top: 0; bottom: 0; }
.rec-sec-edges > span { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -0.5px; background: var(--edge); }
.rec-strip-loops { top: 3px; height: 16px; }
.rec-strip-loops > .map-ghost { top: 0; }
.rec-strip-loops > .map-ghost.row-1 { top: 8px; }
.rec-range.section::before { border-top-color: var(--ink); }
.rec-range.section::after { border-top-color: var(--ink); }
.rec-range.section .rec-handle::before { background: var(--ink); }
.rec-range.section .rec-handle::after { border-top-color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- A teacher's lesson (build 321, work/lesson-library/PLAN.md) ---------- */
/* The Details card's Lesson block, under the card's first line: the teacher and the channel link, who made the marks,
   and the email for the teacher. */
.details-lesson { display: grid; gap: 4px; }
.details-lesson[hidden] { display: none; }
.details-lesson .details-line { margin: 0; }
.details-lesson a { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 3px; }
.details-lesson a:hover { text-decoration-color: var(--ink); }
/* The link to the teacher's lessons is the line's one control, so it takes the guide's 24-pixel floor for a press. */
.details-lesson .details-more a { display: inline-flex; align-items: center; min-height: 24px; }
/* A long teacher's name ends in three dots in a narrow top bar, inside the song's box (Details shows it whole). */
@media (max-width: 900px) {
  .song { grid-template-columns: minmax(0, 1fr); max-width: 100%; }
  .song-sub { max-width: 100%; min-width: 0; }
  .song-sub .rec-line { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- The quiet room on a tab (build 324, quiet-room.mjs) ----------
   Nikhil chose 40 percent on November 25, 2026, from the mockup in work/flow-and-focus/mock. quiet-room.mjs puts
   "quiet" on the body 2.6 seconds after Play with the pointer still, and takes it off at the first pointer move, press
   or key. Opacity alone changes: nothing moves, nothing is removed, and every dimmed tool still takes a press. The
   logo, the music, the loop's card, Restart, Play, the speed tools, Loop, Volume, Play past loop and Follow music stay
   lit. The numbers match the metronome's dimming (metronome.css, ".free-metro.focus"). */
/* The room's two times are the metronome's (metronome.css): a slow settle that never pulls the eye, and a quick way
   back. tokens.css is shared with the website, so these two names live here. */
body { --quiet-rest-time: 1400ms; --quiet-wake-time: 240ms; }
body.quiet .topbar > :not(#homeLogo),
body.quiet #songMap,
body.quiet .bar > .tray.click,
body.quiet .bar > .tray.panels,
body.quiet .status-row .cell:not(#followBtn):not(#continueBtn),
body.quiet .status-row .feedback-foot,
body.quiet .status-row .coffee-foot { opacity: 0.4 !important; transition: opacity var(--quiet-rest-time) cubic-bezier(0.4, 0, 0.2, 1) !important; }
body.quiet-wake .topbar > :not(#homeLogo),
body.quiet-wake #songMap,
body.quiet-wake .bar > .tray.click,
body.quiet-wake .bar > .tray.panels,
body.quiet-wake .status-row .cell:not(#followBtn):not(#continueBtn),
body.quiet-wake .status-row .feedback-foot,
body.quiet-wake .status-row .coffee-foot { transition: opacity var(--quiet-wake-time) var(--tg-ease-out) !important; }
/* The pointer's arrow rests with the room while it sits over the music. */
body.quiet #scoreWrap, body.quiet #scoreWrap * { cursor: none !important; }
@media (prefers-reduced-motion: reduce) {
  body.quiet .topbar > :not(#homeLogo), body.quiet #songMap, body.quiet .bar > .tray.click, body.quiet .bar > .tray.panels, body.quiet .status-row .cell:not(#followBtn):not(#continueBtn), body.quiet .status-row .feedback-foot, body.quiet .status-row .coffee-foot,
  body.quiet-wake .topbar > :not(#homeLogo), body.quiet-wake #songMap, body.quiet-wake .bar > .tray.click, body.quiet-wake .bar > .tray.panels, body.quiet-wake .status-row .cell:not(#followBtn):not(#continueBtn), body.quiet-wake .status-row .feedback-foot, body.quiet-wake .status-row .coffee-foot { transition: none !important; }
}

/* ---------- Rest on the loop's card (build 324) ----------
   One press turns the loop's rest on: "Rest beats before" in Options, Loop, which took two presses to reach. From
   1,100 pixels wide the card is one row, and Rest takes a new 84 pixel column between the loop's name and Focus, so
   the name's column gives up 92 pixels and no button moves. Under 1,100 pixels the card has no measured room for the
   switch, so it waits there and Options, Loop still holds the choice. */
.tc-rest { display: none; }
@media (min-width: 1100px) {
  .tab-card { grid-template-columns: minmax(0, 1fr) 84px 124px 276px max-content max-content; grid-template-areas: "says rest focus edges line keep"; }
  .tc-rest { display: flex; grid-area: rest; width: 84px; }
}
.tc-rest .cell { width: 84px; height: 44px; padding: 0; box-sizing: border-box; }

/* ---------- Build 334: the tab card's fold and a way out of every phone panel ---------- */
/* work/sections-and-loops/card-fold/ (PROPOSAL.md, REVIEW.md) and close-audit/AUDIT.md. Nikhil on his iPhone, build 329:
   "every options screen must always have a way to back out." */
/* 1. The fold control: a chevron at the card's top right, 36 by 36 with a mouse and 44 by 44 on any touch screen,
   whatever the width. It points down while the card is open and up while it's folded. */
#tabCard .tc-fold { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
#tabCard .tc-fold:hover { background: var(--hover); color: var(--ink); }
#tabCard .tc-fold .icon { width: 20px; height: 20px; }
#tabCard.folded .tc-fold .icon { transform: rotate(180deg); }
@media (pointer: coarse) { #tabCard .tc-fold { width: 44px; height: 44px; } }
/* From 601 wide the chevron sits in the open card's top right corner, and the card keeps its room at the right. */
#tabCard:not(.folded) { padding-right: 46px; }
#tabCard:not(.folded) .tc-fold { position: absolute; top: 4px; right: 4px; }
@media (pointer: coarse) {
  #tabCard:not(.folded) { padding-right: 52px; }
  #tabCard:not(.folded) .tc-fold { top: 2px; right: 2px; }
}
/* 2. Folded, the card is one 44 pixel line: the bars said once, then Edited or a phone's Cancel when one waits, then
   the chevron at the same right edge as on the open card. A press anywhere on the line opens the card (main.mjs). */
.tc-fold-says { display: none; }
#tabCard.folded { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 4px 0 12px; cursor: pointer; }
#tabCard.folded > :not(.tc-fold-says):not(.tc-fold):not(.tc-line):not(.tc-keep):not(.map-edit-box) { display: none; }
#tabCard.folded .tc-fold-says { display: block; order: -1; flex: 1 1 auto; min-width: 0; margin: 0; font-size: var(--tg-type-passage); font-weight: 700; line-height: 22px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
#tabCard.folded[data-kind="loop"] .tc-fold-says::before { content: ""; display: inline-block; margin-right: 6px; vertical-align: 3px; width: 10px; height: 5px; box-sizing: border-box; border: 2px solid var(--accent); border-bottom: 0; }
#tabCard.folded .tc-line, #tabCard.folded .tc-keep, #tabCard.folded .slot-stack { display: contents; }
#tabCard.folded .tc-line > :not(.slot-stack), #tabCard.folded .slot-stack > *, #tabCard.folded .tc-keep > * { display: none !important; }
#tabCard.folded #loopCancel:not([hidden]), #tabCard.folded #pillSave[data-state="edited"] { display: inline-flex !important; visibility: visible; flex: none; }
@media (pointer: coarse) { #tabCard.folded { padding-right: 2px; } #tabCard.folded #loopCancel, #tabCard.folded #pillSave { min-height: 44px; height: 44px; } }
/* A phone: the chevron joins the card's first row, after Focus, so nothing is cut. The facts say the bars once: an
   unsaved loop's name already says them, so the line reads "4 bars · In Verse", and a saved loop's reads
   "Bars 5 to 8 · In Verse" (main.mjs, paintFacts). "In Verse" fits at 375 wide. */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  #tabCard:not(.folded) { grid-template-columns: minmax(0, 1fr) max-content max-content; grid-template-areas: "says focus fold" "edges edges edges" "line keep keep"; padding-right: 6px; }
  #tabCard:not(.folded) .tc-fold { position: static; grid-area: fold; justify-self: end; }
  #tabCard.folded { padding: 0 6px 0 10px; }
  #tabCard:not([data-saved]) .tc-facts .tc-bars, #tabCard:not([data-saved]) .tc-facts .tc-sep, #tabCard[data-saved] .tc-facts .tc-sep, #tabCard[data-saved] .tc-facts .tc-count { display: none; }
}

/* 3. Typing boxes: Cancel and Post beside a comment box, Cancel and Save under a name box. 44 pixels tall on a touch
   screen. A press outside a box never saves; the box stays open until one of the two buttons, Enter or Escape. */
.tab-pop.edit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tab-pop.edit .tab-pop-box { flex: 1 1 180px; width: auto; min-width: 0; }
.tab-pop-acts, .name-acts { display: flex; flex: none; gap: 4px; margin-left: auto; }
.name-acts { justify-content: flex-end; margin-top: 6px; }
.tab-pop-acts .cell, .name-acts .cell { justify-content: center; min-width: 64px; }
.tab-pop-acts .cell.go, .name-acts .cell.go { border: 1px solid var(--accent); color: var(--accent); background: var(--surface); }
#songMap .map-edit-box:not(.beside) .name-acts { padding: 4px; border-radius: 8px; background: var(--surface); box-shadow: var(--tg-shadow-lift); }
@media (pointer: coarse) { .tab-pop-acts .cell, .name-acts .cell { min-height: 44px; } }

/* 4. The way out of every panel takes a finger across 44 by 44 or more on a touch screen (the audit's fails). The X in
   Sections and loops and in the song's details card grow from 38 to 44 wide. The X beside the waiting song's note and
   the 32 pixel Close and Not now buttons keep their faces and gain an invisible margin, so nothing around them moves. */
@media (pointer: coarse) {
  #sectionsClose, #detailsClose { width: 44px; min-width: 44px; padding: 0; justify-content: center; }
  #feedbackClose, #feedbackCardLater, #coffeeLater, #accountOfferNo, .free-metro .fm-more { position: relative; }
  /* The metronome's More choices is 36 tall from 601 wide (44 on a phone): an iPad's finger gets the same 44. */
  .free-metro .fm-more::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; margin-top: -22px; }
  #feedbackClose::after, #feedbackCardLater::after, #coffeeLater::after, #accountOfferNo::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; margin-top: -22px; }
}
/* The X beside the waiting song's note: build 288 gave it a 44 by 44 press area, but the status line's own rule for its
   buttons (inset 0) came later and cut it back to the 28 pixel face. The id puts the 44 back, at every width. */
.status-row #waitClose::after { inset: auto; top: 50%; left: 50%; width: 44px; height: 44px; margin: -24px 0 0 -22px; } /* 2 pixels high, so the press area stays inside the window where Home's status line meets its foot */
/* The Emporium's back link: the sign's heading under it took the link's lowest 5 pixels, so a press reached it across
   39 of its 44. The link now sits above the heading. */
.emporium-back { position: relative; z-index: 1; }
/* 5. A clear button inside the search boxes on Home and in the Emporium, 44 by 44 on a touch screen, in place of the
   browser's own small mark. It shows while the box holds words. */
.find-clear { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-right: -8px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.find-clear:hover { background: var(--hover); color: var(--ink); }
.find-clear .icon { width: 16px; height: 16px; }
.home-find:has(> input:placeholder-shown) > .find-clear, .e-find:has(> input:placeholder-shown) > .find-clear { display: none; }
#findBox::-webkit-search-cancel-button, .e-find > input[type="search"]::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
@media (pointer: coarse) { .find-clear { width: 44px; height: 44px; margin-right: -12px; } }
/* On an upright iPad the Emporium's front was 892 pixels wide in an 834 window: the sign (440) and the 380 pixel search
   box didn't fit the 738 pixel column, so the box, its clear button and each row's About ran past the window's right
   edge. The front keeps the window's width, and the search box gives way in the sign row. */
.m-front { grid-template-columns: minmax(0, 1fr); }
.m-signrow .e-find { flex: 0 1 380px; min-width: 0; }
/* 6. Part and color on a recording gets an X at its top right. */
.rec-pop { padding-right: 40px; }
.rec-pop-close { position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; min-height: 32px; padding: 0; justify-content: center; }
@media (pointer: coarse) { .rec-pop { padding-right: 52px; min-height: 44px; } .rec-pop-close { width: 44px; height: 44px; min-height: 44px; } }
