:root {
    color-scheme: light;
    --font-ui: 'Avenir Next', Avenir, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    --canvas: #f8f7f5;
    --surface: #fff;
    --border: #e4dfdc;
    --line: #eeeae7;
    --ink: #292536;
    --muted: #625c69;
    --soft: #766f79;
    --minor: #756683;
    --accent: #655071;
    --accent-hover: #503b5d;
    --accent-soft: #eee7f1;
    --accent-palest: #f7f1f8;
    --negative: #893f55;
    --sidebar: #23212d;
    --sidebar-muted: #c1bac9;
    --sidebar-active: #3b3346;
    --radius: .72rem;
    --sidebar-width: 14rem;
    --pad: clamp(1.15rem, 3.4vw, 3.5rem);
    --measure: 78rem;
    --song-size: 18px;
    background: var(--canvas);
    color: var(--ink);
    font: 500 16px/1.5 var(--font-ui);
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 17.5rem; margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, select, input, textarea { font: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { opacity: .52; cursor: wait; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 2px solid #9875ab; outline-offset: .2rem; }
input[type='checkbox'], input[type='range'] { accent-color: var(--accent); }
input[type='checkbox'] { width: 1rem; height: 1rem; margin: 0; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h2, h3 { line-height: 1.25; }

.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); white-space: nowrap; }
.subdued { color: var(--muted); }
.app-loading, .section-loading { padding: 2rem; color: var(--muted); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .48rem;
    min-height: 2.62rem;
    padding: .51rem .85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: .52rem;
    color: var(--ink);
    font-size: .89rem;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}
.button svg { flex: none; }
.button:hover { background: #faf8f9; border-color: #cfc4ce; }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-danger { background: var(--negative); border-color: var(--negative); color: #fff; }
.button-danger:hover { background: #783448; border-color: #783448; }
.button-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.button-ghost:hover { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.button-quiet { background: var(--accent-soft); border-color: transparent; color: var(--accent-hover); }
.button-quiet:hover { background: #e6dbea; border-color: transparent; }
.icon-button { width: 2.25rem; min-height: 2.25rem; padding: 0; }

input:not([type='checkbox'], [type='range']), select, textarea {
    width: 100%;
    min-width: 0;
    min-height: 2.62rem;
    padding: .5rem .7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: .5rem;
    color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--soft); }
select {
    appearance: none;
    padding-right: 2.15rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23625c69' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - .65rem) 50%;
}
.field { display: grid; gap: .35rem; align-content: start; font-size: .92rem; font-weight: 650; }
.field input, .field select, .field textarea { font-weight: 500; }
.field-help { color: var(--muted); font-size: .85rem; font-weight: 500; }
.form-stack { display: grid; gap: 1rem; }
.form-stack > :empty { display: none; }
.inline-notice { padding: .68rem .86rem; border: 1px solid #e8cbd5; border-radius: .45rem; background: #f9eff3; color: #733243; }

.stage-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.stage-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    align-self: start;
    height: 100dvh;
    min-height: 20rem;
    padding: 1.8rem .92rem 1rem;
    background: var(--sidebar);
    color: #fff;
}
.brand-link { display: inline-flex; align-self: start; margin: 0 0 2.05rem .6rem; text-decoration: none; }
.brand { display: flex; align-items: center; gap: .68rem; font-size: 1.62rem; font-weight: 750; letter-spacing: -.055em; line-height: 1; }
.brand-mark { display: grid; width: 2.35rem; height: 2.35rem; place-items: center; border-radius: .62rem; background: #c7addc; color: #35243e; }
.sidebar-nav { display: grid; gap: .87rem; }
.sidebar-group { display: grid; gap: .27rem; }
.sidebar-group + .sidebar-group { padding-top: .9rem; border-top: 1px solid #3c3847; }
.sidebar-link { position: relative; display: flex; align-items: center; gap: .72rem; min-height: 2.69rem; padding: .55rem .7rem; border-radius: .54rem; color: var(--sidebar-muted); text-decoration: none; font-size: .93rem; font-weight: 650; }
.sidebar-link:hover { background: #302c3b; color: #fff; }
.sidebar-link[aria-current='page'] { color: #f6ecfa; background: var(--sidebar-active); }
.sidebar-link[aria-current='page']::before { position: absolute; inset: .49rem auto .49rem 0; width: .16rem; border-radius: 0 .3rem .3rem 0; background: #c7addc; content: ''; }
.sidebar-link[aria-current='page'] svg { color: #dfc8ef; }
.sidebar-footer { display: grid; gap: .9rem; margin-top: auto; padding-top: 1rem; }
.sidebar-account { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .95rem 0 0 .2rem; border-top: 1px solid #3c3847; }
.avatar { display: grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid #71617c; border-radius: 50%; background: #40354a; color: #f5e9fb; font-size: .83rem; font-weight: 750; }
.account-details { display: grid; min-width: 0; gap: .03rem; }
.account-details strong { overflow: hidden; color: #f4eff6; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.connection-state { display: flex; align-items: center; gap: .25rem; color: var(--sidebar-muted); font-size: .73rem; line-height: 1.25; }
.sidebar-account .button { color: var(--sidebar-muted); }
.sidebar-account .button:hover { background: var(--sidebar-active); color: #fff; }
.workspace { min-width: 0; }
.workspace-header { border-bottom: 1px solid var(--border); background: #fdfcfa; }
.workspace-header-inner { display: flex; align-items: center; min-height: 3.72rem; max-width: calc(var(--measure) + 2 * var(--pad)); margin-inline: auto; padding-inline: var(--pad); gap: .7rem; }
.workspace-crumb { display: flex; align-items: center; gap: .54rem; color: var(--muted); font-size: .9rem; }
.workspace-crumb strong { font-weight: 650; color: var(--ink); }
.workspace-main { max-width: calc(var(--measure) + 2 * var(--pad)); min-width: 0; margin-inline: auto; padding: clamp(1.55rem, 4vw, 3rem) var(--pad) 4rem; }
.workspace-main:focus { outline: none; }
.workspace-menu, .drawer-scrim { display: none; }
.route-page { min-width: 0; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.25rem; margin-bottom: clamp(1.5rem, 3vw, 2rem); }
.page-title-block { min-width: 0; }
.page-heading h1 { font-size: clamp(2rem, 3.4vw, 3.15rem); line-height: 1.04; letter-spacing: -.067em; overflow-wrap: anywhere; font-weight: 750; }
.page-description { margin-top: .68rem; color: var(--muted); line-height: 1.55; }
.page-actions { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: end; gap: .5rem; }
.page-kicker { margin: -.45rem 0 .55rem; }
.back-link { padding-inline: 0; min-height: 2.05rem; color: var(--muted); }
.back-link:hover { background: transparent; color: var(--ink); }
.library-toolbar { display: flex; align-items: stretch; gap: .57rem; }
.search-control { position: relative; flex: 1; min-width: 0; }
.search-control > svg { position: absolute; left: .75rem; top: .69rem; pointer-events: none; color: var(--minor); }
.search-control input { min-height: 2.73rem; padding-left: 2.55rem; }
.sort-control { position: relative; }
.sort-control > svg { position: absolute; top: .7rem; left: .64rem; pointer-events: none; color: var(--minor); }
.sort-control select { height: 100%; max-width: 12rem; padding-left: 2.05rem; font-size: .87rem; font-weight: 650; }
.filter-active { border-color: #a88ab3; background: var(--accent-soft); }
.active-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.filter-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .53rem; border: 1px solid #e1d0e5; border-radius: 1rem; background: var(--accent-palest); color: var(--accent-hover); font-size: .84rem; }
.filter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.collection-bar { display: flex; min-height: 2.4rem; align-items: center; justify-content: space-between; gap: .6rem; margin: 1.2rem 0 .38rem; }
.collection-count { margin-right: auto; color: var(--muted); font-size: .9rem; font-weight: 650; }
.collection-bar .button { min-height: 2rem; }
.collection-export { flex-shrink: 0; }
.selection-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.table-content { min-width: 0; }
.table-frame { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.song-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; text-align: left; }
.song-table th { padding: .55rem .58rem; border-bottom: 1px solid var(--border); color: var(--muted); background: #f5f3f1; font-size: .83rem; font-weight: 650; }
.song-table th:first-child { border-top-left-radius: var(--radius); }
.song-table th:last-child { border-top-right-radius: var(--radius); }
.song-table th .button { flex-direction: row-reverse; gap: .32rem; min-height: 1.65rem; padding: .13rem .25rem; margin-left: -.26rem; font-size: inherit; color: inherit; }
.song-table th .button svg { width: .78rem; opacity: .75; }
.song-table td { padding: .54rem .58rem; vertical-align: middle; overflow-wrap: anywhere; color: var(--muted); font-size: .92rem; }
.song-table tr:not(:last-child) td { border-bottom: 1px solid var(--line); }
.song-table tr:hover td { background: #fcfafc; }
.song-table tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
.song-table tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }
.song-table .check-cell { width: 2.77rem; text-align: center; }
.song-table .number-cell { width: 3.5rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.song-table td.number-cell { font-size: .83rem; }
.song-table .artist-cell { width: 24%; }
.song-table .key-cell { width: 4.5rem; }
.song-table .date-cell { width: clamp(6.4rem, 12vw, 9rem); }
.song-table .quick-cell { width: 5.1rem; padding-right: .55rem; }
.song-cell { display: flex; gap: .62rem; align-items: center; }
.song-glyph { display: grid; width: 2.08rem; height: 2.08rem; flex: none; place-items: center; border-radius: .48rem; background: #f0eaf1; color: #74617f; }
.song-cell-details { display: grid; min-width: 0; }
.song-link.button { display: inline; align-self: start; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; white-space: normal; font-size: .97rem; line-height: 1.28; }
.song-link:hover { text-decoration: underline; text-underline-offset: .18em; }
.mobile-song-meta { display: none; }
.key-label { display: inline-block; padding: .13rem .38rem; border: 1px solid #e5dbeb; border-radius: .35rem; background: #f4eef6; color: #5b4969; font: 650 .8rem/1.26 var(--font-mono); white-space: nowrap; }
.row-tag { display: block; overflow: hidden; margin-top: .12rem; color: var(--minor); font-size: .75rem; white-space: nowrap; text-overflow: ellipsis; }
.row-actions { display: flex; justify-content: end; }
.row-actions .icon-button { width: 2rem; min-height: 2.08rem; }
.is-favorite { color: #9a5d17; }
.is-favorite svg { fill: #f4c37d; }
.action-menu { position: relative; display: inline-grid; }
.action-menu[open] { z-index: 3; }
.action-menu[open] summary { color: var(--accent-hover); background: var(--accent-soft); }
.action-menu-popover { position: absolute; z-index: 4; top: calc(100% + .3rem); right: 0; display: grid; min-width: 12.6rem; padding: .25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 .35rem 1.3rem #281d331c; }
.menu-item { display: flex; align-items: center; gap: .57rem; padding: .51rem .63rem; border: 0; border-radius: .4rem; color: var(--ink); background: transparent; text-align: left; text-decoration: none; white-space: nowrap; font-size: .9rem; }
.menu-item:hover { background: var(--accent-palest); }
.menu-item svg { flex: none; color: var(--minor); }
.menu-item-danger, .menu-item-danger svg { color: var(--negative); }
.empty-state { display: grid; justify-items: center; gap: .65rem; padding: 3.3rem 1rem; border: 1px dashed #d8ceda; border-radius: var(--radius); text-align: center; }
.empty-state h2 { font-size: 1.3rem; }
.empty-state p { max-width: 28rem; color: var(--muted); }
.empty-glyph { display: grid; width: 3rem; height: 3rem; margin-bottom: .3rem; place-items: center; border-radius: .7rem; background: var(--accent-soft); color: var(--accent-hover); }

.sheet-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.15rem; padding: .55rem .75rem; margin-bottom: .9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sheet-tools label, .transpose-tools { display: inline-flex; align-items: center; gap: .45rem; font-size: .87rem; font-weight: 650; }
.sheet-tools input[type='range'] { width: 5.6rem; }
.transpose-stepper { display: inline-flex; align-items: center; }
.transpose-stepper .button { width: 2rem; min-height: 1.9rem; padding: 0; font-size: 1rem; }
.shift-output { min-width: 2.1rem; text-align: center; font-variant-numeric: tabular-nums; }
.song-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(11.5rem, 16rem); gap: 1rem; align-items: start; }
.music-page { min-width: 0; overflow: auto; padding: clamp(1rem, 3vw, 2.75rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sheet-heading { margin-bottom: 1.65rem; }
.sheet-heading h2 { margin-bottom: .18rem; font-size: 1.75rem; letter-spacing: -.046em; overflow-wrap: anywhere; }
.sheet-artist { color: var(--muted); }
.sheet-metadata { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .9rem; margin: .64rem 0 0; }
.sheet-metadata > div { display: flex; gap: .35rem; align-items: baseline; }
.sheet-metadata dd { margin: 0; font-weight: 650; }
.sheet-metadata dt { color: var(--muted); font-size: .84rem; }
.chord-sheet { min-width: 0; color: var(--sheet-ink, #26202e); font: 500 var(--song-size, 18px)/1.42 var(--song-family, var(--font-mono)); }
.music-page .chord-sheet, .performance-paper .chord-sheet { --sheet-chord-gap: .2em; }
.sheet-line { display: block; min-height: 1.42em; white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet-typeset-line { line-height: calc(1.42em + 1.04em * var(--cue-rows, 1) + var(--sheet-chord-gap, 0px)); }
.sheet-word { display: inline-block; min-inline-size: min(100%, var(--word-width)); max-inline-size: 100%; vertical-align: baseline; }
.sheet-anchor { position: relative; }
.sheet-cue { position: absolute; inset-inline-start: 0; inset-block-end: calc(.97em + 1.19em * var(--cue-lane) + var(--sheet-chord-gap, 0px)); white-space: nowrap; }
.sheet-chord { color: var(--sheet-accent, #695079); font-size: .86em; font-weight: 750; line-height: 1.12; }
.sheet-annotation { font-style: italic; font-weight: 600; }
.sheet-instrumental { display: flex; flex-wrap: wrap; gap: .25em .62em; align-items: baseline; }
.sheet-blank { height: .8em; }
.sheet-comment, .sheet-section { display: block; min-height: 1.4em; overflow-wrap: anywhere; }
.sheet-section { margin: .8em 0 .28em; color: var(--sheet-accent, #695079); font-weight: 750; }
.sheet-comment { color: var(--sheet-muted, #61556b); font-size: .89em; font-style: italic; }
.sheet-break { height: .35em; margin-block: .4em; border-top: 1px dashed var(--border); }
.song-metadata-card { display: grid; gap: .9rem; padding: 1.06rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.song-metadata-card h2 { font-size: 1.1rem; }
.song-properties { display: grid; gap: .6rem; margin: 0; }
.song-properties > div, .song-tags { display: grid; gap: .13rem; }
.song-properties dt, .song-tags h3 { font-size: .83rem; font-weight: 650; color: var(--muted); }
.song-properties dd { margin: 0; overflow-wrap: anywhere; }
.tag-list { display: flex; flex-wrap: wrap; gap: .33rem; }
.tag { padding: .19rem .48rem; border: 1px solid #ded1e3; border-radius: .33rem; background: var(--accent-palest); color: var(--accent-hover); font-size: .82rem; }
.duplicate-notice { padding: .5rem; border-radius: .38rem; background: #f9f0dc; color: #695321; font-size: .86rem; }

.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; }
.editor-panel, .editor-preview-panel { overflow: hidden; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.editor-panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 3rem; padding: .65rem .88rem; border-bottom: 1px solid var(--border); background: #f5f3f1; }
.editor-panel-heading h2 { font-size: .93rem; }
.code-language { font: 600 .75rem/1.22 var(--font-mono); color: var(--minor); }
.code-editor { min-width: 0; background: #fdfcfd; border-bottom: 1px solid var(--border); }
.code-editor textarea { display: block; min-height: min(55vh, 30rem); padding: .9rem; resize: vertical; border: 0; border-radius: 0; font: 500 .93rem/1.6 var(--font-mono); }
.code-editor .cm-editor { min-height: min(55vh, 30rem); font: 500 .91rem/1.55 var(--font-mono); }
.code-editor .cm-scroller { min-height: min(55vh, 30rem); max-height: 65vh; }
.code-editor .cm-focused { outline-offset: -.12rem; }
.editor-tags { padding: .84rem .9rem; }
.editor-preview { padding: 1rem; min-height: min(55vh, 30rem); max-height: 75vh; border: 0; border-radius: 0; --song-size: 16px; }
.preview-hint { color: var(--muted); padding: .6rem .03rem; }
.editor-form > :has(.inline-notice) { margin-bottom: .75rem; }

.settings-form { display: grid; gap: .8rem; max-width: 56rem; }
.settings-form > :empty { display: none; }
.settings-card { display: grid; grid-template-columns: .95fr 1fr; align-items: start; gap: 1rem 1.8rem; padding: clamp(1rem, 2vw, 1.45rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.settings-card h2 { margin-bottom: .28rem; font-size: 1.16rem; }
.settings-actions { display: flex; justify-content: end; }

.stage-dialog { width: min(31rem, calc(100vw - 1.6rem)); max-height: calc(100dvh - 2rem); padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: .78rem; color: var(--ink); background: var(--surface); box-shadow: 0 .7rem 2.8rem #1a142735; }
.stage-dialog::backdrop { background: #241b2b68; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .75rem 1rem .66rem 1.2rem; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { font-size: 1.2rem; letter-spacing: -.027em; }
.dialog-body { padding: 1.1rem 1.2rem; }
.dialog-actions { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: .55rem; padding: .7rem 1.2rem .85rem; border-top: 1px solid var(--line); }
.dialog-actions.inside-actions { padding: .7rem 0 0; }
.delete-confirmation { display: grid; gap: .65rem; overflow-wrap: anywhere; }
.delete-song-list { max-height: 8rem; margin: 0; padding-inline-start: 1.25rem; overflow: auto; }
.delete-notice:empty { display: none; }
.import-errors { margin-block: .45rem 0; padding-left: 1.15rem; font-size: .89rem; overflow-wrap: anywhere; }
.import-progress { display: block; width: 100%; margin-top: .45rem; accent-color: var(--accent); }
.import-file-list { max-height: 8rem; margin: .5rem 0 0; padding-left: 1.15rem; overflow: auto; color: var(--muted); font-size: .87rem; overflow-wrap: anywhere; }
.revision-list { display: grid; gap: .7rem; }
.revision-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding-bottom: .55rem; border-bottom: 1px solid var(--line); }
.revision-row > div { display: grid; }
.revision-row span { color: var(--muted); font-size: .87rem; }
.notices { position: fixed; z-index: 20; right: 1rem; bottom: 1rem; display: grid; gap: .4rem; max-width: min(27rem, calc(100vw - 2rem)); }
.notice { display: flex; align-items: center; gap: .5rem; padding: .4rem .48rem .4rem .68rem; border: 1px solid #d8c9df; border-radius: .55rem; color: var(--accent-hover); background: var(--surface); box-shadow: 0 .3rem 1.1rem #2518321f; }
.notice > svg { flex: none; }
.notice-error { border-color: #e4bdca; color: var(--negative); }

.login-screen { display: grid; min-height: 100dvh; padding: 2rem 1rem; place-items: center; background: radial-gradient(ellipse at 50% 0%, #eee6f2 0, transparent 50%), var(--canvas); }
.login-wrap { width: min(100%, 25rem); }
.login-wrap > .brand { justify-content: center; margin-bottom: 1.05rem; }
.login-card { padding: 1.55rem clamp(1.1rem, 5vw, 2rem) 1.85rem; border: 1px solid var(--border); border-radius: .85rem; background: var(--surface); box-shadow: 0 .7rem 2rem #281d3310; }
.login-lock { display: grid; width: 2.65rem; height: 2.65rem; margin: 0 auto .85rem; place-items: center; border-radius: .62rem; background: var(--accent-soft); color: var(--accent); }
.login-card h1 { margin-bottom: .24rem; text-align: center; font-size: 1.83rem; letter-spacing: -.05em; line-height: 1.12; }
.login-card > p { text-align: center; }
.login-form { display: grid; gap: .85rem; margin-top: 1.2rem; }
.login-form > :empty { display: none; }
.password-field { position: relative; }
.password-field input { padding-right: 2.5rem; }
.password-field .button { position: absolute; right: .23rem; top: 50%; transform: translateY(-50%); }
.login-form > .button { width: 100%; margin-top: .12rem; }
.login-language { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .4rem .7rem; margin-top: .8rem; color: var(--muted); }
.login-language select { width: auto; min-width: 7.75rem; }

@media (max-width: 64rem) {
    :root { --sidebar-width: 12rem; }
    .song-table .artist-cell { width: 22%; }
}

@media (max-width: 52rem) {
    :root { --sidebar-width: 14rem; }
    .stage-shell { display: block; }
    .stage-sidebar { position: fixed; z-index: 12; left: 0; width: min(var(--sidebar-width), 85vw); visibility: hidden; transform: translateX(-100%); }
    .drawer-open .stage-sidebar { visibility: visible; transform: translateX(0); }
    .drawer-scrim { position: fixed; z-index: 11; inset: 0; width: 100%; border: 0; background: #241b2b68; }
    .drawer-open .drawer-scrim, .workspace-menu { display: block; }
    .workspace-header-inner { min-height: 3.3rem; }
    .workspace-menu { margin-left: -.28rem; }
}

@media (max-width: 42rem) {
    .song-layout, .editor-grid { grid-template-columns: minmax(0, 1fr); }
    .song-metadata-card { grid-row: auto; }
    .page-heading { align-items: start; flex-direction: column; gap: .95rem; }
    .page-actions { justify-content: start; }
    .song-table .date-cell { display: none; }
}

@media (max-width: 34rem) {
    .workspace-main { padding-bottom: 2.1rem; }
    .library-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .library-toolbar .search-control { grid-column: 1 / -1; }
    .library-toolbar > .button { justify-self: start; }
    .sort-control { justify-self: end; }
    .song-table .artist-cell { display: none; }
    .song-table .key-cell { width: 3rem; }
    .song-table .quick-cell { width: 4rem; }
    .song-table .check-cell { width: 2rem; }
    .song-table .number-cell { width: 2.8rem; }
    .song-table td, .song-table th { padding-inline: .25rem; }
    .song-glyph { display: none; }
    .row-actions .icon-button { width: 1.8rem; }
    .mobile-song-meta { display: block; padding-top: .13rem; color: var(--muted); font-size: .81rem; line-height: 1.2; }
    .settings-card { grid-template-columns: minmax(0, 1fr); }
    .sheet-tools { column-gap: .5rem; }
    .collection-bar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: no-preference) {
    .button, .sidebar-link { transition: background-color .13s ease, color .13s ease, border-color .13s ease; }
    .drawer-open .stage-sidebar { transition: transform .17s ease; }
}

.sheet-comment-box { width: fit-content; margin-block: .35em; padding: .16em .5em; border: 1px solid currentColor; border-radius: .22em; }
.sheet-comment-highlight { width: fit-content; padding-inline: .18em; background: #fbefc8; color: #594529; }
