/* Hallmark · shape: app screens, home is a hymnal page beside the sample chart · genre: editorial · theme: brand (paper and olive kept, olive deepened) · direction: user mockup, with the type and spacing from cfd4373 at the owner's request · redesign: full (home and site chrome), restyle (every other page)
 * paper: oklch(96.5% 0.011 84) · card: oklch(93.4% 0.014 105) tint with oklch(96.3% 0.011 95) cells (cfd4373) · accent: oklch(38.5% 0.068 128) · display: Atkinson Hyperlegible Next · body: Public Sans · chords: Atkinson Hyperlegible Next bold (cfd4373 sizes, weights, line-heights and tracking)
 * nav: open-book mark and wordmark left, Song library as a plain link, language, outlined Sign in, a rule under · signature: the sample chart card, transposed live, printed or expanded · states: hover, active, focus, disabled, selected, pressed, invalid, empty, loading
 * axes: light/grotesk-sans/chromatic-olive · posture: restrained · hero: Stage (/) · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S5 R4 V4 · weakest: E, the editor screens still carry many small controls; their layout is kept as asked and they take the new type and colour only */
/* Hallmark · desktop pass 2026-12-04 · from 1024px: content capped at 1280px with growing gutters, compact hero band beside a shorter sample card, the library table on the first screen, 34px controls (44px on touch from 761px); phones untouched; from 1600px the page grows to 1480px and scales up in steps (zoom 1.1-1.45) · swept in app scope, no waivers needed */
/* Hallmark · dropped "An original practice chart. Press − or + to change the key." · the mockup card carries "Sample chart" and the − + buttons instead; the i18n key is kept */
/* Hallmark · reworded "Chord charts in the key you play." to "For the musicians in your church." · the owner's mockup headline · "Private · {state}" to "Private: {state}", and "Original sample · not a published library chart" to "Original sample, not a published library chart", "Shared snapshot · Not reviewed" to "Shared snapshot, not reviewed" · 63 names dot-joined meta */
/* Hallmark · reworded "0123456789101112" to "None, then 1 to 12" · the capo list shows None for 0 as in the owner's mockup; the option value stays 0 */
/* Hallmark · dismissed 77 · home is an app home: the hero, the sample chart and the reviewed-charts list, as before; no sections were added or cut */
/* Hallmark · answered F4 · one filled button per screen (.primary); the pressed Chords | Numbers side is a filled segment because it is a toggle state, not an action, as the owner asked; Song library is a plain link with an underline for the current page; Sign in is outlined */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  src: url("/public-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* colour: warm paper, dark ink and a terracotta/salmon accent, in OKLCH (2026-12-04 redesign from Ivan's mockup) */
  --color-paper: oklch(96.4% 0.011 62);
  --color-paper-2: oklch(93.4% 0.014 58);
  --color-paper-3: oklch(90.4% 0.016 56);
  --color-tint: oklch(88.5% 0.01 62);       /* sample card: warm stone grey (neutral, sits behind the white bubbles) */
  --color-tint-cell: oklch(95.2% 0.024 84);  /* chord cells: cream, not white */
  --color-field: oklch(99% 0.004 60);
  /* controls inside the beige chart card: tinted, never white */
  --color-tint-control: var(--color-field);
  --color-tint-hover: var(--color-paper-2);
  --color-tint-press: var(--color-paper-3);
  --color-ink: oklch(23% 0.012 50);
  --color-ink-2: oklch(36% 0.014 50);
  --color-muted: oklch(47% 0.016 50);
  --color-rule: oklch(87.5% 0.014 55);
  --color-rule-strong: oklch(80% 0.018 55);
  --color-edge: oklch(58% 0.016 50);
  --color-bar: oklch(23% 0.012 50);
  --color-accent: oklch(50% 0.13 36);
  --color-accent-2: oklch(45% 0.125 35);
  --color-accent-3: oklch(40% 0.115 34);
  --color-accent-ink: oklch(98.5% 0.006 60);
  --color-accent-wash: oklch(92.5% 0.035 45);
  --color-salmon: oklch(73% 0.105 38);         /* logo tile, selected switch, active tab */
  --color-salmon-2: oklch(69% 0.11 37);
  --color-salmon-wash: oklch(91.5% 0.04 48);  /* small pills: beta, Sample chart */
  --color-chord: oklch(21% 0.01 50);
  --color-focus: oklch(50% 0.14 36);
  --color-rust: oklch(52.3% 0.121 38);
  --color-rust-wash: oklch(95% 0.02 45);
  --color-rust-wash-2: oklch(91% 0.035 42);
  --color-rust-ink: oklch(42% 0.12 35);
  --color-accent-wash-2: oklch(88.5% 0.045 44);
  --color-yt: oklch(20% 0.008 50);             /* Watch on YouTube: near-black */
  --color-yt-2: oklch(30% 0.01 50);
  /* section colours: Intro green, Verse purple, Pre-Chorus teal, Chorus gold, Bridge rose, Interlude/Instrumental blue, Outro taupe */
  --sec-intro: oklch(66% 0.085 140);   --sec-intro-wash: oklch(93.5% 0.03 140);
  --sec-verse: oklch(62% 0.085 315);   --sec-verse-wash: oklch(93.5% 0.026 315);
  --sec-pre: oklch(63% 0.075 200);     --sec-pre-wash: oklch(93.5% 0.025 200);
  --sec-chorus: oklch(76% 0.12 78);    --sec-chorus-wash: oklch(94.5% 0.045 85);
  --sec-bridge: oklch(63% 0.11 15);    --sec-bridge-wash: oklch(93.5% 0.03 15);
  --sec-inter: oklch(63% 0.07 250);    --sec-inter-wash: oklch(93.5% 0.022 250);
  --sec-outro: oklch(60% 0.03 60);     --sec-outro-wash: oklch(93% 0.012 60);
  --color-danger: oklch(47% 0.145 29);
  --color-scrim: oklch(25% 0.014 95 / 0.38);
  --color-shadow: oklch(25% 0.014 95 / 0.08);
  /* stage mode: a dark screen for playing live */
  --color-stage-bg: oklch(16% 0.008 100);
  --color-stage-sunk: oklch(20% 0.01 100);
  --color-stage-dim: oklch(64% 0.012 95);
  --color-stage-raise: oklch(27% 0.014 100);
  --color-stage-ink: oklch(94% 0.012 90);
  --color-stage-muted: oklch(74% 0.016 95);
  --color-stage-rule: oklch(37% 0.016 100);
  --color-stage-bar: oklch(63% 0.02 100);
  --color-stage-focus: oklch(82% 0.12 130);
  --color-print-ink: oklch(16% 0.006 100);
  --color-print-paper: oklch(99.4% 0.002 100);
  --color-print-rule: oklch(45% 0.01 100);

  /* type */
  --font-display: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Public Sans", ui-sans-serif, system-ui, sans-serif;
  --font-chord: var(--font-display);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.125rem; --text-xl: 1.375rem; --text-2xl: 1.75rem; --text-3xl: 2.25rem;
  --text-display: clamp(2.5rem, 1.4rem + 3vw, 4.25rem);
  --tracking-display: -0.02em;

  /* space: the 4px scale */
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;

  --container: 1360px; --gutter: 40px; /* content 1280px at most (1480px, scaled up, on big monitors: see wide screens) */
  --radius-control: 6px; --radius-card: 12px; --radius-small: 4px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 120ms; --dur-short: 220ms;
  --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-modal: 400; --z-toast: 500; --z-skip: 600;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { background: var(--color-paper); scrollbar-color: var(--color-edge) var(--color-paper); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; font-synthesis: none; caret-color: var(--color-accent); -webkit-font-smoothing: antialiased; }
::selection { background: var(--color-accent-wash); color: var(--color-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: var(--tracking-display); line-height: 1.1; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
h1 { font-size: var(--text-3xl); margin: 0 0 var(--space-md); max-width: 24ch; }
h2 { font-size: var(--text-xl); margin: var(--space-lg) 0 var(--space-xs); }
h3 { font-size: var(--text-lg); }
p { line-height: 1.6; text-wrap: pretty; }
a { color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--color-accent-2); }
a:active { color: var(--color-accent-3); }
code { font-family: var(--font-mono); background: var(--color-paper-2); padding: 0 var(--space-2xs); border-radius: var(--radius-small); color: var(--color-ink); }
[hidden] { display: none !important; }
.muted, .subline { color: var(--color-muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* focus: one ring, instant, on every control */
:where(a, button, input, select, textarea, summary, label.dropzone, [tabindex]):focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
:where(input, select, textarea):focus-visible { outline-offset: 0; }
main:focus, main:focus-visible { outline: none; }

/* ---------- controls ---------- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 40px; padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--color-edge); border-radius: var(--radius-control);
  background: transparent; color: var(--color-ink); line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
button:hover, .button:hover { background: var(--color-paper-2); color: var(--color-ink); }
button:active, .button:active { background: var(--color-paper-3); }
button:disabled, button:disabled:hover { background: var(--color-paper-3); border-color: var(--color-rule); color: var(--color-muted); cursor: not-allowed; }
.primary, .button.primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.primary:hover, .button.primary:hover { background: var(--color-accent-2); border-color: var(--color-accent-2); color: var(--color-accent-ink); }
.primary:active, .button.primary:active { background: var(--color-accent-3); border-color: var(--color-accent-3); }
.primary:disabled, .primary:disabled:hover { background: var(--color-paper-3); border-color: var(--color-rule); color: var(--color-muted); }
.quiet, .button.quiet, button.quiet { border-color: transparent; }
.danger { color: var(--color-danger); }
.danger:hover { color: var(--color-danger); }
button.icon { min-width: 40px; padding: var(--space-xs) var(--space-sm); font-family: var(--font-display); font-weight: 700; }
button.with-icon { gap: var(--space-xs); padding-inline: var(--space-sm) var(--space-md); }
.ico { flex: none; }
.text-link, button.text-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--color-accent); font-size: var(--text-md); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; cursor: pointer; }
.text-link:hover, button.text-link:hover { background: transparent; color: var(--color-accent-3); text-decoration-thickness: 2px; }
.text-link:active, button.text-link:active { background: transparent; color: var(--color-accent-3); }
button.text-link:disabled, button.text-link:disabled:hover { background: transparent; color: var(--color-muted); }
/* Chords | Numbers: one outlined pill, the pressed side filled (a state, not an action) */
.segmented { display: inline-flex; border: 1px solid var(--color-edge); border-radius: var(--radius-control); overflow: hidden; }
.segmented button.seg { border: 0; border-radius: 0; min-height: 38px; padding: var(--space-xs) var(--space-md); background: var(--color-field); }
.segmented button.seg + button.seg { border-left: 1px solid var(--color-edge); }
.segmented button.seg:hover { background: var(--color-paper-2); }
.segmented button.seg:active { background: var(--color-paper-3); }
.segmented button.seg[aria-pressed=true] { background: var(--color-accent); color: var(--color-accent-ink); }
.segmented button.seg:focus-visible { outline-offset: -3px; outline-color: var(--color-focus); }
.segmented button.seg[aria-pressed=true]:focus-visible { outline-color: var(--color-accent-ink); }

input, textarea, select {
  min-height: 40px; max-width: 100%; padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-edge); border-radius: var(--radius-control);
  background: var(--color-field); color: var(--color-ink);
}
textarea { line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--color-muted); opacity: 1; }
input:disabled, select:disabled, textarea:disabled { background: var(--color-paper-3); color: var(--color-muted); cursor: not-allowed; }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--color-danger); }
label { display: flex; flex-direction: column; gap: var(--space-xs); font-size: var(--text-sm); font-weight: 600; }
label input, label select, label textarea { font-weight: 400; font-size: var(--text-md); }
.helper { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.55; font-weight: 400; }
.check { flex-direction: row; align-items: start; font-weight: 400; margin: var(--space-md) 0; line-height: 1.5; font-size: var(--text-md); }
.check input { min-height: 0; margin-top: var(--space-2xs); width: 18px; height: 18px; accent-color: var(--color-accent); }

/* ---------- header and footer ---------- */
.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-4xl)); }
.skip:focus { top: var(--space-xs); z-index: var(--z-skip); background: var(--color-field); padding: var(--space-md); }
header {
  display: flex; align-items: center; gap: var(--space-lg); min-height: 72px;
  width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--container) - 2 * var(--gutter)); margin: 0 auto; padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-rule-strong);
}
.brand { display: flex; align-items: center; gap: var(--space-sm); text-decoration: none; color: var(--color-ink); font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.015em; white-space: nowrap; line-height: 1; }
.brand:hover { color: var(--color-ink); }
.brand small { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0; color: var(--color-muted); margin-left: var(--space-2xs); }
.mark { flex: none; }
nav { display: flex; gap: var(--space-2xs); }
header nav { margin-left: var(--space-md); }
nav a { color: var(--color-ink-2); text-decoration: none; padding: var(--space-xs) var(--space-sm); font-size: var(--text-md); white-space: nowrap; text-underline-offset: 0.35em; }
nav a:hover { color: var(--color-ink); text-decoration: underline; text-decoration-thickness: 1px; }
nav a:active { color: var(--color-accent-3); }
nav a.active { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 2px; }
#language { margin-left: auto; font-size: var(--text-sm); background-color: var(--color-field); }
#account { white-space: nowrap; border-color: var(--color-accent); color: var(--color-accent-3); }
#account:hover { background: var(--color-accent-wash); color: var(--color-accent-3); }
#account:active { background: var(--color-paper-3); }
footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md);
  width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--container) - 2 * var(--gutter)); margin: 0 auto; padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-rule); color: var(--color-muted); font-size: var(--text-sm);
}
#footer-text { max-width: 70ch; line-height: 1.55; }
#copyright { font-size: var(--text-sm); }

/* ---------- page frame ---------- */
main { max-width: var(--container); margin: 0 auto; padding: var(--space-xl) var(--gutter) var(--space-2xl); min-height: 75vh; }
main.editing { padding-top: var(--space-lg); }
.intro { max-width: 62ch; margin: 0 0 var(--space-lg); font-size: var(--text-lg); }
.actions { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; }
.banner { padding: var(--space-sm) var(--space-md); background: var(--color-paper-2); border-radius: var(--radius-control); font-size: var(--text-sm); line-height: 1.6; margin: var(--space-md) 0; max-width: 80ch; }
.banner p { margin: 0 0 var(--space-xs); }
.import-banner { background: var(--color-rust-wash); }
.back { display: inline-block; color: var(--color-muted); text-decoration: none; font-size: var(--text-sm); margin-bottom: var(--space-xs); }
.back:hover { color: var(--color-ink); text-decoration: underline; }
.empty { padding: var(--space-lg) 0; max-width: 62ch; }
.empty h2 { margin-top: 0; }

/* ---------- home: a hymnal page beside the sample chart ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-2xl); align-items: start; padding: var(--space-lg) 0 var(--space-2xl); }
.hero h1 { font-size: var(--text-display); line-height: 1.02; letter-spacing: -0.03em; max-width: 11ch; margin: 0 0 var(--space-lg); }
.lead { font-size: var(--text-xl); line-height: 1.45; color: var(--color-ink-2); max-width: 30ch; margin: 0 0 var(--space-xl); }
.hero-copy { padding-top: var(--space-xl); }
.owner-links { margin-top: var(--space-md); }
.demo { margin: 0; padding: var(--space-lg) var(--space-lg) var(--space-md); background: var(--color-tint); border: 0; border-radius: var(--radius-card); min-width: 0; }
.demo-head { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: var(--space-xs) var(--space-lg); }
.demo-name { min-width: 0; }
.demo-title { margin: 0; font-size: var(--text-2xl); max-width: none; }
.demo-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-lg); margin: var(--space-2xs) 0 0; }
.demo-meta div { display: flex; align-items: baseline; gap: var(--space-xs); }
.demo-meta dt { font-size: var(--text-sm); color: var(--color-muted); }
.demo-meta dd { margin: 0; font-size: var(--text-sm); color: var(--color-ink); }
.demo-meta .demo-kind dd { color: var(--color-accent); }
.view-buttons { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.demo .chart-tools { margin: var(--space-md) 0 0; }
.demo .sheet-wrap { --chart-scale: 0.86; }
.demo .sheet { margin-top: var(--space-md); }
.demo .bar { background: var(--color-tint-cell); }
.demo .sheet-meta { display: none; }
.demo select, .demo button:not(.primary), .demo .segmented button.seg { background-color: var(--color-tint-control); }
.demo button:not(.primary):hover, .demo .segmented button.seg:hover { background-color: var(--color-tint-hover); }
.demo button:not(.primary):active, .demo .segmented button.seg:active { background-color: var(--color-tint-press); }
.demo .segmented button.seg[aria-pressed=true] { background: var(--color-accent); color: var(--color-accent-ink); }
.focus .hero { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
.focus .demo { max-width: 1100px; margin-inline: auto; }
.focus .demo .sheet { max-width: none; }
.focus .demo .sheet-wrap { --chart-scale: 1.1; }
.library { padding-top: var(--space-xl); border-top: 1px solid var(--color-rule); }
.library-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-sm) var(--space-lg); }
.library-head h2 { font-size: var(--text-3xl); margin: 0; }
.search { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-xs); max-width: 760px; margin: var(--space-lg) 0 var(--space-xl); }
.search input { font-size: var(--text-lg); }
.search select { min-width: 150px; }

/* ---------- lists ---------- */
.rows { border-top: 1px solid var(--color-rule); max-width: 960px; }
.rows + .rows, .actions + .rows { margin-top: var(--space-lg); }
.song-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); width: 100%; padding: var(--space-md) var(--space-xs); border: 0; border-bottom: 1px solid var(--color-rule); border-radius: 0; text-align: left; color: var(--color-ink); text-decoration: none; min-height: 0; }
a.song-row { color: var(--color-ink); }
.song-row:hover { background: var(--color-paper-2); color: var(--color-ink); }
.song-row:active { background: var(--color-paper-3); }
.song-row strong { display: block; font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-2xs); }
.row-sub { display: flex; flex-wrap: wrap; gap: 0 var(--space-md); color: var(--color-muted); font-size: var(--text-sm); }
.row-meta { display: flex; align-items: center; gap: var(--space-md); flex-shrink: 0; }
.row-meta .key { order: 2; min-width: 4ch; text-align: right; font-family: var(--font-chord); font-size: var(--text-xl); color: var(--color-chord); font-weight: 700; }
.tag { font-size: var(--text-xs); color: var(--color-accent-3); background: var(--color-accent-wash); padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-small); }
.rows-head, .song-row .row-cell { display: none; }
.member-row { display: flex; flex-wrap: wrap; gap: 0 var(--space-md); align-items: baseline; }

/* ---------- chart view ---------- */
.title-row { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: var(--space-sm) var(--space-lg); max-width: 980px; }
.song-title { margin-bottom: var(--space-2xs); }
.title-row .song-title { margin: 0 0 var(--space-2xs); }
.subline { margin: 0 0 var(--space-2xs); font-size: var(--text-lg); }
.arrangement { display: block; font-size: var(--text-md); }
.status-line { color: var(--color-muted); font-size: var(--text-sm); margin: 0; }
.links { margin: var(--space-xs) 0 0; }
.owner-actions { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--color-rule); }
.share-url { font-family: var(--font-mono); font-size: var(--text-sm); overflow-wrap: anywhere; }
.report-link { font-size: var(--text-sm); margin-top: var(--space-lg); }
.reader-tools { max-width: 980px; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); align-items: center; justify-content: space-between; border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); padding: var(--space-sm) 0; margin: var(--space-md) 0 var(--space-2xs); }
.chart-tools { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); align-items: center; }
.tool-group { display: flex; align-items: center; gap: var(--space-xs); }
.tool-group.inline { flex-direction: row; font-weight: 400; }
.tool-group.end { margin-left: auto; }
.tool-label { font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); }
.chart-tools select { min-width: 72px; font-family: var(--font-display); font-weight: 700; }
.chart-tools.compact { gap: var(--space-xs); }
.chart-tools.compact .tool-label { display: none; }
.review-box { border-top: 1px solid var(--color-rule); padding-top: var(--space-lg); margin-top: var(--space-xl); max-width: 80ch; }
.review-box textarea { width: 100%; min-height: 96px; }
.focus header, .focus footer, .focus .nonfocus { display: none; }
.focus main { padding-top: var(--space-lg); }
.focus .toolbar { position: sticky; top: 0; background: var(--color-paper); z-index: var(--z-sticky); }

/* the sheet: big chords in bars, four bars a line */
.sheet-wrap { --chart-scale: 1; }
.sheet { max-width: 980px; margin: var(--space-md) 0 0; line-height: 1.2; }
.sheet-meta { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); margin: 0 0 var(--space-xs); }
.sheet-meta div { display: flex; flex-direction: column; }
.sheet-meta dt { font-size: var(--text-xs); color: var(--color-muted); }
.sheet-meta dd { margin: 0; font-size: var(--text-md); font-weight: 600; color: var(--color-ink); }
.music-section { padding: 0 0 var(--space-md); break-inside: avoid; }
.section-heading { font-family: var(--font-body); font-size: var(--text-md); font-weight: 700; letter-spacing: 0; color: var(--color-ink-2); margin: var(--space-md) 0 var(--space-xs); line-height: 1.3; }
.repeat { color: var(--color-accent); font-weight: 700; }
.bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bar { display: flex; align-items: center; gap: var(--space-xs); min-height: calc(64px * var(--chart-scale)); padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-sm); border-right: 1.5px solid var(--color-bar); border-bottom: 1px solid var(--color-rule); }
.bar:nth-child(4n+1) { border-left: 2px solid var(--color-bar); }
.bar .c { flex: 1 1 0; min-width: 0; font-family: var(--font-chord); font-size: calc(28px * var(--chart-scale)); font-weight: 700; color: var(--color-chord); letter-spacing: -0.01em; overflow-wrap: anywhere; white-space: normal; }
.bar.split .c { font-size: calc(22px * var(--chart-scale)); overflow-wrap: normal; word-break: keep-all; min-width: auto; }
.bar.split .c + .c { border-left: 1px dotted var(--color-edge); padding-left: var(--space-xs); }
.sheet.solfege .bar .c { overflow-wrap: normal; word-break: keep-all; min-width: 0; }
.bar .c small { display: block; font-family: var(--font-body); font-size: var(--text-xs); font-weight: 400; color: var(--color-muted); }
.bar .c.soft { color: var(--color-muted); font-weight: 400; }
.bar.incomplete { background: var(--color-rust-wash); }
.bar.incomplete .c { color: var(--color-rust); }

/* ---------- create and edit ---------- */
.create .editor-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); padding-bottom: var(--space-xs); }
.create .editor-top .song-title-input { flex: 1 1 320px; }
.song-title-input { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; border: 0; border-bottom: 1px solid var(--color-edge); background: transparent; padding: var(--space-xs) 0; border-radius: 0; width: 100%; min-height: 48px; }
.editor-save { display: flex; align-items: center; gap: var(--space-sm); margin-left: auto; }
.editor-save .helper { white-space: nowrap; }
.unsaved { color: var(--color-rust); }
.basics { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr 1fr; gap: var(--space-sm) var(--space-md); padding: var(--space-sm) 0 var(--space-md); border-bottom: 1px solid var(--color-rule); }
.basics input, .basics select { width: 100%; }
.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr); gap: var(--space-xl); align-items: start; padding-top: var(--space-lg); }
.mode-switch { display: inline-flex; border: 1px solid var(--color-edge); border-radius: var(--radius-card); padding: var(--space-2xs); margin-bottom: var(--space-md); background: var(--color-field); gap: var(--space-2xs); }
.mode-switch button { border: 0; padding: var(--space-xs) var(--space-md); border-radius: var(--radius-control); min-height: 36px; }
.mode-switch button[aria-selected=true] { background: var(--color-accent-wash); color: var(--color-accent-3); font-weight: 600; box-shadow: inset 0 0 0 1px var(--color-accent); }
.quick-help p { margin: 0 0 var(--space-xs); }
.quick-help details { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-sm); }
.quick-help summary { cursor: pointer; color: var(--color-accent); }
.quick-help ul { margin: var(--space-xs) 0; padding-left: var(--space-lg); line-height: 1.9; }
.quick-text { width: 100%; min-height: 300px; font: 600 var(--text-lg)/1.7 var(--font-mono); resize: vertical; padding: var(--space-sm) var(--space-md); }
.problems { font-size: var(--text-sm); color: var(--color-rust); }
.problems p { margin: var(--space-xs) 0 0; }
.problems .helper { color: var(--color-muted); }
.chord-pad { display: flex; flex-direction: column; gap: var(--space-xs); margin-top: var(--space-sm); }
.pad-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.pad-row button { padding: var(--space-xs) var(--space-sm); background: var(--color-field); }
.pad-row button:hover { background: var(--color-paper-2); }
.pad-row.chords button { font-family: var(--font-chord); font-weight: 700; color: var(--color-chord); min-width: 44px; }
.pad-row button.mod { color: var(--color-ink-2); font-weight: 400; min-width: 40px; }
.pad-row.sections button { font-size: var(--text-sm); color: var(--color-ink-2); }
.preview { position: sticky; top: var(--space-md); border-left: 1px solid var(--color-rule); padding-left: var(--space-lg); max-height: var(--fit-h, calc(100vh - var(--space-xl))); overflow: auto; overscroll-behavior: contain; }
.preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs); }
.preview-head h2 { margin: 0; font-size: var(--text-lg); }
.preview .sheet { margin-top: var(--space-xs); }
.preview .bar { min-height: calc(54px * var(--chart-scale)); }
.song-details { margin-top: var(--space-lg); border-bottom: 1px solid var(--color-rule); padding: var(--space-sm) 0 var(--space-md); }
.song-details summary { cursor: pointer; color: var(--color-accent); }
.song-details .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--space-lg) 0; }
.song-details textarea { min-height: 72px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.full { grid-column: 1 / -1; }
.mobile-save { display: none; }

/* block editor */
.block-editor .composer-layout { grid-template-columns: minmax(0, 1fr) 232px; }
.composer-guide { margin: 0 0 var(--space-md); font-size: var(--text-sm); color: var(--color-ink-2); padding: var(--space-sm) var(--space-md); background: var(--color-paper-2); border-radius: var(--radius-control); }
.composer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--space-xl); align-items: start; margin-top: var(--space-md); }
.composer-canvas { min-width: 0; }
.compose-section { margin: 0 0 var(--space-lg); padding: 0 0 var(--space-lg); border-bottom: 1px solid var(--color-rule); }
.section-bar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.section-bar label { white-space: nowrap; }
.section-bar select { font-weight: 600; width: 160px; }
.section-bar input { width: 88px; }
.section-options { margin-left: auto; position: relative; }
.section-options summary { white-space: nowrap; cursor: pointer; font-size: var(--text-sm); padding: var(--space-xs) var(--space-sm); color: var(--color-ink-2); border-radius: var(--radius-control); }
.section-options summary:hover { background: var(--color-paper-2); }
.section-options-menu { position: absolute; right: 0; top: 100%; min-width: 192px; background: var(--color-paper); border: 1px solid var(--color-rule); box-shadow: 0 1px 2px var(--color-shadow); padding: var(--space-xs); z-index: var(--z-dropdown); display: grid; gap: var(--space-2xs); }
.editable-measures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); }
.edit-measure { background: var(--color-field); border: 1px solid var(--color-edge); border-radius: var(--radius-control); padding: var(--space-xs) var(--space-sm); min-height: 104px; transition: border-color var(--dur-micro) var(--ease-out); }
.edit-measure.selected { border-color: var(--color-accent); outline: 2px solid var(--color-accent-wash); }
.edit-measure.invalid { border-color: var(--color-rust); }
.measure-number { display: block; font-size: var(--text-xs); color: var(--color-muted); }
.chord-inputs { display: flex; gap: var(--space-2xs); padding: var(--space-xs) 0; }
.chord-inputs input { min-width: 0; width: 100%; padding: var(--space-2xs); background: transparent; border: 0; border-radius: var(--radius-small); font-family: var(--font-chord); font-size: var(--text-xl); font-weight: 700; color: var(--color-chord); }
.chord-inputs input::placeholder { font-family: var(--font-body); font-weight: 400; font-size: var(--text-sm); color: var(--color-muted); }
.measure-timing { color: var(--color-muted); font-size: var(--text-xs); }
.add-measure { border-style: dashed; color: var(--color-accent); font-size: var(--text-2xl); min-height: 104px; background: transparent; }
.add-section-bar { display: flex; gap: var(--space-sm); align-items: end; padding: var(--space-2xs) 0 var(--space-lg); }
.measure-inspector { position: sticky; top: var(--space-md); border-left: 1px solid var(--color-rule); padding-left: var(--space-lg); max-height: var(--fit-h, calc(100vh - var(--space-xl))); overflow: auto; overscroll-behavior: contain; }
.measure-inspector h2 { font-size: var(--text-xl); margin: 0 0 var(--space-xs); }
.measure-inspector h3 { font-size: var(--text-md); margin: var(--space-lg) 0 var(--space-xs); }
.beat-total { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; line-height: 1; margin: var(--space-md) 0 0; font-variant-numeric: tabular-nums; }
.timing-presets { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-md); }
.timing-presets button { padding: var(--space-xs); font-size: var(--text-sm); }
.timing-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin: var(--space-sm) 0; }
.timing-row input { width: 88px; }
.quick-chords { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
.quick-chords button { padding: var(--space-xs); font-family: var(--font-chord); font-weight: 700; }
.measure-inspector > button { width: 100%; justify-content: flex-start; margin-top: var(--space-xs); font-size: var(--text-sm); }

/* ---------- import ---------- */
.import-box { max-width: 720px; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-sm); min-height: 240px; border: 2px dashed var(--color-edge); border-radius: var(--radius-card); background: var(--color-field); cursor: pointer; padding: var(--space-lg); text-align: center; font-weight: 400; font-size: var(--text-md); }
.dropzone:hover, .dropzone.over { border-color: var(--color-accent); background: var(--color-accent-wash); }
.dropzone:active { background: var(--color-paper-3); }
.dropzone:focus-within { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.dropzone img { max-width: 100%; max-height: 420px; border-radius: var(--radius-control); box-shadow: 0 4px 16px var(--color-shadow); }
.drop-text { display: flex; flex-direction: column; gap: var(--space-2xs); }
.dropzone.has-image .drop-text { display: none; }
.import-box .actions { margin: var(--space-md) 0; }
.progress { color: var(--color-accent); font-weight: 600; min-height: 1lh; }

/* ---------- copyright and owner pages ---------- */
.legal-section { max-width: 65ch; }
.legal-section h2 { margin: var(--space-xl) 0 var(--space-xs); }
.legal-section h3 { font-size: var(--text-md); margin: var(--space-md) 0 var(--space-2xs); }
.legal-section p { max-width: 65ch; }
.agent { display: flex; flex-direction: column; gap: var(--space-2xs); font-style: normal; background: var(--color-paper-2); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-control); }
#report { margin-top: var(--space-2xl); }
.report-form { max-width: 65ch; }
.access-result { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--color-paper-2); padding: var(--space-md); font-size: var(--text-sm); }

/* ---------- dialog and notice ---------- */
dialog { border: 1px solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper); color: var(--color-ink); padding: var(--space-xl); width: min(460px, calc(100% - var(--space-xl))); }
dialog::backdrop { background: var(--color-scrim); }
dialog h2 { margin-top: 0; font-size: var(--text-2xl); }
dialog label { margin: var(--space-lg) 0; }
dialog p { color: var(--color-muted); }
#login-error { color: var(--color-danger); min-height: 1lh; }
#notice { position: fixed; bottom: var(--space-lg); left: 50%; transform: translateX(-50%); background: var(--color-ink); color: var(--color-paper); padding: var(--space-sm) var(--space-lg); border-radius: var(--radius-control); max-width: calc(100% - var(--space-xl)); z-index: var(--z-toast); }
#notice:empty { display: none; }
@media (min-width: 761px) { #notice { left: auto; right: var(--space-lg); transform: none; max-width: 420px; } }

/* ---------- song map: the order of sections, one quiet line ---------- */
.song-map { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-xs); margin: var(--space-xs) 0 0; font-size: var(--text-sm); color: var(--color-ink-2); font-variant-numeric: tabular-nums; }
.song-map .arrow { color: var(--color-muted); }
.demo .song-map { margin: var(--space-xs) 0 0; }

/* ---------- listen and lyrics: links out to the recording and the lyrics site ---------- */
.listen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); margin: var(--space-sm) 0 var(--space-xs); max-width: 1120px; }
.listen-h { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700; color: var(--color-ink-2); margin: 0; }
.listen-links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); }
.listen .listen-note { flex-basis: 100%; }
.listen-links .button { text-decoration: none; }
.listen-links .listen-yt { background: var(--color-rust-wash); border-color: var(--color-rust); color: var(--color-rust-ink); }
.listen-links .listen-yt:hover { background: var(--color-rust-wash-2); color: var(--color-rust-ink); }
.listen-links .listen-lyrics { background: var(--color-accent-wash); border-color: var(--color-accent); color: var(--color-accent-3); }
.listen-links .listen-lyrics:hover { background: var(--color-accent-wash-2); color: var(--color-accent-3); }
.listen-links .listen-lyrics .listen-host { color: var(--color-accent-2); }
.listen-host { font-size: var(--text-xs); color: var(--color-muted); font-weight: 400; }
.listen-note { margin: 0; font-size: var(--text-xs); color: var(--color-muted); }

/* ---------- set lists ---------- */
.set-fields { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-sm) var(--space-md); margin: var(--space-md) 0 var(--space-lg); max-width: 760px; }
.set-fields label:first-child { flex: 1 1 260px; }
.set-h { font-size: var(--text-xl); margin: var(--space-xl) 0 var(--space-xs); }
.set-items { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--color-rule); max-width: 960px; }
.set-item { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-xs) var(--space-md); padding: var(--space-sm) var(--space-xs); border-bottom: 1px solid var(--color-rule); }
.set-empty { padding: var(--space-md) var(--space-xs); border-bottom: 1px solid var(--color-rule); }
.set-num { font-family: var(--font-display); font-weight: 700; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.set-song { min-width: 0; }
.set-song strong { display: block; font-family: var(--font-display); font-size: var(--text-lg); overflow-wrap: anywhere; }
.set-song .row-sub, .add-row .row-sub { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); align-items: baseline; color: var(--color-ink-2); font-size: var(--text-sm); }
.set-key { flex-direction: row; align-items: center; gap: var(--space-xs); }
.set-move { display: flex; gap: var(--space-2xs); }
.set-actions { margin-top: var(--space-md); }
.save-state { font-size: var(--text-sm); color: var(--color-muted); }
.add-results { max-width: 960px; }
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) 3rem auto; align-items: center; gap: var(--space-md); padding: var(--space-xs); border-bottom: 1px solid var(--color-rule); }
.add-row strong { display: block; font-family: var(--font-display); overflow-wrap: anywhere; }
.add-key { font-family: var(--font-display); font-weight: 700; color: var(--color-ink-2); margin-left: var(--space-xs); }
.set-delete { margin-top: var(--space-2xl); }
.set-toc { margin: var(--space-md) 0 0; padding-left: var(--space-lg); }
.set-toc li { margin: var(--space-2xs) 0; }
.set-song-page { margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid var(--color-rule); }
.set-song-title { display: flex; gap: var(--space-sm); align-items: baseline; margin: 0 0 var(--space-2xs); font-size: var(--text-2xl); }
.set-song-page .subline { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: baseline; }

/* ---------- stage mode: dark, big chords, one song at a time ---------- */
.stage {
  position: fixed; inset: 0; z-index: var(--z-modal); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; padding: var(--space-md) var(--gutter) 0;
  background: var(--color-stage-bg); color: var(--color-stage-ink);
}
body.staging { overflow: hidden; }
.stage-top { display: flex; justify-content: space-between; align-items: start; gap: var(--space-md); }
.stage-title h2 { margin: 0; font-size: var(--text-2xl); color: var(--color-stage-ink); overflow-wrap: anywhere; }
.stage-count { margin: 0; font-size: var(--text-sm); color: var(--color-stage-muted); display: flex; flex-wrap: wrap; gap: var(--space-md); }
.stage .song-map, .stage .song-map .arrow { color: var(--color-stage-muted); }
.stage-sheet { flex: 1 0 auto; --chart-scale: 1.1; }
.stage .sheet { max-width: none; }
.stage .sheet-meta dt, .stage .section-heading, .stage .bar .c small, .stage .bar .c.soft { color: var(--color-stage-muted); }
.stage .sheet-meta dd, .stage .bar .c { color: var(--color-stage-ink); }
.stage .bar { border-color: var(--color-stage-rule); border-right-color: var(--color-stage-bar); }
.stage .bar:nth-child(4n+1) { border-left-color: var(--color-stage-bar); }
.stage .bar.incomplete { background: transparent; }
.stage button { background: transparent; color: var(--color-stage-ink); border-color: var(--color-stage-rule); }
.stage button:hover { background: var(--color-stage-raise); color: var(--color-stage-ink); }
.stage button:active { background: var(--color-stage-rule); }
.stage button:disabled, .stage button:disabled:hover { background: var(--color-stage-sunk); color: var(--color-stage-dim); border-color: var(--color-stage-sunk); cursor: not-allowed; }
.stage :focus-visible { outline: 2px solid var(--color-stage-focus); outline-offset: 2px; }
.stage-nav { position: sticky; bottom: 0; display: flex; gap: var(--space-sm); padding: var(--space-md) 0; background: var(--color-stage-bg); border-top: 1px solid var(--color-stage-rule); margin-top: var(--space-md); }
.stage-nav button { flex: 1 1 0; min-height: 56px; font-size: var(--text-lg); overflow-wrap: anywhere; }
.stage-close { min-height: 44px; }
@media (min-width: 1024px) { .stage-sheet { --chart-scale: 1.5; } .stage-title h2 { font-size: var(--text-3xl); } }

/* ---------- library table: tablets and computers (phones keep the stacked rows) ---------- */
@media (min-width: 761px) {
  .library-rows { max-width: none; }
  .lib-row, .rows-head { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2.4fr) 3.5rem 3.5rem 5.5rem 7.5rem; align-items: center; gap: var(--space-md); padding: var(--space-sm) var(--space-xs); }
  .rows-head { border-bottom: 1px solid var(--color-rule); padding-block: var(--space-xs); font-size: var(--text-sm); color: var(--color-muted); }
  .lib-row .row-main { display: contents; }
  .lib-row strong { margin: 0; font-size: var(--text-lg); min-width: 0; overflow-wrap: anywhere; }
  .lib-row .row-sub { align-items: baseline; gap: 0 var(--space-sm); font-size: var(--text-sm); min-width: 0; }
  .lib-row .row-sub > span:first-child { color: var(--color-ink-2); font-size: var(--text-md); }
  .lib-row .row-meta { display: block; }
  .lib-row, .rows-head { justify-content: stretch; }
  .lib-row .row-meta .key { display: block; text-align: left; font-size: var(--text-lg); }
  .lib-row .row-cell { display: block; font-variant-numeric: tabular-nums; color: var(--color-ink-2); white-space: nowrap; }
  .lib-row .row-updated { color: var(--color-muted); font-size: var(--text-sm); }
}
@media (min-width: 761px) and (max-width: 1023px) {
  .lib-row, .rows-head { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) 3.5rem 3.5rem 7.5rem; }
  .lib-row .row-tempo, .rows-head span:nth-child(5) { display: none; }
  main { padding-top: var(--space-lg); }
  .hero { padding: 0 0 var(--space-lg); gap: var(--space-lg); }
  .hero-copy { padding-top: 0; }
  .library { padding-top: var(--space-lg); }
  .search { margin: var(--space-md) 0; }
}

/* ---------- computers: desktop density ---------- */
@media (min-width: 1024px) {
  header { min-height: 60px; padding: var(--space-xs) 0; }
  main { padding: var(--space-lg) var(--gutter) var(--space-xl); min-height: 70vh; }
  main.editing { padding-top: var(--space-md); }
  h1 { font-size: var(--text-2xl); margin-bottom: var(--space-xs); }
  .intro { font-size: var(--text-md); margin-bottom: var(--space-md); }
  footer { padding: var(--space-sm) 0; font-size: var(--text-xs); }
  #copyright { font-size: var(--text-xs); }

  /* home: a compact hero band, the sample card beside it, the library on the first screen */
  .hero { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: var(--space-xl); align-items: center; padding: 0 0 var(--space-lg); }
  .hero-copy { padding-top: 0; }
  .hero h1 { font-size: clamp(2.5rem, 1.25rem + 1.9vw, 3.125rem); line-height: 1.04; max-width: none; margin-bottom: var(--space-md); }
  .lead { font-size: var(--text-lg); line-height: 1.5; max-width: 34ch; margin-bottom: var(--space-lg); }
  .demo { padding: var(--space-md) var(--space-lg) var(--space-sm); }
  .demo-title { font-size: var(--text-xl); }
  .demo .chart-tools { margin-top: var(--space-sm); }
  .demo .sheet-wrap { --chart-scale: 0.72; }
  .demo .bar.split .c { font-size: 18px; }
  .focus .demo .bar.split .c { font-size: calc(22px * var(--chart-scale)); }
  .demo .sheet { margin-top: var(--space-2xs); }
  .demo .music-section { padding-bottom: var(--space-2xs); }
  .demo .section-heading { margin: var(--space-xs) 0 var(--space-2xs); font-size: var(--text-sm); }
  .focus .demo .sheet-wrap { --chart-scale: 1.1; }
  .focus .demo .section-heading { margin: var(--space-md) 0 var(--space-xs); font-size: var(--text-md); }
  .library { padding-top: var(--space-lg); }
  .library-head h2 { font-size: var(--text-2xl); }
  .search { max-width: 720px; margin: var(--space-sm) 0 var(--space-md); }
  .search input { font-size: var(--text-md); }

  /* lists */
  .song-row { padding: var(--space-sm) var(--space-xs); }
  .song-row strong { font-size: var(--text-lg); margin-bottom: 0; }
  .row-meta .key { font-size: var(--text-lg); }
  .lib-row { padding-block: var(--space-xs); }

  /* chart view: one width for title, tools and sheet; less air around the chords */
  .title-row, .reader-tools, .sheet { max-width: 1120px; }
  .subline { font-size: var(--text-md); }
  .subline .arrangement { display: inline; margin-left: var(--space-sm); color: var(--color-muted); }
  .toolbar { padding: var(--space-xs) 0; margin: var(--space-sm) 0 0; }
  .links { margin-top: var(--space-2xs); }
  .sheet { margin-top: var(--space-sm); }
  .section-heading { margin: var(--space-sm) 0 var(--space-2xs); }
  .music-section { padding-bottom: var(--space-xs); }
  .bar { min-height: calc(56px * var(--chart-scale)); }
  .owner-actions { margin-top: var(--space-md); padding-top: var(--space-sm); }
  .report-link { margin-top: var(--space-md); }

  /* create: editor and live preview side by side, each scrolling on its own */
  .create .editor-top { padding-bottom: 0; }
  .song-title-input { font-size: var(--text-xl); min-height: 40px; padding: var(--space-2xs) 0; }
  .basics { padding: var(--space-xs) 0 var(--space-sm); gap: var(--space-xs) var(--space-md); }
  .basics label { gap: var(--space-2xs); }
  .create-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-xl); padding-top: var(--space-md); }
  .mode-switch { margin-bottom: var(--space-sm); }
  .quick-text { min-height: 260px; font-size: var(--text-md); }
  .preview .bar { min-height: calc(46px * var(--chart-scale)); }
  .preview .bar .c { font-size: calc(22px * var(--chart-scale)); }
  .preview .section-heading { margin: var(--space-sm) 0 var(--space-2xs); }
  .song-details { margin-top: var(--space-md); }
  .composer-layout { margin-top: var(--space-sm); gap: var(--space-lg); }
  .edit-measure, .add-measure { min-height: 88px; }

  /* prose pages keep their measure */
  .legal-section h2 { margin-top: var(--space-lg); }
  #report { margin-top: var(--space-xl); }
  .dropzone { min-height: 200px; }
}
/* computers: compact controls (touch screens get 44px back just below) */
@media (min-width: 1024px) {
  button, .button, input, select { min-height: 34px; padding: var(--space-2xs) var(--space-sm); }
  .text-link, button.text-link { min-height: 34px; }
  button.icon { min-width: 34px; padding-inline: var(--space-xs); }
  button.with-icon { padding-inline: var(--space-xs) var(--space-sm); }
  .segmented button.seg { min-height: 32px; padding: var(--space-2xs) var(--space-sm); }
  .mode-switch button { min-height: 30px; padding: var(--space-2xs) var(--space-sm); }
  .song-row { min-height: 0; }
  .pad-row button { min-height: 32px; padding: var(--space-2xs) var(--space-xs); }
  .pad-row.chords button { min-width: 40px; }
  .pad-row button.mod { min-width: 34px; }
  .check input { min-height: 0; padding: 0; }
  .song-title-input { min-height: 40px; }
  .search input, .search select, .search button { min-height: 38px; }
}
/* touch screens from tablets up: 44px targets */
@media (min-width: 761px) and (pointer: coarse) {
  button, .button, input, select, .text-link, button.text-link { min-height: 44px; }
  .segmented button.seg { min-height: 42px; }
  button.icon { min-width: 44px; }
}
@media (min-width: 1024px) and (max-height: 820px) {
  .demo .sheet-wrap { --chart-scale: 0.68; }
}

/* ---------- wide screens ---------- */
@media (min-width: 1500px) {
  .editable-measures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* big monitors: the page grows wider and everything scales up in steps, so it fills the screen
   instead of sitting in a narrow column. --zoom is read by fitPanels() in app.mjs. */
html { zoom: var(--zoom, 1); }
@media (min-width: 1600px) { :root { --zoom: 1.1; --container: 1560px; } }
@media (min-width: 1800px) { :root { --zoom: 1.2; } }
@media (min-width: 2100px) { :root { --zoom: 1.3; } }
@media (min-width: 2500px) { :root { --zoom: 1.45; } }

/* ---------- tablets ---------- */
@media (max-width: 1023px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); padding-bottom: var(--space-xl); }
  .hero h1 { max-width: 14ch; }
  .create-layout { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; border-left: 0; border-top: 1px solid var(--color-rule); padding: var(--space-md) 0 0; max-height: none; }
  .basics { grid-template-columns: 1fr 1fr 1fr; }
  .basics label:nth-child(1), .basics label:nth-child(2) { grid-column: span 3; }
  .composer-layout, .block-editor .composer-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: var(--space-lg); }
  .measure-inspector { padding-left: var(--space-md); }
}

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .sheet.solfege .bar { padding-inline: var(--space-xs); }
  .sheet.solfege .bar .c { font-size: calc(18px * var(--chart-scale)); }
  .sheet.solfege .bar.split .c { font-size: calc(15px * var(--chart-scale)); }
  .listen-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); width: 100%; gap: var(--space-xs); }
  .listen-links .button, .listen-links button { justify-content: center; padding-inline: var(--space-xs); font-size: var(--text-sm); gap: var(--space-2xs); white-space: nowrap; }
  .listen-links .listen-host { display: none; }
  .set-item { grid-template-columns: 1.5rem minmax(0, 1fr); }
  .set-key, .set-move { grid-column: 2; }
  .add-row { grid-template-columns: minmax(0, 1fr) auto; }
  .add-row .add-key { display: none; }
  .stage-sheet { --chart-scale: 0.95; }
  :root { --gutter: 16px; }
  header { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand lang" "nav account"; gap: var(--space-xs) var(--space-sm); padding: var(--space-sm) 0; min-height: 0; }
  .brand { grid-area: brand; font-size: var(--text-xl); gap: var(--space-xs); }
  .mark { width: 34px; }
  #language { grid-area: lang; margin-left: 0; }
  header nav { grid-area: nav; margin-left: 0; overflow-x: auto; min-width: 0; }
  #account { grid-area: account; padding: var(--space-xs) var(--space-sm); font-size: var(--text-sm); }
  nav a { padding: var(--space-xs) var(--space-sm); }
  input, select, textarea { font-size: var(--text-md); }
  main, main.editing { padding: var(--space-lg) var(--gutter) var(--space-xl); }
  h1 { font-size: var(--text-2xl); }
  .hero { padding-top: 0; }
  .hero h1 { font-size: 2.5rem; }
  .lead { font-size: var(--text-lg); margin-bottom: var(--space-lg); }
  .demo { padding: var(--space-md) var(--space-sm) var(--space-sm); margin-inline: calc(-1 * var(--space-xs)); }
  .demo .sheet-wrap { --chart-scale: 1; }
  .view-buttons button { padding-inline: var(--space-xs) var(--space-sm); font-size: var(--text-sm); }
  .library-head h2 { font-size: var(--text-2xl); }
  .search { grid-template-columns: minmax(0, 1fr) auto; }
  .search input { grid-column: 1 / -1; }
  .search select { min-width: 0; }
  .song-row { align-items: start; gap: var(--space-sm); }
  .row-meta { gap: var(--space-xs); flex-direction: column; align-items: end; }
  .toolbar { gap: var(--space-sm); margin-top: var(--space-sm); }
  .tool-group.end { margin-left: 0; }
  .bar { padding: var(--space-2xs) var(--space-2xs) var(--space-2xs) var(--space-xs); min-height: calc(52px * var(--chart-scale)); }
  .bar .c { font-size: calc(20px * var(--chart-scale)); }
  .bar.split .c { font-size: calc(16px * var(--chart-scale)); }
  .bar.split .c + .c { padding-left: var(--space-2xs); }
  .create .editor-top .editor-save { display: none; }
  .basics { grid-template-columns: 1fr 1fr 1fr; gap: var(--space-sm); }
  .quick-text { min-height: 200px; font-size: var(--text-lg); padding: var(--space-sm); }
  .song-details .fields, .fields { grid-template-columns: minmax(0, 1fr); }
  .mobile-save { display: flex; margin: var(--space-md) 0 var(--space-2xs); }
  .mobile-save button { flex: 1; min-height: 48px; }
  .composer-layout, .block-editor .composer-layout { grid-template-columns: minmax(0, 1fr); }
  .measure-inspector { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--color-rule); padding: var(--space-md) 0; }
  .editable-measures, .block-editor .editable-measures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-bar { flex-wrap: wrap; }
  .section-options { margin-left: 0; }
  .section-bar select { width: 132px; }
  .section-bar input { width: 72px; }
  .dropzone { min-height: 200px; }
  footer { flex-direction: column; align-items: start; }
  header:has(nav a + a) { grid-template-areas: "brand brand" "lang account" "nav nav"; }
  header:has(nav a + a) #language { justify-self: start; }
  header:has(nav a + a) nav { overflow-x: visible; flex-wrap: wrap; }
  .hero-copy { padding-top: 0; }
}
@media (max-width: 400px) {
  .brand small { display: none; }
  .demo .chart-tools { gap: var(--space-xs) var(--space-sm); }
  .segmented button.seg { padding-inline: var(--space-sm); }
  #language { padding-inline: var(--space-xs); }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- print ---------- */
/* ---------- 2026-12-04 redesign from Ivan's mockup ---------- */
/* header: salmon logo tile, beta pill, divider before the tabs, salmon bar under the active tab */
header { border-bottom-color: var(--color-rule); }
.mark { width: 46px; height: 46px; padding: var(--space-xs); background: var(--color-salmon); color: var(--color-ink); border-radius: 12px; }
.brand:hover .mark { color: var(--color-ink); background: var(--color-salmon-2); }
.brand small { background: var(--color-salmon-wash); color: var(--color-ink-2); padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-control); margin-left: var(--space-xs); }
header nav { border-left: 1px solid var(--color-rule); padding-left: var(--space-md); }
nav a.active { text-decoration: none; box-shadow: inset 0 -3px 0 var(--color-salmon); }
nav a.active:hover { text-decoration: none; }
#account { border-color: var(--color-ink-2); color: var(--color-ink); }
#account:hover { background: var(--color-paper-2); color: var(--color-ink); }
/* small pills */
.pill { display: inline-block; font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600; line-height: 1.3; color: var(--color-ink-2); background: var(--color-salmon-wash); padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-control); }
/* Chords | Do Re Mi | Numbers: the chosen side is salmon */
.segmented button.seg[aria-pressed=true] { background: var(--color-salmon); color: var(--color-ink); font-weight: 600; }
.segmented button.seg[aria-pressed=true]:focus-visible { outline-color: var(--color-ink); }
/* Chords | Do Re Mi | Numbers as three separate buttons, like A− and A+ */
.segmented { gap: var(--space-xs); border: 0; border-radius: 0; overflow: visible; }
.segmented button.seg, .segmented button.seg + button.seg { border: 1px solid var(--color-edge); border-radius: var(--radius-control); }
.segmented button.seg[aria-pressed=true] { border-color: var(--color-salmon-2); }
.segmented button.seg:focus-visible { outline-offset: 2px; }
.segmented button.seg { white-space: nowrap; }

/* chart page header: title and artist on the left; Print, Focus view, YouTube and lyrics on the right */
.title-row { max-width: none; align-items: start; }
.title-block { min-width: 0; flex: 1 1 320px; }
.title-row .song-title { margin: 0 0 var(--space-2xs); }
.title-block .subline { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-sm); margin: 0; }
.title-block .subline .arrangement { margin: 0; }
.title-actions { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-sm); }
.back::before { content: "← "; }
/* Watch on YouTube (near-black, red mark) and Read lyrics (outlined); both open another site */
.listen-links { display: flex; flex-wrap: wrap; gap: var(--space-sm); justify-content: flex-end; }
.listen-links .button, .listen-links button { gap: var(--space-xs); padding-inline: var(--space-sm) var(--space-md); }
.listen-links .listen-yt { background: var(--color-yt); border-color: var(--color-yt); color: var(--color-accent-ink); }
.listen-links .listen-yt:hover { background: var(--color-yt-2); border-color: var(--color-yt-2); color: var(--color-accent-ink); }
.listen-links .listen-yt:active { background: var(--color-ink-2); }
.listen-links .listen-lyrics { background: transparent; border-color: var(--color-edge); color: var(--color-ink); }
.listen-links .listen-lyrics:hover { background: var(--color-paper-2); color: var(--color-ink); }
.yt-mark { flex: none; }
/* key, tempo, time under the title */
.meta-row { display: flex; flex-wrap: wrap; align-items: baseline; margin: var(--space-md) 0 0; }
.meta-row div { display: flex; align-items: baseline; gap: var(--space-sm); padding: 0 var(--space-lg); border-left: 1px solid var(--color-rule); }
.meta-row div:first-child { padding-left: 0; border-left: 0; }
.meta-row dt { font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); }
.meta-row dd { margin: 0; font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; color: var(--color-ink); }
/* key/tempo/time on the left, YouTube and lyrics on the right of the same line */
.meta-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-lg); margin: var(--space-md) 0 0; }
.meta-line .meta-row { margin: 0; }
.listen-links .short, .style-pick { display: none; }
/* the controls in one rounded bar, groups split by thin lines */
.toolbar.reader-tools { max-width: none; border: 1px solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-field); padding: var(--space-xs) var(--space-md); margin: var(--space-md) 0 0; }
.reader-tools .chart-tools > * + * { border-left: 1px solid var(--color-rule); padding-left: var(--space-md); }

/* song flow: coloured badges in song order */
.song-flow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); margin: var(--space-md) 0 0; }
.flow-label { font-size: var(--text-sm); font-weight: 700; color: var(--color-ink); padding-right: var(--space-md); border-right: 1px solid var(--color-rule); }
.flow-items { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); list-style: none; margin: 0; padding: 0; }
.flow-item { display: flex; align-items: center; gap: var(--space-xs); }
.flow-chip { display: inline-flex; align-items: center; gap: var(--space-xs); padding: var(--space-3xs) var(--space-sm) var(--space-3xs) var(--space-3xs); border-radius: 999px; background: var(--sec-wash, var(--color-paper-2)); }
.flow-arrow { color: var(--color-ink-2); margin-right: var(--space-xs); }
.flow-name { font-weight: 600; color: var(--color-ink); white-space: nowrap; }
.flow-repeat { font-weight: 400; color: var(--color-ink-2); }
.sec-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 2em; height: 2em; padding: 0 0.3em; border: 2px solid var(--sec, var(--color-edge)); border-radius: 999px; background: var(--color-field); font-family: var(--font-display); font-size: var(--text-sm); font-weight: 700; color: var(--color-ink); letter-spacing: 0; }
.sec-intro { --sec: var(--sec-intro); --sec-wash: var(--sec-intro-wash); }
.sec-verse { --sec: var(--sec-verse); --sec-wash: var(--sec-verse-wash); }
.sec-pre-chorus { --sec: var(--sec-pre); --sec-wash: var(--sec-pre-wash); }
.sec-chorus { --sec: var(--sec-chorus); --sec-wash: var(--sec-chorus-wash); }
.sec-bridge { --sec: var(--sec-bridge); --sec-wash: var(--sec-bridge-wash); }
.sec-interlude, .sec-instrumental { --sec: var(--sec-inter); --sec-wash: var(--sec-inter-wash); }
.sec-outro { --sec: var(--sec-outro); --sec-wash: var(--sec-outro-wash); }

/* the chart: a white card; each section has a coloured stripe and a label pill; each bar starts with a | line */
.sheet { max-width: none; background: transparent; border: 0; padding: 0; }
/* each part of the song is its own bubble: white, rounded, a coloured edge in the part's colour */
.sheet .music-section { background: var(--color-field); border: 1px solid var(--color-rule); border-left: 5px solid var(--sec, var(--color-edge)); border-radius: var(--radius-card); padding: var(--space-xs) var(--space-md) var(--space-sm); margin: 0 0 var(--space-md); }
.sheet .section-heading { display: inline-flex; align-items: center; gap: var(--space-xs); margin: var(--space-xs) 0 var(--space-xs); padding: 0 var(--space-sm) 0 0; border-radius: 999px; background: var(--sec-wash, var(--color-paper-2)); font-size: var(--text-md); color: var(--color-ink); }
.sheet .section-heading .sec-badge { font-size: var(--text-xs); letter-spacing: 0; }
.sheet .repeat { color: var(--color-ink-2); letter-spacing: 0; text-transform: none; }
.sheet .bar { position: relative; border: 0; border-bottom: 1px solid var(--color-rule); padding-left: var(--space-md); }
.sheet .bar:nth-child(4n+1) { border-left: 0; }
.sheet .bar::before { content: ""; position: absolute; left: 0; top: 24%; bottom: 24%; width: 3px; border-radius: 1px; background: var(--color-bar); }
.sheet .bars .bar:nth-last-child(-n+4):nth-child(4n+1), .sheet .bars .bar:nth-last-child(-n+4):nth-child(4n+1) ~ .bar { border-bottom: 0; }
.sheet .bar.split .c + .c { border-left: 0; padding-left: 0; }
.sheet .bar.incomplete { background: var(--color-rust-wash); }
/* the home sample card keeps its beige; the chart inside is the same white card */
.demo .sheet { padding: 0; }
.demo .bar { background: transparent; }
.demo .segmented button.seg[aria-pressed=true] { background: var(--color-salmon); color: var(--color-ink); }

/* stage mode: the chart card and pills go dark */
.stage .sheet { background: transparent; border: 0; padding: 0; }
.stage .sheet .section-heading { background: transparent; color: var(--color-stage-muted); }
.stage .sheet .music-section { background: transparent; border-color: var(--color-stage-rule); border-left-color: var(--sec, var(--color-stage-rule)); }
.stage .sec-badge { background: var(--color-stage-bg); color: var(--color-stage-ink); }
.stage .sheet .bar { border-bottom-color: var(--color-stage-rule); }
.stage .sheet .bar::before { background: var(--color-stage-bar); }
.stage .flow-label { color: var(--color-stage-muted); border-right-color: var(--color-stage-rule); }
.stage .flow-name { color: var(--color-stage-ink); }
.stage .flow-repeat, .stage .flow-arrow { color: var(--color-stage-muted); }

/* phones: their own layout. Buttons in rows under the title, controls without the outer bar, smaller badges */
@media (max-width: 760px) {
  .title-actions { align-items: stretch; width: 100%; }
  .title-actions .view-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .listen-links { display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch; }
  .listen-links .button, .listen-links button { justify-content: center; padding-inline: var(--space-xs); font-size: var(--text-sm); white-space: nowrap; }
  .listen-links .ico:last-child { display: none; }
  .meta-row div { padding: 0 var(--space-md); }
  .meta-row dd { font-size: var(--text-lg); }
  .toolbar.reader-tools { border: 0; border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); border-radius: 0; background: transparent; padding: var(--space-sm) 0; }
  .reader-tools .chart-tools > * + * { border-left: 0; padding-left: 0; }
  .toolbar.reader-tools { position: relative; }
  .reader-tools > .tool-group.end { position: absolute; right: 0; bottom: var(--space-sm); }
  header nav { border-left: 0; padding-left: 0; }
  /* phones: less on top so the chords start higher */
  .title-row { flex-wrap: nowrap; gap: var(--space-sm); }
  .title-actions { width: auto; }
  .title-actions .view-buttons { display: flex; }
  .title-actions .view-buttons > button:not(.expand-btn) { display: none; }
  .title-actions .expand-btn { padding: var(--space-xs); min-width: 44px; justify-content: center; }
  .title-actions .expand-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .meta-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-sm); }
  .meta-line .listen-links { display: flex; margin-top: 0; gap: var(--space-xs); }
  .listen-links .long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .listen-links .short { display: inline; }
  .meta-line .listen-links .button, .meta-line .listen-links button { min-height: 40px; padding-inline: var(--space-sm); }
  /* phones: Key, Capo and Style as three drop-down buttons in one row; the bigger controls stay on computers */
  .toolbar.reader-tools { border: 0; padding: var(--space-xs) 0 0; }
  .reader-tools .chart-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); width: 100%; max-width: none; }
  .reader-tools .chart-tools > .segmented, .reader-tools .chart-tools > .tool-group:last-child:not(.style-pick), .reader-tools > .tool-group.end, .reader-tools .chart-tools .icon { display: none; }
  .reader-tools .chart-tools > .tool-group { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3xs); min-width: 0; }
  .reader-tools .chart-tools .tool-label { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--color-ink-2); }
  .reader-tools .chart-tools select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; width: 100%; min-width: 0; min-height: 48px; border: 1px solid var(--color-salmon-2); border-radius: var(--radius-card); background-color: var(--color-salmon-wash); color: var(--color-ink); font-size: var(--text-md); padding-inline: var(--space-sm) var(--space-lg); }
  /* phones: the bubbles already name each part, so the song-flow row is left out */
  main > .song-flow, .set-song-page .song-flow { display: none; }
  .meta-row { row-gap: var(--space-xs); }
  .meta-line { display: block; }
  .meta-line .listen-links { margin-top: var(--space-sm); }
  .meta-row div { padding: 0 var(--space-sm); }
  .flow-label { flex-basis: 100%; border-right: 0; padding-right: 0; font-size: var(--text-xs); }
  .flow-items { gap: var(--space-xs); }
  .sec-badge { font-size: var(--text-xs); }
  .sheet .music-section { padding: var(--space-2xs) var(--space-xs) var(--space-xs); border-left-width: 4px; margin-bottom: var(--space-sm); }
  .sheet .section-heading { font-size: var(--text-sm); }
  .sheet .bar { padding-left: var(--space-sm); }
}

/* very small phones: chords a bit smaller so names like F#m7 stay on one line */
@media (max-width: 380px) {
  .sheet .bar { padding-left: var(--space-xs); }
  .bar .c { font-size: calc(17px * var(--chart-scale)); }
  .sheet.solfege .bar .c { font-size: calc(15px * var(--chart-scale)); }
  .bar.split .c { font-size: calc(14px * var(--chart-scale)); flex: 1 1 auto; overflow: visible; }
  .bar.split .c + .c { flex: 0 1 auto; padding-left: var(--space-2xs); }
  .sheet .bar:not(.split) .c { overflow: hidden; }
  header nav a { font-size: var(--text-sm); }
  .segmented { gap: var(--space-2xs); }
  .reader-tools .chart-tools select { font-size: var(--text-sm); padding-inline: var(--space-xs) var(--space-md); background-position: right var(--space-2xs) center; background-size: 10px 7px; }
  .segmented button.seg { padding-inline: var(--space-xs); }
}
@media print {
  header, footer, .toolbar, .nonfocus, #notice, .view-buttons, .chart-tools, .review-box, .reader-tools, .links, .owner-actions, .report-link, .back, .status-line, .banner,
  .measure-inspector, .composer-guide, .editor-top, .song-details { display: none !important; }
  body { background: var(--color-print-paper); color: var(--color-print-ink); }
  main { padding: 0; max-width: none; margin: 0; }
  h1 { font-size: 24pt; }
  .sheet { max-width: none; }
  .hero { display: block; padding: 0; }
  .demo { border: 0; padding: 0; background: none; }
  .demo .sheet-meta { display: flex; }
  .music-section { break-inside: avoid; page-break-inside: avoid; }
  .section-heading { break-after: avoid; color: var(--color-print-ink); }
  .bar { min-height: 44px; border-color: var(--color-print-rule); }
  .bar:nth-child(4n+1) { border-left-color: var(--color-print-rule); }
  .bar .c { color: var(--color-print-ink); font-size: 18pt; }
  .composer-layout { display: block; }
  .sheet .music-section { background: none; break-inside: avoid; }
  .song-flow, .meta-row { display: flex !important; }
  .stage, .set-toc { display: none !important; }
  .set-song-page { border: 0; margin: 0; padding: 0; }
  .set-song-page + .set-song-page { break-before: page; page-break-before: always; }
}
