:root {
  color-scheme: light;
  --ink: #0b1d33;
  --muted: #50657d;
  --line: #b4c5d8;
  --line-strong: #7f98b2;
  --surface: #f7fbff;
  --surface-raised: #ffffff;
  --surface-muted: #dbe8f5;
  --background: #dce8f5;
  --nav-surface: #0a2746;
  --nav-ink: #f5f9ff;
  --nav-muted: #b9cce0;
  --footer-surface: #0b2745;
  --footer-bar: #102f52;
  --footer-ink: #f4f9ff;
  --footer-muted: #b7cadd;
  --paper: #ffffff;
  --paper-line: rgba(22, 102, 157, .1);
  --paper-ink: #0b1d33;
  --blue: #176fb0;
  --blue-dark: #0d4777;
  --cyan: #1a9fc3;
  --cyan-bright: #36c1df;
  --green: var(--blue);
  --green-dark: var(--blue-dark);
  --rust: #d94f57;
  --amber: #d99a20;
  --danger: #b52f3f;
  --focus: rgba(26, 159, 195, .34);
  --shadow: rgba(8, 31, 55, .16);
  --grid-line: rgba(18, 76, 122, .07);
  --ambient: rgba(24, 130, 184, .13);
  --chord-card-width: 158px;
  --chord-card-height: 146px;
  --chord-fret-width: 96px;
  --chord-piano-width: 128px;
  --chord-diagram-height: 84px;
  --chord-symbol-size: 16px;
  --sheet-font-size: 12pt;
  --sheet-line-height: 14pt;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--background);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf6ff;
  --muted: #a4b8cd;
  --line: #304b67;
  --line-strong: #51708d;
  --surface: #0d243b;
  --surface-raised: #12304c;
  --surface-muted: #183a59;
  --background: #061522;
  --nav-surface: #04111e;
  --nav-ink: #f3f8ff;
  --nav-muted: #a9bfd5;
  --footer-surface: #061522;
  --footer-bar: #0b2238;
  --footer-ink: #f2f8ff;
  --footer-muted: #9db5ca;
  --paper: #0b2035;
  --paper-line: rgba(54, 193, 223, .09);
  --paper-ink: #ecf6ff;
  --blue: #2d9ddd;
  --blue-dark: #74c7ef;
  --cyan: #36c1df;
  --cyan-bright: #72dbef;
  --rust: #ff7378;
  --amber: #f2bd52;
  --danger: #ff727d;
  --focus: rgba(54, 193, 223, .42);
  --shadow: rgba(0, 0, 0, .38);
  --grid-line: rgba(71, 157, 207, .09);
  --ambient: rgba(18, 106, 160, .2);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; color: var(--ink); background-color: var(--background); background-image: linear-gradient(135deg, var(--ambient), transparent 38%), linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 100% 100%, 32px 32px, 32px 32px; }
button, input, select { font: inherit; }
button, summary, select, input[type="checkbox"], input[type="range"], input[type="color"] { cursor: pointer; }
a { color: var(--green-dark); }
h1, h2 { font-family: "Fraunces", serif; margin: 0; }
h1 { font-size: 38px; line-height: 1.05; }
h2 { font-size: 20px; }
p { line-height: 1.55; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.site-header { min-height: 64px; padding: 0 28px; border-bottom: 1px solid #244b70; display: flex; align-items: center; gap: 34px; color: var(--nav-ink); background: var(--nav-surface); position: sticky; top: 0; z-index: 20; box-shadow: 0 5px 18px var(--shadow); }
.site-header nav { display: flex; align-items: stretch; align-self: stretch; gap: 6px; }
.site-header nav a { display: flex; align-items: center; padding: 0 14px; color: var(--nav-muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.site-header nav a:hover { color: var(--nav-ink); background: rgba(255, 255, 255, .05); }
.site-header nav a[aria-current="page"] { color: var(--nav-ink); border-color: var(--cyan-bright); }
.site-header > form { margin-left: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: "Fraunces", serif; font-weight: 700; font-size: 24px; color: var(--nav-ink); text-decoration: none; }
.brand-mark { width: 30px; height: 32px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--nav-ink); border-bottom: 2px solid var(--nav-ink); }
.brand-mark i { border-left: 1px solid var(--nav-ink); position: relative; }
.brand-mark i:last-child { border-right: 1px solid var(--nav-ink); }
.brand-mark i:nth-child(2)::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--rust); left: -3px; top: 9px; }

.theme-switch { position: relative; margin-left: auto; display: inline-flex; flex: 0 0 auto; }
.theme-switch input { position: absolute; opacity: 0; pointer-events: none; }
.theme-switch-track { width: 112px; height: 34px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; position: relative; border: 1px solid #4e6f8f; border-radius: 999px; color: var(--nav-muted); background: #061a2e; font-size: 10px; font-weight: 800; text-align: center; }
.theme-switch-track span { position: relative; z-index: 1; transition: color 160ms ease; }
.theme-switch-track i { position: absolute; z-index: 0; top: 3px; left: 3px; width: 51px; height: 26px; border-radius: 999px; background: var(--cyan); box-shadow: 0 2px 8px rgba(0, 0, 0, .28); transition: transform 180ms ease; }
.theme-switch input:not(:checked) + .theme-switch-track span:first-child,
.theme-switch input:checked + .theme-switch-track span:nth-child(2) { color: #061522; }
.theme-switch input:checked + .theme-switch-track i { transform: translateX(54px); }
.theme-switch input:focus-visible + .theme-switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }

.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid transparent; border-radius: 5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.button-primary { background: var(--blue); color: #ffffff; border-color: var(--blue); box-shadow: 0 3px 10px rgba(8, 63, 105, .18); }
.button-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button-secondary { background: var(--surface-raised); color: var(--ink); border-color: var(--line-strong); }
.button-secondary:hover { border-color: var(--cyan); color: var(--blue-dark); }
.button-quiet { color: var(--muted); background: transparent; border-color: transparent; }
.button-quiet:hover { background: var(--surface-muted); color: var(--ink); }
.site-header .button-quiet { color: var(--nav-muted); }
.site-header .button-quiet:hover { color: var(--nav-ink); background: rgba(255, 255, 255, .08); }

.flash-stack { width: min(1180px, calc(100% - 32px)); margin: 14px auto -2px; position: relative; z-index: 10; }
.flash { margin: 0 0 8px; padding: 11px 14px; background: var(--surface-raised); border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 4px; box-shadow: 0 4px 14px var(--shadow); }
.flash-error { border-left-color: var(--danger); }
.flash-success { border-left-color: var(--green); }
.eyebrow { display: block; margin-bottom: 6px; color: var(--rust); font-size: 12px; line-height: 1.2; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }

.workspace { width: min(1180px, calc(100% - 32px)); margin: 30px auto 70px; }
.workspace-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.workspace-heading > div > p { margin: 8px 0 0; color: var(--muted); }
.import-panel { width: min(720px, 64%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: 0 8px 24px var(--shadow); }
.import-panel > summary { padding: 13px 16px; font-weight: 800; color: var(--green-dark); }
.import-form { border-top: 1px solid var(--line); padding: 16px; display: grid; grid-template-columns: minmax(260px, 1fr) 190px auto; gap: 12px; align-items: end; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .compact-field > span, .control-label, .label-picker legend { color: var(--muted); font-size: 12px; font-weight: 700; }
.field input, .field select, .compact-field select { width: 100%; min-height: 39px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: var(--surface-raised); }
.field input:focus, .field select:focus, .compact-field select:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.label-picker { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.label-picker legend { margin-bottom: 7px; }
.label-picker label { position: relative; }
.label-picker input { position: absolute; opacity: 0; pointer-events: none; }
.label-picker span, .tag { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-muted); color: var(--ink); font-size: 12px; font-weight: 700; }
.label-picker input:checked + span { color: #ffffff; background: var(--blue); border-color: var(--blue); }
.label-picker input:focus-visible + span { outline: 3px solid var(--focus); }

.filter-bar { display: grid; grid-template-columns: minmax(200px, 1fr) 180px 180px auto auto auto; gap: 10px; align-items: end; padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); background: var(--surface); }
.toggle-field, .toggle-control { min-height: 39px; display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; font-weight: 700; }
.toggle-field input, .toggle-control input { width: 17px; height: 17px; accent-color: var(--green); }
.song-list { border: 1px solid var(--line-strong); background: var(--surface-raised); box-shadow: 0 8px 22px var(--shadow); }
.song-row { min-height: 86px; padding: 12px 14px; display: grid; grid-template-columns: minmax(260px, 1.4fr) minmax(200px, 1fr) minmax(230px, auto) 42px; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.song-row:last-child { border-bottom: 0; }
.song-row:hover { background: var(--surface-muted); }
.song-main { min-width: 0; display: flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; }
.song-main > span:last-child { min-width: 0; }
.song-main strong, .song-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-main strong { font-family: "Fraunces", serif; font-size: 18px; }
.song-main small { margin-top: 3px; color: var(--muted); }
.song-key { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid var(--cyan); border-radius: 50%; font-family: "IBM Plex Mono", monospace; color: var(--blue-dark); background: var(--surface-muted); }
.song-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.category-tag { border-left: 4px solid var(--tag-color, var(--green)); }
.song-facts { display: flex; justify-content: flex-end; gap: 13px; color: var(--muted); font-size: 12px; }
.highlight-button { width: 38px; height: 38px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; }
.highlight-button:hover, .highlight-button.is-active { color: var(--amber); background: color-mix(in srgb, var(--amber) 16%, var(--surface-raised)); border-color: var(--amber); }
.highlight-button.is-active { font-variation-settings: "FILL" 1; }
.empty-state { padding: 70px 20px; border: 1px dashed var(--line-strong); text-align: center; background: var(--surface); }
.empty-state p { color: var(--muted); }
.taxonomy-panel { margin-top: 20px; border-top: 1px solid var(--line-strong); padding-top: 12px; }
.taxonomy-panel > summary { font-weight: 700; color: var(--green-dark); }
.taxonomy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
.taxonomy-grid form { display: grid; grid-template-columns: 1fr 130px auto; align-items: end; gap: 10px; padding: 16px; background: var(--surface-raised); border: 1px solid var(--line); }
.taxonomy-grid h2 { grid-column: 1 / -1; font-size: 17px; }
.color-field input { padding: 4px; }

.login-layout { width: min(920px, calc(100% - 32px)); min-height: calc(100vh - 65px); margin: 0 auto; display: grid; grid-template-columns: 1.2fr 0.8fr; align-items: center; gap: 70px; }
.login-intro { border-left: 8px solid var(--rust); padding: 14px 0 18px 28px; }
.login-intro h1 { max-width: 620px; font-size: 58px; }
.login-intro p { max-width: 520px; color: var(--muted); font-size: 18px; }
.login-form { display: grid; gap: 8px; padding: 26px; background: var(--surface-raised); border: 1px solid var(--line-strong); box-shadow: 0 14px 34px var(--shadow); }
.login-form label { margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.login-form input { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 8px 10px; color: var(--ink); background: var(--surface); }
.login-form .button { margin-top: 12px; }

.chord-table-wrap { overflow-x: auto; border: 1px solid var(--line-strong); background: var(--surface-raised); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; background: var(--surface-muted); }
.mono { font-family: "IBM Plex Mono", monospace; color: var(--rust); }

.player { width: min(1320px, calc(100% - 32px)); margin: 24px auto 80px; }
.song-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 16px; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); text-decoration: none; font-weight: 700; }
.song-metadata { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.song-metadata span, .song-metadata a { color: inherit; }
.song-actions { display: flex; align-items: center; gap: 8px; }
.song-actions form { margin: 0; }
.more-menu { position: relative; }
.more-menu summary { list-style: none; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu-content { position: absolute; z-index: 15; right: 0; top: calc(100% + 6px); width: 180px; padding: 6px; border: 1px solid var(--line); background: var(--surface-raised); box-shadow: 0 8px 20px var(--shadow); }
.more-menu-content button { width: 100%; padding: 9px; border: 0; background: transparent; text-align: left; }
.more-menu-content button:hover { background: var(--surface-muted); }
.more-menu-content .danger-action { color: var(--danger); }
.organise-bar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); background: var(--surface); }
.organise-bar > details { position: relative; }
.organise-bar > details > summary { color: var(--green-dark); font-weight: 700; }
.organise-form { position: absolute; z-index: 15; right: 0; top: 30px; width: min(540px, 85vw); padding: 16px; display: grid; gap: 12px; border: 1px solid var(--line-strong); background: var(--surface-raised); box-shadow: 0 12px 28px var(--shadow); }
.player-toolbar { position: sticky; top: 64px; z-index: 12; min-height: 72px; margin: 12px 0; padding: 10px 12px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: 0 5px 16px var(--shadow); }
.control-group { display: flex; align-items: center; gap: 6px; }
.control-group > button { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-raised); color: var(--ink); font-weight: 800; }
.transpose-controls output { width: 72px; text-align: center; font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.control-group .reset-control { width: auto; padding: 0 9px; color: var(--muted); }
.compact-field { display: grid; gap: 3px; }
.compact-field select { min-width: 130px; }
.tuning-field { flex: 1; }
.tuning-field select { width: 100%; }
.scroll-controls { border-left: 1px solid var(--line); padding-left: 12px; }
.scroll-controls label { display: grid; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 700; }
.scroll-controls input { width: 110px; accent-color: var(--green); }
.player-stage { display: block; }
.paper { min-height: 900px; padding: 42px 48px 70px; color: var(--paper-ink); background-color: var(--paper); background-image: linear-gradient(var(--paper-line) 1px, transparent 1px); background-size: 100% 28px; border: 1px solid var(--line-strong); box-shadow: 0 12px 30px var(--shadow); }
.print-song-heading { display: none; }
.song-sheet { font-family: "IBM Plex Mono", monospace; font-size: 15px; line-height: 1.55; }
.song-section { margin: 0 0 30px; break-inside: avoid; }
.song-section h2 { margin-bottom: 8px; padding-bottom: 5px; border-bottom: 2px solid var(--line); color: var(--blue-dark); font-size: 18px; }
.sheet-line { min-height: 1.55em; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.chords-line, .inline-chord { color: var(--rust); font-family: "IBM Plex Mono", monospace; font-weight: 600; }
.chord-token { padding: 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--rust); font-family: "IBM Plex Mono", monospace; font-weight: 600; line-height: inherit; }
.chord-token:hover, .chord-token.is-active { color: var(--blue-dark); border-color: var(--amber); background: color-mix(in srgb, var(--amber) 18%, transparent); }
.inline-chord { display: inline-block; margin-right: 3px; transform: translateY(-0.45em); font-size: .8em; }
.tab-line { color: var(--blue-dark); font-family: "IBM Plex Mono", monospace; font-size: 13px; white-space: pre; overflow-x: auto; }
.blank-line { min-height: .8em; }
.repeat-reference { display: none; margin: 4px 0; color: var(--muted); font-style: italic; }
.condense-repeats .repeat-section .section-lines { display: none; }
.condense-repeats .repeat-section .repeat-reference { display: block; }
.hide-tabs [data-tab-line] { display: none; }
.diagram-loading { color: var(--muted); }
.fret-diagram { width: 170px; position: relative; }
.fret-svg { width: 100%; height: auto; display: block; overflow: visible; }
.fret-line, .fret-string { stroke: var(--line-strong); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.fret-nut { stroke: var(--ink); stroke-width: 4; }
.fret-dot { fill: var(--cyan-bright); stroke: color-mix(in srgb, var(--cyan-bright) 55%, #ffffff); stroke-width: 1.5; }
.fret-barre { stroke: var(--cyan-bright); stroke-width: 16; stroke-linecap: round; }
.finger-number { fill: #051421; font: 800 9px "IBM Plex Mono", monospace; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.string-marker { fill: var(--muted); font: 700 11px "IBM Plex Mono", monospace; text-anchor: middle; }
.base-fret-label { fill: var(--muted); font: 700 9px "IBM Plex Mono", monospace; }
.diagram-caption { margin: 10px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.piano-diagram { width: 280px; height: 134px; display: grid; grid-template-columns: repeat(14, 1fr); position: relative; border: 1px solid #536779; border-top: 5px solid #172737; border-radius: 3px 3px 6px 6px; background: #172737; overflow: hidden; }
.piano-white-key { min-width: 0; height: 129px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 7px; position: relative; z-index: 1; border-right: 1px solid #8191a0; border-radius: 0 0 4px 4px; color: #53606b; background: linear-gradient(90deg, #cbd2d8 0, #fdfdfd 12%, #ffffff 72%, #d7dde1 100%); box-shadow: inset 0 -4px 7px rgba(9, 22, 33, .16); }
.piano-white-key:nth-of-type(7n) { border-right-color: #344858; }
.piano-white-key.is-active { color: #051421; background: linear-gradient(180deg, #e2fbff 0%, #7bd8ed 74%, #34b7d4 100%); box-shadow: inset 0 -7px 0 var(--cyan), inset 0 0 0 2px #8fe9f8; }
.piano-white-key i { font-style: normal; font: 700 8px "IBM Plex Mono", monospace; }
.piano-black-key { width: calc(100% / 14 * .62); height: 78px; position: absolute; z-index: 3; top: 0; left: calc((var(--black-key-index) + 1) * (100% / 14) - (100% / 14 * .31)); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; border: 1px solid #02070b; border-radius: 0 0 4px 4px; color: #9fb1c0; background: linear-gradient(90deg, #02070b 0, #202d38 28%, #071018 72%, #010305 100%); box-shadow: 0 4px 5px rgba(0, 0, 0, .55), inset 0 -5px 4px rgba(255, 255, 255, .05); }
.piano-black-key.is-active { color: #04121c; background: linear-gradient(180deg, #68d8ee 0%, #1496b6 78%, #08728c 100%); box-shadow: 0 4px 5px rgba(0, 0, 0, .5), inset 0 0 0 2px #8ceafa; }
.piano-black-key i { font-style: normal; font: 700 6px "IBM Plex Mono", monospace; }

.song-page.chord-footer-open { padding-bottom: 232px; }
.chord-footer { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; height: 224px; display: grid; grid-template-rows: 42px 1fr; border-top: 1px solid #2a618b; color: var(--footer-ink); background: var(--footer-surface); box-shadow: 0 -10px 28px var(--shadow); transition: transform 180ms ease, visibility 180ms ease; }
.chord-footer.is-collapsed { transform: translateY(100%); visibility: hidden; pointer-events: none; }
.chord-footer-bar { min-width: 0; padding: 5px 14px 5px 18px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid #285476; background: var(--footer-bar); }
.chord-footer-title { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.chord-footer-title strong { font-family: "Fraunces", serif; font-size: 18px; }
.chord-footer-title span, .chord-drag-hint { color: var(--footer-muted); font-size: 11px; }
.chord-drag-hint { margin-left: auto; }
.chord-order-control { display: flex; align-items: center; gap: 6px; }
.chord-order-control > span { color: var(--footer-muted); font-size: 11px; font-weight: 700; }
.chord-order-control select { min-height: 30px; padding: 3px 25px 3px 7px; border: 1px solid #4e7597; border-radius: 4px; color: var(--footer-ink); background: #163c5e; font-size: 11px; font-weight: 700; }
.chord-size-control { height: 31px; display: flex; align-items: center; gap: 3px; padding: 2px 4px; border: 1px solid #4e7597; border-radius: 4px; color: var(--footer-muted); background: #0d2b47; }
.magnifier-icon { width: 12px; height: 12px; margin: 0 4px 0 2px; position: relative; border: 2px solid currentColor; border-radius: 50%; }
.magnifier-icon::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -3px; border-radius: 2px; background: currentColor; transform: rotate(45deg); transform-origin: left center; }
.chord-size-control button { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 3px; color: var(--footer-ink); background: #1c4a70; font-size: 16px; font-weight: 800; line-height: 1; }
.chord-size-control button:hover { color: #061522; background: var(--cyan-bright); }
.chord-size-control button:disabled { cursor: default; opacity: .32; }
.chord-size-control output { width: 34px; color: var(--footer-muted); font-size: 9px; font-weight: 800; text-align: center; }
.chord-footer-hide { min-height: 31px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid #4e7597; border-radius: 4px; color: var(--footer-muted); background: #163c5e; font-size: 11px; font-weight: 700; }
.chord-footer-hide:hover { color: var(--footer-ink); border-color: var(--cyan); }
.chord-footer-hide i, .chord-footer-tab i { font-style: normal; font-size: 15px; line-height: 1; }
.chord-footer-tab { position: fixed; z-index: 46; right: 12px; bottom: 0; min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border: 1px solid #3f769e; border-bottom: 0; border-radius: 6px 6px 0 0; color: var(--footer-ink); background: var(--footer-bar); box-shadow: 0 -5px 16px var(--shadow); font-weight: 700; }
.chord-footer-tab:hover { background: #17476e; }
.chord-footer-tab[hidden] { display: none; }
.chord-strip { min-width: 0; padding: 8px 18px 11px; display: flex; align-items: stretch; gap: 9px; overflow-x: auto; overflow-y: hidden; cursor: grab; scrollbar-width: thin; scrollbar-color: var(--cyan) transparent; scroll-snap-type: x proximity; overscroll-behavior-x: contain; touch-action: pan-y; }
.chord-strip.is-dragging { cursor: grabbing; user-select: none; scroll-snap-type: none; }
.chord-card { width: var(--chord-card-width); min-width: var(--chord-card-width); height: var(--chord-card-height); padding: 6px 8px; display: grid; grid-template-rows: 25px minmax(0, 1fr) 24px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: var(--surface-raised); box-shadow: 0 4px 12px rgba(0, 0, 0, .18); scroll-snap-align: start; transition: width 140ms ease, min-width 140ms ease, height 140ms ease, border-color 140ms ease; }
.chord-card.is-active { border-color: var(--cyan-bright); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cyan) 30%, transparent), 0 4px 12px rgba(0, 0, 0, .2); }
.chord-card-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.chord-card-header button { padding: 0; border: 0; background: transparent; color: var(--rust); font: 700 var(--chord-symbol-size) "IBM Plex Mono", monospace; }
.chord-card-header button:hover { color: var(--green-dark); }
.chord-card-header span { color: var(--muted); font-size: 10px; font-weight: 700; }
.chord-card-diagram { min-height: 0; display: grid; place-items: center; overflow: hidden; }
.chord-card-diagram > p { margin: 0; color: var(--muted); font-size: 10px; }
.chord-card-voicing { display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; align-items: center; gap: 4px; }
.chord-card-voicing button { width: 24px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 3px; color: var(--blue-dark); background: var(--surface-muted); font-size: 16px; line-height: 1; }
.chord-card-voicing button:disabled { cursor: default; opacity: .28; }
.chord-card-voicing span { overflow: hidden; color: var(--muted); font-size: 9px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.chord-card .fret-diagram { width: var(--chord-fret-width); height: var(--chord-diagram-height); }
.chord-card .fret-svg { width: 100%; height: 100%; }
.chord-card .piano-diagram { width: var(--chord-piano-width); height: var(--chord-diagram-height); border-top-width: 3px; }
.chord-card .piano-white-key { height: var(--chord-diagram-height); padding-bottom: 2px; border-radius: 0 0 2px 2px; }
.chord-card .piano-white-key i { display: none; }
.chord-card .piano-black-key { height: calc(var(--chord-diagram-height) * .6); padding: 0; border-radius: 0 0 2px 2px; }
.chord-card .piano-black-key i { display: none; }

body[data-chord-size="compact"] { --chord-card-width: 112px; --chord-card-height: 130px; --chord-fret-width: 72px; --chord-piano-width: 86px; --chord-diagram-height: 67px; --chord-symbol-size: 13px; }
body[data-chord-size="small"] { --chord-card-width: 135px; --chord-card-height: 138px; --chord-fret-width: 82px; --chord-piano-width: 105px; --chord-diagram-height: 75px; --chord-symbol-size: 14px; }
body[data-chord-size="medium"] { --chord-card-width: 158px; --chord-card-height: 146px; --chord-fret-width: 96px; --chord-piano-width: 128px; --chord-diagram-height: 84px; --chord-symbol-size: 16px; }
body[data-chord-size="large"] { --chord-card-width: 190px; --chord-card-height: 158px; --chord-fret-width: 108px; --chord-piano-width: 158px; --chord-diagram-height: 91px; --chord-symbol-size: 18px; }

.print-layout .site-header { display: none; }
.print-layout .player { width: min(1200px, calc(100% - 24px)); margin-top: 12px; }
.print-layout .song-header { display: none; }
.print-toolbar { position: sticky; top: 0; z-index: 30; min-height: 62px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: 0 6px 20px var(--shadow); }
.print-toolbar input[type="range"] { width: 100px; accent-color: var(--green); }
.segmented { display: flex; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }
.segmented button { min-height: 36px; padding: 6px 10px; border: 0; border-right: 1px solid var(--line-strong); color: var(--ink); background: var(--surface-raised); }
.segmented button:last-child { border-right: 0; }
.segmented button.is-active { color: white; background: var(--green); }
.fit-status { color: var(--muted); font-size: 12px; }
.print-layout .player-stage { display: block; }
.print-layout .paper { width: 210mm; min-height: 297mm; margin: 14px auto; padding: 12mm; color: #0b1d33; background: #ffffff; box-shadow: 0 10px 30px var(--shadow); }
.print-layout .song-section h2 { color: #0d4777; border-color: #b4c5d8; }
.print-layout .chords-line, .print-layout .inline-chord, .print-layout .chord-token { color: #c43f4b; }
.print-layout .tab-line { color: #174f78; }
.print-layout .print-song-heading { display: block; margin-bottom: 8mm; padding-bottom: 4mm; border-bottom: 2px solid var(--ink); }
.print-song-heading h1 { font-size: 24pt; }
.print-song-heading p { margin: 2mm 0 0; color: var(--muted); }
.print-layout .song-sheet { font-size: var(--sheet-font-size); line-height: var(--sheet-line-height); }
.print-layout .song-section { margin-bottom: 5mm; }
.print-layout .song-section h2 { font-size: 13pt; margin-bottom: 2mm; }
body[data-columns="2"] .song-sheet { columns: 2; column-gap: 9mm; column-rule: 1px solid #d8dfdc; }

.theory-desk { width: min(1240px, calc(100% - 32px)); margin: 30px auto 80px; }
.theory-heading { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr); align-items: end; gap: 42px; padding: 8px 0 25px; border-bottom: 1px solid var(--line-strong); }
.theory-heading h1 { max-width: 760px; font-size: 48px; }
.theory-heading > div:first-child > p { max-width: 760px; margin: 12px 0 0; color: var(--muted); font-size: 17px; }
.mental-model { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #315f85; background: var(--nav-surface); box-shadow: 0 10px 26px var(--shadow); }
.mental-model span { min-height: 66px; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; color: var(--nav-muted); border-right: 1px solid #315f85; border-bottom: 1px solid #315f85; font-size: 12px; }
.mental-model span:nth-child(2n) { border-right: 0; }
.mental-model span:nth-last-child(-n + 2) { border-bottom: 0; }
.mental-model strong { color: var(--cyan-bright); font: 700 17px "Fraunces", serif; }

.theory-tabs { min-height: 52px; margin: 18px 0; display: flex; align-items: stretch; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: 0 5px 16px var(--shadow); position: sticky; top: 74px; z-index: 10; }
.theory-tabs button { min-width: 130px; padding: 9px 18px; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: transparent; font-weight: 800; }
.theory-tabs button:hover { color: var(--ink); background: var(--surface-muted); }
.theory-tabs button.is-active { color: #ffffff; background: var(--blue); box-shadow: inset 0 -4px 0 var(--cyan-bright); }
.theory-panel[hidden] { display: none; }

.builder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.theory-builder { min-width: 0; border: 1px solid var(--line-strong); border-top: 5px solid var(--cyan); background: var(--surface-raised); box-shadow: 0 10px 24px var(--shadow); }
.chord-builder { border-top-color: var(--rust); }
.theory-builder > header { min-height: 84px; padding: 16px 18px; display: flex; align-items: flex-start; gap: 14px; border-bottom: 1px solid var(--line); }
.theory-builder h2 { font-size: 23px; }
.theory-builder header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.builder-number { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--cyan); font: 700 12px "IBM Plex Mono", monospace; background: var(--surface-muted); }
.chord-builder .builder-number { color: var(--rust); }
.builder-controls { padding: 14px 18px; display: grid; grid-template-columns: minmax(105px, .7fr) minmax(180px, 1.3fr); gap: 12px; }
.builder-result { min-height: 200px; padding: 18px; color: var(--footer-ink); background: var(--footer-surface); }
.result-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.result-meta span { color: var(--cyan-bright); font-weight: 800; }
.chord-builder .result-meta span { color: #ff858a; }
.result-meta strong { color: var(--footer-muted); font: 600 12px "IBM Plex Mono", monospace; }
.note-run { margin-top: 22px; display: grid; grid-template-columns: repeat(7, minmax(48px, 1fr)); gap: 6px; }
.note-run span { min-height: 72px; display: grid; place-items: center; position: relative; border: 1px solid #3d6688; background: #123656; }
.note-run small { position: absolute; top: 5px; left: 7px; color: #809bb5; font: 500 9px "IBM Plex Mono", monospace; }
.note-run strong { color: #ffffff; font: 700 21px "IBM Plex Mono", monospace; }
.chord-note-run { grid-template-columns: repeat(4, minmax(64px, 1fr)); }
.chord-note-run span { border-color: #75454f; background: #472934; }
.result-mood { margin: 12px 0 0; color: var(--footer-muted); font-size: 12px; }

.tuning-map { margin-top: 16px; border: 1px solid var(--line-strong); background: var(--surface-raised); }
.tuning-map > header { padding: 17px 20px; display: flex; align-items: end; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--line); }
.tuning-map > header .eyebrow { margin: 0 0 4px; }
.tuning-map > header p { max-width: 600px; margin: 0; color: var(--muted); font-size: 13px; }
.tuning-rail { min-width: 0; padding: 20px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 8px; overflow-x: auto; }
.tuning-string { min-width: 76px; height: 76px; display: grid; place-items: center; align-content: center; border: 1px solid var(--line-strong); background: var(--surface-muted); }
.tuning-string small { color: var(--muted); font-size: 9px; }
.tuning-string strong { color: var(--blue-dark); font: 700 28px "IBM Plex Mono", monospace; }
.tuning-interval { min-width: 70px; display: grid; justify-items: center; color: var(--muted); }
.tuning-interval::before { content: ""; width: 100%; height: 2px; margin-bottom: -15px; background: var(--line-strong); }
.tuning-interval strong { z-index: 1; padding: 2px 6px; color: var(--cyan); background: var(--surface-raised); font: 700 11px "IBM Plex Mono", monospace; }
.tuning-interval small { font-size: 8px; }

.note-language { margin-top: 16px; padding: 20px; display: grid; grid-template-columns: 240px 1fr; gap: 10px 30px; border-left: 5px solid var(--rust); color: var(--nav-ink); background: var(--nav-surface); }
.note-language .eyebrow { color: #ff858a; }
.note-language p { margin: 0; color: var(--nav-muted); }
.chromatic-line { grid-column: 1 / -1; margin-top: 12px; display: grid; grid-template-columns: repeat(12, minmax(55px, 1fr)); gap: 3px; overflow-x: auto; }
.chromatic-line span { min-width: 62px; padding: 8px 5px; border: 1px solid #315f85; color: var(--cyan-bright); font: 600 11px "IBM Plex Mono", monospace; text-align: center; background: #0c3152; }

.reference-block { border: 1px solid var(--line-strong); background: var(--surface-raised); box-shadow: 0 8px 20px var(--shadow); }
.reference-block > header, .memory-reference > header { padding: 17px 19px; border-bottom: 1px solid var(--line); }
.reference-block > header .eyebrow, .memory-reference > header .eyebrow { margin-bottom: 4px; }
.interval-ruler { padding: 14px; display: grid; grid-template-columns: repeat(13, 1fr); gap: 5px; }
.interval-ruler article { min-width: 0; min-height: 98px; padding: 8px 4px; display: grid; justify-items: center; align-content: center; border: 1px solid var(--line); background: var(--surface-muted); text-align: center; }
.interval-ruler article:nth-child(6), .interval-ruler article:nth-child(8), .interval-ruler article:last-child { border-color: var(--cyan); }
.interval-ruler article > strong { color: var(--blue-dark); font: 700 20px "IBM Plex Mono", monospace; }
.interval-ruler article > span { color: var(--rust); font: 700 11px "IBM Plex Mono", monospace; }
.interval-ruler article > small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.reference-note { margin: 0; padding: 0 19px 17px; color: var(--muted); font-size: 12px; }
.reference-grid { margin-top: 16px; display: grid; grid-template-columns: 1.08fr .92fr; gap: 16px; }
.mode-list, .formula-list { padding: 8px 18px 16px; }
.mode-list > div { min-height: 52px; display: grid; grid-template-columns: 1.1fr 1fr .9fr; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.mode-list > div:last-child, .formula-list > div:last-child { border-bottom: 0; }
.mode-list strong, .formula-list strong { font-size: 13px; }
.mode-list code, .formula-list code { color: var(--cyan); font: 600 11px "IBM Plex Mono", monospace; }
.mode-list span { color: var(--muted); font-size: 11px; }
.formula-list > div { min-height: 48px; display: grid; grid-template-columns: 1fr 1fr .8fr; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.formula-list span { color: var(--rust); font: 600 12px "IBM Plex Mono", monospace; }
.compact-reference-grid { grid-template-columns: .7fr 1.3fr; }
.ratio-list { padding: 16px 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ratio-list > div { min-height: 86px; display: grid; place-items: center; align-content: center; border: 1px solid var(--line); background: var(--surface-muted); text-align: center; }
.ratio-list strong { color: var(--cyan); font: 700 20px "IBM Plex Mono", monospace; }
.ratio-list span { color: var(--muted); font-size: 9px; }
.key-reference { padding-bottom: 16px; }
.key-reference > article { margin: 13px 18px 0; padding: 13px; border-left: 4px solid var(--blue); background: var(--surface-muted); }
.key-reference > article > strong { color: var(--blue-dark); }
.key-reference > article p { margin: 5px 0 8px; font: 600 12px "IBM Plex Mono", monospace; }
.key-reference > article div { display: flex; flex-wrap: wrap; gap: 5px; }
.key-reference > article div span { padding: 3px 7px; color: #ffffff; background: var(--blue); font: 600 10px "IBM Plex Mono", monospace; }

.memory-reference { border: 1px solid var(--line-strong); background: var(--surface-raised); }
.memory-card-grid { padding: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.memory-card-grid article { min-height: 150px; padding: 15px; display: flex; flex-direction: column; border: 1px solid #315f85; color: var(--nav-ink); background: var(--nav-surface); }
.memory-card-grid article > span { color: #ff858a; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.memory-card-grid article > strong { margin: auto 0 8px; color: var(--cyan-bright); font: 700 20px "IBM Plex Mono", monospace; }
.memory-card-grid article > p { margin: 0; color: var(--nav-muted); font-size: 12px; }
.memory-workspace { margin-top: 16px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 16px; align-items: start; }
.learning-ladder, .personal-memory { border: 1px solid var(--line-strong); background: var(--surface-raised); box-shadow: 0 8px 20px var(--shadow); }
.learning-ladder > header, .personal-memory > header { padding: 17px 19px; position: relative; border-bottom: 1px solid var(--line); }
.learning-ladder > header output { position: absolute; right: 19px; bottom: 18px; color: var(--cyan); font: 700 12px "IBM Plex Mono", monospace; }
.learning-ladder ol { margin: 0; padding: 10px 18px 16px 46px; }
.learning-ladder li { padding: 5px 0; color: var(--muted); }
.learning-ladder label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.learning-ladder input { width: 17px; height: 17px; accent-color: var(--cyan); }
.learning-ladder input:checked + span { color: var(--ink); text-decoration: line-through; }
.memory-note-form { padding: 16px 18px; display: grid; grid-template-columns: 130px 1fr auto; align-items: end; gap: 10px; border-bottom: 1px solid var(--line); }
.memory-note-field textarea { width: 100%; resize: vertical; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: var(--surface); font: inherit; }
.saved-memory-notes { padding: 10px 18px 17px; }
.saved-memory-notes article { padding: 12px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.saved-memory-notes article:last-child { border-bottom: 0; }
.saved-memory-notes article > div > span { color: var(--rust); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.saved-memory-notes p { margin: 3px 0; white-space: pre-wrap; }
.saved-memory-notes small { color: var(--muted); font-size: 9px; }
.saved-memory-notes form button { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--danger); background: var(--surface-muted); font-size: 18px; }
.memory-empty { margin: 0; padding: 20px 18px; color: var(--muted); }

@media (max-width: 1000px) {
  .workspace-heading { display: block; }
  .import-panel { width: 100%; margin-top: 18px; }
  .filter-bar { grid-template-columns: 1fr 1fr 1fr; }
  .song-row { grid-template-columns: minmax(240px, 1.3fr) minmax(180px, 1fr) 42px; }
  .song-facts { grid-column: 1 / 3; justify-content: flex-start; padding-left: 55px; }
  .player-toolbar { flex-wrap: wrap; }
  .paper { padding: 34px 30px 60px; }
  .print-toolbar { position: relative; flex-wrap: wrap; }
  .theory-heading { grid-template-columns: 1fr; gap: 20px; }
  .mental-model { max-width: 620px; }
  .interval-ruler { grid-template-columns: repeat(7, 1fr); }
  .reference-grid, .compact-reference-grid, .memory-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header { padding: 0 10px; gap: 8px; }
  .site-header nav { margin-left: 0; }
  .site-header nav a { padding: 0 8px; font-size: 13px; }
  .site-header > form { display: none; }
  .brand { font-size: 21px; }
  .brand-mark { width: 25px; height: 28px; }
  .theme-switch-track { width: 88px; font-size: 9px; }
  .theme-switch-track i { width: 39px; }
  .theme-switch input:checked + .theme-switch-track i { transform: translateX(42px); }
  .brand > span:last-child { display: none; }
  h1 { font-size: 32px; }
  .workspace { width: min(100% - 20px, 1180px); margin-top: 20px; }
  .import-form, .filter-bar, .taxonomy-grid, .taxonomy-grid form { grid-template-columns: 1fr; }
  .import-form .label-picker, .taxonomy-grid h2 { grid-column: 1; }
  .filter-bar .button { width: 100%; }
  .song-row { grid-template-columns: 1fr 40px; gap: 8px; }
  .song-tags, .song-facts { grid-column: 1; padding-left: 55px; justify-content: flex-start; }
  .song-row > form { grid-column: 2; grid-row: 1; }
  .login-layout { grid-template-columns: 1fr; gap: 28px; align-content: center; padding: 30px 0; }
  .login-intro h1 { font-size: 42px; }
  .player { width: min(100% - 16px, 1320px); margin-top: 14px; }
  .song-header { display: block; }
  .song-actions { margin-top: 16px; flex-wrap: wrap; }
  .organise-bar { align-items: flex-start; }
  .player-toolbar { position: relative; top: auto; align-items: flex-end; }
  .transpose-controls { width: 100%; }
  .tuning-field { min-width: 180px; }
  .scroll-controls { border-left: 0; padding-left: 0; }
  .player-stage { display: block; }
  .paper { min-height: 70vh; padding: 25px 18px 48px; }
  .song-sheet { font-size: 15px; }
  .song-page.chord-footer-open { padding-bottom: 211px; }
  .chord-footer { height: 203px; grid-template-rows: 39px 1fr; }
  .chord-footer-bar { padding: 4px 8px 4px 10px; gap: 7px; }
  .chord-footer-title span, .chord-drag-hint, .chord-order-control > span, .chord-footer-hide span { display: none; }
  .chord-footer-title strong { font-size: 16px; }
  .chord-order-control { margin-left: auto; }
  .chord-order-control select { max-width: 112px; }
  .chord-strip { padding: 7px 10px 10px; }
  .print-layout .paper { width: 100%; min-height: auto; margin: 10px auto; padding: 8mm; }
  .theory-desk { width: min(100% - 20px, 1240px); margin-top: 20px; }
  .theory-heading { padding-bottom: 18px; }
  .theory-heading h1 { font-size: 35px; }
  .theory-heading > div:first-child > p { font-size: 14px; }
  .mental-model { grid-template-columns: 1fr 1fr; }
  .mental-model span { min-height: 58px; padding: 9px 10px; }
  .mental-model strong { font-size: 15px; }
  .theory-tabs { top: 64px; margin: 12px 0; }
  .theory-tabs button { min-width: 0; flex: 1; padding: 8px; }
  .builder-grid { grid-template-columns: 1fr; }
  .builder-controls { grid-template-columns: 1fr 1fr; }
  .note-run { overflow-x: auto; grid-template-columns: repeat(7, minmax(58px, 1fr)); }
  .chord-note-run { grid-template-columns: repeat(4, minmax(62px, 1fr)); }
  .tuning-map > header { display: block; }
  .tuning-map > header p { margin-top: 8px; }
  .tuning-rail { padding: 14px; }
  .note-language { grid-template-columns: 1fr; padding: 16px; }
  .chromatic-line { grid-column: 1; }
  .interval-ruler { grid-template-columns: repeat(4, 1fr); }
  .interval-ruler article { min-height: 88px; }
  .mode-list > div { grid-template-columns: 1fr; gap: 3px; padding: 9px 0; }
  .formula-list > div { grid-template-columns: 1fr 1fr; padding: 6px 0; }
  .formula-list code { grid-column: 2; }
  .ratio-list { grid-template-columns: repeat(3, 1fr); }
  .memory-card-grid { grid-template-columns: 1fr 1fr; }
  .memory-note-form { grid-template-columns: 1fr; align-items: stretch; }
  .memory-note-form .button { width: 100%; }
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  :root { background: white; }
  body { min-height: 0; color: #0b1d33; background: white; }
  .no-print, .flash-stack { display: none !important; }
  .print-layout .player { width: auto; margin: 0; }
  .print-layout .paper { width: auto; min-height: 0; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .print-layout .print-song-heading { margin-bottom: 5mm; }
  .song-section { break-inside: avoid; }
  .sheet-line { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}