@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ground: #eeeae3;
  --surface: #f8f5ef;
  --paper: #fffcf6;
  --ink: #302d35;
  --muted: #69616d;
  --line: #d9d1d3;
  --accent: #64538c;
  --on-accent: #ffffff;
  --soft: #e6dfed;
  --warning: #934725;
  --rail: 224px;
  --reading-size: 20px;
  --dock-surface: rgb(248 245 239 / .66);
  --dock-shadow: 0 10px 34px rgb(32 23 41 / .17), inset 0 1px 0 rgb(255 255 255 / .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-appearance=light]) {
    color-scheme: dark;
    --ground: #211f25; --surface: #302c34; --paper: #28252d;
    --ink: #ede7ec; --muted: #b8aebb; --line: #48404e;
    --accent: #c4afea; --on-accent: #28212f; --soft: #3d334b; --warning: #e6ad8c;
    --dock-surface: rgb(48 44 52 / .72);
    --dock-shadow: 0 12px 40px rgb(0 0 0 / .3), inset 0 1px 0 rgb(255 255 255 / .13);
  }
}
:root[data-appearance=dark] {
  color-scheme: dark;
  --ground: #211f25; --surface: #302c34; --paper: #28252d;
  --ink: #ede7ec; --muted: #b8aebb; --line: #48404e;
  --accent: #c4afea; --on-accent: #28212f; --soft: #3d334b; --warning: #e6ad8c;
  --dock-surface: rgb(48 44 52 / .72);
  --dock-shadow: 0 12px 40px rgb(0 0 0 / .3), inset 0 1px 0 rgb(255 255 255 / .13);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 28px; scrollbar-color: var(--line) var(--ground); }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 Manrope, system-ui, sans-serif; caret-color: var(--accent); }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--on-accent); }
button, input, select { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
button:hover:not(:disabled) { background: var(--soft); }
button:active:not(:disabled) { translate: 0 1px; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
a { color: inherit; text-underline-offset: 4px; }
input { min-width: 0; color: inherit; accent-color: var(--accent); }
input::placeholder { color: var(--muted); opacity: 1; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 44px; padding: 9px; border: 0; flex: none; }
.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(.94); }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.7; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
.skip { position: fixed; top: -80px; left: 12px; z-index: 100; padding: 14px; background: var(--accent); color: var(--on-accent); }
.skip:focus { top: 10px; }

.appbar { height: 78px; display: flex; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--paper); }
.brand { min-width: 174px; justify-content: flex-start; border: 0; padding: 0; gap: 10px; font-size: 23px; letter-spacing: -.04em; font-weight: 700; }
.brand:hover { background: none !important; }
.brand svg { width: 25px; height: 28px; color: var(--accent); }
.brand circle { fill: currentColor; stroke: none; }
#header-search { flex: 1; max-width: 610px; min-width: 0; }
#appearance { margin-left: auto; }
.finding { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
#search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 44px; padding: 0 4px 0 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
#search:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.search-symbol { width: 16px; height: 16px; color: var(--muted); }
.field { position: relative; flex: 1; min-width: 0; }
#query { width: 100%; min-width: 0; height: 40px; padding: 0; border: 0; background: none; font-size: 13px; outline: none; }
.search-submit { min-height: 34px; padding: 5px 12px; border: 0; color: var(--accent); }
.suggestions { position: absolute; z-index: 20; top: calc(100% + 10px); left: -30px; right: -80px; margin: 0; padding: 6px; list-style: none; max-height: 300px; overflow-y: auto; background: var(--surface); border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / .17); }
.suggestion { display: flex; gap: 12px; padding: 11px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.suggestion.picked, .suggestion:hover { background: var(--soft); }
.suggestion-title { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.suggestion-artist { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }

.workspace { display: grid; grid-template-columns: var(--rail) minmax(0,1fr); min-height: calc(100dvh - 78px); }
.library { padding: 32px 16px; }
.library h2 { margin: 0 16px 16px; color: var(--muted); font-size: 12px; font-weight: 500; }
.library nav { display: grid; gap: 8px; }
.history-row { color: inherit; text-decoration: none; border-radius: 8px; }
.history-row:hover { background: var(--soft); }
.history-row[aria-current=page] { background: var(--soft); }
.library .history-row { display: block; padding: 12px 16px; }
.history-row strong { display: block; color: var(--ink); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.history-row span { min-width: 0; }
.history-artist, .history-provider, .history-key, .history-votes { display: block; color: var(--muted); font-size: 12px; }
.library .history-artist { margin-top: 4px; }
.library .history-facts { margin-top: 6px; }
.library .history-key { margin-top: 4px; }
.library .history-score { margin-top: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.history-score { font-variant-numeric: tabular-nums; }
.rating { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rating svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.history-votes { font-size: 11px; }
#main { min-width: 0; margin: 32px 36px 0; border-radius: 8px 8px 0 0; background: var(--paper); outline: none; }
#main:focus-visible, #sheet-title:focus-visible { outline: none; }
body[data-history=empty] .library { display: none; }
body[data-history=empty] .workspace { grid-template-columns: minmax(0,1fr); }
body[data-history=empty] #main { max-width: 1100px; width: calc(100% - 72px); margin-inline: auto; }
body[data-view=home] .workspace { display: block; min-height: 100dvh; }
body[data-view=home] .library { display: none; }
body[data-view=home] .appbar { position: absolute; top: 16px; right: 20px; width: 44px; height: 44px; padding: 0; background: none; border: 0; z-index: 2; }
body[data-view=home] .brand, body[data-view=home] #header-search { display: none; }
body[data-view=home] #main { margin: 0; width: 100%; max-width: none; min-height: 100dvh; background: none; border-radius: 0; }
.home-center { width: min(650px,calc(100% - 48px)); margin: 0 auto; padding-top: max(140px,calc(50dvh - 110px)); padding-bottom: 45px; }
.home-center h1 { margin: 0 0 30px; font-size: 38px; line-height: 1.2; letter-spacing: -.02em; text-align: center; font-weight: 700; }
#home-search #search { height: 58px; background: var(--paper); padding-left: 18px; }
#home-search #query { height: 54px; font-size: 15px; }
#home-search .search-submit { padding-inline: 16px; min-height: 44px; font-size: 13px; }
#home-search .search-symbol { width: 18px; height: 18px; }
#home-search #settings { color: var(--muted); }
.home-history { margin-top: 28px; }
.home-history h2 { margin: 0 0 8px; padding: 0 16px; font-size: 12px; font-weight: 500; color: var(--muted); }
.home-history .history-row { display: grid; grid-template-columns: minmax(130px,1.35fr) minmax(125px,1fr) 92px; align-items: center; gap: 18px; min-height: 66px; padding: 11px 16px; border-bottom: 1px solid color-mix(in srgb,var(--line) 55%,transparent); }
.home-history .history-row:last-child { border: 0; }
.home-history .history-main, .home-history .history-facts, .home-history .history-score { display: grid; gap: 4px; min-width: 0; }
.home-history .history-score { text-align: right; justify-items: end; }
.home-history .history-row:hover { background: color-mix(in srgb,var(--soft) 45%,transparent); }

#results { padding: 24px 48px 50px; }
.result-filters { padding: 24px 48px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.result-filters button { min-height: 38px; font-size: 12px; }
.result-filters button[aria-pressed=true] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.hits { display: block; }
.hit { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 24px; padding: 22px 12px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.hits>[role=listitem]:last-child .hit { border-bottom: 1px solid var(--line); }
.hit:hover { background: var(--soft); }
.hit-title { grid-column: 1; font-size: 23px; line-height: 1.25; font-weight: 650; letter-spacing: -.025em; overflow-wrap: anywhere; }
.hit-artist { grid-column: 1; color: var(--muted); font-size: 13px; }
.hit-provider { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 7px; font-size: 12px; }
.badge { display: inline-flex; font-size: 11px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.hit-detail, .hit-note { grid-column: 1; color: var(--muted); font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
.hit-note { font-style: italic; }
.hit-rating { grid-column: 2; grid-row: 1 / span 4; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; padding-top: 4px; font-variant-numeric: tabular-nums; }
.hit-votes { color: var(--muted); font-size: 11px; white-space: nowrap; }
.empty { padding: 28px 12px; color: var(--muted); }
.notice { padding: 12px; color: var(--warning); font-size: 13px; }
.error, .bad { color: var(--warning); }
.active-filters { padding: 18px 48px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.active-filters button { font-size: 12px; min-height: 36px; color: var(--accent); }

#sheet-panel { padding-bottom: 140px; }
.song-heading { padding: 30px 38px 24px; }
.back { padding: 0; margin-bottom: 14px; border: 0; gap: 4px; min-height: 32px; color: var(--muted); font-size: 12px; font-weight: 500; }
.back:hover { color: var(--accent); background: none !important; }
.back svg { width: 16px; height: 16px; }
.song-heading h1 { margin: 0 0 14px; font-size: 52px; line-height: 1.15; letter-spacing: -.035em; font-weight: 650; overflow-wrap: anywhere; }
.song-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; color: var(--muted); font-size: 12px; }
.song-type { display: inline-flex; font-size: 11px; line-height: 1.5; border: 1px solid var(--line); padding: 3px 8px; border-radius: 3px; }
#sheet-origin { font-size: 12px; }
.sheet-body { padding: 12px 38px 60px; max-width: 950px; font-size: var(--reading-size); }
.sheet-body.two { max-width: none; }
.block { margin: 0 0 40px; break-inside: avoid; }
.marker { margin: 0 0 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.line { margin: 0 0 9px; line-height: 1.6; overflow-wrap: break-word; }
.line.over { white-space: pre-wrap; }
.lyric-word { display: inline-flex; vertical-align: top; max-width: 100%; white-space: nowrap; }
.lyric-word .part { min-width: 0; }
.part { display: inline-block; vertical-align: top; max-width: 100%; }
.chord { display: block; white-space: pre; padding-inline-end: .4em; color: var(--accent); font-size: .7em; font-weight: 700; line-height: 1.5; }
.chord:empty::before { content: '\200b'; }
.words { display: block; white-space: pre-wrap; }
.line.beside { display: flex; gap: 1em; align-items: baseline; }
.gutter { flex: 0 0 4.5em; color: var(--accent); font-size: .72em; white-space: pre-wrap; font-weight: 700; }
.line.beside .words { flex: 1; min-width: 0; }
.changes { display: flex; flex-wrap: wrap; gap: 1em; }
.stave { display: block; max-width: 100%; overflow-x: auto; font: .75em/1.6 ui-monospace, Consolas, monospace; white-space: pre; margin: 8px 0; }
.diagrams { display: flex; flex-wrap: wrap; gap: 20px; margin: 0 0 30px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.diagram { margin: 0; text-align: center; }
.diagram-name { color: var(--accent); font-size: 13px; font-weight: 650; }
.box { display: block; height: 70px; width: auto; margin: auto; fill: none; stroke: none; }
.diagrams.sideways .box { height: 58px; }
.box .string, .box .fret { stroke: var(--muted); stroke-width: .9; }
.box .nut { stroke: var(--ink); stroke-width: 2.6; }
.box .dot { fill: var(--ink); }
.box .barre { stroke: var(--ink); stroke-width: 5.6; stroke-linecap: round; }
.box .mark, .box .fret-number { fill: var(--muted); font: 7px system-ui, sans-serif; }
.box .mark { text-anchor: middle; }

.playbar { position: fixed; inset: auto 32px 24px calc(var(--rail) + 32px); z-index: 5; display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - var(--rail) - 64px); margin: 0 auto; padding: 10px 14px; border: 0; border-radius: 22px; background: var(--surface); box-shadow: var(--dock-shadow); }
.playbar .icon-button { border-radius: 12px; }
.key-control { display: flex; align-items: center; gap: 0; padding: 3px; border-radius: 40px; background: color-mix(in srgb,var(--soft) 82%,transparent); }
.key-control>.icon-button { width: 34px; min-height: 38px; padding: 6px; border-radius: 50%; }
.key-control>.icon-button svg { width: 15px; height: 15px; }
.key-picker { min-width: 70px; padding: 3px 6px; gap: 6px; border: 0; border-radius: 30px; color: var(--accent); }
.key-picker output { min-width: 23px; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.key-picker svg { width: 13px; height: 13px; }
.capo-picker { min-width: 62px; gap: 8px; border: 0; border-radius: 30px; background: color-mix(in srgb,var(--soft) 82%,transparent); font-variant-numeric: tabular-nums; }
.capo-picker svg { width: 18px; height: 18px; }
.toolbar-divider { width: 8px; height: 24px; border-left: 1px solid var(--line); }
#export { width: 68px; gap: 7px; }
.focus-mode .appbar, .focus-mode .library, .focus-mode .back { display: none; }
.focus-mode .workspace { display: block; }
.focus-mode #main { max-width: 1000px; margin: 20px auto 0; width: 100%; }
.focus-mode .playbar { left: 24px; right: 24px; max-width: calc(100vw - 48px); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .playbar { background: var(--dock-surface); backdrop-filter: blur(8px) saturate(135%); -webkit-backdrop-filter: blur(8px) saturate(135%); }
}
.note-menu { position: fixed; inset: auto; margin: 0; width: 258px; padding: 12px; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgb(0 0 0 / .25); }
.note-menu:popover-open { display: block; }
.note-menu::backdrop { background: transparent; }
.note-grid, .fret-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 5px; min-width: 0; flex: 1; }
.note-grid button, .fret-grid button { padding: 5px 0; min-width: 0; min-height: 34px; border: 0; border-radius: 8px; font-size: 12px; font-variant-numeric: tabular-nums; background: var(--soft); }
.note-grid [aria-pressed=true], .fret-grid [aria-pressed=true] { background: var(--accent); color: var(--on-accent); }
.visual-group { display: flex; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 16px 0; min-width: 0; }
.visual-group:last-child { border: 0; }
.group-symbol { width: 22px; flex: none; color: var(--muted); }
.group-symbol svg { width: 22px; height: 22px; }
.visual-segment { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: 14px; min-width: 0; }
.visual-choice, .visual-segment>button { border: 0; border-radius: 11px; min-width: 44px; min-height: 48px; padding: 9px; color: var(--muted); background: transparent; }
.visual-choice svg { width: 25px; height: 25px; }
.visual-choice[aria-pressed=true] { background: var(--accent); color: var(--on-accent); }
.visual-choice:disabled { opacity: .35; }
.size-segment { align-items: center; }
.size-segment>output { min-width: 26px; text-align: center; color: var(--muted); font-size: 12px; }

.drawer { position: fixed; z-index: 8; inset: 0 0 0 auto; width: 340px; max-width: 100%; overflow-y: auto; background: var(--surface); box-shadow: -12px 0 42px rgb(0 0 0 / .2); padding: 26px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-head h2 { margin: 0; font-size: 25px; font-weight: 650; letter-spacing: -.025em; line-height: 1.3; }
.drawer>.primary { width: 100%; margin-top: 18px; }
dialog { width: 480px; max-width: calc(100% - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 28px; border: 0; border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 70px rgb(0 0 0 / .27); }
dialog::backdrop { background: rgb(16 12 22 / .72); }
.export { width: min(1100px,calc(100vw - 40px)); height: min(850px,calc(100dvh - 40px)); max-height: calc(100dvh - 40px); padding: 0; overflow: hidden; }
.export[open] { display: flex; flex-direction: column; }
.export>.dialog-head { padding: 22px 26px; border-bottom: 1px solid var(--line); flex: none; }
#export-summary { margin: 4px 0 0; font-size: 12px; }
.export-panes { display: grid; grid-template-columns: 300px minmax(0,1fr); flex: 1; min-height: 0; }
#export-controls { overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 24px; border-right: 1px solid var(--line); }
.export-preview { min-width: 0; min-height: 0; background: #d8d8d8; padding: 14px; }
#export-pages { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.export-foot { display: flex; align-items: center; gap: 8px; padding: 15px 24px; margin: 0; flex: none; border-top: 1px solid var(--line); }
.export-foot output { flex: 1; color: var(--muted); font-size: 12px; }
.export-foot output.bad { color: var(--warning); }
#share-code { max-width: 190px; padding: 6px; margin: 24px auto; background: #fff; }
#share-code:empty { display: none; }
#share-code svg { display: block; width: 100%; height: auto; stroke: none; }
.share-label { display: block; font-size: 12px; margin: 18px 0 6px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { width: 100%; background: var(--ground); border: 1px solid var(--line); padding: 8px 10px; border-radius: 8px; font-size: 12px; }
.share-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 12px; }
.preference[aria-pressed=true] { background: var(--soft); color: var(--accent); }
#share-state, #settings-state { display: block; font-size: 12px; margin-top: 12px; }
.settings-group { border: 0; border-top: 1px solid var(--line); margin: 26px 0 0; padding: 16px 0 0; }
.settings-group legend { font-size: 13px; font-weight: 650; padding-right: 12px; }
.settings-list { display: grid; gap: 8px; }
.settings-row { width: 100%; min-height: 48px; justify-content: flex-start; gap: 12px; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--soft); text-align: left; }
.settings-row[aria-pressed=true] { background: var(--accent); color: var(--on-accent); }
.settings-row svg { flex: none; }
.settings-row>span { display: grid; gap: 3px; }
.settings-name { font-size: 13px; font-weight: 650; }
.settings-aside { font-size: 12px; font-weight: 400; }
.toast { position: fixed; z-index: 30; bottom: 110px; left: 50%; translate: -50% 0; max-width: calc(100% - 32px); padding: 12px 20px; background: var(--accent); color: var(--on-accent); border-radius: 8px; box-shadow: 0 5px 25px rgb(0 0 0 / .13); font-size: 12px; text-align: center; }
.toast:empty { display: none; }
#control-tooltip { position: fixed; z-index: 2000; pointer-events: none; width: max-content; max-width: 250px; padding: 7px 10px; border-radius: 7px; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1.4; box-shadow: 0 4px 18px rgb(0 0 0 / .13); }

@media (min-width: 1100px) { .sheet-body.two .sheet { column-count: 2; column-gap: 36px; } }
@media (max-width: 1050px) {
  :root { --rail: 190px; }
  .brand { min-width: 150px; }
  #main { margin: 20px 20px 0; }
  .playbar { left: 24px; right: 24px; max-width: calc(100vw - 48px); }
}
@media (max-width: 760px) {
  :root { --rail: 0px; }
  .workspace { display: block; }
  .library { display: none; }
  .appbar { height: 66px; padding: 0 16px; gap: 6px; }
  .brand { min-width: 0; margin-right: 6px; font-size: 19px; gap: 5px; }
  .brand svg { width: 20px; }
  .finding { gap: 3px; }
  .finding>.icon-button { width: 38px; }
  #appearance { width: 36px; }
  #search { padding-left: 9px; }
  #query { font-size: 12px; }
  .appbar .search-submit { display: none; }
  #main, body[data-history=empty] #main { margin: 16px 16px 0; width: auto; }
  .song-heading { padding: 24px; }
  .song-heading h1 { font-size: 37px; }
  .sheet-body { padding: 12px 24px 40px; }
  .home-center { width: min(650px,calc(100% - 36px)); }
  .home-center h1 { font-size: 34px; margin-bottom: 24px; }
  #home-search #query { font-size: 14px; }
  .playbar { gap: 5px; padding: 9px 12px; }
  #results { padding: 20px 24px 40px; }
  .result-filters { padding: 20px 24px 0; gap: 6px; }
  .active-filters { padding: 16px 24px 0; }
  .hit { gap: 6px 14px; padding: 20px 0; }
  .hit-title { font-size: 21px; }
  .drawer { inset: auto 0 0; width: 100%; height: auto; max-height: 46dvh; padding: 16px 24px calc(18px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgb(0 0 0 / .2); }
  dialog { padding: 22px; }
  .export { width: calc(100vw - 20px); max-width: calc(100vw - 20px); height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); padding: 0; }
  .export>.dialog-head { padding: 16px 20px; }
  .export-panes { display: flex; flex-direction: column; }
  #export-controls { flex: 1 1 54%; max-height: 54%; padding: 0 20px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .export-preview { flex: 1 1 46%; min-height: 130px; padding: 8px; }
  .export-foot { padding: 12px 16px; flex-wrap: wrap; }
  .export-foot output { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .playbar { inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px; width: min(350px,calc(100vw - 24px)); max-width: calc(100vw - 24px); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px 5px; padding: 8px 12px; }
  .key-control { grid-column: 1 / 3; grid-row: 1; justify-self: center; }
  .capo-picker { grid-column: 3; grid-row: 1; justify-self: center; min-height: 44px; }
  #reset-key { grid-column: 4; grid-row: 1; justify-self: center; }
  .toolbar-divider { display: none; }
  #share { grid-column: 1; grid-row: 2; justify-self: center; }
  #export { grid-column: 2; grid-row: 2; justify-self: center; width: 64px; }
  #focus { grid-column: 3; grid-row: 2; justify-self: center; }
  #adjust { grid-column: 4; grid-row: 2; justify-self: center; }
  .key-control>.icon-button { width: 36px; }
  #sheet-panel { padding-bottom: 190px; }
  .playbar[data-lyrics-only=true] #share { grid-column: 1; grid-row: 1; }
  .playbar[data-lyrics-only=true] #export { grid-column: 2; grid-row: 1; }
  .playbar[data-lyrics-only=true] #focus { grid-column: 3; grid-row: 1; }
  .playbar[data-lyrics-only=true] #adjust { grid-column: 4; grid-row: 1; }
  .toast { bottom: 140px; }
}
@media (max-width: 450px) {
  :root { --reading-size: 18px; }
  .appbar .search-symbol { display: none; }
  .appbar #search { height: 42px; }
  #main, body[data-history=empty] #main { margin: 0; border-radius: 0; }
  .song-heading { padding: 20px; }
  .song-heading h1 { font-size: 32px; }
  .song-meta { gap: 6px 10px; }
  .song-type { font-size: 11px; padding: 2px 6px; }
  .sheet-body { padding: 12px 20px 40px; }
  .block { margin-bottom: 30px; }
  .line.beside { gap: .6em; }
  .line.beside .gutter { flex-basis: 3.7em; }
  .home-center { padding-top: max(140px,calc(50dvh - 98px)); }
  #home-search #search { height: 54px; padding-left: 13px; }
  #home-search #query { height: 50px; }
  #home-search .search-submit { padding-inline: 10px; font-size: 12px; }
  #home-search .search-symbol { width: 16px; }
  body[data-view=home] .appbar { top: 10px; right: 10px; }
  .home-history h2 { padding-inline: 12px; }
  .home-history .history-row { grid-template-columns: minmax(0,1fr) auto; column-gap: 14px; row-gap: 4px; padding: 13px 12px; min-height: 82px; }
  .home-history .history-main { grid-column: 1; grid-row: 1; }
  .home-history .history-score { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .home-history .history-facts { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 5px 12px; }
  .hit { gap: 6px 10px; }
  .hit-provider { gap: 8px; }
  .hit-rating { max-width: 90px; }
  .suggestions { left: -20px; right: -10px; }
  .suggestion { display: block; }
  .suggestion-artist { display: block; margin-top: 3px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background .15s ease-out, color .15s ease-out; }
  .drawer { animation: drawer-in .2s cubic-bezier(.16,1,.3,1); }
  @keyframes drawer-in { from { translate: 18px 0; } to { translate: 0 0; } }
}
@media (prefers-reduced-transparency: reduce) { .playbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media print {
  body { background: #fff !important; color: #111 !important; }
  .appbar, .library, #finder, .playbar, .back, .drawer, .toast, dialog, .note-menu, #control-tooltip, .skip { display: none !important; }
  .workspace { display: block; }
  #main { width: 100% !important; max-width: none !important; margin: 0 !important; background: #fff !important; }
  #sheet-panel { padding: 0; }
  .song-heading { padding: 0 0 20px; }
  .song-heading h1 { font: 700 24pt Manrope,sans-serif; }
  .song-meta { color: #333; }
  .sheet-body { padding: 0; max-width: none; font: 11pt/1.5 Manrope,sans-serif; }
  .sheet-body.two .sheet { column-count: 2; column-gap: 24px; }
  .chord, .diagram-name { color: #111; }
  .marker { color: #444; }
  .block { break-inside: avoid; }
}
