@charset "UTF-8";

/* Theme variables */
:root {
    /* Native controls, scrollbars and unstyled buttons follow the theme. */
    color-scheme: light;
    /* Colors - light mode */
    --bg: #fafafa;
    --bg-secondary: #f7f7f7;
    --text: #000000;
    --text-secondary: #666666;
    --border: #e0e0e0;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    /* the selection highlight of the tab editor (otf-editor/cursor.js draws it as the accent at opacity 0.14), as one colour: the chart editor's
       selected bars use it too, so a selection looks the same in both. It follows the theme because it is made from --accent. */
    --selection-wash: color-mix(in srgb, var(--accent) 14%, transparent);
    --chord: #2563eb;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --heart: #e11d48;
    /* Text that sits ON an --accent / --danger fill (incl. their -hover
       shades): white on the dark light-theme fills, near-black on the pale
       dark-theme ones. */
    --on-accent: #ffffff;
    --on-danger: #ffffff;
    /* What is selected or playing: the tab's sounding note, a dragged phrase,
       the play caret, the editors' cursor box and chosen chord, the chart
       editor's cell. Its own cyan, apart from --accent, because the chords
       are --accent blue and a blue wash behind a blue chord disappeared.
       Light: the brightest cyan still 3:1 on --bg, so outlines and carets
       show; dark: neon. --on-highlight is text on a solid --highlight fill. */
    --highlight: #0099dd;
    --on-highlight: #000000;
    /* Aliases: names the stylesheet has long used without defining them. Each
       points at a real token so it follows the theme. */
    --text-primary: var(--text);
    --text-muted: var(--text-secondary);
    --text-tertiary: var(--text-secondary);
    --border-color: var(--border);
    --bg-primary: var(--bg);
    --bg-tertiary: #eeeeee;
    --bg-hover: #eeeeee;
    --surface: var(--bg-secondary);
    --accent-color: var(--accent);
    --primary: var(--accent);
    --primary-dark: var(--accent-hover);
    --error: var(--danger);
    --danger-dark: var(--danger-hover);
    --radius: var(--radius-md);
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    /* Tablature ink hierarchy (three tiers, brightest first):
       fret numbers use --text, stems/beams/barlines use --tab-ink, and the
       horizontal string lines ("rulers") use --tab-rule, which must read
       clearly quieter than both so beams never melt into the staff.
       Deliberately NOT --text-secondary: that token is muted BODY text and
       is used site-wide, so the staff can't tune itself through it. */
    --tab-ink: #5a5a5a;
    --tab-rule: #8a8a8a;
    /* High Scores podium */
    --medal-gold: #b8860b;
    --medal-silver: #6b7280;
    --medal-bronze: #a1662f;

    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;

    /* Font sizes */
    --font-xs: 0.65rem;   /* tiny labels, tag voting */
    --font-sm: 0.8rem;    /* buttons, secondary UI */
    --font-base: 0.9rem;  /* body text */
    --font-md: 1rem;      /* slightly larger */
    --font-lg: 1.25rem;   /* headings */

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;

    /* Legacy - keeping for existing usage */
    --btn-label-size: var(--font-sm);

    /* Chrome heights: shell.js publishes --bottomband-h and --topbar-h, the
       bands' measured heights, on <html>. */
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #000000;
    --bg-secondary: #111111;
    --text: #ffffff;
    --text-secondary: #999999;
    --border: #333333;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --chord: #60a5fa;
    --danger: #f87171;
    --danger-hover: #fca5a5;
    --success: #4ade80;
    --heart: #fb7185;
    --on-accent: #0a0a0a;
    --on-danger: #0a0a0a;
    --highlight: #00e5ff;
    --on-highlight: #000000;
    --bg-tertiary: #1c1c1c;
    --bg-hover: #1c1c1c;
    /* Bars/stems/beams read just below the white fret numbers (14.2:1 on
       black); the string rulers sit a full step quieter at 6.1:1 — the same
       grey that serves as the light theme's ruler, where it reads 3.3:1
       against #fafafa. */
    --tab-ink: #d4d4d4;
    --tab-rule: #8a8a8a;
    --medal-gold: #fbbf24;
    --medal-silver: #cbd5e1;
    --medal-bronze: #d68a52;
}

/* Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.2s, color 0.2s;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* Song view and editor use available width with comfortable margins */
.container:has(.song-view:not(.hidden)),
.container:has(.editor-panel:not(.hidden)) {
    max-width: min(100% - 4rem, 1800px);
}

/* Header */
/* Homepage hero (the old global header, now landing-page-only) */
.landing-hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.site-logo {
    margin-bottom: 0.5rem;
}

/* The banner is wide filigree art; the plaque bg dissolves into the page */
.site-logo img {
    max-width: 560px;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* The BB plaque is cream-on-dark; flip it in light mode so it reads as
   dark-on-cream and matches the theme */
:root:not([data-theme="dark"]) .site-logo img,
:root:not([data-theme="dark"]) .topbar-brand img:not(.brand-dungeon-face) {
    filter: invert(1);
}

/* Dark theme: invert the logo */


.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.visitor-stats {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* Icon buttons */
.icon-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: background 0.2s, border-color 0.2s;
}

.icon-btn .btn-label {
    font-size: var(--btn-label-size);
    font-weight: 500;
}

.icon-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

/* Highlight pulse animation for directing attention */
.highlight-pulse {
    animation: pulse-highlight 0.6s ease-in-out infinite;
    box-shadow: 0 0 0 3px var(--accent);
}

@keyframes pulse-highlight {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Theme toggle - show sun in dark mode, moon in light mode */
.icon-sun { display: none; }
.icon-moon { display: inline; }
[data-theme="dark"] .icon-sun { display: inline; }
[data-theme="dark"] .icon-moon { display: none; }

/* Favorites count badge */
.favorites-count {
    font-size: 0.75rem;
    background: var(--accent);
    color: var(--bg);
    border-radius: 10px;
    padding: 0.1rem 0.4rem;
    min-width: 1.2rem;
    text-align: center;
}

/* Favorite button states */
.favorite-btn .heart-full { display: none; color: var(--heart); }
.favorite-btn .heart-empty { display: inline; }
.favorite-btn.is-favorite .heart-full { display: inline; }
.favorite-btn.is-favorite .heart-empty { display: none; }

/* Search */
.search-container {
    position: relative;   /* the type-ahead hangs off it */
    margin-bottom: 1.5rem;
}

/* Type-ahead (G43j, search-typeahead.js). It sits where it would fall in the
   flow — under the whole search header — and is out of the flow, so opening
   it moves nothing and every control above it stays pressable. Same surface,
   border and shadow as the search tips; z-index 100 like them and the Tags
   menu (only one is ever open), above the results and below the top bar and
   sheets. */
.typeahead {
    position: absolute;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    z-index: 100;
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


.ta-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    /* Reserved always, so the active row's bar shifts nothing */
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
}

/* The active row has a bar as well as a fill, so it does not rest on colour */
.ta-row.active {
    background: var(--bg-hover);
    border-left-color: var(--accent);
}

.ta-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ta-hit {
    font-weight: 700;
}

.ta-detail {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* The syntax the row writes: the search tips' code style, inline */
.ta-syntax {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: var(--bg);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--accent);
}

@media (max-width: 600px) {
    /* Two lines on a phone: the name, then what it writes and how much is
       behind it. Side by side, the title and the writer were both ellipsised
       to nothing useful, and `artist:Bill Monroe` is half the width again. */
    .ta-row {
        min-height: 44px;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 0.15rem;
    }

    .ta-label {
        flex: 1 0 100%;
        order: 1;
    }

    .ta-syntax {
        order: 2;
    }

    .ta-detail {
        flex: 1 1 auto;
        order: 3;
    }
}

/* G54: the chip bar. The bar carries the box's border and focus ring; a
   collection's chip sits in it before the text (tags.js initSearchChips). */
.search-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.5rem 0 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
[data-theme="dark"] .search-bar:focus-within {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}
.search-chips { display: contents; }
.search-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.5rem;
    padding: 0.2rem 0.3rem 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent, #fff);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.search-chip + .search-chip { margin-left: 0; }
.search-chip button {
    border: 0;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
    font-size: 0.75rem;
    line-height: 1.25rem;
    cursor: pointer;
}
.search-chip.dungeon { background: #7f1d1d; color: #fecaca; }

#search-input {
    flex: 1;
    min-width: 7rem;
    width: auto;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 0;
    background: transparent;
    color: var(--text);
    outline: none;
}

#search-input::placeholder {
    color: var(--text-secondary);
}

.search-help {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    position: relative;
}

.search-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.search-hint:hover {
    color: var(--accent);
    background: var(--border);
}

/* Search tips button and dropdown */
.search-tips-btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.search-tips-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.search-tips-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    z-index: 100;
    min-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-tips-content {
    padding: var(--space-md);
}

.search-tips-header {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border);
}

.search-tips-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: var(--space-sm) 0 var(--space-xs) 0;
}

.search-tips-content p:first-of-type {
    margin-top: 0;
}

.search-tips-content code {
    display: block;
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: var(--bg);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.2rem;
    color: var(--accent);
}

/* Tag dropdown */
.tag-dropdown {
    position: relative;
    display: inline-block;
}

.tag-dropdown-btn {
    font-size: 0.75rem;
    color: var(--text);
    background: var(--bg-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.tag-dropdown-btn:hover { border-color: var(--accent); }
/* On, and saying how many — the Instrument pill does the same */
.tag-dropdown-btn.facet-active {
    color: var(--accent);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.tag-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 180px;
    max-height: min(60vh, 24rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .tag-dropdown-content {
    background: rgba(30, 30, 30, 0.95);
}

.tag-dropdown-content.show {
    display: block;
}

.tag-group {
    margin-bottom: 0.5rem;
}

.tag-group:last-child {
    margin-bottom: 0;
}

.tag-group-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid var(--border);
}

.tag-dropdown-content label {
    display: block;
    font-size: 0.8rem;
    padding: 0.2rem 0;
    cursor: pointer;
    color: var(--text-primary);
}

.tag-dropdown-content label:hover {
    color: var(--accent);
}

.tag-dropdown-content input[type="checkbox"] {
    margin-right: 0.4rem;
}

.search-stats-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.search-stats {
    color: var(--text-secondary);
    font-size: 0.875rem;
    flex: 1;
}

/* "N more in the Dungeon →" on the stats line (G54, search-core.js
   showDungeonMore): a quiet link in the Dungeon's red. */
.dungeon-more {
    margin-left: auto;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 0.85rem;
    color: #b91c1c;
    cursor: pointer;
}
[data-theme="dark"] .dungeon-more { color: #f87171; }
.dungeon-more.hidden { display: none; }
.tag-dropdown-content label.tag-nested { padding-left: 1.6rem; font-size: 0.85rem; }
.tag-dropdown-content .include-dungeon { color: #b91c1c; }
.tag-dropdown-content label { white-space: nowrap; }
/* On a phone the Collection button sits near the right edge: open leftward. */
@media (max-width: 760px) {
    .tag-dropdown-content { left: auto; right: 0; }
}
[data-theme="dark"] .tag-dropdown-content .include-dungeon { color: #f87171; }

/* "Include the dungeon" (search scope preference). Not offered inside the
   dungeon (already archive-only) or on a list (lists aren't searches). */
.include-dungeon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
    cursor: pointer;
}

body.dungeon-mode .include-dungeon {
    display: none;
}

/* An archived song in canon-scope results (search with the dungeon
   included, or a list) */
.dungeon-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: rgba(185, 28, 28, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.3);
    margin-left: 0.4rem;
    vertical-align: middle;
}

.list-action-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.list-action-btn:hover {
    background: var(--bg);
    border-color: var(--accent);
}

.list-action-btn.danger {
    color: #e74c3c;
    border-color: #e74c3c;
}

.list-action-btn.danger:hover {
    background: #e74c3c;
    color: white;
}

.list-action-btn.primary {
    color: var(--accent);
    border-color: var(--accent);
    font-weight: 500;
}

.list-action-btn.primary:hover {
    background: var(--accent);
    color: var(--on-accent);
}

/* List ownership badges */
.list-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
    vertical-align: middle;
}

.list-badge-owner {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.list-badge-following {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.list-badge-orphaned {
    background: rgba(230, 126, 34, 0.15);
    color: #e67e22;
    border: 1px solid rgba(230, 126, 34, 0.3);
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.list-badge-shared {
    background: rgba(155, 89, 182, 0.15);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.shared-list-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Results list */
.results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-item {
    position: relative;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, border-color 0.2s;
}

.result-item:hover {
    border-color: var(--accent);
    transform: translateX(2px);
}

.result-item.is-favorite {
    border-left: 3px solid var(--heart);
}

/* Drag and drop for list reordering */
.result-item[draggable="true"] {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 0.25rem 0;
    user-select: none;
    opacity: 0.5;
    transition: opacity 0.2s;
}

/* Hover styles only for a pointer that can hover: a tap leaves :hover stuck on the row (G55 D4) */
@media (hover: hover) {
    .result-item:hover .drag-handle {
        opacity: 1;
    }
}

.result-item.dragging {
    opacity: 0.4;
    background: var(--bg);
    border-style: dashed;
    transform: scale(0.98);
}

/* Drop indicator for drag reordering */
.result-item.drag-over-above::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent);
}

.result-item.drag-over-below::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent);
}

.result-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.result-writer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

/* G54: the song's genre under its title (search-core.js songChrome); a
   Dungeon song searched from the book says Dungeon, in the Dungeon's red. */
.result-genre {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}
.result-genre.dungeon { color: #b91c1c; font-weight: 600; }
[data-theme="dark"] .result-genre.dungeon { color: #f87171; }

.result-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Search results as a table: a row per part (G40g, result-table.js).
   Every row is a `.result-item`, so what opens a result and what a result
   credits stay one rule -- the table only changes its shape. The card row
   below is still what a list and favorites draw, hence the resets here. */
.result-table {
    width: 100%;
    border-collapse: collapse;
    /* Fixed, so the columns line up down the page instead of being dealt out
       by whichever description happens to be longest. */
    table-layout: fixed;
    font-size: 0.85rem;
}
.result-table thead th {
    text-align: left;
    padding: 0.35rem 0.6rem 0.35rem 0;
    border-bottom: 1px solid var(--text);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
}
.result-table tr.rt-row {
    /* .result-item is a flex card elsewhere; in the table it is a row. */
    display: table-row;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    transform: none;
}
.result-table tr.rt-row:hover { background: var(--bg-secondary); border-color: transparent; }
.result-table tbody th, .result-table tbody td {
    padding: 0.45rem 0.6rem 0.45rem 0;
    border-bottom: 1px solid var(--border);
    vertical-align: baseline;
    text-align: left;
    font-weight: 400;
}
/* A song's rows read as one block: the rule falls under the last of them. */
.result-table tbody th, .result-table tbody td { border-bottom: 0; }
.result-table tbody tr.rt-last > * { border-bottom: 1px solid var(--border); }

/* The song, spanning its parts */
.result-table th.rt-song { width: 24%; padding-right: 1rem; }
/* One of the reader's own, marked where the song is named rather than on
   every one of its rows. */
.result-table tr.is-favorite > th.rt-song {
    border-left: 3px solid var(--heart);
    padding-left: 0.4rem;
}
.result-table .rt-song .result-title { font-size: 0.95rem; font-weight: 600; margin: 0; }
.result-table .rt-song .result-writer,
.result-table .rt-song .result-covering { font-size: 0.72rem; margin: 0.1rem 0 0; }

/* The part: the one thing in the row that looks pressable, because pressing
   it is what opens that part (Mike, 2026-11-06: "I thought we'd have
   clickable links here to each part"). */
/* Wide enough for the longest kind name, "Lyrics & Chords", which is also
   the commonest: a part that overflows its column reads as if it belonged to
   the Who beside it. */
.result-table .rt-part { width: 17%; }
.result-table .rt-pick {
    padding: 0; background: none; border: 0; font: inherit; font-weight: 600;
    color: var(--accent); text-align: left; cursor: pointer; white-space: nowrap;
}
.result-table .rt-pick:hover, .result-table .rt-pick:focus-visible {
    text-decoration: underline; text-underline-offset: 2px;
}
.result-table tr.lit .rt-pick { font-weight: 700; }
/* What the tab says about how it is played, and only ever what it says. */
.result-table .rt-style {
    font-size: 0.68rem; color: var(--text-secondary); white-space: nowrap;
    border: 1px solid var(--border); border-radius: 999px; padding: 0 0.4rem;
}
.result-table .rt-who { width: 14%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-table .rt-none { color: var(--text-secondary); }
.result-table .rt-pin { color: var(--warning, #d97706); }

/* What this version is: what somebody said, then what its file says, then
   the line that matched. The description is true whatever you searched; the
   matched line changes with every query, so the lasting fact goes first. */
.result-table .rt-desc { color: var(--text-secondary); }
.result-table .rt-said { color: var(--text); }
.result-table .rt-hit { color: var(--text-secondary); font-style: italic; quotes: '\201C' '\201D'; }
/* The card's preview is one nowrap line with an ellipsis; in a cell it is
   ordinary text that wraps, and match-line.js has already cut it to length. */
.result-table .rt-desc .result-preview {
    display: inline; font-size: inherit; white-space: normal; overflow: visible;
}
/* The compact view's lines (G54) live in the song cell; the table hides them. */
.result-table .rt-summary, .result-table .rt-song-hit { display: none; }
.result-table mark, .result-table .highlight {
    background: color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--text); border-radius: 3px; padding: 0 2px;
}

/* Compact (G54): one block per song, its parts in one line, a count that
   opens its branch in place. Always on a phone (search-core.js isCompact);
   the desktop's Table / Compact switch. Same markup as the table: the song
   cell carries the summary, and a part's rows show only while its branch is
   open. Mike, 2026-11-17: "Yeah, I think we have to collapse on mobile." */
.result-table.rt-compact, .rt-compact tbody, .rt-compact tr, .rt-compact th, .rt-compact td { display: block; }
.result-table.rt-compact thead { display: none; }
/* display: block must beat `.result-table tr.rt-row { display: table-row }`,
   or each row shrinks to its content and its rule stops short of the edge. */
.result-table.rt-compact tr.rt-row { display: block; padding: 0; }
.result-table.rt-compact tbody td,
.result-table.rt-compact tbody tr.rt-last > td { border-bottom: 0; padding: 0; width: auto; }
.result-table.rt-compact tbody tr.rt-last > * { border-bottom: 0; }
/* The rule goes over each song, so a shut song still has one. */
.result-table.rt-compact tr.rt-row:not(.rt-more) { border-top: 1px solid var(--border); }
.result-table.rt-compact tr.rt-row > td,
.result-table.rt-compact tr.rt-more:not(.rt-open) { display: none; }
.result-table.rt-compact tbody tr > th.rt-song {
    width: auto; border-bottom: 0;
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.75rem;
    padding: 0.55rem 0;
}
.result-table.rt-compact tr.is-favorite > th.rt-song { padding-left: 0.5rem; }
.result-table.rt-compact .rt-song .result-title { flex: 0 1 auto; min-width: 0; font-size: 1rem; }
.result-table.rt-compact .rt-song .result-writer { font-size: 0.75rem; margin: 0; }
.result-table.rt-compact .rt-song .result-genre { margin: 0 0 0 auto; font-size: 0.75rem; white-space: nowrap; }
.result-table.rt-compact .rt-song .result-covering,
.result-table.rt-compact .rt-summary,
.result-table.rt-compact .rt-song-hit { flex-basis: 100%; }
.result-table.rt-compact .rt-summary { display: block; margin-top: 0.2rem; font-size: 0.9rem; line-height: 1.6; }
.result-table.rt-compact .rt-summary .rt-none { color: var(--text-secondary); }
/* The words, when they matched (a typed search): a third line. */
.result-table.rt-compact .rt-song-hit {
    display: block; margin-top: 0.1rem; font-size: 0.82rem; color: var(--text-secondary);
    font-style: italic; quotes: '\201C' '\201D'; overflow-wrap: anywhere;
}
/* A part: the same pressable blue as the table's Part column. */
.rt-summary .rt-seg {
    padding: 0; background: none; border: 0; font: inherit; font-weight: 600;
    color: var(--accent); cursor: pointer; white-space: nowrap;
}
.rt-summary .rt-seg:hover, .rt-summary .rt-seg:focus-visible { text-decoration: underline; text-underline-offset: 2px; }
.rt-summary .rt-seg.lit { font-weight: 800; }
.rt-summary .rt-sep { color: var(--text-secondary); margin: 0 0.4rem; }
/* A count opens its branch: an outlined number, filled while it is open. */
.rt-summary .rt-n {
    display: inline-block; min-width: 1.45em; margin-left: 0.3rem; padding: 0 0.4em;
    border-radius: 999px; box-shadow: inset 0 0 0 1.5px currentColor;
    font-size: 0.78rem; line-height: 1.45; text-align: center; font-variant-numeric: tabular-nums;
}
.rt-summary .rt-branch[aria-expanded="true"] .rt-n { background: var(--accent); color: var(--on-accent, #fff); box-shadow: none; }
/* An open branch: a line per take under the song, who first. */
.result-table.rt-compact tr.rt-open { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.55rem; }
.result-table.rt-compact tr.rt-open > th.rt-song { flex-basis: 100%; }
.result-table.rt-compact tr.rt-open > td.rt-who,
.result-table.rt-compact tr.rt-open > td.rt-desc { display: block; }
.result-table.rt-compact tr.rt-open > td.rt-who {
    margin-left: 0.85rem; padding: 0.3rem 0; width: auto; font-weight: 600; color: var(--accent);
    overflow: visible; white-space: nowrap;
}
.result-table.rt-compact tr.rt-open > td.rt-desc { flex: 1 1 12rem; min-width: 0; font-size: 0.82rem; padding: 0.3rem 0; }
.result-table.rt-compact tr.rt-open.rt-part-end { padding-bottom: 0.45rem; }
.result-table.rt-compact tr.rt-open > td.rt-desc .result-preview,
.result-table.rt-compact tr.rt-open > td.rt-desc .rt-hit { display: none; }
/* After an A–Z jump each letter heads its songs. */
.result-table.rt-compact tr.rt-letter-row { display: block; }
.result-table.rt-compact tr.rt-letter-row > th {
    display: block; padding: 0.7rem 0 0.15rem; border: 0; text-align: left;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; color: var(--text-secondary);
}
@media (max-width: 40rem) {
    /* Mike, 2026-11-17: no writer on a phone, unless an artist: search matched
       (that is the covering line, which stays). */
    .result-table.rt-compact .rt-song .result-writer { display: none; }
}

/* The A–Z strip (G54): beside the list from its first song, then held under
   the top band (and a phone's stuck controls) while the list scrolls. First
   in #results, a column flexbox, and as tall as its own negative margin, so it
   takes no room above the table. */
.rt-az {
    /* --az-h and --az-row are set by search-core.js fitStrip: the height left on
       screen below the strip's top (the toolbar of a phone's browser swings),
       shared by its buttons. The fallback is the stuck height. */
    --az-top: calc(var(--topbar-h, 48px) + var(--controls-h, 0px) + 6px);
    --az-h: min(40rem, calc(100dvh - var(--az-top) - var(--bottomband-h, 0px) - 8px));
    position: sticky; top: var(--az-top); z-index: 20; align-self: flex-end;
    height: var(--az-h); margin-bottom: calc(-1 * var(--az-h) - 0.5rem);
    display: flex; flex-direction: column; justify-content: space-between; align-items: center;
    width: 1.6rem; padding: 0.15rem 0; touch-action: none; user-select: none; -webkit-user-select: none;
}
.results:has(> .rt-az) > .result-table { padding-right: 1.9rem; }
.rt-az button {
    flex: 1 1 0; min-height: 0; max-height: 1.6rem; width: 1.45rem; display: flex; align-items: center; justify-content: center;
    padding: 0; border: 0; border-radius: 999px; background: none;
    font: inherit; font-size: min(0.68rem, calc(var(--az-row, 20px) * 0.75)); line-height: 1;
    font-weight: 700; color: var(--accent); cursor: pointer;
}
.rt-az button.rt-az-top { font-size: min(0.56rem, calc(var(--az-row, 20px) * 0.6)); letter-spacing: 0.02em; text-transform: uppercase; }
.rt-az button[aria-current="true"] { background: var(--accent); color: var(--on-accent, #fff); max-height: min(1.45rem, var(--az-row, 1.45rem)); }
/* Too short for every letter: every other one shows (dragging still reaches
   the rest), and the one in force always does. */
.rt-az.rt-az-sparse button:nth-child(2n+4):not(:last-child):not([aria-current="true"]) { display: none; }
/* The Dungeon's strip is bloody (Mike, 2026-11-17: "Dungeon gets a bloody
   a-z"): Creepster in the Dungeon's red on its cellar black, bleeding from
   the top, and the letter you are on is a drop of blood that drips. */
body.dungeon-mode .rt-az {
    width: 1.75rem; border-radius: 0 0 10px 10px; padding-top: 1.1rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 22'%3E%3Cpath d='M0 0h28v5c-1 0-1.5 1-1.5 3s-.5 3-1.5 3-1.5-1-1.5-3-.5-3-2-3-2 1-2 2v9c0 1.4-.8 2-1.6 2s-1.6-.6-1.6-2V7c0-1-.6-2-1.8-2S12 6 12 7v2c0 1-.6 1.6-1.4 1.6S9.2 10 9.2 9V7c0-1-.8-2-2-2s-2 1-2 2v5c0 1.2-.7 1.8-1.5 1.8S2.2 13.2 2.2 12V7C2.2 5.6 1 5 0 5z' fill='%238b0000'/%3E%3C/svg%3E") top / 100% auto no-repeat, #141012;
    box-shadow: inset 0 0 0 1px #5c1414;
}
body.dungeon-mode .rt-az button {
    font-family: 'Creepster', serif; font-weight: 400; font-size: min(0.95rem, calc(var(--az-row, 20px) * 0.85)); color: #e11d1d;
    text-shadow: 0 1px 0 #3f0000;
}
body.dungeon-mode .rt-az button.rt-az-top { font-size: min(0.66rem, calc(var(--az-row, 20px) * 0.6)); text-transform: none; letter-spacing: 0.03em; }
body.dungeon-mode .rt-az button[aria-current="true"] {
    position: relative; background: #b91c1c; color: #fecaca; text-shadow: none;
    border-radius: 50% 50% 50% 50% / 42% 42% 58% 58%;
}
body.dungeon-mode .rt-az button[aria-current="true"]::after {
    content: ''; position: absolute; left: 58%; top: 88%; width: 5px; height: 11px;
    background: #b91c1c; border-radius: 0 0 4px 4px / 0 0 6px 6px;
}
body.dungeon-mode .result-table.rt-compact tr.rt-letter-row > th {
    font-family: 'Creepster', serif; font-weight: 400; font-size: 1.15rem; color: #e11d1d; letter-spacing: 0.04em;
}

/* The controls stay in view on a phone (G54): the search box and the stats
   line scroll away, the row of controls sticks under the top band. The
   container gives up its box so the row can stick against the page's. */
@media (max-width: 40rem) {
    .search-container { display: contents; }
    /* The page's side padding differs by width, so the row's background reaches
       the edges with shadows, which never make the page scroll sideways. */
    .search-help {
        position: sticky; top: var(--topbar-h, 48px); z-index: 30;
        margin-top: 0.5rem; padding: 0.4rem 0; background: var(--bg);
        box-shadow: -1rem 0 0 var(--bg), 1rem 0 0 var(--bg);
    }
    .search-help.is-stuck {
        box-shadow: -1rem 0 0 var(--bg), 1rem 0 0 var(--bg),
            0 1px 0 var(--border), -1rem 1px 0 var(--border), 1rem 1px 0 var(--border);
    }
    .search-stats-row { margin-bottom: 1rem; }
    /* the type-ahead hung off the container; now it hangs off the page */
    .typeahead { left: 1rem; right: 1rem; }
}

/* Table or Compact, at the end of the stats line on a desktop (G54). */
.rt-view { display: inline-flex; margin-left: 0.75rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; flex: none; }
.rt-view:empty { display: none; }
.rt-view .rt-view-btn { padding: 0.12rem 0.6rem; border: 0; background: none; font: inherit; font-size: 0.72rem; color: var(--text-secondary); cursor: pointer; }
.rt-view .rt-view-btn[aria-pressed="true"] { background: var(--bg-secondary); color: var(--text); font-weight: 600; }
@media (max-width: 40rem) { .rt-view { display: none; } }

/* The search bar's own line has three things on it now; let them wrap rather
   than push "Include the dungeon" off a phone. */
@media (max-width: 40rem) {
    .search-stats-row { flex-wrap: wrap; }
    .search-stats { flex: 1 0 100%; }
}

/* The kind picker: which parts the table lists (All / Lyrics / Tabs / Charts),
   and the count of what it found. */
.result-kinds {
    display: inline-flex;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--border);
    overflow: hidden;
    flex: none;
}
.result-kinds .result-kind {
    padding: 0.2rem 0.65rem;
    background: none; border: 0; cursor: pointer;
    font: inherit; font-size: 0.75rem; color: var(--text-secondary);
    white-space: nowrap;
}
.result-kinds .result-kind[aria-pressed="true"] {
    background: var(--accent); color: var(--on-accent, #fff); font-weight: 600;
}
.result-parts {
    color: var(--text-secondary);
    font-size: 0.78rem;
    white-space: nowrap;
}

/* On a phone the four controls just miss one line, and `?` wrapping on its own
   wastes a whole row. Tighten them rather than drop one. */
@media (max-width: 40rem) {
    .search-help { gap: 0.35rem; }
    .search-help .result-kind { padding: 0.2rem 0.5rem; }
    .search-help .tag-dropdown-btn,
    .search-help .search-facet-pill .pill-btn { padding: 0.2rem 0.5rem; }
}
/* 25rem since G54: "Collection" is longer than the "Tags" it replaced, and at
   390 px (an iPhone 13) the ? wrapped. */
@media (max-width: 25rem) {
    .search-help { gap: 0.25rem; }
    .search-help .result-kind,
    .search-help .tag-dropdown-btn,
    .search-help .search-facet-pill .pill-btn { font-size: 0.7rem; padding: 0.2rem 0.4rem; }
}
@media (max-width: 23rem) {
    .search-help { gap: 0.2rem; }
    .search-help .result-kind,
    .search-help .tag-dropdown-btn,
    .search-help .search-facet-pill .pill-btn { padding: 0.2rem 0.3rem; }
}

/* Tag badges */
.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0.25rem 0;
}

.tag-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: opacity 0.15s;
}

.tag-badge:hover {
    opacity: 0.8;
}

/* Genre tags - blue */
.tag-genre {
    background: rgba(37, 99, 235, 0.15);
    color: #2563eb;
}
[data-theme="dark"] .tag-genre {
    background: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
}

/* Vibe tags - green */
.tag-vibe {
    background: rgba(22, 163, 74, 0.15);
    color: #16a34a;
}
[data-theme="dark"] .tag-vibe {
    background: rgba(74, 222, 128, 0.2);
    color: #86efac;
}

/* Structure tags - purple */
.tag-structure {
    background: rgba(147, 51, 234, 0.15);
    color: #9333ea;
}
[data-theme="dark"] .tag-structure {
    background: rgba(192, 132, 252, 0.2);
    color: #d8b4fe;
}

/* Instrument tags - orange (for tab/notation availability) */
.tag-instrument {
    background: rgba(234, 88, 12, 0.15);
    color: #ea580c;
}
[data-theme="dark"] .tag-instrument {
    background: rgba(251, 146, 60, 0.2);
    color: #fdba74;
}

/* Other tags - gray */
.tag-other {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Grassiness score badge - green */
.grassiness-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    cursor: help;
}
[data-theme="dark"] .grassiness-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

/* Associated-artist line: only when the search named one (F9) */
.result-covering {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Clickable artist names */
.covering-artist {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}
.covering-artist:hover {
    text-decoration-style: solid;
}

.covering-more {
    color: var(--text-tertiary);
    font-style: italic;
}

/* Song view tags row */
.song-tags-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.song-tags-row .meta-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.song-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.song-tags .no-tags {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.add-tags-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border: 1px dashed var(--border-color);
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: border-style 0.15s, color 0.15s;
}

.add-tags-btn:hover {
    border-style: solid;
    color: var(--text-primary);
}

.add-tags-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

/* Add tags form */
.add-tags-form {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.add-tags-header {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.add-tags-input-row {
    display: flex;
    gap: 0.5rem;
}

.add-tags-input-row input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.add-tags-input-row input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.add-tags-input-row button {
    padding: 0.4rem 0.8rem;
    background: var(--accent-color);
    color: var(--on-accent);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: opacity 0.15s;
}

.add-tags-input-row button:hover {
    opacity: 0.9;
}

.add-tags-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.tag-preview {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag-preview .preview-label {
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.tag-error {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Votable tags with voting controls */
.votable-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: 1px solid currentColor;
}

.votable-tag .tag-name {
    margin-right: 0;
}

/* Voting chip - compact pill with arrows and count */
.votable-tag .vote-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    background: inherit;
    border: 1px solid currentColor;
    border-radius: var(--radius-xl);
    padding: 0.1rem var(--space-xs);
    margin-left: 0.15rem;
}

.votable-tag .vote-btn {
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    padding: 0.1rem;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.votable-tag .vote-btn:hover {
    opacity: 1;
}

.votable-tag .vote-btn.voted {
    opacity: 1;
}

.votable-tag .vote-divider {
    width: 1px;
    height: 12px;
    background: currentColor;
    opacity: 0.3;
}

.hidden {
    display: none !important;
}

/* Song view */
.song-view {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
   Quick Controls Section (matches Tags section pattern)
   ========================================================================== */

/* Disclosure toggle buttons in header */
.disclosure-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}

.disclosure-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.disclosure-arrow {
    font-size: 0.7rem;
}

/* Song title row with Lists button */
.song-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Info disclosure content */
.info-content {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}

.info-content.hidden {
    display: none;
}

.info-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
}

.info-item {
    font-size: 0.9rem;
}

.info-label {
    color: var(--text-muted);
}

/* Artists list with expand */
.artists-list {
    cursor: default;
}

.artists-toggle {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: var(--accent);
    cursor: pointer;
}

.artists-toggle:hover {
    text-decoration: underline;
}

.artists-more {
    font-size: 0.8rem;
}

/* "Recorded by" names: each a YouTube search for that recording (F9); credit names (G74) look the same */
.recorded-by-link,
.credit-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.recorded-by-link:hover,
.credit-link:hover {
    color: var(--accent);
}

/* "Edited by" names open the song's History (G61b) */
.edited-by-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.edited-by-link:hover {
    color: var(--accent);
}


/* Info tags section */
.info-tags {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.info-tags-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-top: 0.15rem;
}

/* Source link at bottom */
.song-source {
    padding: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.source-label {
    color: var(--text-muted);
}


/* Control groups - segmented button style */
.qc-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    overflow: hidden;
}

/* Small square buttons for +/- */
.qc-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 0;
    background: var(--bg);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.qc-btn:hover {
    background: var(--bg-tertiary);
}

.qc-btn:active {
    transform: scale(0.95);
}

/* Divider between grouped elements */
.qc-group > *:not(:last-child) {
    border-right: 1px solid var(--border);
}

/* Label between buttons (Aa) */
.qc-label {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0 0.5rem;
    min-width: 28px;
    text-align: center;
    color: var(--text-secondary);
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

/* Key selector button (shows current key with dropdown arrow) */
.qc-key-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    height: 32px;
    border: none;
    border-radius: 0;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 55px;
    justify-content: center;
    transition: background 0.15s;
}

.qc-key-btn:hover {
    background: var(--bg-tertiary);
}


/* Checkbox items in dropdown */
.qc-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.25rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

/* Only where a pointer can hover: on a touch screen :hover sticks to whatever was last tapped, and the Options sheet opens with its last row
   (Band ▸ Guitar) under the finger that tapped the button, so that one row sat filled like a selected one (G52) */
@media (hover: hover) {
    .qc-checkbox:hover {
        background: var(--bg-secondary);
    }
}

.qc-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.qc-dropdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem;
    font-size: 0.85rem;
}

.qc-select {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

/* Toggle button (Nashville) */
.qc-toggle-btn {
    padding: 0.4rem 0.75rem;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.qc-toggle-btn:hover {
    background: var(--bg-tertiary);
}

.qc-toggle-btn.active {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}


/* Quick controls responsive */
@media (max-width: 600px) {
    .qc-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .qc-key-btn,
    .qc-toggle-btn {
        height: 28px;
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
}


/* Share Modal */
.share-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.share-modal-backdrop.hidden {
    display: none;
}

.share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
}

.share-modal.hidden {
    display: none;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.share-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.share-modal-close:hover {
    color: var(--text);
}

.share-modal-content {
    padding: 1.25rem;
}

.share-section {
    margin-bottom: 1.5rem;
}

.share-section:last-child {
    margin-bottom: 0;
}

.share-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.share-description {
    margin: 0 0 0.75rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.share-link-row {
    display: flex;
    gap: 0.5rem;
}

.share-link-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.85rem;
}

.share-copy-btn {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.share-copy-btn:hover {
    background: var(--accent-hover);
}

.share-invite-section {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.share-generate-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.share-generate-btn:hover {
    background: var(--bg);
    border-color: var(--accent);
}

.share-expiry {
    margin: 0.5rem 0 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.share-expiry.hidden {
    display: none;
}

/* Local Share Modal (for non-synced lists) */
.local-share-explanation {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
}

.local-share-explanation p {
    margin: 0;
    line-height: 1.5;
}

.local-share-actions {
    text-align: center;
}

.local-share-alternative {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.local-share-alternative .share-copy-btn {
    width: 100%;
    padding: 0.6rem 1rem;
}

.back-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    transition: background 0.2s, border-color 0.2s;
}

.back-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

/* Song content: one flat surface between the two docks, no card (G19) */
.song-content {
    padding: 1.25rem 0.25rem;
}

/* The chart a song's search-engine page (/songs/{id}/) carries in its HTML,
   built by scripts/lib/build_song_pages.py. Shown until the app boots and
   openWork() replaces it, so it borrows the song page's look. */
.prerender h1 { font-size: 1.5rem; font-weight: 600; margin: 0 0 0.5rem; }
.prerender .by,
.prerender .facts,
.prerender .rights { color: var(--text-secondary); font-size: 0.9rem; margin: 0 0 0.25rem; }
.prerender .open { display: inline-block; margin: 0.75rem 0 0.5rem; color: var(--accent); }
.prerender h2 {
    color: var(--text-secondary); font-size: 0.85rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em; margin: 1.25rem 0 0.25rem;
}
.prerender pre {
    font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.95rem;
    line-height: 1.45; white-space: pre; overflow-x: auto; margin: 0;
}
.prerender .ch { color: var(--chord); font-weight: 600; }
.prerender .note { font-style: italic; color: var(--text-secondary); margin: 0.5rem 0; }
.prerender .rights { margin-top: 1.5rem; }
.prerender .artists { color: var(--text-secondary); font-size: 0.9rem; margin: 1.5rem 0 0; }
.prerender .artists a { color: var(--text-secondary); }
.prerender .artists details { display: inline; }
.prerender .artists summary { display: inline; cursor: pointer; text-decoration: underline dotted; }
.prerender .artists details[open] summary { display: none; }
.prerender .artists details::details-content { display: inline; }

.song-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-bottom: 0;
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.header-controls {
    flex-shrink: 0;
}

/* Edit/Work link button */
.work-link-btn,
.flag-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.work-link-btn:hover,
.flag-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Unified feedback modal */
.flag-song-context {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.flag-mailto-link {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.flag-intro {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
}

.flag-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.flag-option {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.flag-option:hover {
    border-color: var(--accent);
}

.flag-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.flag-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--bg);
    box-shadow: inset 0 0 0 2px var(--accent);
}

.flag-option-label {
    font-weight: 500;
    color: var(--text);
}

.flag-option-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.flag-description-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Super-user request modal */
.superuser-modal-content {
    max-width: 500px;
}

.superuser-intro {
    margin-bottom: 1.5rem;
}

.superuser-intro p {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
}

.superuser-intro p:first-child {
    color: var(--text);
    font-size: 1.1rem;
}

.superuser-responsibilities {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.superuser-responsibilities p {
    margin: 0 0 0.75rem 0;
}

.superuser-responsibilities ul {
    margin: 0;
    padding-left: 1.25rem;
}

.superuser-responsibilities li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.superuser-reason-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.superuser-confirm-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1rem;
    cursor: pointer;
}

.superuser-confirm-label input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.superuser-confirm-label span {
    color: var(--text);
    font-size: 0.95rem;
}

/* Super-user prompt link in editor */
.superuser-prompt {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.superuser-prompt-link {
    color: var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
}

.superuser-prompt-link:hover {
    text-decoration: underline;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    font-size: 0.95rem;
    max-width: 90%;
    text-align: center;
    animation: toast-in 0.3s ease;
}

.toast.hidden {
    display: none;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Undo toast notification */
.undo-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toast-in 0.3s ease;
}

.undo-toast.hidden {
    display: none;
}

.undo-toast-message {
    flex: 1;
}

.undo-toast-btn {
    background: var(--primary);
    color: var(--on-accent);
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

.undo-toast-btn:hover {
    background: var(--primary-dark);
}

.undo-toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.undo-toast-close:hover {
    color: var(--text);
}

/* Tags section - full width below header */
.song-tags-section {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-md);
}

.song-tags-section .song-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}

/* Tags collapsed/expanded - collapsed by default on all platforms */
.tags-collapsed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    cursor: pointer;
}

.tags-collapsed:hover {
    color: var(--accent);
}

.tags-collapsed.hidden {
    display: none;
}

.tags-label {
    font-weight: 500;
    color: var(--text);
}

.tags-summary {
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tags-expand {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.tags-expanded {
    display: none;
}

.tags-expanded.expanded {
    display: block;
}

.tags-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
}

.tags-header:hover {
    color: var(--accent);
}

.tags-collapse {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.song-header-left {
    flex: 1;
    min-width: 0;
}

.song-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.song-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Header controls (all display options) */
.header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: stretch;
    justify-content: flex-end;
}

/* Hide mobile options toggle on desktop */
.mobile-options-toggle {
    display: none;
}

.header-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.header-control-label {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.header-checkboxes {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex: 1;
}

.header-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-sm);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.header-checkbox:hover {
    color: var(--text);
}

.header-checkbox input[type="checkbox"] {
    accent-color: var(--accent);
    width: 0.9rem;
    height: 0.9rem;
}

/* Display dropdown */
.display-dropdown-wrapper {
    position: relative;
}

.display-dropdown-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.75rem;
    font-size: var(--font-sm);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}

.display-dropdown-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

.display-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.display-dropdown.hidden {
    display: none;
}

.display-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    font-size: var(--font-sm);
    color: var(--text);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.display-option:hover {
    background: var(--bg-secondary);
}

.display-option input[type="checkbox"] {
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
}

.meta-item {
    margin-bottom: 0.2rem;
}

.meta-label {
    color: var(--text-secondary);
}

.meta-item a {
    color: var(--accent);
    text-decoration: none;
}

.meta-item a:hover {
    text-decoration: underline;
}

.strum-machine-link {
    margin-top: 0.5rem;
}

.strum-machine-link a {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background 0.15s, border-color 0.15s;
}

.strum-machine-link a:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    text-decoration: none;
}

.strum-machine-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 0.4rem;
}

.detected-key {
    font-weight: 600;
    color: var(--accent);
}

/* Render options fieldset */
.render-options-fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem 1rem;
    margin: 0 0 1rem 0;
    background: transparent;
}

.render-options-fieldset legend {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.render-options {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--space-md);
}

/* Control boxes with labels */
.control-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    justify-content: flex-start;
}

.control-box-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
}

.font-size-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.display-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.display-options label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.display-options label:hover {
    color: var(--text);
}

.display-options input[type="checkbox"] {
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
}

.key-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.key-select {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

.key-select:focus {
    outline: none;
    border-color: var(--accent);
}

.chord-mode-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.chord-mode-select {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

.chord-mode-select:focus {
    outline: none;
    border-color: var(--accent);
}

.compact-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.compact-toggle input {
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
}

.compact-toggle input:disabled {
    opacity: 0.5;
}

.compact-toggle:hover {
    color: var(--text);
}

/* Font size controls */
.font-size-controls {
    display: flex;
    gap: 0.25rem;
}

.font-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.font-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.font-btn:active:not(:disabled) {
    background: var(--border);
}

.font-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Song body and sections */
.song-body {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.song-body.two-column {
    column-count: 2;
    column-gap: 2rem;
    font-size: 0.85em;
}

.song-body.two-column .song-section {
    break-inside: avoid;
    overflow: hidden;
}


.song-section {
    margin-bottom: 1.5rem;
}

.section-indent {
    margin-left: 2rem;
}

.section-label {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.section-comment,
.song-comment {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.section-preformatted {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.3;
    margin: 0;
    overflow-x: auto;
    white-space: pre;
}

.section-repeat {
    color: var(--accent);
    font-style: italic;
    margin: 1rem 0;
    font-size: 0.9rem;
}

/* Song line with chords above lyrics */
.song-line {
    margin-bottom: 0.25rem;
}

.chord-line {
    color: var(--chord);
    font-weight: 600;
    white-space: pre;
    min-height: 1.2em;
}

.lyrics-line {
    white-space: pre;
}

/* Inline chord-lyrics segments: each chord wraps with its lyrics */
.cl-line {
    line-height: 1.4;
    overflow-wrap: break-word;
}

.cl-segment {
    display: inline-block;
    vertical-align: bottom;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
}
/* a chord with no word of its own right before another chord (`[A][D]Charlottesville`, `[D] [G]`): one character of air, or the
   glyphs touch ("AD"). Same rule in the book and the lead editor (renderers/chordpro.js, lead-editor/cm-editor.js). */
.cl-segment.cl-before-chord { padding-right: 1ch; }

.cl-chord {
    display: block;
    color: var(--chord);
    font-weight: 600;
    line-height: 1.3;
    min-height: 1.3em;
}

/* Chord glyphs (chords.js chordGlyphHtml): display only, the file stays ASCII */
.cg { white-space: nowrap; }
.cg sup {
    font-size: 0.66em;
    vertical-align: 0;
    position: relative;
    top: -0.55em;
    margin-left: 0.03em;
    letter-spacing: -0.01em;
    line-height: 0;
}
.cg .bass { font-size: 0.85em; }
.cg .acc { letter-spacing: -0.14em; padding-right: 0.06em; }
.cg .acc.flat { margin-left: -0.1em; }
.cg .faint { opacity: 0.35; }

/* Wrap indicator: subtle arrow when a chord-lyrics line wraps */
.cl-line.wrapped {
    position: relative;
    padding-right: 1.5em;
}

.cl-line.wrapped::after {
    content: '↩';
    position: absolute;
    top: 1.3em;
    right: 0;
    color: var(--text-secondary);
    opacity: 0.4;
    font-size: 0.8em;
    line-height: 1.3;
}

/* Legacy styles */
.chord {
    color: var(--chord);
    font-weight: 600;
}

.verse-marker {
    color: var(--text-secondary);
    font-style: italic;
    margin: 1rem 0 0.5rem 0;
    display: block;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Part content fetched on demand (data/songs/{id}.pro) */
.part-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

.part-error {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem;
}

.part-error-detail {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: 0.25rem;
}

.part-retry-btn {
    font: inherit;
    font-size: 0.85rem;
    margin-top: 0.75rem;
    padding: 0.35rem 1rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.part-retry-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Dead-link landing (unknown #song/#work slug) */
.not-found {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.not-found-suggestions {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
}

.not-found-suggestions li {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: baseline;
    padding: 0.25rem 0;
}

.not-found-open-btn {
    color: var(--accent);
    font-weight: 600;
}

.not-found-home-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--accent);
    font-weight: 600;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.modal-body textarea {
    width: 100%;
    height: 120px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.75rem;
    resize: vertical;
    outline: none;
}

.modal-body textarea:focus {
    border-color: var(--accent);
}

.modal-body input[type="text"] {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    outline: none;
}

.modal-body input[type="text"]:focus {
    border-color: var(--accent);
}

.modal-body .required {
    color: var(--accent);
}

.modal-status {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    text-align: center;
}

.modal-status.success {
    color: var(--success);
}

.modal-status.error {
    color: var(--error, #e74c3c);
}

.modal-status.hidden {
    display: none;
}

.request-intro {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.copy-btn {
    background: var(--accent);
    border: none;
    color: var(--on-accent);
    font-size: 0.9rem;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: var(--accent-hover);
}

.copy-status {
    color: var(--success);
    font-size: 0.875rem;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .container {
        padding: 0.75rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    #search-input {
        font-size: 1rem;
        padding: 0.75rem;
    }

    .result-item {
        padding: 0.75rem;
    }

    .result-title {
        font-size: 0.95rem;
    }

    .song-content {
        padding: 1rem;
    }

    .song-title {
        font-size: 1.25rem;
    }

    .song-body {
        font-size: 0.8rem;
        overflow-x: auto;
    }

    /* Disable two-column on mobile */
    .song-body.two-column {
        column-count: 1;
    }

    .section-indent {
        margin-left: 1rem;
    }

    /* Ensure touch-friendly button size on mobile */
    .font-btn {
        width: 2.75rem;
        height: 2.75rem;
    }

    .modal-content {
        max-height: 90vh;
    }


    /* Mobile song header layout */
    .song-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .song-header-left {
        width: 100%;
    }

    .header-controls {
        width: 100%;
        justify-content: flex-start;
    }

    /* Hide Chords and Layout groups on mobile - show via toggle */
    .header-control-group.mobile-hidden {
        display: none;
    }

    .header-control-group.mobile-hidden.mobile-visible {
        display: flex;
    }

    /* Mobile options toggle button */
    .mobile-options-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--bg-secondary);
        color: var(--text-secondary);
        cursor: pointer;
        font-size: 1rem;
        min-width: 2.5rem;
    }

    .mobile-options-toggle:hover {
        border-color: var(--accent);
        color: var(--text);
    }

    .mobile-options-toggle.active {
        background: var(--accent);
        color: var(--on-accent);
        border-color: var(--accent);
    }

    /* ABC controls - make fieldset collapsible on mobile */
    .render-options-fieldset legend {
        cursor: pointer;
        user-select: none;
    }

    .render-options-fieldset legend::after {
        content: ' ▼';
        font-size: 0.7em;
    }

    .render-options-fieldset.collapsed legend::after {
        content: ' ▶';
    }

    .render-options-fieldset.collapsed .render-options {
        display: none;
    }
}

/* Highlight for search matches */
mark {
    background: rgba(37, 99, 235, 0.2);
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

[data-theme="dark"] mark {
    background: rgba(96, 165, 250, 0.3);
}



/* Editor panel */
.editor-panel {
    margin-top: 1rem;
}

.editor-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.editor-notice {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* My Book autosave state (G66): Saved / Saving… quiet, Offline / Not saved in the danger colour */
.editor-save-state[data-state="offline"],
.editor-save-state[data-state="failed"] {
    color: var(--danger);
    font-style: normal;
    font-weight: 600;
}

.editor-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    min-height: 500px;
}

@media (min-width: 1000px) {
    .editor-main {
        min-height: 600px;
        gap: 2rem;
    }
}

@media (min-width: 1400px) {
    .editor-main {
        min-height: 700px;
    }
}

.editor-input {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metadata-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-row label {
    min-width: 50px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.field-row input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
}

.field-row input:focus {
    outline: none;
    border-color: var(--accent);
}

.song-input-container {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.editor-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* Compact pane titles: "Raw" over the textarea (inside the existing
   header row with the make-verse mini-bar) and "Visual editor" over the
   preview. Muted small caps so they read as labels, not content. */
.editor-pane-title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* One shared note for both panes: the two views are the same document */
.editor-sync-note {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    font-style: italic;
    color: var(--text-secondary);
}

/* make-verse/chorus mini-bar: lives in the ChordPro pane header (a fixed
   spot, no layout shift under a drag-selection) and appears only while the
   textarea has a selection */
.editor-selection-toolbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-left: auto;
    margin-right: 0.75rem;
}
.editor-selection-toolbar.hidden { display: none; }
.est-btn {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 6px);
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
    min-height: 28px;
    cursor: pointer;
}
.est-btn:hover { border-color: var(--accent); color: var(--accent); }

.auto-detect-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.auto-detect-label input {
    cursor: pointer;
}

.song-input-container label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

#editor-content {
    flex: 1;
    min-height: 300px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    resize: none;
}

#editor-content:focus {
    outline: none;
    border-color: var(--accent);
}

#editor-content::placeholder {
    color: var(--text-secondary);
}

.format-help {
    font-size: 0.85rem;
}

.format-help summary {
    cursor: pointer;
    color: var(--accent);
}

.format-help ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
    color: var(--text-secondary);
}

.format-help li {
    margin: 0.25rem 0;
}

.format-help code {
    background: var(--bg-secondary);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.editor-help-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.hints-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--accent);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.hints-btn:hover {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

/* ChordPro Hints Panel */
.hints-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.hints-panel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1001;
}

.hints-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.hints-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
}

.hints-close:hover {
    color: var(--text);
}

.hints-content {
    padding: 0.75rem 1rem;
}

.hint-section {
    margin-bottom: 1rem;
}

.hint-section:last-child {
    margin-bottom: 0;
}

.hint-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.hint-code {
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    margin: 0;
    overflow-x: auto;
    white-space: pre;
}

.hint-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.25rem;
}

/* Hints panel - narrow screens (overlay) */
@media (max-width: 1199px) {
    .hints-panel:not(.hidden) {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

/* Hints panel - wide screens (docked right) */
@media (min-width: 1200px) {
    .hints-panel:not(.hidden) {
        position: fixed;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .hints-backdrop {
        display: none !important;
    }
}

.editor-summary {
    flex: 1 1 14rem;
    min-width: 0;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;   /* a phone can't fit three buttons + the fork notice on one row */
    gap: 0.75rem;
    align-items: center;
}

.action-btn {
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--accent);
}

.action-btn.primary {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

.action-btn.primary:hover {
    background: var(--accent-hover);
}

.action-btn.delete-btn {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.action-btn.delete-btn:hover {
    background: #c82333;
    border-color: #bd2130;
}

.save-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.save-status.success {
    color: var(--success);
}

.save-status.error {
    color: var(--danger);
}

/* G88: "Submit without the chart" after a refused chart's message */
.save-status .save-status-action { margin-left: 0.5rem; padding: 0.3rem 0.75rem; font-size: inherit; color: var(--text); }

/* Dedup offramp — "this looks like a song we already have" (phase 3b) */
.dedup-offramp-content {
    max-width: 460px;
}

.dedup-offramp-lead {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.dedup-offramp-choices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dedup-offramp-choice {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: left;
    width: 100%;
    background: var(--bg-secondary, transparent);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.dedup-offramp-choice:hover,
.dedup-offramp-choice:focus-visible {
    border-color: var(--accent);
}

.dedup-offramp-choice-primary {
    border-color: var(--accent);
}

.dedup-offramp-choice-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.dedup-offramp-choice-detail {
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--text-secondary);
}

/* Editor preview */
.editor-preview {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.preview-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.preview-option {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Editor transpose controls */
.editor-transpose-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.editor-transpose-controls .transpose-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.editor-transpose-controls .transpose-btn:hover {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

.editor-transpose-controls .key-display {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    min-width: 50px;
    text-align: center;
}

.editor-key-select {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.25rem;
    min-width: 50px;
    text-align: center;
    cursor: pointer;
}

.preview-content {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.preview-placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

/* Mobile editor */
@media (max-width: 800px) {
    .editor-main {
        grid-template-columns: 1fr;
    }

    .editor-preview {
        min-height: 250px;
    }
}

/* Add Song Type Picker */
.add-song-picker-content {
    max-width: 400px;
}

.picker-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.picker-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    padding: 1rem 1.25rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
}

.picker-card:hover {
    border-color: var(--accent);
    background: var(--bg);
}

.picker-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.picker-card-title {
    font-weight: 600;
    display: block;
}

.picker-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.15rem;
}

/* Request form inside picker */
.picker-request-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.picker-back-btn {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0;
    font-family: inherit;
}

.picker-back-btn:hover {
    text-decoration: underline;
}

.picker-form-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.picker-form-fields input,
.picker-form-fields select,
.picker-form-fields textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.picker-form-fields textarea {
    min-height: 60px;
    resize: vertical;
}

.picker-dedup-warning {
    padding: 0.5rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dedup-msg {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    width: 100%;
}
.dedup-match {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}
.dedup-link {
    color: var(--accent);
    font-weight: 500;
}
.dedup-artist {
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.dedup-badge {
    font-size: 0.7rem;
    background: var(--text-secondary);
    color: var(--bg);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 500;
}
.dedup-bounty-btn {
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
}
.dedup-bounty-btn:hover {
    background: var(--accent);
    color: var(--on-accent);
}
.dedup-proceed {
    margin-top: 0.4rem;
    width: 100%;
}
.dedup-proceed-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.dedup-proceed-btn:hover {
    color: var(--text);
}

.picker-form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.picker-req-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.picker-req-status.success {
    color: var(--success, #22c55e);
}

.picker-req-status.error {
    color: var(--error, #ef4444);
}

/* Tablature target step: pick the song a new tab belongs to */
.picker-tab-results {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 260px;
    overflow-y: auto;
    margin: 0.5rem 0;
}

.picker-tab-result {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.6rem;
    background: var(--bg-secondary, transparent);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.picker-tab-result:hover {
    border-color: var(--accent);
}

.picker-tab-result-artist,
.picker-tab-empty {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* The songbook failed to load — distinct from a genuine no-match */
.picker-tab-empty.picker-tab-error {
    color: var(--danger);
}

/* ── "This song already has tabs" — the early offramp panel ──
   Shared by the add-song picker's tab step and the work page's bounty
   section (docs/js/otf-editor/existing-tabs.js). */
.tab-existing-panel {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.75rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary, transparent);
}

.tab-existing-head {
    font-weight: 600;
    font-size: 0.95rem;
}

.tab-existing-sub {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.tab-existing-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 15rem;
    overflow-y: auto;
}

.tab-existing-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-existing-view,
.tab-existing-improve,
.tab-existing-add,
.tab-existing-back {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.tab-existing-view {
    flex: 1;
    text-align: left;
}

.tab-existing-view:hover,
.tab-existing-improve:hover,
.tab-existing-add:hover,
.tab-existing-back:hover {
    border-color: var(--accent);
}

.tab-existing-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-existing-add {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
}

/* Bounty CTA button reset (was <a>, now <button>) */
.bounty-cta-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

/* Empty results button reset (was <a>, now <button>) */
.empty-results-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

/* Source view (side-by-side ChordPro and rendered) */
/* ============================================
   AUTH STYLES
   ============================================ */

.auth-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-btn:hover {
    background: var(--accent-hover);
}

.auth-icon {
    font-size: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.user-info:hover {
    background: var(--bg-secondary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.user-name {
    font-size: 0.875rem;
    color: var(--text);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Account Modal */
.account-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    object-fit: cover;
}

.account-details {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-weight: 600;
    font-size: 1rem;
}

.account-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.875rem;
}

.sync-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.sync-indicator.synced {
    background: var(--success);
}

.sync-indicator.syncing {
    background: var(--accent);
    animation: pulse 1s infinite;
}

.sync-indicator.error {
    background: var(--danger);
}

.sync-indicator.offline {
    background: var(--text-secondary);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.action-btn.danger {
    background: var(--danger);
    color: var(--on-danger);
    border-color: var(--danger);
}

.action-btn.danger:hover {
    background: var(--danger-hover);
}

/* Mobile: hide auth text, show only icon */
@media (max-width: 600px) {
    .auth-btn .auth-text {
        display: none;
    }

    .auth-btn {
        padding: 0.5rem;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .user-name {
        display: none;
    }
}

/* ============================================
   AUTH MODAL STYLES
   ============================================ */

.auth-modal-content {
    max-width: 400px;
}

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.auth-google-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .auth-google-btn {
    background: #2d2d2d;
    color: #e8eaed;
    border-color: #5f6368;
}

[data-theme="dark"] .auth-google-btn:hover {
    background: #3c3c3c;
}

.auth-google-icon {
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-email-toggle {
    display: block;
    width: 100%;
    padding: 0;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.875rem;
    cursor: pointer;
    text-align: center;
}

.auth-email-toggle:hover {
    text-decoration: underline;
}

.auth-email-toggle.hidden {
    display: none;
}

.auth-email-form {
    margin-top: 1rem;
}

.auth-email-form.hidden {
    display: none;
}

.auth-field {
    margin-bottom: 0.75rem;
}

.auth-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.auth-field input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9375rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.auth-error {
    padding: 0.625rem 0.75rem;
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
    border-radius: 6px;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
}

.auth-error.hidden {
    display: none;
}

.auth-success {
    padding: 0.625rem 0.75rem;
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
    border-radius: 6px;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
}

.auth-success.hidden {
    display: none;
}

.auth-submit-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 0.5rem;
}

.auth-submit-btn:hover {
    background: var(--accent-hover);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-link-btn {
    display: inline;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
}

.auth-link-btn:hover {
    text-decoration: underline;
}

.auth-toggle-row {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.auth-toggle-row .auth-link-btn {
    margin-left: 0.25rem;
    font-weight: 500;
}

.reset-step p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Initials avatar (for email users without Google avatar) */
.user-avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.user-avatar-initials.hidden {
    display: none;
}

.account-avatar-initials {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.account-avatar-initials.hidden {
    display: none;
}

/* Toast notification */
.auth-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    background: var(--success);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.auth-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Something worked, but not all the way (e.g. saved live, sync still pending) */
.auth-toast.warning {
    background: var(--danger);
    color: var(--on-danger);
}

/* A toast with a sentence in it (a refused chart, G56): as wide as its words, within the screen, rather than half of it */
.auth-toast.auth-toast-fit { width: max-content; max-width: calc(100vw - 2rem); }
/* ...and its "Submit without the chart" (G88) takes taps, which a plain toast lets through */
.auth-toast.auth-toast-fit:has(.auth-toast-action) { display: flex; align-items: center; gap: var(--space-md); pointer-events: auto; }
.auth-toast.warning .auth-toast-action { background: transparent; color: inherit; border: 1px solid currentColor; }

/* A notice (toast.js, duration 0): stays until acted on, so it takes taps, wears
   the calm look of the news banner, and stands above the bottom band (shell.js
   publishes --bottomband-h) and the lyrics editor's docked chord picker
   (--chm-picker-h, unset when it is closed). Nothing of the tab editor's is
   under it: its toolbar is in the top bar and its player is the band. */
.auth-toast.auth-toast-notice {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    bottom: calc(var(--bottomband-h, 0px) + var(--chm-picker-h, 0px) + 1rem);
    width: max-content;   /* left: 50% would otherwise offer it only half the screen */
    max-width: calc(100vw - 2rem);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: inset 3px 0 0 var(--accent), 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}
.auth-toast-text { flex: 1; min-width: 0; }
.auth-toast-action {
    flex-shrink: 0;
    background: var(--primary);
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font: inherit;
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
}
.auth-toast-action:hover { background: var(--primary-dark); }
.auth-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-lg);
    line-height: 1;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem -0.25rem 0;
    cursor: pointer;
}
.auth-toast-close:hover { color: var(--text); }

/* ============================================
   LIST PICKER STYLES
   ============================================ */


.list-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.list-option:hover {
    background: var(--bg-secondary);
}

.list-option input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
}

.list-option.favorites-option {
    background: var(--bg-secondary);
}

.list-option.favorites-option .heart-icon {
    color: var(--heart);
}

.list-divider {
    height: 1px;
    background: var(--border);
}

#custom-lists-container {
    max-height: 200px;
    overflow-y: auto;
}

.create-list-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-top: 1px solid var(--border);
    color: var(--accent);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.create-list-btn:hover {
    background: var(--bg-secondary);
}

/* ============================================
   EXPORT DROPDOWN
   ============================================ */

.export-wrapper {
    position: relative;
}

.export-icon {
    font-size: 1.1rem;
}

/* Unified List Picker Popup */
.list-picker-popup {
    position: fixed;
    min-width: 200px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2100;
    overflow: hidden;
}

.list-picker-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.list-picker-option:hover {
    background: var(--bg-secondary);
}

.list-picker-option input[type="checkbox"] {
    margin: 0;
}

.list-picker-option .heart-icon {
    color: #e74c3c;
}

.list-picker-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

.list-picker-lists {
    max-height: 200px;
    overflow-y: auto;
}

.list-picker-folder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.list-picker-folder-icon {
    font-size: 0.85rem;
}

.list-picker-folder-name {
    font-weight: 500;
}

/* List preview in picker */
.list-picker-label {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.list-picker-name {
    font-weight: 500;
}

.list-picker-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-picker-new-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-top: 1px solid var(--border);
    color: var(--accent);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.list-picker-new-btn:hover {
    background: var(--bg-secondary);
}

.list-picker-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border);
}

.list-picker-input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
}

.list-picker-input:focus {
    outline: none;
    border-color: var(--accent);
}

.list-picker-add-btn {
    padding: 0.4rem 0.75rem;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.list-picker-add-btn:hover {
    opacity: 0.9;
}

/* Legacy inline form (keep for backwards compat) */
.create-list-inline {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border);
}

.create-list-inline input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
}

.create-list-inline input:focus {
    outline: none;
    border-color: var(--accent);
}

.create-list-confirm {
    padding: 0.4rem 0.75rem;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.create-list-confirm:hover {
    opacity: 0.9;
}

.export-dropdown {
    position: fixed;  /* Fixed to escape overflow:auto clipping from .song-actions */
    min-width: 180px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2100;  /* Above other overlays */
    overflow: hidden;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.export-option:hover {
    background: var(--bg-secondary);
}

.export-option-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.export-divider {
    height: 1px;
    background: var(--border);
}

.export-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem 0.25rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
}

.export-section-label:first-child {
    border-top: none;
    margin-top: 0;
}

/* ============================================
   FEEDBACK DROPDOWN
   ============================================ */

.feedback-wrapper {
    position: relative;
}

.feedback-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 220px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.feedback-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    text-decoration: none;
}

.feedback-option:hover {
    background: var(--bg-secondary);
}

.feedback-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.feedback-label {
    flex: 1;
}

.feedback-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.feedback-option.email-option {
    color: var(--accent);
}

.feedback-option.email-option:hover {
    background: var(--accent);
    color: var(--on-accent);
}

/* ============================================
   SIDEBAR LISTS STYLES
   ============================================ */

.nav-lists {
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.nav-lists:empty {
    display: none;
}

.nav-lists .nav-item {
    padding-left: 1.5rem;
    font-size: 0.95rem;
}

.nav-lists .nav-item .nav-icon {
    font-size: 1rem;
}

/* Sidebar section headers */
.nav-section-header {
    padding: 0.5rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.nav-section-header:first-child {
    margin-top: 0;
}

/* Followed list items */
.nav-item-followed {
    border-left: 2px solid #3498db;
}

.nav-item-followed .nav-icon {
    color: #3498db;
}

/* Orphaned list items (Thunderdome) */
.nav-item-orphaned {
    border-left: 2px solid #e67e22;
    background: rgba(230, 126, 34, 0.05);
}

.nav-item-orphaned .nav-icon {
    color: #e67e22;
}

/* Section header with action button */
.nav-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-section-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
}

.nav-section-action:hover {
    opacity: 1;
    color: var(--accent);
}

.nav-section-actions {
    display: flex;
    gap: 0.25rem;
}

/* Folder styles */
.nav-folder {
    display: flex;
    flex-direction: column;
}

.nav-folder-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-folder-arrow {
    font-size: 0.6rem;
    width: 1rem;
    text-align: center;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.nav-folder-content {
    display: flex;
    flex-direction: column;
}

/* Inline name input (folders, lists, etc.) */
.nav-inline-input {
    flex: 1;
    min-width: 0;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
}

.nav-inline-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.nav-inline-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.nav-item-editing {
    background: rgba(52, 152, 219, 0.1);
}

/* Context menus (folder, list) */
.folder-context-menu,
.list-context-menu {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    overflow: hidden;
    min-width: 140px;
}

.folder-context-menu button,
.list-context-menu button {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}

.folder-context-menu button:hover,
.list-context-menu button:hover {
    background: var(--bg-secondary);
}

.folder-context-menu button.danger,
.list-context-menu button.danger {
    color: #e74c3c;
}

.folder-context-menu button.danger:hover,
.list-context-menu button.danger:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Drag and drop states */
.nav-item.dragging {
    opacity: 0.5;
}

.nav-item[draggable="true"] {
    cursor: grab;
}

.nav-item[draggable="true"]:active {
    cursor: grabbing;
}

.drop-target {
    background: rgba(52, 152, 219, 0.15) !important;
    outline: 2px dashed #3498db;
    outline-offset: -2px;
}

.nav-secondary {
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.nav-secondary:hover {
    color: var(--text);
}

/* ============================================
   MANAGE LISTS MODAL STYLES
   ============================================ */

.create-list-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.create-list-form input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
}

.create-list-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.lists-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.list-item-icon {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.list-item-name {
    flex: 1;
    font-size: 0.95rem;
}

.list-item-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.list-item-actions {
    display: flex;
    gap: 0.25rem;
}

.list-item-btn {
    padding: 0.375rem 0.5rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.list-item-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.list-item-btn.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.lists-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

/* ============================================
   RESULT LIST PICKER STYLES
   ============================================ */

.result-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-main {
    flex: 1;
    min-width: 0;
}

.result-list-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.result-list-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-secondary);
}

.result-list-btn.has-lists {
    color: var(--accent);
    border-color: var(--accent);
}

/* Multi-select button in result items - circular style matching other buttons */
.result-select-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-right: 0.25rem;
    opacity: 0;
    pointer-events: none;
}

@media (hover: hover) {
    .result-item:hover .result-select-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

.result-select-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-secondary);
}

.result-select-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    opacity: 1;
    pointer-events: auto;
}

/* On touch devices, always show select button */
@media (hover: none) {
    .result-select-btn {
        opacity: 0.7;
        pointer-events: auto;
    }
}

/* Selected state for result items */
.result-item.selected {
    background: var(--accent);
    background: color-mix(in srgb, var(--accent) 15%, var(--bg));
    border-left: 3px solid var(--accent);
    padding-left: calc(0.75rem - 3px);
}

/* Batch operations bar - fixed at bottom */
/* Hidden by its own height, not a fixed offset: on a phone it wraps taller than
   80px and "1 selected" peeked at the foot of every page (G55 D5). visibility
   takes the hidden bar's buttons out of the tab order once it has slid away. */
.batch-operations-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    z-index: 2500;
    padding: 0.75rem 1rem;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.2s ease-out, visibility 0s linear 0.2s;
}

.batch-operations-bar.visible {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.2s ease-out, visibility 0s;
}

.batch-bar-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.batch-count {
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.batch-actions button,
.batch-actions select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.batch-actions button:hover,
.batch-actions select:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.batch-select-all {
    background: var(--accent) !important;
    color: var(--on-accent) !important;
    border-color: var(--accent) !important;
}

.batch-select-all:hover {
    background: var(--accent-hover) !important;
}

.batch-remove {
    background: var(--danger) !important;
    color: var(--on-danger) !important;
    border-color: var(--danger) !important;
}

.batch-remove:hover {
    background: var(--danger-hover) !important;
}

.batch-dropdown select {
    min-width: 120px;
}

/* Mobile adjustments for batch bar */
@media (max-width: 600px) {
    .batch-bar-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .batch-actions {
        justify-content: center;
    }
}


/* ============================================
   LIST ITEM METADATA (Setlist Notes)
   ============================================ */

/* ============================================
   NOTES BOTTOM SHEET
   ============================================ */

/* Notes sheet backdrop */
.notes-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2999;
}

.notes-sheet-backdrop.hidden {
    display: none;
}

/* Notes sheet container */
.notes-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    max-height: 60vh;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.notes-sheet.hidden {
    display: none;
}

/* Notes sheet header */
.notes-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.notes-sheet-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 0.5rem;
}

.notes-sheet-close {
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.notes-sheet-close:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

/* Notes sheet content */
.notes-sheet-content {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(60vh - 60px);
}

/* Row for key and tempo */
.notes-sheet-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Individual field container */
.notes-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.notes-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notes-field-full {
    flex: 1;
}

/* Input styles */
.notes-input {
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text);
    min-width: 80px;
}

.notes-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.notes-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Tempo input - narrower */
.notes-field:has(#notes-tempo) {
    flex: 0 0 auto;
}

#notes-tempo {
    width: 90px;
}

/* Notes textarea */
.notes-textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text);
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.notes-textarea::placeholder {
    color: var(--text-muted);
}

/* Desktop: notes sheet appears as a side panel or modal */
@media (min-width: 768px) {
    .notes-sheet {
        left: 50%;
        right: auto;
        bottom: 50%;
        transform: translate(-50%, 50%);
        width: 100%;
        max-width: 500px;
        border-radius: 16px;
        max-height: 80vh;
    }

    .notes-sheet-content {
        max-height: calc(80vh - 60px);
    }
}

/* ============================================
   VERSION BADGE & PICKER
   ============================================ */

/* Version badge in search results */
.version-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent);
    background: rgba(79, 70, 229, 0.15);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Part label badge — shown in list view for part-qualified items */
.part-label-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(100, 100, 100, 0.15);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* "Just edited" badge — a metadata edit that is live in the overlay and
   still syncing to works/. Cool where the placeholder badge is warm: this
   one reports your own successful write, not something the song is missing. */
.pending-meta-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: rgba(34, 197, 94, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(34, 197, 94, 0.35);
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* Placeholder badge — search results and song view */
.placeholder-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(245, 158, 11, 0.3);
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* Bounty badge in search results */
.bounty-result-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.25);
    margin-left: 0.3rem;
    vertical-align: middle;
    cursor: pointer;
}

/* Placeholder work view elements (used in work-view.js) */
.placeholder-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 2rem 0;
}

.placeholder-cta {
    margin-top: 2rem;
    padding: 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 8px;
    text-align: center;
}

.placeholder-cta-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.placeholder-contribute-btn {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.placeholder-contribute-btn:hover {
    background: var(--accent-hover);
}

/* Placeholder metadata editor */
.placeholder-editor {
    max-width: 500px;
    margin: 1rem auto;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.placeholder-editor-header h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    color: var(--text);
}
.placeholder-editor-sub {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.placeholder-editor-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.placeholder-editor-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.placeholder-editor-field[hidden] { display: none; }
.placeholder-editor-field label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.placeholder-editor-field input,
.placeholder-editor-field select,
.placeholder-editor-field textarea {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}
.placeholder-editor-field textarea {
    resize: vertical;
}
/* A locked field (a reader with no claim on the song, G54): shown as plain text, no box. The only boxes left on the
   form are the ones that take input (the label pills, the checkboxes, "What changed?"). */
.placeholder-editor-field input[readonly],
.placeholder-editor-field textarea[readonly],
.placeholder-editor-field select:disabled {
    border-color: transparent;
    background: transparent;
    color: var(--text);
    -webkit-text-fill-color: var(--text);   /* iOS greys a disabled select's text */
    padding-left: 0;
    padding-right: 0;
    -webkit-appearance: none;
    appearance: none;                       /* no Key arrows */
    resize: none;
    cursor: default;
    opacity: 1;
}
.placeholder-editor-field input[readonly]:focus,
.placeholder-editor-field textarea[readonly]:focus { outline: none; }
.placeholder-editor-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.placeholder-editor-save {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}
.placeholder-editor-save:hover {
    background: var(--accent-hover);
}
.placeholder-editor-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.placeholder-editor-cancel {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}
.placeholder-editor-cancel:hover {
    border-color: var(--text-secondary);
    color: var(--text);
}
.placeholder-editor-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.placeholder-editor-status.error {
    color: var(--error, #ef4444);
}

/* Work view bounty section */
.work-bounty-section {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.work-bounty-header {
    background: var(--bg-secondary);
}
.work-bounty-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}
.work-bounty-toggle:hover {
    background: var(--bg);
}
.work-bounty-flag {
    font-size: 1rem;
}
.work-bounty-body {
    padding: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}
.work-bounty-card {
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    min-width: 140px;
}
.work-bounty-label {
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
}
.work-bounty-desc {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}
.work-bounty-contribute {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
}
.work-bounty-contribute:hover {
    text-decoration: underline;
}
.work-bounty-empty {
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0.25rem 0;
}
.work-bounty-request-btn {
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    width: 100%;
}
.work-bounty-request-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
/* Inline bounty request form */
.work-bounty-inline-form {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}
.work-bounty-inline-select,
.work-bounty-inline-desc {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.8rem;
}
.work-bounty-inline-select { flex: 0 0 auto; }
.work-bounty-inline-desc { flex: 1 1 120px; }
.work-bounty-inline-actions {
    display: flex;
    gap: 0.25rem;
}
.work-bounty-inline-submit {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
}
.work-bounty-inline-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.work-bounty-inline-cancel {
    background: none;
    border: 1px solid var(--border);
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.work-bounty-inline-status {
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Bounty view */
.bounty-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}
.bounty-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.bounty-title {
    font-size: 1.75rem;
    margin: 0 0 0.25rem;
}
.bounty-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0 0 0.25rem;
}
.bounty-stats {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}
/* Filter bar */
.bounty-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}
.bounty-filter-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}
.bounty-filter-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}
.bounty-filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}
/* Sections */
.bounty-section {
    margin-bottom: 2rem;
}
.bounty-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.bounty-group-count {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.bounty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}
.bounty-card {
    display: block;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s;
}
.bounty-card:hover {
    border-color: var(--accent);
}
.bounty-card-placeholder {
    border-left: 3px solid var(--text-secondary);
}
.bounty-card-part {
    border-left: 3px solid var(--accent);
}
.bounty-card-wanted {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--accent);
    margin-bottom: 0.25rem;
}
.bounty-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}
.bounty-card-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.bounty-card-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}
.bounty-card-has {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}
.bounty-card-notes {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.bounty-filter-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin: 0.5rem 0 0;
    font-style: italic;
}
/* Trailing count of wanted entries the board filtered out because we already
   hold the song. Quieter than the hint itself — it's provenance, not a task. */
.bounty-hint-aside {
    display: block;
    margin-top: 0.2rem;
    font-style: normal;
    font-size: 0.94em;
    opacity: 0.75;
}
.bounty-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}
.bounty-empty-sub {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
.bounty-cta {
    margin-top: 2rem;
    padding: 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 8px;
    text-align: center;
}
.bounty-cta p {
    margin: 0 0 0.75rem;
    color: var(--text-secondary);
}
.bounty-cta-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.bounty-cta-btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
}
.bounty-cta-btn:hover {
    background: var(--accent-hover);
}
.bounty-cta-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.bounty-cta-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}
.bounty-cta-btn-secondary:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
}
/* Bounty request modal */
.bounty-request-content {
    max-width: 480px;
}
.bounty-req-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0 0.75rem 0;
}
.bounty-request-content label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    margin-top: 0.75rem;
}
.bounty-request-content input,
.bounty-request-content select,
.bounty-request-content textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    box-sizing: border-box;
}
.bounty-request-content textarea {
    resize: vertical;
}
.bounty-req-results {
    max-height: 240px;
    overflow-y: auto;
    margin-top: 0.5rem;
}
.bounty-req-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    border: none;
    background: var(--bg-secondary);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}
.bounty-req-result:hover {
    background: var(--accent);
    color: var(--on-accent);
}
.bounty-req-result-title {
    font-weight: 500;
}
.bounty-req-result-artist {
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.bounty-req-result:hover .bounty-req-result-artist {
    color: color-mix(in srgb, var(--on-accent) 80%, transparent);
}
.bounty-req-no-results {
    padding: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.bounty-req-selected {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
.bounty-req-has {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}
.bounty-req-change {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    margin-top: 0.25rem;
}
.bounty-req-change:hover {
    text-decoration: underline;
}
.bounty-req-status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.bounty-req-instrument-row {
    margin-top: 0.25rem;
}
.bounty-request-content .bounty-cta-btn {
    margin-top: 1rem;
    width: 100%;
}

/* My Submissions (Phase 4a) */
.my-submissions-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}
.my-submissions-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.my-submission-status {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
}
.my-submission-status-live {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
}
.my-submission-status-in-songbook {
    background: color-mix(in srgb, var(--success) 18%, transparent);
    color: var(--success);
}
.my-submission-status-in-review,
.my-submission-status-requested {
    background: color-mix(in srgb, var(--text-secondary) 18%, transparent);
    color: var(--text-secondary);
}
.my-submission-status-held {
    background: color-mix(in srgb, #d97706 18%, transparent);
    color: #b45309;
}
.my-submissions-empty .bounty-cta-btn {
    margin-top: 0.75rem;
}

/* G35: display names (display-name.js) */
.account-display-name:empty { display: none; }
.account-display-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
}
.name-sheet .name-lead { margin: 0 0 1rem; line-height: 1.45; }
.name-sheet .name-label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.name-sheet .name-input {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 1rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
}
.name-sheet .name-rules,
.name-sheet .name-hint {
    margin: 0.4rem 0 0;
    font-size: var(--font-sm);
    color: var(--text-secondary);
}
.name-sheet .name-error {
    min-height: 1.2em;
    margin: 0.4rem 0 0;
    font-size: var(--font-sm);
    color: var(--danger);
}
.name-sheet .name-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* High Scores (#174) — the contribution leaderboard */
.high-scores-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}
.high-scores-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.bounty-high-scores-link {
    color: var(--accent);
    text-decoration: none;
}
.bounty-high-scores-link:hover {
    text-decoration: underline;
}
.high-scores-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.high-score-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius-md);
}
.high-score-rank {
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.high-score-main {
    flex: 1;
    min-width: 0;
}
.high-score-name {
    font-weight: 600;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}
.high-score-breakdown {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}
.high-score-total {
    flex-shrink: 0;
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.high-score-you-badge {
    margin-left: 0.45rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--accent);
    vertical-align: middle;
}
/* Medals are the left rule + the rank numeral, so they read the same in both
   themes without repainting the row background. */
.high-score-row-gold {
    border-left-color: var(--medal-gold);
}
.high-score-row-gold .high-score-rank,
.high-score-row-gold .high-score-total {
    color: var(--medal-gold);
}
.high-score-row-silver {
    border-left-color: var(--medal-silver);
}
.high-score-row-silver .high-score-rank,
.high-score-row-silver .high-score-total {
    color: var(--medal-silver);
}
.high-score-row-bronze {
    border-left-color: var(--medal-bronze);
}
.high-score-row-bronze .high-score-rank,
.high-score-row-bronze .high-score-total {
    color: var(--medal-bronze);
}
.high-score-row-you {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-secondary));
}
/* A medalled row that is also the caller's keeps its medal rule. */
.high-score-row-you.high-score-row-gold { border-left-color: var(--medal-gold); }
.high-score-row-you.high-score-row-silver { border-left-color: var(--medal-silver); }
.high-score-row-you.high-score-row-bronze { border-left-color: var(--medal-bronze); }
.high-scores-privacy-note {
    margin-top: 1.25rem;
    text-align: center;
}
/* G39: each row opens that contributor's page; search above the board. */
a.high-score-row {
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s;
}
a.high-score-row:hover {
    border-color: var(--accent);
}
.high-scores-search {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 1rem;
    padding: 0.55rem 0.8rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.high-scores-search:focus {
    outline: none;
    border-color: var(--accent);
}
.contributor-back {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}
.contributor-back:hover {
    text-decoration: underline;
}
/* One person's contributions (G86, contribution-table.js): search's table, the
   song's cell spanning that person's rows for it. Shared by a contributor page
   and My Submissions, which adds Status. */
.contribution-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
}
.contribution-controls .contributor-search { flex: 1 1 12rem; width: auto; margin: 0; }
.contribution-table { margin-bottom: 1.5rem; }
.contribution-table th.rt-song { width: 36%; }
.contribution-table .rt-part { width: 24%; }
.contribution-table .ct-what { width: 22%; color: var(--text-secondary); }
.contribution-table .ct-when { width: 18%; color: var(--text-secondary); white-space: nowrap; }
.contribution-table.ct-with-status th.rt-song { width: 30%; }
.contribution-table.ct-with-status .rt-part { width: 20%; }
.contribution-table.ct-with-status .ct-what { width: 17%; }
.contribution-table.ct-with-status .ct-when { width: 15%; }
.contribution-table .ct-status { width: 18%; text-align: right; }
.contribution-table a.rt-pick { text-decoration: none; white-space: normal; }
.contribution-table a.rt-pick:hover, .contribution-table a.rt-pick:focus-visible { text-decoration: underline; }
.contributor-section-head {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}
/* A phone: a block per song, a line per contribution under it, as search's
   compact view opens a part's rows. */
@media (max-width: 40rem) {
    .contribution-table, .contribution-table tbody, .contribution-table tr,
    .contribution-table th, .contribution-table td { display: block; }
    .contribution-table thead { display: none; }
    .contribution-table tr.rt-row {
        display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.55rem;
        padding: 0 0 0.4rem;
    }
    .contribution-table tr.rt-row:not(.rt-more) { border-top: 1px solid var(--border); padding-top: 0.55rem; }
    .contribution-table tbody tr > th.rt-song { flex-basis: 100%; width: auto; padding: 0 0 0.25rem; }
    /* beats the desktop's column widths (.ct-with-status included) on every row */
    .result-table.contribution-table tbody td,
    .contribution-table tbody tr.rt-last > * { width: auto; padding: 0; border: 0; }
    .contribution-table td.rt-part { margin-left: 0.85rem; }
    .contribution-table td.ct-what, .contribution-table td.ct-when { font-size: 0.82rem; }
    .contribution-table td.ct-status { margin-left: auto; }
}

/* Search empty results */
.empty-results {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-results-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.empty-results-hint {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.empty-results-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.empty-results-btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: var(--accent);
    color: var(--on-accent);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
}
.empty-results-btn:hover {
    background: var(--accent-hover);
}
.empty-results-link {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .bounty-grid {
        grid-template-columns: 1fr;
    }
}


/* Admin delete modal: one selectable row per group member */
.delete-candidate-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.delete-candidate {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.delete-candidate input[type="checkbox"] {
    margin-top: 0.2rem;
}

.delete-candidate .candidate-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.delete-candidate .candidate-first-line {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.delete-candidate.current {
    border-color: var(--accent);
}

.delete-modal-hint {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}


.vote-btn {
    width: 2rem;
    height: 1.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.vote-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.vote-btn.voted {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.vote-arrow {
    font-size: 0.8rem;
}

.vote-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}



.current-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(79, 70, 229, 0.15);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Canonical (editorially pinned) version badge */
.canonical-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--success);
    background: rgba(22, 163, 74, 0.15);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    vertical-align: middle;
}


/* ============================================
   ABOUT VIEW STYLES
   ============================================ */

.about-view {
    animation: fadeIn 0.2s ease;
}

.about-header {
    margin-bottom: 1.5rem;
}

.about-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
}

.about-image {
    display: flex;
    justify-content: center;
}

.about-image img {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.about-image-placeholder {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 3 / 4;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.about-text h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    color: var(--text);
}

.about-section {
    margin-bottom: 1.75rem;
}

.about-section:last-child {
    margin-bottom: 0;
}

.about-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.about-section p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
}

.about-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    width: fit-content;
}

.about-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.about-link-icon {
    font-size: 1.1rem;
}

/* Mobile responsive for About view */
@media (max-width: 700px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .about-image {
        order: -1;
    }

    .about-image-placeholder {
        max-width: 200px;
        margin: 0 auto;
    }

    .about-text h1 {
        font-size: 2rem;
        text-align: center;
    }

    .about-section h3 {
        text-align: center;
    }

    .about-section p {
        text-align: center;
    }

    .about-links {
        align-items: center;
    }
}

.toggle-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.toggle-btn:not(:last-child) {
    border-right: 1px solid var(--border);
}

.toggle-btn.active {
    background: var(--accent);
    color: var(--on-accent);
}

.toggle-btn:hover:not(.active):not(:disabled) {
    background: var(--bg);
}

.toggle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.abc-view {
    margin-bottom: 1rem;
}

.abc-notation {
    background: var(--bg-secondary);
    padding: 1rem 1rem 1.5rem 1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    overflow-x: auto;
    overflow-y: visible;
}

.abc-notation svg {
    display: block;
    height: auto;
}

/* Dark mode adjustments for ABC SVG */
[data-theme="dark"] .abc-notation svg path {
    stroke: var(--text);
}

[data-theme="dark"] .abc-notation svg text {
    fill: var(--text);
}

/* Tab washes (a dragged phrase, the tab editor's selection) are drawn OVER the
   staff. Blended, they only tint the page: black digits stay black on light
   (multiply), white digits stay white on dark (screen), at any strength. The
   editor's rects sit in their own overlay, so the overlay is what blends. */
.phrase-highlight, .editor-selection-overlay { mix-blend-mode: multiply; }
[data-theme="dark"] .phrase-highlight, [data-theme="dark"] .editor-selection-overlay { mix-blend-mode: screen; }

/* Note highlighting during playback */
.abcjs-playing path,
.abcjs-playing rect,
.abcjs-playing circle {
    fill: var(--highlight) !important;
    stroke: var(--highlight) !important;
}



.abc-btn {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.abc-btn:hover {
    background: var(--accent-hover);
}

.abc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ABC render options */
.abc-render-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    align-items: stretch;
}

/* Control buckets - visually grouped controls */
.abc-control-bucket {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: fit-content;
}

.abc-control-bucket .bucket-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.abc-control-bucket .bucket-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Playback bucket styling */
.abc-playback-bucket {
    margin-left: auto;
    flex-direction: row;
    align-items: center;
}

.abc-playback-bucket .bucket-controls {
    gap: 0.5rem;
}

.abc-select {
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

.abc-select:focus {
    outline: none;
    border-color: var(--accent);
}

.size-display {
    font-size: 0.85rem;
    min-width: 2.5rem;
    text-align: center;
    color: var(--text);
    font-weight: 500;
}

.tempo-input {
    width: 3.5rem;
    padding: 0.2rem 0.3rem;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-weight: 500;
}

.tempo-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Hide number input spinners */
.tempo-input::-webkit-outer-spin-button,
.tempo-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.tempo-input[type=number] {
    -moz-appearance: textfield;
}

.abc-fallback {
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 4px;
    color: var(--text);
    overflow-x: auto;
}

.instrumental-notice {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================
   LANDING PAGE
   ============================================ */

.landing-page {
    margin-bottom: 2rem;
}

.landing-search {
    margin-bottom: 1.5rem;
}

/* The search box and its scope: side by side, or stacked when they won't fit */
.landing-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem 1rem;
}

#landing-search-input {
    flex: 1 1 22rem;
    min-width: 0;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#landing-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] #landing-search-input:focus {
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
}

#landing-search-input::placeholder {
    color: var(--text-secondary);
}

/* Search prompt when no query */
.search-prompt {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-prompt code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.landing-heading {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin: 0 0 0.5rem;
    text-align: left;
}

/* G54: Collections. Each card is a square photo a third of its width, with
   the title, count and one line beside it (Mike, 2026-11-16); the six sit in
   a grid, two per row, one on a phone; the Dungeon is its own card below. */
.collections-grid { display: block; }
.collections-six {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.1rem 1.5rem;
}
.collection-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0.9rem;
    align-items: center;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: var(--radius-lg, 12px);
    color: inherit;
    text-decoration: none;
}
.collection-card:hover { background: var(--bg-secondary); }
.collection-card:hover .collection-title { color: var(--accent); }
.collection-image {
    width: 100%;
    height: auto;           /* the width/height attributes only reserve the space */
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}
.collection-content { min-width: 0; }
.collection-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.25;
}
.collection-count {
    display: block;
    margin: 0.15rem 0 0.3rem;
    font-size: 0.85rem;
    color: var(--accent);
}
.collection-description {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.35;
    color: var(--text-secondary);
}

/* The Dungeon: the cellar under the book. Zombie Earl, a Creepster title. */
@font-face {
    font-family: 'Creepster';
    src: url('../fonts/creepster/Creepster-Regular.ttf') format('truetype');
    font-display: swap;
}
.collection-card.dungeon-card {
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    margin: 2rem 0 0;
    padding: 1rem 1.1rem;
    background: #141012;
    border: 1px solid #5c1414;
}
.collection-card.dungeon-card:hover { background: #1c1416; }
.collection-card.dungeon-card .collection-image { width: 140px; height: 140px; }
.collection-card.dungeon-card .collection-title {
    font-family: 'Creepster', serif;
    font-weight: 400;
    font-size: 1.7rem;
    letter-spacing: 0.03em;
    line-height: 1.1;
    color: #e11d1d;
}
.collection-card.dungeon-card .collection-description { color: #a1a1aa; margin-top: 0.3rem; }
.collection-card.dungeon-card .collection-count { color: #f87171; margin: 0.35rem 0 0; }

/* Dungeon mode: blood-red accent while browsing the archive */
body.dungeon-mode {
    --accent: #b91c1c;
    --on-accent: #ffffff;
    --accent-hover: #991b1b;
}

body.dungeon-mode #search-stats {
    color: #b91c1c;
    font-weight: 600;
}

.dungeon-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Review queue — destructive asks waiting on an admin (Dungeon panel) */
/* Sits directly above #results inside .container — inherit that width */
.review-queue-panel {
    margin: 0 0 1rem;
}

.review-queue {
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
}

.review-queue-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.review-queue-title {
    font-weight: 600;
}

.review-queue-counts,
.review-queue-note,
.review-queue-empty,
.review-queue-loading {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.review-queue-note {
    margin: 0.4rem 0 0.75rem;
    line-height: 1.45;
}

.review-queue-error {
    font-size: 0.85rem;
    color: var(--error, #ef4444);
}

.review-queue-section + .review-queue-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.review-section-title {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.review-section-count {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 0.4rem;
}

.review-section-note {
    margin: 0 0 0.6rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.review-hold-item .review-item-kind {
    color: var(--text-secondary);
}

.review-queue-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.review-queue-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 4px);
    background: var(--bg);
    padding: 0.6rem 0.75rem;
}

.review-queue-item[data-status="rejected"] {
    opacity: 0.65;
}

.review-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.review-item-kind {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--accent);
}

.review-item-target {
    font-family: var(--mono, monospace);
    font-size: 0.85rem;
}

.review-item-into,
.review-item-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.review-item-status {
    margin-left: auto;
}

.review-item-blurb,
.review-item-reason {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.review-item-reason {
    font-style: italic;
}

/* The one line that prevents a real loss: releasing a clash hold replaces the newer edit (G61c). Not grey. */
.review-item-note {
    font-size: 0.85rem;
    color: var(--text);
    margin-top: 0.4rem;
}

.review-item-command {
    margin-top: 0.5rem;
}

.review-item-command-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.review-item-command-code {
    margin: 0;
    padding: 0.5rem 0.6rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm, 4px);
    font-size: 0.78rem;
    overflow-x: auto;
    white-space: pre;
}

.review-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.review-item-working {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.review-action {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 4px);
    background: var(--bg-secondary);
    color: var(--text);
    cursor: pointer;
}

.review-action.approve:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.review-action.reject:hover {
    border-color: var(--error, #ef4444);
    color: var(--error, #ef4444);
}

/* Request dialogs — "Request suppression" / "Request merge…" in the song
   overflow (review-queue.js showSuppressRequestDialog / showMergeRequestDialog) */
.review-request-modal-content {
    max-width: 460px;
}

.review-request-explainer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1rem;
}

.merge-target-results {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 220px;
    overflow-y: auto;
}

.merge-target-result {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.6rem;
    background: var(--bg-secondary, transparent);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.merge-target-result:hover {
    border-color: var(--accent);
}

.merge-target-result-artist,
.merge-target-empty {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* The songbook failed to load — distinct from a genuine no-match */
.merge-target-empty.merge-target-error {
    color: var(--danger);
}

.merge-target-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    margin: 0 0 1rem;
    line-height: 1.5;
}

/* Landing footer: the A–Z link and the bounty link */
.landing-footer {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.bounty-link,
.browse-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.bounty-link:hover,
.browse-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg);
}

.bounty-icon {
    font-size: 1.25rem;
}

/* All songs A–Z: docs/songs/index.html, written by
   scripts/lib/build_song_pages.py (render_all_songs). A plain page, not the app. */
.all-songs {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.all-songs a {
    color: var(--text);
}

.all-songs a:hover {
    color: var(--accent);
}

.all-songs .all-songs-home {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
}

.all-songs h1 {
    margin: 1.25rem 0 0.25rem;
}

.all-songs-intro {
    color: var(--text-secondary);
}

.all-songs-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.85rem;
    margin: 1rem 0 0.5rem;
    font-weight: 600;
}

.all-songs-letters a {
    text-decoration: none;
}

.all-songs h2 {
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.all-songs ul {
    list-style: none;
    columns: 18rem;
    column-gap: 2rem;
}

.all-songs li {
    break-inside: avoid;
    padding: 0.15rem 0;
}

.all-songs .by {
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* A phone: one card per row; the Dungeon's Earl a little smaller */
@media (max-width: 760px) {
    .collections-six { grid-template-columns: 1fr; gap: 1rem; }
    .collection-title { font-size: 1.1rem; }
    .collection-card.dungeon-card { grid-template-columns: 112px 1fr; }
    .collection-card.dungeon-card .collection-image { width: 112px; height: 112px; }
    .collection-card.dungeon-card .collection-title { font-size: 1.45rem; }
}

/* G87: Curated collections. The cover is the title in a serif on one of six muted colours (the
   colour is set inline from curated-model.js COVER_COLORS), inside a thin inset rule, like an old
   songbook. The cards are the six's .collection-card, two to a row, one on a phone. */
.cur-cover {
    width: 100%; aspect-ratio: 1; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    position: relative; padding: 11% 13% 21%; box-sizing: border-box; overflow: hidden; color: #f3ead7; text-align: center;
    font: 700 1.05rem/1.18 Georgia, 'Times New Roman', serif; letter-spacing: 0.01em; overflow-wrap: break-word;
}
.cur-cover::before { content: ''; position: absolute; inset: 7px; border: 1px solid rgba(243, 234, 215, 0.38); border-radius: 6px; }
.cur-cover::after { content: '\2766'; position: absolute; bottom: 12%; left: 0; right: 0; font-size: 0.8rem; opacity: 0.6; }
.collection-card .cur-cover { font-size: 0.9rem; }
.cur-by { color: var(--text-secondary); font-size: 0.85rem; }
.cur-section { margin-top: 2rem; }
.cur-section.hidden { display: none; }
.cur-head-row { display: flex; align-items: baseline; justify-content: space-between; }
.cur-head-row .landing-heading { margin-bottom: 0.5rem; }
.cur-all { font-size: 0.8rem; color: var(--accent); text-decoration: none; }
.cur-all:hover { text-decoration: underline; }
.cur-browse { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.cur-browse-title { margin: 0 0.5rem 1.2rem; font-size: 1.6rem; }
.cur-browse .collections-six { margin: 0.5rem; }

/* The collection's own page: the list page with a cover beside the title */
.lp-head.cur-page-head { display: grid; grid-template-columns: 132px 1fr; gap: 1.1rem; align-items: end; margin: 0.4rem 0 1rem; }
.cur-page-head .cur-cover { width: 132px; font-size: 1.1rem; grid-row: span 2; }
.cur-page-head h1 { margin: 0; font-size: 1.9rem; line-height: 1.15; }
.cur-meta { margin-top: 0.3rem; font-size: 0.92rem; color: var(--text-secondary); }
.cur-meta a { color: var(--accent); text-decoration: none; }
.cur-meta a:hover { text-decoration: underline; }
.cur-line { margin-top: 0.25rem; font-size: 0.95rem; }
.cur-page-head .mb-btns { grid-column: 2; margin-top: 0.2rem; display: flex; gap: 0.5rem; flex-wrap: nowrap; }
.lp-table .cur-num { width: 2rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* The publishing sheet's cover choice */
.cur-swatches { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cur-swatch { width: 2.4rem; height: 2.4rem; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.25); cursor: pointer; padding: 0; }
.cur-swatch[aria-checked="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }

/* G92: the publishing sheet's Home page choice, a wanted row, a request in the Dungeon, the bounty page's songbook groups */
.cur-places { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cur-place { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; min-width: 2.4rem; padding: 0.4rem 0.7rem;
    border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); color: var(--text); font: inherit; cursor: pointer; }
.cur-place[aria-checked="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.cur-holder { font-size: 0.72rem; color: var(--text-secondary); font-weight: normal; }
.list-badge-requested { background: var(--bg-secondary); color: var(--text); border: 1px solid var(--border); }
.lp-row.is-wanted .lp-part { font-style: italic; }
/* The Part column says Wanted; a phone has no Part column, so the title carries the tag there (see the phone block of the list table) */
.lp-wanted { display: none; }
.review-songbook-title { font-family: inherit; font-size: 0.95rem; }
.review-songbook-songs { margin: 0.5rem 0 0; padding-left: 1.6rem; font-size: 0.88rem; }
.review-songbook-songs .review-wanted { color: var(--text-secondary); font-style: italic; margin-left: 0.4rem; }
.review-songbook-toggle { margin-top: 0.4rem; }
.bounty-songbook-group { margin: 1.2rem 0 0.5rem; font-size: 1rem; }
.bounty-songbook-group a { color: var(--accent); text-decoration: none; }
.bounty-songbook-group a:hover { text-decoration: underline; }

@media (max-width: 760px) {
    .cur-section .collections-six { grid-template-columns: 1fr; }
    .lp-head.cur-page-head { grid-template-columns: 96px 1fr; gap: 0.9rem; align-items: start; }
    .cur-page-head .cur-cover { width: 96px; font-size: 0.85rem; grid-row: auto; }
    .cur-page-head h1 { font-size: 1.45rem; }
    .cur-page-head .mb-btns { grid-column: 1 / -1; margin-top: 0; gap: 0.35rem; }
    /* Play · Add a song… · Add to My Book · ⋯ share one row at 440 (G100) */
    .cur-page-head .mb-btns .action-btn { padding: 0.5rem 0.62rem; font-size: 0.85rem; white-space: nowrap; }
    .cur-page-head .mb-btns .mb-more.action-btn { padding: 0.5rem 0.6rem; }
    .lp-table td.cur-num, .lp-table th.cur-num { display: none !important; }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    /* Paper is white and chords print black. Dark mode prints with the light theme
       (printInLightTheme in js/main.js), because the tab bakes its colours into its SVG. */
    :root {
        --bg: #ffffff;
        --bg-secondary: #ffffff;
        --chord: #000000;
    }

    /* Hide non-essential elements */
    header,
    .search-container,
    #results,
    .song-tags-section,
    .song-meta,
    .app-bottomband,
    .arr-host,
    .song-lines,
    .tab-controls,
    .header-badge,
    .song-practice-line,
    .song-details-btn > [aria-hidden="true"],
    .track-switcher-rest,
    .track-switcher-list,
    .track-solo {
        display: none !important;
    }

    /* Reset body for print */
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    /* Full width layout */
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .song-view {
        position: static !important;
        padding: 0 !important;
        background: white !important;
        z-index: auto !important;
    }

    .song-content {
        max-width: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Song header for print */
    .song-header {
        position: static !important;
        background: white !important;
        border-bottom: 2px solid black !important;
        padding: 0 0 0.5rem 0 !important;
        margin-bottom: 1rem !important;
    }

    .song-title {
        font-size: 18pt !important;
        color: black !important;
    }

    .song-artist {
        font-size: 12pt !important;
        color: #333 !important;
    }

    /* Chord/lyric content */
    .section {
        break-inside: avoid;
        margin-bottom: 0.75rem;
    }

    .section-label {
        font-weight: bold;
        color: black !important;
    }

    .lyrics {
        color: black !important;
    }

    /* ABC notation - ensure SVG prints, inside the page */
    .abc-notation {
        background: none !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .abc-notation svg {
        width: 100% !important;
        height: auto !important;
    }

    /* Tablature - ensure SVG prints */
    .tablature-container svg {
        max-width: 100% !important;
        height: auto !important;
    }

    /* The staff without its on-screen card, and no row split across two pages */
    .tablature-track-section {
        border: 0 !important;
    }

    .tablature-container {
        background: none !important;
        padding: 0 !important;
    }

    .stave-row {
        break-inside: avoid;
    }

    /* The track name is a button on screen; on paper it is just the name */
    .track-switcher-button {
        border: 0 !important;
        background: none !important;
        padding: 0 !important;
        min-height: 0 !important;
    }

    /* The tuning circles are plain black letters: a browser leaves out their
       backgrounds anyway, and the letters are white */
    .tuning-notes {
        opacity: 1 !important;
    }

    .tuning-string {
        background: none !important;
        color: #000 !important;
        width: auto !important;
        height: auto !important;
        padding: 0 1px;
        font-size: 10pt;
    }

    /* Screen leftovers a tab prints without: the raw instrument id ("5-string-banjo"),
       the "Details" button of a song with no writer, and the converted-from-TablEdit
       disclaimer. The credit and the source link stay, in black. */
    .track-instrument,
    .song-details-btn.no-writer,
    .attribution-disclaimer {
        display: none !important;
    }

    /* Two-column layout option */
    body.print-two-columns .song-content {
        column-count: 2;
        column-gap: 2rem;
    }

    body.print-two-columns .section {
        break-inside: avoid-column;
    }

    body.print-two-columns .song-header {
        column-span: all;
    }

    /* Page setup. Chrome prints its own date, title and address in a page margin
       that can hold them (0.35in and up), and a page cannot switch them off. So the
       page margin is too small for them, and the body's padding, cloned onto every
       printed page, makes up the half inch. Safari does not clone block padding: it
       keeps the 0.25in. */
    @page {
        margin: 0.25in 0.5in;
    }

    body {
        padding: 0.25in 0 !important;
        box-decoration-break: clone;
        -webkit-box-decoration-break: clone;
    }
}

/* ============================================
   WorkView Styles
   ============================================ */


.work-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

.work-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.work-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}



.part-label {
    font-weight: 500;
}



.work-part-content {
    min-height: 200px;
}








/* Bounty section title (non-collapsible on dashboard) */
.work-bounty-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

/* ============================================
   Tablature Renderer Styles
   ============================================ */

.tablature-container {
    --tab-scale: 1;
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* Tablature scaling via the Aa control is NOT done here any more.
 *
 * It was `transform: scale(var(--tab-scale))`, and a transform does not
 * participate in layout: at the top setting the staff kept its unscaled
 * box, so the rows overlapped vertically and the extra width ran straight
 * off the right edge instead of reflowing. TabRenderer.setScale() now
 * folds the size into the layout — it lays out against
 * (container width / scale) and sizes the <svg> element by the scale, so
 * bigger notes mean FEWER measures per row and the row still fits.
 * `--tab-scale` remains set on the container as a state marker. */

.track-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.track-info strong {
    color: var(--text);
}

/* Track switcher (G23; docs/js/track-switcher.js): the name above a staff as a
   button with a short list under it, on the read view (every width) and in
   the tab editor (every width). One copy, here. */
.track-info.has-track-switcher { position: relative; }
.track-switcher-button, .track-switcher-item {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border, #ccc);
    border-radius: 8px;
    background: var(--bg, #fff);
    color: var(--text, #222);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.track-switcher-name { text-transform: capitalize; }
.track-switcher-list {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--bg, #fff);
    border: 1px solid var(--border, #ccc);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.track-switcher-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 0;
    font-weight: 400;
    text-align: left;
}
.track-switcher-check { width: 1.2em; }

.instrument-icon {
    font-size: 1.5rem;
}

.tuning-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tuning-name {
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
}

.tuning-notes {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    opacity: 0.8;
}

.tuning-string {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.tuning-string.fifth {
    background: #8b4513;
}

/* KEPT, but it is a safety net and not the layout.
 *
 * A row is engraved to the container's measured width (TabRenderer
 * _availableWidth / _calculateLayout), so in normal use nothing here has
 * anything to scroll. It used to scroll constantly, because a staff
 * rendered into a hidden container was laid out against an 800px GUESS —
 * this rule is exactly what made that bug invisible until someone zoomed
 * in far enough to notice the right-hand side was gone.
 *
 * Two cases genuinely still need it, both "one measure is wider than the
 * container", which no reflow can fix because a measure cannot be split:
 *   1. extreme browser zoom, where the container falls below the
 *      renderer's `minMeasureWidth` (138px) + margins;
 *   2. the reader's size control at its top setting on a narrow phone.
 * (The OTF editor's cursor step used to be a third, via a ratcheted
 * `measureWidthFloor`; with `max-width: 100%` below, its rows were shrunk,
 * not scrolled. Removed, fix-it A20.)
 */
.stave-row {
    margin-bottom: 1.5rem;
    overflow-x: auto;
    overflow-y: visible;
}

.stave-row svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Responsive tablature on mobile */
@media (max-width: 600px) {
    .tablature-container {
        padding: 0.5rem;
    }

    .track-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .tuning-display {
        width: 100%;
        justify-content: flex-start;
    }

    .tuning-string {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .tab-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .tab-tempo-control,
    .tab-key-control {
        width: 100%;
        justify-content: center;
    }
}

/* ASCII Tab */
.ascii-tab {
    font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    white-space: pre;
    line-height: 1.5;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    color: var(--text);
}

/* Tab Player Controls */
.tab-player-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.tab-player-controls button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.tab-player-controls button:hover {
    background: var(--bg-hover);
}

.tab-player-controls button.playing {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

.tab-player-controls .playback-position {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 80px;
}

.tab-player-controls .tempo-control {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
}

.tab-player-controls .tempo-control input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Mixer */
.tab-mixer {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.tab-mixer h3 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.mixer-channels {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.mixer-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.mixer-channel label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.mixer-channel input[type="range"] {
    writing-mode: vertical-lr;
    direction: rtl;
    height: 60px;
    width: 20px;
    margin: 0.25rem 0;
}

.mixer-channel .value {
    font-size: 0.625rem;
    color: var(--text-muted);
}

/* Track tabs */
.track-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0;
    padding: 0 0.25rem;
}

.track-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-bottom: none;
    background: var(--bg-secondary);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-weight: 500;
    font-size: 0.8125rem;
    transition: all 0.15s;
}

.track-tab:hover {
    background: var(--bg-hover);
}

.track-tab.active {
    background: var(--bg);
    border-color: var(--border);
    position: relative;
    z-index: 1;
}

/* Tab badge in search results (legacy) */
.tab-badge {
    display: inline-block;
    font-size: 0.6875rem;
    padding: 0.125rem 0.375rem;
    background: var(--accent);
    color: var(--on-accent);
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}


/* ============================================
   TAKE HEADER: the credit line under a tab's title ("Banjo tab by schlange ·
   Banjo Hangout ★") and the status notices under it. Which take you read is
   View ▸ Tabs (the takes drill-in), not anything on the page.
   ============================================ */

.arr-host {
    margin-bottom: var(--space-md);
}

.song-lines { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

/* The reading line (G40c): what you are looking at and who made it */
.song-reading-line {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

/* The census line: one button, "Lyrics 2 · Charts 1 · Tabs 1 ▾" */
.song-census {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: var(--space-sm);
    padding: 4px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font: inherit;
    font-size: var(--font-sm);
    cursor: pointer;
    white-space: nowrap;
}
.song-census b { color: var(--text); font-variant-numeric: tabular-nums; }
.song-census .census-seg.here, .song-census .census-seg.here b { color: var(--accent); font-weight: 700; }
.song-census .census-caret { font-size: 0.7em; }

.song-reading-line .arr-who {
    font-weight: 600;
    color: var(--text);
}

/* The curation pin: the editor's pick, the take everyone lands on. */
.arr-pin {
    color: var(--warning, #d97706);
    font-size: var(--font-sm);
}

/* Tablature view in song view */
.tablature-view {
    padding: 1rem 0;
}

.tablature-view.hidden {
    display: none;
}

/* Tab controls for song view */
.tab-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tab-controls:not(.tab-dock) button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tab-controls:not(.tab-dock) button:hover:not(:disabled) {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

.tab-controls:not(.tab-dock) button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tab-controls:not(.tab-dock) button.playing {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

.tab-controls:not(.tab-dock) .tab-position {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 80px;
}

.tab-controls .tab-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* Tempo control */
.tab-tempo-control {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.tab-tempo-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-tempo-btn:hover:not(:disabled) {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

.tab-tempo-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tab-tempo-input {
    width: 50px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: center;
}

.tab-tempo-input::-webkit-inner-spin-button,
.tab-tempo-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tab-tempo-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

/* Key/capo control */
.tab-key-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-key-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tab-key-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.tab-key-select:hover {
    border-color: var(--accent);
}

.tab-capo-indicator {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

/* Track mixer */
.tab-track-mixer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
    width: 100%;
    flex-wrap: wrap;
}

.tab-track-mixer .mixer-label {
    /* A speaker glyph labels the row; the track options are plain text
       (instrument emoji were dropped — Unicode can't tell a mandolin from
       a guitar, so they were actively misleading). */
    font-size: 0.95rem;
    line-height: 1;
    color: var(--text-secondary);
    flex: 0 0 auto;
}

.track-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.track-toggle:hover {
    border-color: var(--accent);
}

.track-toggle:has(.track-checkbox:checked) {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.track-checkbox {
    display: none;
}

.track-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Multi-track display */
.tablature-all-tracks {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}


.track-solo {
    margin-left: auto;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-xs);
    cursor: pointer;
}

.track-solo:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tablature-track-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.tablature-track-section.backup-track {
    border-color: var(--border);
    opacity: 0.9;
}

/* Percussion: detected, deliberately not drawn. We can identify a drum
   track reliably but not yet which drum each staff line means, so we show
   the track greyed out and say so rather than inventing a pitched stave. */
.tablature-track-section.percussion-track {
    border-style: dashed;
    background: var(--bg-secondary);
}

.percussion-placeholder {
    padding: 1rem;
    color: var(--text-secondary);
}

.percussion-placeholder-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.percussion-icon {
    font-size: 1.1rem;
    filter: grayscale(1);
    opacity: 0.7;
}

.percussion-note {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 46ch;
}

.tablature-track-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 500;
}

.tablature-track-header .track-icon {
    font-size: 1.1rem;
}

.tablature-track-header .track-name {
    max-width: none;
    text-transform: capitalize;
}

.tablature-track-header .track-role {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 0.8rem;
}

/* Metronome toggle */
.tab-metronome-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    transition: all 0.2s;
}

.tab-metronome-toggle:hover {
    border-color: var(--accent);
}

.tab-metronome-checkbox {
    display: none;
}

.tab-metronome-icon {
    font-size: 1.1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.tab-metronome-checkbox:checked + .tab-metronome-icon {
    opacity: 1;
}

.tab-metronome-toggle:has(.tab-metronome-checkbox:checked) {
    background: var(--accent);
    border-color: var(--accent);
}

/* Loop-whole-song toggle (mirrors the metronome toggle) */
.tab-loop-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    transition: all 0.2s;
}
.tab-loop-toggle:hover { border-color: var(--accent); }
.tab-loop-checkbox { display: none; }
.tab-loop-label { font-size: 1.1rem; opacity: 0.5; transition: opacity 0.2s; }
.tab-loop-checkbox:checked + .tab-loop-label { opacity: 1; }
.tab-loop-toggle:has(.tab-loop-checkbox:checked) {
    background: var(--accent);
    border-color: var(--accent);
}

/* Beat cursor */
.beat-cursor {
    pointer-events: none;
    transition: x 0.016s linear;
}

/* Tab attribution */
.tab-attribution {
    margin-top: 1.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.attribution-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
}

.attribution-item a {
    color: var(--accent);
    text-decoration: none;
}

.attribution-item a:hover {
    text-decoration: underline;
}

.attribution-disclaimer {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.part-panel {
    display: none;
}

.part-panel.active {
    display: block;
}

/* ============================================
   MANAGE LISTS PAGE
   ============================================ */

.manage-lists-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.manage-lists-view.hidden {
    display: none;
}

.manage-lists-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.manage-lists-title {
    flex: 1;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Breadcrumb navigation */
.breadcrumb-link {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.15s;
}

.breadcrumb-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-secondary);
    margin: 0 0.5rem;
}

.breadcrumb-current {
    color: var(--text);
}

.manage-lists-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* List/Folder Cards */
.list-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.list-card:hover {
    border-color: var(--accent);
}

/* Clickable list cards - obvious hover state */
.list-card.clickable {
    cursor: pointer;
}

.list-card.clickable .list-card-header {
    transition: background-color 0.15s;
}

.list-card.clickable:hover .list-card-header {
    background-color: rgba(128, 128, 128, 0.1);
}

/* Hide action buttons by default, show on hover */
.list-card.clickable .list-card-actions {
    opacity: 0;
    transition: opacity 0.15s;
}

.list-card.clickable:hover .list-card-actions {
    opacity: 1;
}

/* Folder cards - more obvious clickable state */
.folder-card .list-card-header {
    transition: background-color 0.15s;
}

.folder-card .list-card-header:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

/* Hide folder action buttons by default too */
.folder-card .list-card-actions {
    opacity: 0;
    transition: opacity 0.15s;
}

.folder-card:hover .list-card-actions {
    opacity: 1;
}

.list-card-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    cursor: pointer;
}

.list-card-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.list-card-info {
    flex: 1;
    min-width: 0;
}

.list-card-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.list-card-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Inline input for new list creation */
.new-list-card {
    border-color: var(--accent);
    background: rgba(52, 152, 219, 0.05);
}

.new-list-input {
    flex: 1;
    min-width: 0;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
}

.new-list-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.new-list-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.list-card-menu-btn {
    padding: 0.4rem 0.6rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
}

.list-card-menu-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.list-card-btn {
    padding: 0.3rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.15s, background 0.15s;
}

.list-card-btn:hover:not(:disabled) {
    background: var(--bg);
    color: var(--text);
    opacity: 1;
}

.list-card-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.list-card-expand {
    padding: 0.4rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform 0.2s;
}

.list-card-expand.expanded {
    transform: rotate(180deg);
}

/* Folder children container */
.folder-children {
    padding: 0 0.75rem 0.75rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.folder-children.hidden {
    display: none;
}

.folder-children .list-card {
    background: var(--bg);
}

/* Expanded list content (songs) */
.list-card-songs {
    border-top: 1px solid var(--border);
    max-height: 400px;
    overflow-y: auto;
}

.list-card-songs.hidden {
    display: none;
}

.list-song-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
}

.list-song-item:last-child {
    border-bottom: none;
}

.list-song-item:hover {
    background: var(--bg);
}

.list-song-checkbox {
    flex-shrink: 0;
}

.list-song-info {
    flex: 1;
    min-width: 0;
}

.list-song-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-song-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-song-remove {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.1s, background 0.1s, color 0.1s;
}

.list-song-item:hover .list-song-remove {
    opacity: 1;
}

.list-song-remove:hover {
    background: var(--danger);
    color: var(--on-danger);
}

/* Song item actions container (up/down/remove buttons) */
.list-song-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.list-song-btn {
    padding: 0.2rem 0.4rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}

.list-song-item:hover .list-song-btn {
    opacity: 0.7;
}

.list-song-btn:hover:not(:disabled) {
    background: var(--bg);
    color: var(--text);
    opacity: 1;
}

.list-song-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Song actions within expanded card */
.list-songs-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.list-songs-actions button {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text);
    transition: background 0.1s, border-color 0.1s;
}

.list-songs-actions button:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.list-songs-actions button.hidden {
    display: none;
}

.list-songs-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* Copy/Move dialog */
.copy-move-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.copy-move-dialog-content {
    background: var(--bg);
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.copy-move-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.copy-move-dialog-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.copy-move-dialog-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    line-height: 1;
}

.copy-move-dialog-close:hover {
    color: var(--text);
}

.copy-move-dialog-lists {
    overflow-y: auto;
    padding: 0.5rem;
}

.copy-move-dialog-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: background 0.15s;
}

.copy-move-dialog-option:hover {
    background: var(--bg-secondary);
}

.copy-move-dialog-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.copy-move-dialog-name {
    flex: 1;
    font-weight: 500;
}

.copy-move-dialog-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Batch actions bar for manage lists */
.manage-lists-batch-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.manage-lists-batch-bar.hidden {
    display: none;
}

.manage-lists-batch-count {
    font-weight: 600;
    color: var(--accent);
}

.manage-lists-batch-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Card menu dropdown */
.list-card-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 140px;
    overflow: hidden;
}

.list-card-menu.hidden {
    display: none;
}

.list-card-menu-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.1s;
}

.list-card-menu-item:hover {
    background: var(--bg-secondary);
}

.list-card-menu-item.danger {
    color: var(--danger);
}

.list-card-menu-item.danger:hover {
    background: var(--danger);
    color: var(--on-danger);
}

/* Empty state */
.manage-lists-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.manage-lists-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .manage-lists-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .manage-lists-title {
        text-align: center;
    }
    
    .manage-lists-header .back-btn {
        align-self: flex-start;
    }
    
    .manage-lists-header .action-btn {
        width: 100%;
    }
}

/* ===== Editor topbar: compact metadata line + quiet view toggle ===== */
.editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.5rem 0;
}
.metadata-summary {
    flex: 1;
    min-width: 0;
    text-align: left;
    background: none;
    border: none;
    padding: 0.4rem 0.25rem;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.metadata-summary:hover { background: var(--bg-secondary); }
.metadata-summary.metadata-summary-unnamed {
    color: var(--text-secondary);
    font-weight: 400;
    font-style: italic;
}
.metadata-summary::after {
    content: ' \25BE';
    color: var(--text-secondary);
    font-style: normal;
    font-size: 0.85em;
}
.metadata-summary.expanded::after { content: ' \25B4'; }

/* ===== Two-pane editor: raw ChordPro (left) + interactive preview (right) ===== */

/* transpose/key fade in once the song has a chord; space stays reserved
   so the cards below never jump */
.ve-transpose-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 1;
    transition: opacity 220ms ease, visibility 220ms;
}
.ve-transpose-group.ve-gone {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}


/* ============================================
   APP SHELL: top band, bottom band, pill primitive
   (the one home for chrome — see docs/js/shell.js)
   ============================================ */

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    height: 48px;
    padding: 0 var(--space-md);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: transform 0.25s ease;
}

/* Global, dismissible notice bar below the top band — currently used for
   "the songbook index failed to load". Sticky under the topbar so it stays
   visible while the page (which may itself be showing an empty/error state)
   scrolls underneath it. */
.app-banner {
    position: sticky;
    top: 48px;
    z-index: 899;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--danger);
    color: var(--on-danger);
    font-size: var(--font-sm);
}

.app-banner.hidden { display: none; }

.app-banner-text { flex: 1; min-width: 0; }

.app-banner-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.app-banner-retry {
    background: color-mix(in srgb, var(--on-danger) 20%, transparent);
    border: 1px solid color-mix(in srgb, var(--on-danger) 50%, transparent);
    border-radius: var(--radius-sm);
    color: var(--on-danger);
    padding: 0.2rem 0.6rem;
    font-size: var(--font-sm);
    cursor: pointer;
}

.app-banner-retry:hover { background: color-mix(in srgb, var(--on-danger) 35%, transparent); }

.app-banner-dismiss {
    background: none;
    border: none;
    color: var(--on-danger);
    font-size: var(--font-md);
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
    opacity: 0.85;
}

.app-banner-dismiss:hover { opacity: 1; }

/* G31c: big What's new news. Calm, not an alarm: the page's own colours with
   an accent edge, and a link to the page. */
.app-banner.app-banner-news {
    background: var(--bg-secondary);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    box-shadow: inset 3px 0 0 var(--accent);
}
.app-banner-news .app-banner-dismiss { color: var(--text-secondary); }
.app-banner-link {
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}

/* G31c: something unread behind a menu item (⋯ ▸ What's new) */
.menu-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5484d;
    vertical-align: 0.1em;
    margin-left: 0.15rem;
}

/* The band's regions hold their natural width (the title is the one elastic
   part). Letting them shrink is what produced the overlap this replaces: the
   nav compressed past its content, spilled out of .topbar-left, and painted
   over the actions. Holding their width instead turns "too narrow" into a
   clean scrollWidth overflow, which is the signal shell.js measures. */
.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.topbar-back {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: var(--font-md);
    padding: 0.2rem 0.55rem;
    cursor: pointer;
}

.topbar-back:hover { border-color: var(--accent); }

.topbar-brand {
    position: relative;
}

.topbar-brand img {
    height: 32px;
    width: auto;
    display: block;
    border-radius: 6px;
}

/* Zombie Earl rises over the plaque in dungeon mode only.
   Selector includes .topbar-brand so display:none outranks the
   .topbar-brand img { display: block } base rule. */
.topbar-brand .brand-dungeon-face {
    display: none;
}

body.dungeon-mode .topbar-brand .brand-dungeon-face {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -55%);
    height: 30px;
    width: 30px;
    border-radius: 50%;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
}



.topbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.topbar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-sm);
    white-space: nowrap;
}

.topbar-nav-link:hover { color: var(--text); background: var(--bg-secondary); }

/* G77: Support is in every band, the song dock included; the label rolls up
   with the other labels (density-icons), the heart never leaves. */
.topbar-support {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-sm);
    white-space: nowrap;
}

.topbar-support:hover { color: var(--text); background: var(--bg-secondary); }
.topbar-support-icon { font-size: 1.05em; line-height: 1; }
.topbar-nav-link.active { color: var(--accent); }

.topbar-title {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: var(--font-md);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-action-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: var(--font-sm);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    white-space: nowrap;
}

.topbar-action-btn:hover { border-color: var(--accent); }
.topbar-action-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.topbar-icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-lg);
    line-height: 1;
    padding: 0.25rem 0.45rem;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.topbar-icon-btn:hover { color: var(--text); background: var(--bg-secondary); }

/* ---- Feature tour (G14, js/tour.js) ----
   The invitation: a first-time visitor's band carries a Tour button that
   pulses three times, then keeps a soft steady glow. main.js removes it once
   the tour has been opened (it moves to the ⋯ menu). */
.topbar-tour-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent);
    font-size: var(--font-sm);
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 0 8px 1px color-mix(in srgb, var(--accent) 40%, transparent);
    animation: tour-glow 2.4s ease-in-out 3;
}

.topbar-tour-btn:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }

@keyframes tour-glow {
    0%, 100% { box-shadow: 0 0 8px 1px color-mix(in srgb, var(--accent) 40%, transparent); }
    50% { box-shadow: 0 0 18px 5px color-mix(in srgb, var(--accent) 65%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
    .topbar-tour-btn { animation: none; }
}

/* The card. Under the bands (900) and everything that opens from them, so
   whatever the reader opens covers the card, never the reverse; tour.js
   keeps it clear of both bands. No backdrop: the page stays usable — so the
   card has to stand out on its own: an accent frame and halo, a "Tour"
   label, an arrow at the control, and an arrival animation. */
.tour-card {
    position: fixed;
    z-index: 899;
    width: min(320px, calc(100vw - 16px));
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent),
        0 12px 32px rgba(0, 0, 0, 0.35);
    padding: var(--space-sm) var(--space-md) var(--space-md);
}

/* The arrow: a square turned 45°, two of its borders showing, set on the
   edge facing the control at --tour-arrow-x (tour.js placeCard). */
.tour-card::before {
    content: '';
    display: none;
    position: absolute;
    left: calc(var(--tour-arrow-x, 50%) - 8px);
    width: 14px;
    height: 14px;
    background: var(--bg);
    border: 2px solid var(--accent);
    transform: rotate(45deg);
}

.tour-card[data-placement="below"]::before {
    display: block;
    top: -9px;
    border-right: none;
    border-bottom: none;
}

.tour-card[data-placement="above"]::before {
    display: block;
    bottom: -9px;
    border-left: none;
    border-top: none;
}

/* Arrives from the control's side: down from a control above it, up from
   one below it (or from the bottom when it rests). */
.tour-card { --tour-from: 12px; }
.tour-card[data-placement="below"] { --tour-from: -12px; }
.tour-card.tour-arrive { animation: tour-arrive 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2); }

@keyframes tour-arrive {
    from { opacity: 0; transform: translateY(var(--tour-from)) scale(0.96); }
    to { opacity: 1; transform: none; }
}

.tour-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* "✨ Tour · 3 of 7": says what this card is, so it never reads as one of
   the app's own popups. */
.tour-label {
    color: var(--accent);
    font-size: var(--font-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tour-count {
    color: var(--text-secondary);
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    margin-left: 0.3em;
}

.tour-count::before { content: '· '; }

.tour-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-lg);
    line-height: 1;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.tour-close:hover { color: var(--text); background: var(--bg-secondary); }

.tour-title {
    font-size: var(--font-md);
    margin: var(--space-xs) 0;
}

.tour-body {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    line-height: 1.45;
    margin: 0 0 var(--space-sm);
}

.tour-more {
    font-size: var(--font-sm);
    margin: calc(-1 * var(--space-xs)) 0 var(--space-sm);
}

.tour-more a {
    color: var(--accent);
}

.tour-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-xs);
}

.tour-back,
.tour-next {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: var(--font-sm);
    padding: 0.35rem 0.85rem;
    cursor: pointer;
}

.tour-back:disabled { visibility: hidden; }

.tour-next {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.tour-next:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* The ring around the control a step is about. Above the bands so a band
   control is visibly ringed; it never takes a click. On arrival it sends out
   three ripples (.tour-ping). */
.tour-ring {
    position: fixed;
    z-index: 901;
    pointer-events: none;
    border: 3px solid var(--accent);
    border-radius: 10px;
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent),
        0 0 18px 4px color-mix(in srgb, var(--accent) 40%, transparent);
}

.tour-ring::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 3px solid var(--accent);
    border-radius: inherit;
    opacity: 0;
}

.tour-ring.tour-ping::after { animation: tour-ping 1s ease-out 3; }

@keyframes tour-ping {
    from { opacity: 0.8; transform: scale(1); }
    to { opacity: 0; transform: scale(1.3); }
}

/* A drop-zone step rings the page itself, dashed like body.file-dragover
   (what a real drag over the window shows). */
.tour-ring.tour-ring-zone {
    border-style: dashed;
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.tour-ring.tour-ring-zone::after { display: none; }   /* no page-sized ripple */

@media (prefers-reduced-motion: reduce) {
    .tour-card.tour-arrive,
    .tour-ring.tour-ping::after { animation: none; }
}

.topbar-overflow { position: relative; }

.app-bottomband {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    min-height: 52px;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg);
    border-top: 1px solid var(--border);
}

/* --bottomband-h is the band's live height, published by shell.js. The band
   is no longer a constant (the phone playback strip is taller), so anything
   stacked on it reads the variable; the fallback covers first paint. */
body.has-bottomband .container {
    padding-bottom: calc(var(--bottomband-h, 52px) + 20px);
}

/* Pill: inline disclosure control (replaces bespoke collapsible bars) */
.pill { position: relative; display: inline-flex; }

.pill-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: var(--font-sm);
    padding: 0.3rem 0.75rem;
    cursor: pointer;
}

.pill-btn:hover, .pill-btn.open { border-color: var(--accent); }
.pill-caret { font-size: 0.7em; color: var(--text-secondary); }

.pill-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 950;
    min-width: 180px;
    /* Grow to fit content, but never past the viewport (fixes clipped
       full-width rows like the Strum Machine button at narrow widths) */
    width: max-content;
    max-width: min(92vw, 480px);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    padding: var(--space-sm);
}

.pill-popover.align-right { left: auto; right: 0; }

.topbar-overflow .pill-popover {
    left: auto;
    right: 0;
}

.pill-popover-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: var(--font-sm);
    padding: 0.45rem 0.6rem;
    cursor: pointer;
}

.pill-popover-item:hover { background: var(--bg-secondary); }

.pill-popover-divider {
    border-top: 1px solid var(--border);
    margin: var(--space-xs) 0;
}

/* ---- Top band density ladder (driven by shell.js updateDensity) ----
   The band measures itself and adds these classes cumulatively until its
   content fits, so the collapse follows the CONTENT — a long display name,
   a view with three actions — rather than a viewport width that cannot know
   what the band is currently carrying. Ordered cheapest-loss-first; nothing
   that disappears here becomes unreachable. */

/* 1. Tighten the spacing before anything is actually dropped. */
.app-topbar.density-snug { gap: 0.35rem; padding: 0 0.5rem; }
.app-topbar.density-snug .topbar-nav-link,
.app-topbar.density-snug .topbar-action-btn { padding: 0.3rem 0.45rem; }

/* 2. The display name goes; the avatar still opens the account menu. */
.app-topbar.density-no-name .user-name { display: none; }

/* 3. The center title goes; the page itself still shows it. */
.app-topbar.density-no-title .topbar-title { display: none; }

/* 4. Actions become icons — the label survives as the button's tooltip. */
.app-topbar.density-icons .topbar-action-label,
.app-topbar.density-icons .topbar-tour-label,
.app-topbar.density-icons .auth-text,
.app-topbar.density-icons .topbar-support-label { display: none; }

/* 5. Nav becomes icons. */
.app-topbar.density-nav-icons .topbar-nav-label { display: none; }

/* 6. Fully rolled up: nav leaves the band for the ⋯ menu, where shell.js
      renderOverflow has already put the same items as text entries. */
.app-topbar.density-nav-overflow .topbar-nav { display: none; }

/* No-JS / no-ResizeObserver fallback: without the ladder the band still has
   to cope, so keep the old viewport breakpoint for the un-measured case
   only. shell.js sets data-density on its first pass, which retires this. */
@media (max-width: 800px) {
    .app-topbar:not([data-density]) .topbar-nav-label { display: none; }
    .app-topbar:not([data-density]) .topbar-nav-link { padding: 0.3rem 0.45rem; }
    .app-topbar:not([data-density]) .topbar-action-label { display: none; }
    .app-topbar:not([data-density]) .topbar-title { display: none; }
}

/* ============================================
   THE THIN TOP DOCK (G19, shell.js setTopBar({dock}))
   Song pages and the lyrics editor: ← · BB · [search] · [Edit] · ⋯ and
   nothing else. The nav, bug, theme, tour and account leave the band and
   live in the ⋯ menu. Same element, same 48px.
   ============================================ */

.app-topbar.topbar-dock .topbar-nav,
.app-topbar.topbar-dock #topbar-tour,
.app-topbar.topbar-dock #topbar-bug,
.app-topbar.topbar-dock #topbar-theme,
.app-topbar.topbar-dock #auth-section {
    display: none;
}

.topbar-dock .topbar-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 34px;
    height: 34px;
    padding: 0 0.4rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.15rem;
    line-height: 1;
}

.topbar-dock .topbar-back:hover { background: var(--bg-secondary); }

.topbar-back-label {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-md);
    color: var(--text-secondary);
}

/* a list's name is long ("Friday Jam, Oct 3"): leave room for Edit and ⋯ at 360px */
@media (max-width: 370px) {
    .topbar-back-label { max-width: 31vw; }
}

/* G77: with ♡ Support in every band, a thin dock can still be too wide at the
   last step (← Friday Jam, Oct 3 at 360px). There the back label gives up the
   width, trimmed with "…", rather than the band running off the screen. Only
   at the last step: until then .topbar-left holds its width so the ladder can
   see the overflow. */
.app-topbar.topbar-dock.density-nav-overflow .topbar-left {
    flex-shrink: 1;
    min-width: 0;
}

.topbar-dock .topbar-icon-btn {
    min-width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--text);
}

.topbar-dock #topbar-overflow-btn {
    font-size: 1.35rem;
    border-radius: 50%;
}

/* Edit: the one way into editing, always in the band */
.topbar-edit-btn {
    border-radius: 999px;
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
    font-size: var(--font-base);
    padding: 0 0.75rem;
    /* one line, a fixed height: the ✏️ emoji's line box made it 34px, a
       pixel past what the band's wrap check allows (topbar-density.spec.js) */
    height: 32px;
    line-height: 1;
}

.topbar-edit-btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* A first visit: ⋯ glows (three pulses, then a steady glow) */
.topbar-dock #topbar-overflow-btn.tour-invite {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    box-shadow: 0 0 0 2px var(--accent), 0 0 8px 1px color-mix(in srgb, var(--accent) 40%, transparent);
    color: var(--accent);
    animation: tour-glow 2.4s ease-in-out 3;
}

@media (prefers-reduced-motion: reduce) {
    .topbar-dock #topbar-overflow-btn.tour-invite { animation: none; }
}

/* ⋯ menu (renderMenu): a popover under the button on a wide screen */
.topbar-dock .topbar-overflow .pill-popover {
    width: 340px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: var(--space-xs) var(--space-sm) var(--space-sm);
}

/* An open menu rises above the bottom band (also z 900, later in the page) */
.app-topbar:has(#topbar-overflow-menu:not(.hidden)) { z-index: 1000; }

.topbar-overflow .menu-scrim { display: none; }
/* G51: the sheet's X. Only the phone sheet layout shows it; everywhere else the menu is a small
   popover you can simply press past. */
.topbar-overflow .topbar-sheet-close { display: none; }

.menu-section-title {
    padding: 0.6rem 0.6rem 0.2rem;
    font-size: var(--font-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.menu-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
}

.menu-item-icon {
    flex: none;
    width: 1.5rem;
    min-height: 1.2em;
    text-align: center;
    color: var(--text-secondary);
}

.menu-item-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.menu-item-label { font-size: var(--font-base); }

.menu-item-sub {
    margin-top: 1px;
    font-size: var(--font-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-item-chevron {
    align-self: center;
    color: var(--text-secondary);
    transition: transform 0.15s;
}

.menu-item.expanded .menu-item-chevron { transform: rotate(90deg); }
.menu-item.expanded .menu-item-sub { display: none; }

.menu-sub { padding: 0 0 var(--space-xs) 2.1rem; }
.menu-sub-item { font-size: var(--font-base); }

.menu-segmented-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 0.4rem 0.6rem;
}

.menu-segmented {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.menu-segmented-btn {
    padding: 0.35rem 0.8rem;
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: var(--font-sm);
    cursor: pointer;
}

.menu-segmented-btn + .menu-segmented-btn { border-left: 1px solid var(--border); }
.menu-segmented-btn.active { background: var(--accent); color: var(--on-accent); }

/* On a phone the menu is a sheet from the bottom over a scrim. The scrim and
   the sheet live inside the band's own stacking context, so the band's
   buttons dim with the page. */
@media (max-width: 640px) {
    .topbar-dock .topbar-overflow:has(#topbar-overflow-menu:not(.hidden)) .menu-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1;
        background: rgba(0, 0, 0, 0.4);
    }

    .topbar-dock .topbar-overflow .pill-popover {
        position: fixed;
        z-index: 2;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-width: none;
        max-height: 85vh;
        border-width: 1px 0 0;
        border-radius: 16px 16px 0 0;
        padding: var(--space-md) var(--space-md) var(--space-lg);
        transform: none !important;   /* shell.js's edge-clamp is for popovers */
    }

    /* G51: fixed over the scrim, above where the sheet can ever reach (max-height 85vh), so there is one
       dependable way out no matter how many rows the menu has. */
    .topbar-dock .topbar-overflow .topbar-sheet-close:not(.hidden) {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        z-index: 3;
        top: calc(var(--topbar-h, 48px) + 8px);
        right: 8px;
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 50%;
        background: var(--bg-secondary);
        color: var(--text);
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
    }

    /* the grab handle */
    .topbar-dock .topbar-overflow .pill-popover::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        margin: 0 auto var(--space-sm);
        border-radius: 2px;
        background: var(--border);
    }

    .menu-item { padding: 0.65rem 0.6rem; }
}

/* ---- Details sheet (work-view.js openDetails) ---- */
.dock-sheet .notes-sheet-title { margin: 0; font-size: 1.1rem; }

.details-content { border: none; padding: 0; }
.details-content .info-details { display: block; margin: 0; }

.details-content .info-item {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: var(--space-sm);
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--font-base);
}

.details-content .info-label { color: var(--text-secondary); }
.details-content .info-tags { align-items: start; }
.details-content .info-tags-label { padding-top: 0; font-size: inherit; }

.details-footer {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    padding-top: var(--space-md);
}

.details-edit-btn {
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    background: var(--bg);
    color: var(--accent);
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
}

.details-edit-btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* The writer line is a button: it opens Details */
.song-details-btn {
    display: block;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: var(--font-base);
    text-align: left;
    cursor: pointer;
}

.song-details-btn:hover { color: var(--accent); }

/* ============================================
   UNIFIED SONG PAGE (M2): title/artist row, pill row, part tabs,
   bottom-band playback controls. See work-view.js + song-controls.js.
   ============================================ */

.song-writer-line,
.song-artist-line {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin-top: 2px;
}

.song-practice-line {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin-top: 2px;
}

.song-practice-line a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.song-practice-line a:hover {
    color: var(--accent);
}

/* Pill popover content building blocks */
.pill-section {
    padding: 4px 2px;
}

.pill-section + .pill-section {
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 10px;
}

.pill-transpose-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pill-current-key {
    font-weight: 600;
    min-width: 2.5em;
    text-align: center;
}

.pill-key-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.pill-key-btn {
    padding: 4px 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-sm);
}

.pill-key-btn:hover { border-color: var(--accent); }

.pill-key-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.pill-key-btn.original { font-weight: 700; }

.pill-checks {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pill-nashville-btn { width: 100%; }

/* Wider popovers for Info / Arrangement content */
.pill.pill-wide .pill-popover {
    min-width: 300px;
    max-width: min(440px, calc(100vw - 24px));
}

.pill-info-content { font-size: var(--font-sm); }

/* Playback controls mounted in the bottom band */
.app-bottomband .tab-controls,
.app-bottomband .abc-band-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    border: none;
    background: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Tab controls hosted in the bottom band: flatten the old boxed styling so
   the band itself is the container, and the mixer flows inline. */
.app-bottomband .tab-controls {
    background: none;
    border-radius: 0;
    margin-bottom: 0;
    padding: 0;
    justify-content: center;
    flex: 1;
}

.app-bottomband .tab-track-mixer {
    border-top: none;
    margin-top: 0;
    padding: 0 0 0 0.75rem;
    border-left: 1px solid var(--border);
    width: auto;
}

/* Full screen (the top dock's button, song page only): the header block goes,
   both bands stay. Not while the tab editor is open; it has its own page. */
body.full-screen:not(.tab-editing) .song-header,
body.full-screen:not(.tab-editing) .song-practice-line,
body.full-screen:not(.tab-editing) #song-reading-line,
body.full-screen:not(.tab-editing) .song-source,
body.full-screen:not(.tab-editing) #song-census { display: none; }

/* Full screen is a mode, so the button has to look like one: aria-pressed
   alone is invisible to anyone who can see the screen. */
#full-screen-btn[aria-pressed="true"] {
    background: var(--accent);
    color: var(--on-accent);
}
#full-screen-btn[aria-pressed="true"]:hover {
    background: var(--accent);
    color: var(--on-accent);
}

/* ============================================
   THE READING DOCK (G19b; docs/js/song-dock.js)
   Key · Size · View · Display in the bottom band, for a lyric sheet and a
   chord chart; ▶ · Tempo · Size · View for ABC notation. One row at 360px.
   ============================================ */

.reading-dock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
}

.dock-btn,
.dock-size,
.dock-seg,
.dock-tempo {
    box-sizing: border-box;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text);
    font: inherit;
    font-size: var(--font-sm);
}

.dock-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.75rem;
    white-space: nowrap;
    cursor: pointer;
}

.dock-btn:hover,
.dock-btn[aria-expanded="true"] { border-color: var(--accent); }
.dock-caret { font-size: 0.7em; color: var(--text-secondary); }

.dock-size,
.dock-tempo {
    display: inline-flex;
    align-items: center;
    padding: 0 0.25rem 0 0.65rem;
    white-space: nowrap;
}

.dock-tempo { padding-left: 0.6rem; }
.dock-size-aa,
.dock-tempo-label { color: var(--text-secondary); margin-right: 0.1rem; }
.dock-tempo-n { min-width: 2.2ch; text-align: center; font-variant-numeric: tabular-nums; cursor: pointer; border-radius: 4px; user-select: none; -webkit-user-select: none; }
/* the metronome icon in Tempo (G52): a 32px target, the glyph in the text colour, the accent while it is on */
.dock-metronome-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-secondary); cursor: pointer; }
.dock-metronome-btn[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); }
/* tap tempo (song-dock.js wireTapTempo): lit while taps are being counted */
.dock-tempo-n.tapping { background: var(--accent); color: var(--on-accent); }

.dock-size-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.dock-size-btn:hover:not(:disabled) { background: var(--bg-tertiary); }
.dock-size-btn:disabled { opacity: 0.35; cursor: default; }

/* Bars per row, in the tab Display sheet: Readable | Fit to screen (U24), then − 4 + */
.dock-bars-modes {
    display: flex;
    gap: 0.25rem;
    padding: 0.2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-secondary);
    font-size: var(--font-sm);
}
.dock-bars-modes .dock-bars-auto { flex: 1; min-height: 34px; }
.dock-bars {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    box-sizing: border-box;
    height: 34px;
    padding: 0 0.25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-secondary);
    font-size: var(--font-sm);
}
.dock-bars-auto {
    padding: 0.3rem 0.65rem;
    border: none;
    border-radius: 999px;
    background: none;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
.dock-bars-auto:hover { background: var(--bg-tertiary); }
.dock-bars-auto[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.dock-bars-count {
    /* one width for "4" and "8 · 5 fit", so − and + never move under a
       finger (a growing label once put "−" where the reset is) */
    width: 9.5ch;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.dock-seg { display: inline-flex; overflow: hidden; padding: 0; }

.dock-seg-btn {
    border: none;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: var(--font-sm);
    padding: 0 0.75rem;
    cursor: pointer;
    white-space: nowrap;
}

.dock-seg-btn.on { background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: default; }

.dock-play {
    flex: none;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 1rem;
    cursor: pointer;
}

.dock-play:disabled { opacity: 0.6; }
/* ▶ and ⏸ are drawn (song-dock.js setPlayGlyph): centred in the circle by the box, not by a font's side bearings; the character is hidden text */
.dock-play, .dock-stop { display: inline-flex; align-items: center; justify-content: center; gap: 0.35em; line-height: 1; }
.dock-play .dock-glyph, .dock-stop .dock-glyph { flex: none; display: block; }
/* a click lands on the button itself, never on a glyph the handler is about to replace (a popover that asks "was this click inside me?" afterwards would find it detached) */
.dock-play > *, .dock-stop > * { pointer-events: none; }
.dock-glyph-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ============================================
   THE SET-LIST PILL (G19c; docs/js/list-pill.js)
   ‹ 2 of 9 › at the left of the bottom dock when the song was opened from a
   list. ‹ and › step; the middle goes back to the list.
   ============================================ */

.list-pill {
    display: inline-flex;
    align-items: stretch;
    flex: none;
    box-sizing: border-box;
    height: 34px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-secondary);
    font-size: var(--font-sm);
}

.list-pill-btn {
    border: none;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    line-height: 1;
    padding: 0 0.55rem;
    cursor: pointer;
}

.list-pill-btn.list-prev,
.list-pill-btn.list-next { font-size: 1.25rem; }
.list-pill-btn.list-pos { padding: 0 0.15rem; color: var(--text); white-space: nowrap; }
.list-pill-btn:hover:not(:disabled) { background: var(--bg-tertiary); }
.list-pill-btn:disabled { opacity: 0.35; cursor: default; }

/* the tempo chip a tab in a list gets, and the sheet it opens */
.dock-note { color: var(--text-secondary); }
.dock-tempo-chip-n { font-variant-numeric: tabular-nums; }
.tab-tempo-sheet { text-align: center; }
.tab-tempo-sheet .dock-tempo { height: 48px; margin: var(--space-md) auto; padding: 0 0.4rem; font-size: var(--font-lg, 1.2rem); }
.tab-tempo-sheet .dock-tempo-label { display: none; }
.tab-tempo-sheet .dock-tempo-n { min-width: 3.2ch; font-weight: 600; }
.tab-tempo-sheet .dock-size-btn { width: 40px; height: 40px; font-size: 1.4rem; }

/* ============================================
   THE TAB DOCK (G19c; docs/js/tab-dock.js)
   ▶ [⏹] Tempo − n + · View ▾ · Display, in `.tab-controls.tab-dock`, the same
   on every width. The tab EDITOR's band is `.tab-controls` without
   `.tab-dock` and keeps the rules further down.
   ============================================ */

.app-bottomband .tab-controls.tab-dock {
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.4rem;
    overflow: visible;
}

.tab-dock > * { flex: none; }

.tab-dock .dock-play {
    width: auto;
    min-width: 38px;
    padding: 0 0.8rem;
    border-radius: 999px;
    white-space: nowrap;
}

.tab-dock .dock-stop,
.reading-dock .bt-stop {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
}

/* Stop appears once playback has started, and goes when it ends */
.tab-dock .dock-stop:disabled,
.reading-dock .bt-stop:disabled { display: none; }

/* G52: the chart's backtrack in the reading dock: ▶ [■] Tempo. Nothing in it shrinks, and on a phone the word Tempo goes. */
.reading-dock .bt-play, .reading-dock .bt-stop, .reading-dock .bt-tempo { flex: none; }
/* ▶ Loop (a loop is armed) is wider than the circle ▶ and ⏸ sit in: the pill grows to its label, the circle stays at 38px */
.reading-dock .bt-play { width: auto; min-width: 38px; padding: 0 0.55rem; white-space: nowrap; border-radius: 999px; }
@media (max-width: 520px) { .reading-dock .bt-tempo .dock-tempo-label { display: none; } }
/* The row is tight below 460px (the mock moves Aa into Display at 390, which would need Display to hold Size): the pill
   padding goes, and below 430px the word Aa. ⏸ already stops, so ■ goes below 420px, and below 460px when a set list's pill leads the dock
   (which also turns Tempo into a chip). */
@media (max-width: 460px) {
    .reading-dock:has(.bt-play) .dock-size { padding-left: 0.25rem; }
    .reading-dock:has(.bt-play) .dock-tempo { padding-left: 0.25rem; }
    .reading-dock:has(.bt-play) .dock-btn { padding: 0 0.45rem; }
    /* the metronome icon (32px, never smaller) and ▶ Loop take the room the gaps and the pill's padding give back */
    .reading-dock:has(.bt-play) { gap: 3px; }
    .reading-dock .bt-play { padding: 0 0.45rem; }
    .reading-dock:has(.list-pill) .bt-stop:not(:disabled) { display: none; }
}
/* The word Aa stays down to 430px, so a 440 phone (Mike's) can tell Size's − + from Tempo's */
@media (max-width: 430px) {
    .reading-dock:has(.bt-play) .dock-size-aa { display: none; }
}
@media (max-width: 420px) {
    .reading-dock:has(.bt-play) { gap: 2px; }
    .reading-dock:has(.bt-play) .dock-tempo { padding-left: 0.1rem; }
    .reading-dock .bt-play { padding: 0 0.4rem; gap: 0.25em; }
    .reading-dock .bt-play .dock-glyph { width: 14px; height: 14px; }
    .reading-dock .bt-stop:not(:disabled) { display: none; }
}
@media (max-width: 370px) {
    /* doubled class: the list pill's own rules for this width come later in the file */
    .reading-dock.reading-dock:has(.bt-play) { gap: 2px; }
    .reading-dock.reading-dock:has(.bt-play) .dock-size-btn { width: 22px; }
    .reading-dock.reading-dock:has(.bt-play) .dock-btn { padding: 0 0.35rem; }
    .reading-dock.reading-dock .bt-play { width: auto; min-width: 32px; height: 32px; padding: 0 0.4rem; font-size: 0.9rem; }
}

/* The position readout rides the dock's top edge (empty when stopped) */
.tab-dock .tab-position {
    position: absolute;
    right: 0.75rem;
    bottom: calc(100% - 9px);
    padding: 1px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.7rem;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.tab-dock .tab-position:empty { display: none; }

/* ---- The tab Display sheet: the band's controls, moved in ---- */
.tab-display .dock-group-label { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--border); }
.tab-display .dock-group-label:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.tab-display .dock-group-chart { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--border); }
.dock-opt-row.dock-opt-end { justify-content: flex-end; }

.dock-sheet .tab-play-in { padding-top: 0; }

.dock-sheet .tab-capo-indicator {
    display: block;
    margin-top: var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: 400;
}

.dock-sheet .tab-capo-indicator:empty { display: none; }

.dock-sheet .tab-practice > label,
.dock-sheet .tab-practice > label:hover,
.dock-sheet .tab-practice > label:has(input:checked) {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.1rem;
    border: none;
    background: none;
    border-radius: 0;
    font-size: var(--font-base);
    color: var(--text);
}

.dock-sheet .tab-practice input[type="checkbox"] {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.dock-sheet .tab-practice span { opacity: 1; font-size: inherit; }

.dock-sheet .tab-track-mixer {
    margin: 0;
    padding: 0;
    border: none;
    gap: 0.4rem;
}

.dock-sheet .tab-track-mixer .mixer-label { display: none; }

.dock-sheet .track-toggle {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: var(--font-sm);
}

.dock-sheet .track-name { max-width: none; }

/* a take in View's drill-in, and the way back */
.dock-count {
    margin-left: 0.4rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: var(--font-xs);
    font-weight: 500;
    white-space: nowrap;
}

.dock-row .dock-row-label { flex: 1; }
.dock-chev { color: var(--text-secondary); font-size: 1.2rem; }

.dock-back {
    border: none;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0 0.3rem 0 0;
    cursor: pointer;
}

.dock-row.dock-take { justify-content: flex-start; gap: 0.5rem; }
.dock-pin { width: 1.1em; color: var(--warning, #d97706); text-align: center; flex: none; }
.dock-take-text { flex: 1; min-width: 0; }
.dock-take-who { font-weight: 600; }
.dock-take-src { margin-left: 0.4rem; color: var(--text-secondary); font-size: var(--font-sm); }

/* wide screens: the dock lines up with the song's left edge, as the mock draws it */
@media (min-width: 800px) {
    .app-bottomband:has(.reading-dock) {
        padding-left: calc((100% - min(100% - 4rem, 1800px)) / 2 + 1.25rem);   /* the song's own left edge */
        padding-right: 1.25rem;
    }
    .reading-dock,
    .app-bottomband .tab-controls.tab-dock { justify-content: flex-start; }
}

@media (max-width: 420px) {
    .reading-dock { gap: 0.25rem; }
    .list-pill-btn { padding: 0 0.45rem; }
    /* a set list's pill takes a share of the row: ABC drops the word Tempo, and the band's margins give */
    .abc-dock:has(.list-pill) .dock-tempo-label { display: none; }
    .app-bottomband:has(.list-pill) { padding-left: 0.4rem; padding-right: 0.4rem; }
    .dock-btn { padding: 0 0.55rem; }
    .dock-size { padding-left: 0.45rem; }
    .dock-size-btn { width: 26px; }
    .dock-seg-btn { padding: 0 0.5rem; }
}

@media (max-width: 370px) {
    /* a set list's pill takes a share of the row: give a little everywhere */
    .reading-dock:has(.list-pill) .dock-btn { padding: 0 0.45rem; }
    .reading-dock:has(.list-pill) .dock-size { padding-left: 0.4rem; }
    .reading-dock:has(.list-pill) .dock-size-btn { width: 24px; }
    .list-pill-btn { padding: 0 0.35rem; }
    .list-pill-btn.list-pos { padding: 0 0.1rem; }
    .abc-dock:has(.list-pill) .dock-size-aa { display: none; }
    .abc-dock .dock-tempo-label,
    .tab-dock .dock-tempo-label { display: none; }
}

/* ---- The sheets behind the dock: View, Key, Display (shell.js openSheet) ---- */
.dock-sheet .dock-list { display: flex; flex-direction: column; }

.dock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    width: 100%;
    padding: 0.7rem 0.1rem;
    border: none;
    border-bottom: 1px solid var(--border);
    background: none;
    color: var(--text);
    font: inherit;
    font-size: var(--font-base);
    text-align: left;
    cursor: pointer;
}

.dock-row:last-child { border-bottom: none; }
.dock-row:hover { background: var(--bg-secondary); }
.dock-row-check { color: var(--accent); font-weight: 700; }

.dock-sheet-heading,
.dock-group-label {
    margin: var(--space-md) 0 var(--space-xs);
    color: var(--text-secondary);
    font-size: var(--font-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dock-group-label.dock-group-chart {
    margin-top: var(--space-lg, 1rem);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.dock-sheet-heading:first-child,
.dock-group-label:first-child { margin-top: 0; }

.dock-opt-hint { color: var(--text-secondary); font-size: var(--font-xs); font-weight: 400; letter-spacing: 0; text-transform: none; }
.qc-checkbox.is-off { color: var(--text-secondary); cursor: default; }

.dock-opt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 0.45rem 0.1rem;
    font-size: var(--font-base);
}

.dock-opt-row .pill-mode-group { flex: none; }
.dock-opt-row .pill-mode-btn { flex: none; padding: 0.3rem 0.7rem; }
/* a choice of several whose names do not fit one line (the bass style at 440px): the pills wrap */
.pill-mode-group.dock-opt-wrap { flex-wrap: wrap; padding: 0.2rem 0.1rem 0.45rem; }
.pill-mode-group.dock-opt-wrap .pill-mode-btn { flex: none; padding: 0.3rem 0.7rem; }


/* the bass style dial (G52): a stepped slider, Root and fifth at the left to Walk into every change at the right, its name beside it; one line at 440px */
.bass-dial { display: flex; align-items: center; gap: var(--space-md); padding: 0.2rem 0.1rem 0.45rem; }
.bass-dial input[type=range] { flex: 1 1 6rem; min-width: 0; margin: 0; height: 28px; background: transparent; -webkit-appearance: none; appearance: none; }
/* drawn by hand: WebKit (every iPhone browser) draws no track for a native range in this sheet */
.bass-dial input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--text-muted); }
.bass-dial input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--text-muted); }
.bass-dial input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -8px; border: 0; border-radius: 50%; background: var(--accent); }
.bass-dial input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--accent); }
.bass-dial input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.bass-dial #bass-style-name { flex: 0 1 auto; white-space: nowrap; font-size: var(--font-base); }

/* the Key sheet: the current key large, a step either side, the twelve keys */
.dock-sheet .pill-transpose-row { gap: var(--space-xl); padding: 0.4rem 0 0; }
.dock-sheet .pill-transpose-row .qc-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); font-size: 1.4rem; }
.dock-sheet .pill-current-key { font-size: 2.2rem; min-width: 2.5ch; }
.pill-original-key { text-align: center; color: var(--text-secondary); font-size: var(--font-xs); margin-bottom: var(--space-sm); }
.dock-sheet .pill-key-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; padding-top: var(--space-md); }
.dock-sheet .pill-key-btn { padding: 0.65rem 0; font-size: var(--font-base); }
.dock-sheet .pill-nashville-btn { width: auto; }
.pill-hint { margin-left: var(--space-sm); color: var(--text-secondary); font-size: var(--font-xs); }

/* ============================================
   PHONE-WIDTH: reclaim horizontal space
   ============================================ */
@media (max-width: 640px) {
    /* Song pages: back + brand are the navigation — hide the global nav
       icons so the band breathes */
    .app-topbar.has-back .topbar-nav {
        display: none;
    }

    .app-topbar {
        gap: 0.35rem;
        padding: 0 0.5rem;
    }

    .container {
        padding: 0.5rem;
    }

    /* The desktop "comfortable margins" rule (100% - 4rem) costs 64px on a
       phone — song and editor pages get the full width instead */
    .container:has(.song-view:not(.hidden)),
    .container:has(.editor-panel:not(.hidden)) {
        max-width: 100%;
    }

    /* The song sheet goes full-bleed: no card chrome inside a container
       inside a viewport — every horizontal pixel goes to the music */
    .song-content {
        background: none;
        border: none;
        border-radius: 0;
        padding: 0.25rem 0;
    }
}

/* Segmented mode buttons inside pill popovers (replaces native selects,
   whose menus render at odd sizes over the popover on mobile) */
.pill-mode-label {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.pill-mode-group {
    display: flex;
    gap: 4px;
}

.pill-mode-btn {
    flex: 1;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text);
    border-radius: 999px;
    font-size: var(--font-sm);
    cursor: pointer;
    white-space: nowrap;
}

.pill-mode-btn:hover { border-color: var(--accent); }

.pill-mode-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

/* Pill popovers hosted in the bottom band open upward */
.app-bottomband .pill-popover {
    top: auto;
    bottom: calc(100% + 6px);
}

.tab-key-pill .pill-popover {
    min-width: 220px;
}

/* The key pill lives inside a qc-group whose overflow:hidden (rounded
   button cluster) would clip its drop-up popover */
.qc-group:has(.tab-key-pill) {
    overflow: visible;
}

/* The tab settings sheet is phone-only. tab-controls-sheet.js inserts it
   (and the ⚙ button) only while the media query matches, so the desktop DOM
   is untouched; this belt-and-braces rule covers the resize instant. */
.tab-settings-sheet {
    display: none;
}

/* Phone song-page band diet: back · logo · Lists · ⋯ (Export/bug/theme/
   auth live in the overflow or on other pages) */
@media (max-width: 640px) {
    .app-topbar.has-back #topbar-bug,
    .app-topbar.has-back #topbar-theme,
    .app-topbar.has-back #auth-section {
        display: none;
    }

    /* Playback band on a phone: ~13 control groups used to WRAP into 4-6
       rows, then (worse) into a 1468px sideways strip with no scroll
       affordance — Play/Stop were reachable, tempo and everything past it
       were not. The band now carries the PERFORMANCE controls only
       (Play · Stop · tempo · loop · ⚙) and tab-controls-sheet.js re-parents
       the rest into the settings sheet below. */
    /* Asymmetric padding: the top gap is where the position readout rides */
    .app-bottomband:has(.tab-controls:not(.tab-dock)) {
        padding: 0.7rem 0.35rem 0.4rem;
        min-height: 60px;
    }

    .app-bottomband .tab-controls:not(.tab-dock) {
        flex-wrap: nowrap;
        justify-content: center;
        gap: 0.4rem;
        /* Safety net only — the five band controls fit 390px. A visible
           scrollbar is the affordance if a narrower device overflows. */
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .app-bottomband .tab-controls:not(.tab-dock) > * {
        flex: 0 0 auto;
        order: 2;
    }

    .app-bottomband .tab-controls:not(.tab-dock) .tab-play-btn { order: 0; }
    .app-bottomband .tab-controls:not(.tab-dock) .tab-stop-btn { order: 1; }
    .app-bottomband .tab-controls:not(.tab-dock) .tab-tempo-group { order: 2; }
    .app-bottomband .tab-controls:not(.tab-dock) .tab-loop-toggle { order: 3; }
    .app-bottomband .tab-controls:not(.tab-dock) .tab-more-btn { order: 4; }

    /* 44px touch targets (the desktop 32px row was 28-33px on a phone) */
    .app-bottomband .tab-controls:not(.tab-dock) .qc-toggle-btn {
        height: 44px;
        padding: 0 0.6rem;
        font-size: 0.9rem;
        border-radius: var(--radius-md);
    }

    .app-bottomband .tab-controls:not(.tab-dock) .qc-btn {
        width: 40px;
        height: 44px;
        font-size: 1.2rem;
    }

    .app-bottomband .tab-controls:not(.tab-dock) .qc-label {
        height: 44px;
        min-width: 26px;
        padding: 0 0.2rem;
    }

    .app-bottomband .tab-controls:not(.tab-dock) .tab-loop-toggle {
        height: 44px;
        padding: 0 0.55rem;
        border-radius: var(--radius-md);
    }

    .app-bottomband .tab-controls:not(.tab-dock) .tab-more-btn {
        width: 44px;
        padding: 0;
        justify-content: center;
        font-size: 1.15rem;
    }

    /* The clock has no room in a five-control row, so it rides the band's
       top edge instead (empty whenever playback is stopped). */
    .app-bottomband .tab-controls:not(.tab-dock) .tab-position {
        position: absolute;
        top: 1px;
        left: 0;
        right: 0;
        min-width: 0;
        text-align: center;
        font-size: 0.62rem;
        line-height: 1;
        pointer-events: none;
    }

    /* The strip's overflow-x would clip the key pill's drop-up, so it
       becomes a sheet pinned above the band instead. */
    .app-bottomband .tab-controls:not(.tab-dock) .pill-popover,
    .tab-settings-sheet {
        position: fixed;
        top: auto;
        bottom: calc(var(--bottomband-h, 60px) + 8px);
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        max-width: none;
    }
}

/* ── The settings sheet, and the band width that summons it ──────────────
   The sheet only EXISTS while the band has collapsed — tab-controls-sheet.js
   builds it at that moment and removes it again — so its own chrome needs no
   width test. It used to live inside the phone media query because a phone
   viewport was the only way to get one; now the band collapses on its own
   width (a narrow window, a split view, a test that constrains the
   container), and the chrome has to follow it there. Everything the band
   gave up ends up in here, in labeled rows. */
.tab-settings-sheet {
    z-index: 950;
    display: block;
    max-height: 62vh;
    overflow-y: auto;
    padding: var(--space-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.tab-sheet-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.15rem;
}

.tab-sheet-row + .tab-sheet-row {
    border-top: 1px solid var(--border);
}

.tab-sheet-label {
    flex: 0 0 3.2rem;
    font-size: var(--font-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.tab-sheet-items {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

/* The mixer's band styling (left rule, inline width) makes no sense in
   a labeled row */
.tab-settings-sheet .tab-track-mixer {
    border-left: none;
    padding: 0;
    gap: 0.4rem;
}

.tab-settings-sheet .qc-btn { width: 40px; height: 40px; }
.tab-settings-sheet .qc-label { height: 40px; }
.tab-settings-sheet .qc-toggle-btn { height: 40px; padding: 0 0.75rem; }
.tab-settings-sheet .pill-btn { padding: 0.45rem 0.75rem; }
.tab-settings-sheet .pill-mode-btn { padding: 0.5rem 0.7rem; }
.tab-settings-sheet .track-toggle,
.tab-settings-sheet .tab-metronome-toggle {
    padding: 0.45rem 0.6rem;
}

/* The count-in label is an unstyled native checkbox everywhere else;
   in a row of bordered toggles it needs the same outline to read as
   one of them. */
.tab-settings-sheet .tab-countin-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
}

/* Drop-ups opened from inside the sheet sit above the sheet itself */
.tab-settings-sheet .pill-popover {
    z-index: 960;
}

/* ── The band asks about ITSELF, not the window ───────────────────────────
   `container-type: inline-size` makes the bottom band a query container
   named `tabband`, so the collapsed layout below is chosen by the BAND's
   width rather than the window's. That is the same question tab-controls-sheet.js asks (it observes
   the element and publishes `.is-narrow-band`), and it is what makes the
   phone layout reachable by constraining the container instead of the
   viewport — which is to say, reachable from a test.

   The `@media (max-width: 640px)` block above stays as the fallback for
   browsers without container queries. Where both apply they say the same
   thing, so the duplication is inert rather than contradictory; this block
   comes second so it wins the tie.

   The drop-up offsets are restated inside the block rather than inherited,
   because this block wins the tie against the media query and has to carry
   everything the collapsed band needs — see the note beside them. */
@supports (container-type: inline-size) {
    /* The container is the BAND, not `.tab-controls` inside it. On a phone
       `.tab-controls` is an `overflow-x: auto` strip, and a query container
       is also a containing block for `position: fixed` descendants — so
       putting it there made the strip clip its own settings sheet down to a
       44px slot. The band has no overflow, and its inline size comes from
       `left: 0; right: 0` (or from a width a test pins on it), so it can be
       size-contained without depending on its contents. */
    .app-bottomband {
        container: tabband / inline-size;
    }

    @container tabband (max-width: 640px) {
        .app-bottomband .tab-controls:not(.tab-dock) {
            flex-wrap: nowrap;
            justify-content: safe center;   /* a strip that overflows scrolls from its first control */
            gap: 0.25rem;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
        }

        .app-bottomband .tab-controls:not(.tab-dock) > * {
            flex: 0 0 auto;
            order: 2;
        }

        .app-bottomband .tab-controls:not(.tab-dock) .tab-play-btn { order: 0; }
        .app-bottomband .tab-controls:not(.tab-dock) .tab-stop-btn { order: 1; }
        .app-bottomband .tab-controls:not(.tab-dock) .tab-tempo-group { order: 2; }
        .app-bottomband .tab-controls:not(.tab-dock) .tab-loop-toggle { order: 3; }
        .app-bottomband .tab-controls:not(.tab-dock) .tab-more-btn { order: 4; }

        /* 44px touch targets — a band this narrow is being touched. */
        .app-bottomband .tab-controls:not(.tab-dock) .qc-toggle-btn {
            height: 44px;
            padding: 0 0.4rem;
            font-size: 0.9rem;
            border-radius: var(--radius-md);
        }


        .app-bottomband .tab-controls:not(.tab-dock) .qc-btn {
            width: 36px;
            height: 44px;
            font-size: 1.2rem;
        }

        .app-bottomband .tab-controls:not(.tab-dock) .qc-label {
            height: 44px;
            min-width: 26px;
            padding: 0 0.1rem;
        }

        .app-bottomband .tab-controls:not(.tab-dock) .tab-loop-toggle {
            height: 44px;
            padding: 0 0.45rem;
            border-radius: var(--radius-md);
        }

        .app-bottomband .tab-controls:not(.tab-dock) .tab-more-btn {
            width: 44px;
            padding: 0;
            justify-content: center;
            font-size: 1.15rem;
        }

        /* No room for the clock in a five-control row; it rides the top edge. */
        .app-bottomband .tab-controls:not(.tab-dock) .tab-position {
            position: absolute;
            top: 1px;
            left: 0;
            right: 0;
            min-width: 0;
            text-align: center;
            font-size: 0.62rem;
            line-height: 1;
            pointer-events: none;
        }

        /* The strip's overflow-x would clip a drop-up, so the sheet and the
           pill popovers become panels pinned just above the band — the same
           offsets the media-query fallback uses, deliberately.

           `100%` would have been tidier, but it does not mean what it looks
           like it means here: `container-type` does NOT make the band the
           containing block for a `position: fixed` descendant in Chromium,
           so a percentage resolves against the viewport and the sheet flies
           off the top of the screen. `--bottomband-h` (published by
           shell.js) is the band's real height and the honest answer. */
        .app-bottomband .tab-controls:not(.tab-dock) .pill-popover,
        .app-bottomband .tab-controls:not(.tab-dock) .tab-settings-sheet {
            position: fixed;
            top: auto;
            bottom: calc(var(--bottomband-h, 60px) + 8px);
            left: 0.5rem;
            right: 0.5rem;
            width: auto;
            max-width: none;
        }
    }
}

/* Narrow phones (360px and down): the same five controls, tighter. Keeps
   the 44px height — only the gaps and side padding give. */
@media (max-width: 374px) {
    .app-bottomband .tab-controls:not(.tab-dock) {
        gap: 0.2rem;
    }

    .app-bottomband .tab-controls:not(.tab-dock) .qc-btn {
        width: 34px;
    }

    .app-bottomband .tab-controls:not(.tab-dock) .qc-toggle-btn {
        padding: 0 0.35rem;
    }

    .app-bottomband .tab-controls:not(.tab-dock) .tab-loop-toggle {
        padding: 0 0.4rem;
    }

    .app-bottomband .tab-controls:not(.tab-dock) .tab-more-btn {
        width: 36px;
    }

}

/* Wanted list on the bounty board */
.wanted-block {
    margin-bottom: 2rem;
}

.wanted-card {
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.core-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: var(--font-xs);
    font-weight: 600;
    vertical-align: middle;
}

.wanted-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.wanted-chip {
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.bounty-show-more {
    display: block;
    margin: 0.75rem auto 0;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: var(--font-sm);
    cursor: pointer;
}

.bounty-show-more:hover { border-color: var(--accent); }

.partgap-card {
    text-decoration: none;
    color: inherit;
}

/* --- Search controls: the Instrument pill (2026-07, trimmed 2026-11-08) --- */
.facet-clear { text-align: center; color: var(--text-secondary); }

/* Instrument facet: one-tap toggles inside the Instrument pill */
.facet-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
}
.facet-toggle-box {
    flex: 0 0 auto;
    width: 0.85rem;
    height: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg);
}
.facet-toggle.checked { color: var(--accent); }
.facet-toggle.checked .facet-toggle-box {
    border-color: var(--accent);
    background: var(--accent);
    position: relative;
}
.facet-toggle.checked .facet-toggle-box::after {
    content: '';
    position: absolute;
    left: 0.22rem;
    top: 0.04rem;
    width: 0.22rem;
    height: 0.45rem;
    border: solid var(--on-accent);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.facet-hint {
    padding: 0.35rem 0.6rem 0.5rem;
    font-size: 0.7rem;
    line-height: 1.35;
    color: var(--text-secondary);
    max-width: 15rem;
}


/* ==========================================================================
   Drafts (#drafts) and the app-wide file drop — PWA, §9.3
   ========================================================================== */

.drafts-view {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.drafts-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.drafts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.draft-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.draft-row-main {
    min-width: 0;
}

.draft-row-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.draft-row-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.draft-row-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* The inline "Delete this draft?" — the app's answer to window.confirm.
   It wraps onto its own line inside the row it is asking about, so the
   question and the thing it is about are never separated. */
.draft-row:has(.draft-confirm) {
    flex-wrap: wrap;
}

.draft-confirm {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.draft-confirm-question {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: auto;
}

/* Same question, same shape, in the tab editor's action bar. */
.tab-edit-discard-question {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Dragging a .tef / .otf.json anywhere over the app: one calm hint, and no
   overlay element that could swallow the drop. */
body.file-dragover {
    outline: 3px dashed var(--accent);
    outline-offset: -3px;
}

/* ============================================
   THE EDITOR AS A MODE OF THE SONG PAGE (plan §9)
   The band survives edit mode: its own controls stay where they are, the
   session's buttons take the ✏️ Edit slot, and anything that cannot mean
   something mid-edit (Key, Repeats, Feel) is not shown.
   ============================================ */

.tab-edit-status {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

/* G32: one of your submissions is held for review (main.js updateHeldBadge). */
.user-info.has-held {
    position: relative;
}
.user-info.has-held::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: #d97706;
    box-shadow: 0 0 0 2px var(--bg);
}

/* G32: "where did my submission land" (submission-landed.js), in a sheet. */
#submission-landed-sheet {
    border-top: 4px solid var(--success);
}
#submission-landed-sheet .notes-sheet-title {
    white-space: normal;
    font-size: 1.15rem;
}
#submission-landed-sheet .notes-sheet-title::before {
    content: '✓ ';
    color: var(--success);
}
.landed-card p {
    margin: 0 0 0.75rem;
    line-height: 1.45;
}
.landed-next {
    color: var(--text-secondary);
    font-size: var(--font-sm);
}
.landed-link-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}
.landed-link {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 0.4rem 0.6rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
}
.landed-copy-btn {
    flex-shrink: 0;
}
.landed-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* "Submitted — live now, appears in search after the next build." */
.arr-status {
    margin-top: var(--space-xs);
    padding: 0.35rem 0.6rem;
    border-left: 3px solid var(--accent);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    color: var(--text-secondary);
}
.arr-status .arr-skipped {
    margin-top: 0.15rem;
}

/* "Tab by" credit row (otf-editor/tab-credit.js), in the Submit step. */
.tab-credit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    margin: 0.35rem 0 0.5rem;
    font-size: var(--font-sm);
}
.tab-credit-field {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 14rem;
    min-width: 0;
}
.tab-credit-label {
    color: var(--text-secondary);
    white-space: nowrap;
}
.tab-credit input {
    flex: 1;
    min-width: 0;
    font: inherit;
    color: inherit;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.4rem;
}
.tab-credit input:focus {
    border-style: solid;
    border-color: var(--accent);
    outline: none;
}
.tab-credit.is-locked input {
    border-style: solid;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}
.tab-credit-error {
    flex-basis: 100%;
    color: var(--danger, #c0392b);
}
.tab-credit-note {
    flex-basis: 100%;
    color: var(--text-secondary);
}

/* ==========================================================================
   Lead-sheet editor (js/lead-editor/): one CodeMirror view, Lyrics | Chords | ChordPro
   Lyrics and Chords modes reuse the book's own classes (.song-body, .song-section,
   .section-label, .cl-line, .cl-segment, .cl-chord), so it looks like the
   song page by construction; only editor-only chrome is styled below.
   ========================================================================== */
.editor-workspace { display: block; height: auto; margin-bottom: 0.5rem; }
.editor-lead { min-width: 0; }
.editor-modebar { display: flex; align-items: center; gap: 0.75rem; margin: 0.25rem 0 0.6rem; flex-wrap: wrap; }
.le-modeswitch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--bg); }
.le-modeswitch button {
    border: 0; background: none; color: var(--text-secondary); padding: 0.35rem 0.9rem;
    font: inherit; font-size: 0.85rem; cursor: pointer; min-height: 32px;
}
.le-modeswitch button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.le-pane-toggle { display: none; }

.le-workspace { display: block; }
.le-preview-pane { display: none; }
.le-mode-chordpro { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.le-mode-chordpro .le-preview-pane {
    display: block; background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 8px; padding: 1.25rem; min-width: 0;
}
.le-preview-empty { color: var(--text-secondary); font-family: inherit; }
@media (max-width: 799.98px) {
    .le-mode-chordpro { display: block; }
    .le-mode-chordpro .le-preview-pane { display: none; }
    .le-mode-chordpro.le-show-preview .le-preview-pane { display: block; }
    .le-mode-chordpro.le-show-preview .le-source-pane { display: none; }
    #editor-pane-toggle:not(.hidden) { display: inline-flex; }
}

.le-cm .cm-editor {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
    min-height: 55vh; color: var(--text);
}
.le-cm .cm-editor.cm-focused { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; }
/* overflow-x CLIP (not hidden: no scroll container, the page still scrolls the chart): CodeMirror measures text with a
   99999px-wide absolute line (measureTextSize, whenever no line is plain text, i.e. always here). Unclipped it widened the
   PAGE for that instant, and a phone viewport answered by resetting the scroll: a jump to the top in the middle of a glide. */
.le-cm .cm-scroller { overflow: visible; overflow-x: clip; font-family: inherit; line-height: inherit; }
.le-cm .cm-content { padding: 1.25rem; caret-color: var(--text); min-height: 50vh; }
.le-cm .cm-line { padding: 0; }
.le-cm .cm-content ::selection { background: color-mix(in srgb, var(--highlight) 40%, transparent); }
.le-cm .cm-content.cl-source { font-family: 'SF Mono', 'Fira Code', Consolas, monospace; font-size: 0.9rem; line-height: 1.5; }
.le-cm .cm-chordtok { color: var(--chord); font-weight: 600; }
.le-cm .cm-directive { color: var(--text-secondary); }
.le-source-pane { position: relative; }
/* the empty-sheet hint is a sibling overlay of CodeMirror, so its buttons are real */
.le-empty { position: absolute; z-index: 2; top: 1.25rem; left: 1.25rem; right: 1.25rem; color: var(--text-secondary); cursor: text; }
.le-empty.hidden { display: none; }
.le-paste-hint { font-size: 0.85rem; }
.cl-empty { display: flex; flex-direction: column; gap: 0.35rem; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.cl-empty strong { color: var(--text); font-size: 1.05rem; }

/* Visual mode: the book's blocks, inside CodeMirror's lines */
/* CodeMirror measures a line's box, margins excluded: any vertical margin on .cm-line (or on a
   block widget) drifts its height map away from the screen. The book's spacing is kept as PADDING. */
.le-cm .cm-line.cl-line { white-space: pre-wrap; }
.le-cm .cm-line.song-line { margin-bottom: 0; padding-bottom: 0.25rem; }
.le-cm .cm-line.song-line.cl-last { margin-bottom: 0; padding-bottom: 1.5rem; }
.le-cm .cm-line.cl-blank { min-height: 0.35rem; line-height: 0.35rem; }
.le-cm .cl-label-row { margin-bottom: 0; display: flow-root; }
.le-cm .cl-label-row .section-label { cursor: pointer; display: inline-block; border-radius: 4px; padding: 0 0.25rem; margin-left: -0.25rem; }
.le-cm .cl-label-row .section-label:hover { background: var(--bg-tertiary); }
.le-cm .cl-hidden { display: none; }
.le-mode-chords .le-cm .cl-chord-glyph { cursor: pointer; }
/* Chords paint AND hit-test above the cursor's empty pill (absolute, min-width 1.6em: after a short syllable it
   reaches the next chord), so a tap on a visible glyph selects that chord while the pill still shows beneath. */
.le-cm .cl-chord-glyph { position: relative; z-index: 1; }
/* Lyrics mode: the chords are drawn but inert, greyed so a pasted lyrics+chords sheet is not mistaken for editable.
   Colour and opacity only: no weight / size / width change, the layout is the book's pixel for pixel. */
.le-mode-lyrics .le-cm .cl-chord-glyph { color: var(--text-secondary); opacity: 0.5; cursor: default; }
.le-cm .cl-chord .cg sup { top: -0.55em; }
.le-cm .cl-locked { margin: 0; padding-bottom: 1rem; display: flow-root; }
.le-cm .cl-locked-block { border: 1px dashed var(--border); border-radius: 6px; padding: 0.4rem 0.6rem; overflow-x: auto; }   /* a wide tab scrolls in its box (the chart clips x) */
.le-cm .cl-locked-title { color: var(--text-secondary); font-size: 0.8rem; font-style: italic; }

/* The box: the syllable a chord goes on */
.le-cm .cm-line.cl-has-box:not(:has(.cl-segment)) { padding-top: 1.4em; }
.le-cm .cl-box-text, .chm-strip .cl-box-text, .le-loupe .cl-box-text { outline: 2px solid var(--highlight); outline-offset: 1px; border-radius: 3px; background: color-mix(in srgb, var(--highlight) 30%, transparent); }
.le-cm .cl-box-chord .cl-chord-glyph, .chm-strip .cl-box-chord .cl-chord-glyph, .le-loupe .cl-box-chord .cl-chord-glyph { background: var(--highlight); color: var(--on-highlight); border-radius: 3px; box-shadow: 0 0 0 3px var(--highlight); }
.le-cm .cl-slot, .chm-strip .cl-slot, .le-loupe .cl-slot { position: relative; display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.le-cm .cl-slot-pill, .chm-strip .cl-slot-pill, .le-loupe .cl-slot-pill {
    position: absolute; left: -2px; bottom: 1.35em; min-width: 1.6em; height: 1.25em; padding: 0 3px;
    border: 2px dashed var(--highlight); border-radius: 3px; color: var(--chord); font-weight: 600;
    line-height: 1.15; white-space: nowrap; background: var(--bg-secondary);
}
.le-cm .cl-slot-invalid .cl-slot-pill, .chm-strip .cl-slot-invalid .cl-slot-pill, .le-loupe .cl-slot-invalid .cl-slot-pill { border-color: #dc2626; color: #dc2626; }

/* Chords mode: the chart is locked - no text selection, no callout, no keyboard */
.le-mode-chords .cm-content {
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
    cursor: default; touch-action: manipulation;
}

/* floating section bar */
.le-selbar {
    position: fixed; z-index: 62; display: flex; gap: 2px; padding: 4px; max-width: calc(100vw - 16px); overflow-x: auto;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.le-selbar.hidden { display: none; }
/* phones: docked at the bottom of the visual viewport, above the keyboard (index.js placeDockedBar); the iOS selection menu
   draws where the floating bar sat */
.le-selbar.le-selbar-docked { left: 8px; right: 8px; top: auto; bottom: var(--le-selbar-bottom, 8px); max-width: none; flex-wrap: wrap; justify-content: center; overflow-x: visible; }   /* every type in view ("Other…" was off the right edge) */
.le-selbar button, .le-labelmenu button {
    border: 0; background: none; color: var(--text); font: inherit; font-size: 0.85rem; padding: 0.4rem 0.7rem;
    border-radius: 6px; cursor: pointer; white-space: nowrap; min-height: 34px;
}
.le-selbar button:hover, .le-labelmenu button:hover { background: var(--bg-tertiary); }
.le-selbar-field { font: inherit; padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.le-labelmenu {
    position: fixed; z-index: 62; display: flex; flex-direction: column; gap: 2px; padding: 6px; min-width: 200px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.le-labelmenu { overflow-y: auto; overscroll-behavior: contain; }   /* max-height is set by index.js::openLabelMenu */
.le-labelmenu button { text-align: left; }
.le-labelmenu button.danger { color: #dc2626; }
.le-labelmenu-types { display: flex; flex-wrap: wrap; gap: 2px; }
.le-labelmenu-types button.on { background: var(--accent); color: var(--on-accent); }
.le-labelmenu-rename { display: flex; gap: 4px; }
.le-labelmenu-rename input { flex: 1; min-width: 0; font: inherit; padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
/* `left: 50%` with no width of its own offers the toast only half the screen, so on a phone
   anything longer than three words wrapped to three lines with the dash left dangling. Same
   fix as .auth-toast-notice above. */
.le-toast { display: flex; gap: 0.5rem; align-items: center; width: max-content; max-width: calc(100vw - 2rem); }
.le-toast-undo { background: none; border: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* the chord menu (js/lead-editor/chord-menu.js) */
.chm-menu {
    z-index: 60; color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.chm-menu.hidden { display: none; }
/* SPLIT (phones, narrow windows): the root draws nothing; the magnifier is a fixed bar just under the
   app's top band, the picker a fixed bar at the bottom. js/lead-editor/index.js publishes --chm-top,
   --chm-strip-h and --chm-picker-h on <html> (the --bottomband-h pattern) and pads the chart by them. */
.chm-split { display: contents; }
.chm-split .chm-strip {
    position: fixed; z-index: 60; left: 0; right: 0; top: var(--chm-top, 48px); margin: 0;
    padding: 4px 8px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}
.chm-split .chm-body {
    position: fixed; z-index: 60; left: 0; right: 0; bottom: var(--bottomband-h, 0px); padding: 8px 10px 14px;
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12); max-height: 55vh; overflow-y: auto;
}
.editor-lead.chm-docked { padding-top: calc(var(--chm-strip-h, 0px) + var(--chm-strip-gap, 0px)); padding-bottom: calc(var(--chm-picker-h, 0px) + 8px); }
/* The picker is fixed over the foot of the screen, so it also covers the panel's LAST row — Copy, Download,
   What changed? and Submit — at every scroll position, and the page cannot be scrolled far enough to clear it.
   Reserve its height below the panel while it is docked, so Submit comes out from under it. Chart mode makes the
   same reservation (the "Chart chip" block below); Lyrics and ChordPro dock no picker, so they need none. */
#editor-panel:has(.editor-lead.chm-docked) { padding-bottom: calc(var(--chm-picker-h, 0px) + 24px); }
/* SIDE (wide desktop): one panel in the editor layout, sticky while the chart scrolls */
.editor-workspace.chm-has-side > .editor-lead { grid-column: 1; grid-row: 1; }
.editor-workspace.chm-has-side { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 1rem; align-items: start; }
.chm-side {
    position: sticky; top: calc(var(--chm-top, 48px) + 8px); align-self: start; grid-column: 2; grid-row: 1;
    max-height: calc(100vh - var(--chm-top, 48px) - 16px); overflow-y: auto; padding: 8px 10px 10px;
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.chm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; padding: 2px 4px 8px; }
.chm-sp { flex: 1; }
.chm-head button { font: inherit; border: 0; background: none; cursor: pointer; color: var(--text-secondary); }
.chm-head .chm-done { color: var(--accent); font-weight: 600; }
.chm-head .chm-move, .chm-head .chm-remove { padding: 3px 9px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--border); color: var(--text); white-space: nowrap; }
.chm-head .chm-move.on { background: var(--accent); color: var(--on-accent); box-shadow: none; font-weight: 600; }
.chm-deco.chm-bass { font-size: 15px; }

/* the trackpad strip: the current line, enlarged; drag it to step the box seam by seam */
.chm-strip { display: flex; align-items: stretch; gap: 5px; margin-bottom: 6px; }
.chm-split .chm-strip { margin-bottom: 0; }
.chm-strip.empty .chm-strip-view { visibility: hidden; }
.chm-strip-view {
    flex: 1; min-width: 0; overflow: hidden; position: relative; min-height: 80px; border-radius: 10px;
    background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); touch-action: none; cursor: ew-resize;
    -webkit-user-select: none; user-select: none; display: flex; align-items: center; padding: 0 12px;
}
.chm-strip-view.dragging { box-shadow: inset 0 0 0 2px var(--accent); }
.chm-strip-line { width: 100%; pointer-events: none; }
.chm-strip-cl { white-space: nowrap; display: inline-block; margin: 0; padding: 0; transition: transform 0.08s; }
.chm-strip-cl .cl-segment { white-space: pre; }
.chm-strip-cl.song-line, .chm-strip-cl.cl-last { margin: 0; padding: 0; }
.chm-strip-cl .section-indent, .chm-strip-cl.section-indent { margin-left: 0; }
.chm-strip .cl-segment > .cm-widgetBuffer:first-child, .le-loupe .cl-segment > .cm-widgetBuffer:first-child { position: absolute; }   /* see .le-cm below */
.chm-step {
    flex: none; width: 40px; border: 0; border-radius: 10px; background: var(--bg); color: var(--text);
    box-shadow: inset 0 0 0 1px var(--border); font: inherit; font-size: 15px; cursor: pointer; min-height: 40px;
}
.chm-step-vert { flex: none; display: flex; flex-direction: column; gap: 0; }
.chm-step-vert .chm-step { min-height: 40px; flex: 1; width: 40px; border-radius: 8px; }
.chm-basses { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.chm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.chm-cell {
    position: relative; min-height: 48px; border-radius: 8px; background: var(--bg); border: 0; padding: 0; cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--border); color: var(--text);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.chm-cell .c { font: 600 17px/1.1 -apple-system, sans-serif; }
.chm-cell .n { font: 11px/1 -apple-system, sans-serif; color: var(--text-secondary); }
.chm-cell.empty { background: none; opacity: 0.35; cursor: default; }
/* .chm-inkey.sel too: the in-key tint below has the same specificity and comes later, so it hid the chosen chord */
.chm-cell.sel, .chm-cell.chm-inkey.sel { box-shadow: inset 0 0 0 2.5px var(--highlight); background: color-mix(in srgb, var(--highlight) 30%, var(--bg)); }
.chm-cell.used::after { content: ''; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--chord); }
.chm-cell.quiet .c { color: var(--text-secondary); font-weight: 400; }
.chm-decos { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; padding-bottom: 2px; }
/* the second row (⋯ open): the rarer marks then /bass; it wraps, it never scrolls sideways */
.chm-decos2 { grid-template-columns: repeat(auto-fill, minmax(min(60px, 22%), 1fr)); }
.chm-deco {
    min-width: 0; min-height: 44px; border-radius: 8px; padding: 0 6px; background: var(--bg); border: 0; cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--border); color: var(--text);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.chm-deco .c { font: 600 16px/1.1 -apple-system, sans-serif; }
.chm-deco .n { font: 10px/1 -apple-system, sans-serif; color: var(--text-secondary); }
.chm-deco.on { box-shadow: inset 0 0 0 2.5px var(--highlight); background: color-mix(in srgb, var(--highlight) 30%, var(--bg)); }
.chm-foot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); padding: 4px 2px 0; flex-wrap: wrap; }
.chm-more { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.chm-morepanel { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.chm-root { border: 0; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); color: var(--text); border-radius: 6px; padding: 6px 9px; font: inherit; cursor: pointer; min-height: 34px; }
.chm-root.on, .chm-root.chm-inkey.on { box-shadow: inset 0 0 0 2.5px var(--highlight); background: color-mix(in srgb, var(--highlight) 30%, var(--bg)); }
.chm-free { display: flex; gap: 6px; }
.chm-free input { flex: 1; min-width: 0; font: inherit; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.chm-free input.invalid { border-color: #dc2626; }
.chm-go { border: 0; background: var(--accent); color: var(--on-accent); border-radius: 6px; padding: 0 14px; font: inherit; font-weight: 600; }
.chm-go:disabled { opacity: 0.45; }
/* CodeMirror's zero-width widget buffer BEFORE a segment's block chord would add a phantom text row above it: only that
   one leaves the flow. The others (after the chord, around the cursor's slot mid-word) sit on the lyric line and must stay
   inline: WebKit (iOS) mis-lays out an ABSOLUTE buffer mid-word once the font size changes (A+ / A-), and the segment grew a
   third row, D / some / body (the "staircase"; reproduced in Playwright WebKit, never in Chromium). They cannot simply be
   hidden either: CodeMirror's coordsAtPos measures them (display:none put the cursor at 0,0 and broke scrolling to it). */
.le-cm .cl-segment > .cm-widgetBuffer:first-child { position: absolute; }
.cl-empty-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.4rem; }
.cl-empty-actions .le-paste-btn { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 8px; padding: 0.4rem 0.9rem; font: inherit; cursor: pointer; min-height: 36px; }
.cl-empty-actions .le-link-request { color: var(--text-secondary); font-size: 0.85rem; }
/* bottom is set by index.js::undoToast, above the docked picker; only Undo takes taps, so the chart under the toast stays
   tappable while it shows */
.le-toast { pointer-events: none; z-index: 90; }
.le-toast .le-toast-undo { pointer-events: auto; }

/* ---- Chords mode: gliding the cursor, the slot after the words, chord lines ---- */
/* what a finger can grab must not scroll the page: the boxed chord's row and the slot pill */
/* G51: the boxed WORD joins them — it is the big drag handle for the chord the box holds, so the scroller must not take it. */
.le-mode-chords .cl-box-chord, .le-mode-chords .cl-slot-pill, .le-mode-chords .cl-box-text { touch-action: none; }
/* a long press must glide, not select text or pop iOS's callout */
.le-mode-chords .le-cm { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.le-cm .cl-slot-pill::after { content: ''; position: absolute; inset: -10px; }   /* a finger-sized target */
/* the empty slot after the words sits a little to the right of the last letter */
.le-cm .cl-slot-after .cl-slot-pill, .chm-strip .cl-slot-after .cl-slot-pill, .le-loupe .cl-slot-after .cl-slot-pill { left: 0.45em; }
/* ...and outlined on the lyric row below it, like a syllable (.cl-box-text). Absolute inside the zero-size slot: no width,
   no wrap, so the line and every stop measure the same whether the cursor is here or not (e2e "the end of a line"). */
.le-cm .cl-slot-after .cl-slot-text, .chm-strip .cl-slot-after .cl-slot-text, .le-loupe .cl-slot-after .cl-slot-text {
    position: absolute; left: 0.45em; bottom: -0.28em; width: calc(1.6em + 10px); height: 1.2em; box-sizing: border-box;
    outline: 2px solid var(--highlight); outline-offset: 1px; border-radius: 3px; pointer-events: none;
    background: color-mix(in srgb, var(--highlight) 30%, transparent);
}
/* the cursor between two words (a GAP stop): the same box as the slot after the words, centred on the space - the dashed
   pill on the chord row (while the gap holds no chord) and an outline on the lyric row. Absolute, no width (see above). */
.le-cm .cl-slot-gap .cl-slot-pill, .chm-strip .cl-slot-gap .cl-slot-pill, .le-loupe .cl-slot-gap .cl-slot-pill { left: 0.5ch; transform: translateX(-50%); }
.le-cm .cl-slot-gap .cl-slot-text, .chm-strip .cl-slot-gap .cl-slot-text, .le-loupe .cl-slot-gap .cl-slot-text {
    position: absolute; left: 0.5ch; bottom: -0.28em; width: 1ch; height: 1.2em; transform: translateX(-50%);
    box-sizing: border-box; outline: 2px solid var(--highlight); outline-offset: -1px; border-radius: 3px; pointer-events: none;
    background: color-mix(in srgb, var(--highlight) 30%, transparent);
}
.chm-enter { font-weight: 600; white-space: nowrap; }
/* an empty chord line the cursor is on: space is PADDING (the height map ignores margins) */
.le-cm .cl-newline { margin: 0; padding-bottom: 0.25rem; display: flow-root; }
.le-cm .cl-newline .cl-line { margin: 0; }
/* a soft ring that follows the cursor so a move glides */
.le-cursor-ring {
    position: fixed; z-index: 55; pointer-events: none; border-radius: 6px;
    background: color-mix(in srgb, var(--highlight) 35%, transparent);
    left: 0; top: 0; will-change: transform;
}
/* a small settle on release (and for taps / arrows); NEVER while a finger is driving it: it would lag */
.le-cursor-ring.settle { transition: transform 90ms ease-out, width 90ms ease-out, height 90ms ease-out; }
.le-cursor-ring.dragging { transition: none; }
.le-cursor-ring.hidden { display: none; }
/* the loupe: a bubble above a thumb gliding over the chart, showing the cursor's line magnified (js/lead-editor/loupe.js).
   A picture: pointer-events none. Above the docked picker (z 60). No vertical margins: it is outside CodeMirror, but the clone is a .cm-line. */
.le-loupe {
    position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; box-sizing: border-box;
    will-change: transform;
}
.le-loupe.hidden { display: none; }
.le-loupe-view {
    position: relative; overflow: hidden; border-radius: 12px; padding: 0;
    background: var(--bg, #fff); color: var(--text, #000);
    border: 1px solid var(--border, #ccc); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.le-loupe-view .le-loupe-cl {
    display: block; margin: 0; white-space: nowrap; width: max-content; padding: 0.55rem 0.5rem 0.3rem;
    -webkit-user-select: none; user-select: none; transition: none;   /* it follows the finger: no lag */
}
.le-loupe.empty .le-loupe-view { min-height: 2.5rem; }
.le-loupe-tail {
    position: absolute; bottom: -6px; width: 12px; height: 12px; margin-left: -6px; box-sizing: border-box;
    background: var(--bg, #fff); border: solid var(--border, #ccc); border-width: 0 1px 1px 0; transform: rotate(45deg);
}
.le-loupe.pop .le-loupe-view { animation: le-loupe-pop 90ms ease-out; }
.le-loupe.pop .le-loupe-tail { animation: le-loupe-fade 90ms ease-out; }
@keyframes le-loupe-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes le-loupe-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .le-loupe.pop .le-loupe-view, .le-loupe.pop .le-loupe-tail { animation: none; } }
/* holding the sheet turns it into a trackpad: the buttons fade and are not pressed */
.chm-menu.is-trackpad .chm-head, .chm-menu.is-trackpad .chm-body > :not(.chm-head), .chm-menu.is-trackpad .chm-step { opacity: 0.3; pointer-events: none; }
.chm-menu.is-trackpad .chm-strip-view { box-shadow: inset 0 0 0 2px var(--accent); }
.chm-menu { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.chm-menu input { -webkit-user-select: text; user-select: text; }
/* the decoration marks are plain characters at a readable size (chord glyphs elsewhere are untouched) */
.chm-deco { font: 600 18px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.chm-deco.chm-bass { font-size: 16px; }
.chm-addline {
    border: 0; background: none; box-shadow: inset 0 0 0 1px var(--border); color: var(--text);
    border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer;
}

/* In the key (solid) versus outside it (dashed, muted): the difference has to be plain at a glance, light or dark */
.chm-cell.chm-inkey, .chm-root.chm-inkey, .chm-deco.chm-inkey {
    background: color-mix(in srgb, var(--accent) 13%, var(--bg)); color: var(--text);
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, var(--border));
}
.chm-cell.chm-inkey .c { font-weight: 700; }
.chm-cell.chm-outside:not(.sel), .chm-root.chm-outside:not(.on), .chm-deco.chm-outside:not(.on) {
    background: color-mix(in srgb, var(--text-secondary) 7%, transparent); color: var(--text-secondary);
    box-shadow: none; outline: 1.5px dashed color-mix(in srgb, var(--text-secondary) 65%, transparent); outline-offset: -2px;
}
.chm-cell.chm-outside .c { font-weight: 500; }
.chm-cell.chm-outside.sel { outline: 2.5px dashed var(--highlight); outline-offset: -2px; box-shadow: none; background: color-mix(in srgb, var(--highlight) 30%, var(--bg)); }
.chm-root.chm-outside.on { outline: 2.5px dashed var(--highlight); outline-offset: -2px; box-shadow: none; background: color-mix(in srgb, var(--highlight) 30%, var(--bg)); }
.chm-deco.chm-extra.on { background: color-mix(in srgb, var(--highlight) 30%, var(--bg)); color: var(--text); box-shadow: inset 0 0 0 2.5px var(--highlight); outline: 0; }
@media (max-width: 400px) { .chm-deco { font-size: 16px; padding: 0 2px; } .chm-deco.chm-bass { font-size: 14px; } }
/* 320px phones: the 8 main cells are ~34px wide and "sus4" at 16px needs ~36 (the labels ran into each other) */
@media (max-width: 340px) { .chm-deco { font-size: 13.5px; padding: 0; letter-spacing: -0.02em; } }
.chm-row-more { margin-bottom: 4px; }
.chm-deco.chm-inkey.on { box-shadow: inset 0 0 0 2.5px var(--highlight); background: color-mix(in srgb, var(--highlight) 30%, var(--bg)); }
.chm-deco.chm-outside.on { outline: 2.5px dashed var(--highlight); outline-offset: -2px; background: color-mix(in srgb, var(--highlight) 30%, var(--bg)); }
.chm-head .chm-func { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
/* the docked sheet is too narrow to share a row with Key / Move / Remove / Done:
   the function ("B⁷ · II⁷ (V⁷/V)") is the teaching aid, so it gets a line of its
   own, last, rather than an ellipsis */
.chm-menu .chm-head .chm-func, .chm-menu .chm-head .chm-func-ph { flex: 0 1 auto; min-width: 0; white-space: nowrap; line-height: 1.5em; overflow: hidden; text-overflow: ellipsis; }
/* Move / Remove come and go with the chord: the header's first row keeps its height either way */
.chm-menu .chm-head { display: block; padding: 0 4px 6px; }
/* the picker's header rows have a FIXED height (the e2e compares them across cursor states) */
.chm-row { display: flex; align-items: center; gap: 8px; box-sizing: border-box; overflow: hidden; }
.chm-row2 { height: 40px; }
.chm-row3 { height: 40px; gap: 4px; }
.chm-row3 .chm-step, .chm-row3 .chm-mag { flex: none; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 8px; border: 0; background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); font-size: 16px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.chm-row3 .chm-mag.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.editor-zoom { display: inline-flex; gap: 4px; }
.chm-row .chm-sp { flex: 1 1 0; min-width: 0; }
/* a 320px phone: the header's two rows must fit the picker's width (same heights, every control) */
@media (max-width: 340px) {
    .chm-row { gap: 4px; }
    .chm-row3 { gap: 2px; }
    .chm-row3 .chm-step, .chm-row3 .chm-mag { width: 34px; }
}
.chm-row2 .chm-move, .chm-row2 .chm-remove { flex: none; }
/* the decorations row is always there; with an empty box it is dimmed and inert */
.chm-decos.idle { opacity: 0.38; pointer-events: none; }
.chm-decos.idle .chm-deco { cursor: default; }
.chm-head .chm-func .cg { font-weight: 600; }

/* the panel in the tab editor (js/otf-editor/chord-picker.js, G21e): the split bar above the bottom band. On a wide window
   it is a centred card, not an edge-to-edge strip over a tab that is wider than it needs. */
.chm-row3 .chm-close { flex: none; height: 40px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); font: inherit; font-weight: 600; cursor: pointer; }
.chm-notice { margin: 2px 0 8px; padding: 6px 10px; border-radius: 6px; font-size: 13px; line-height: 1.35; color: #b91c1c; background: color-mix(in srgb, #dc2626 9%, var(--bg)); box-shadow: inset 0 0 0 1px color-mix(in srgb, #dc2626 35%, transparent); }
@media (min-width: 641px) {
    .chm-tab.chm-split .chm-body {
        left: 50%; right: auto; width: min(560px, 100%); transform: translateX(-50%);
        border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0;
    }
}

/* =====================================   THE EDITOR'S CONTROLS: one band, every device (index.html #editor-band, mounted in .app-bottomband by
   editor.js showEditorBand). Mode | undo redo | key | Display. Wraps rather than overflowing a narrow phone; the
   band's height is live (--bottomband-h), so the docked chord picker and the chart's padding follow it.
   ============================================ */
.app-bottomband .editor-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; width: 100%; }
.editor-band-group { display: inline-flex; align-items: center; gap: 4px; }
.editor-band-btn {
    min-width: 36px; min-height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg-secondary); color: var(--text); font: inherit; font-size: 1rem; cursor: pointer;
}
.editor-band-btn:hover:not(:disabled) { border-color: var(--accent); }
.editor-band-btn:disabled { opacity: 0.4; cursor: default; }
.editor-band-btn.chart-chords-btn { font-size: 0.9rem; font-weight: 600; padding: 0 10px; }
.editor-band-btn.chart-chords-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.editor-band .editor-key-select { min-height: 36px; font-size: 0.9rem; }
.editor-band .le-modeswitch button { min-height: 36px; }
/* the Display options wait inside the band, unseen, until the pill's first open moves them into its popover */
.editor-band > .editor-display-options { display: none; }
.editor-display-options { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.editor-display-options .editor-zoom { display: flex; align-items: center; gap: 6px; }
.editor-display-options .editor-zoom > span { flex: 1; }
.editor-display-options label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.editor-display-pill .pill-btn { min-height: 36px; }
/* The semitone steps go wherever the band would otherwise wrap; the key list does the same job. G51: this used to
   ride along with the 480px block, but the band needs 680px to hold - / + beside four chips, undo/redo, the key and
   Display — so 481-679 showed them and wrapped to two rows, --bottomband-h 97px instead of 55. Measured, not guessed. */
@media (max-width: 780px) {
    .editor-band .transpose-btn { display: none; }
}
/* The switch tightens wherever the band would otherwise wrap. G51: was 480px, but with - / + gone the band still
   needs this down to 640 — at 481-639 the full-size chips, undo/redo, the key and Display wrapped to a second row. */
@media (max-width: 780px) {
    .editor-band .le-modeswitch button { padding: 0.35rem 0.38rem; font-size: 0.82rem; }
    .editor-band .editor-band-group { gap: 2px; }
    .editor-band .editor-band-btn { min-width: 32px; padding: 0 4px; }
    .editor-band .editor-key-select { min-width: 0; padding: 0 2px; }
    .editor-band .editor-display-pill .pill-btn { padding: 0.3rem 0.5rem; }
    .app-bottomband .editor-band { gap: 4px; }
    .app-bottomband:has(.editor-band) { padding-left: 6px; padding-right: 6px; }
}
/* 360-480px (iPhone, SE, most Androids, and the big Pro Max at 440): still one row; at 320 it wraps to two, and the
   picker and chart follow --bottomband-h. G51: this was 400px, which left 401-480 with only the looser block above —
   and since the Chart chip made four, four chips + undo/redo + the key no longer fit a 440px row, so the Display pill
   dropped to a second one and --bottomband-h went from ~55 to 95 (Mike's iPhone, 2026-11-09). */
@media (max-width: 520px) {
    .editor-band .editor-band-btn.chart-chords-btn { font-size: 0.7rem; padding: 0 4px; min-width: 0; }
    .editor-band:has(.chart-chords-btn:not(.hidden)) { gap: 6px 4px; }          /* Chart mode has one more button: keep the band to one row */
    .editor-band:has(.chart-chords-btn:not(.hidden)) .editor-band-group { gap: 2px; }
    .editor-band .le-modeswitch button { padding: 0.3rem 0.25rem; font-size: 0.78rem; }
    .editor-band .editor-band-btn { min-width: 28px; padding: 0 3px; }
    .editor-band .editor-display-pill .pill-btn { padding: 0.3rem 0.4rem; }
    /* the native arrow takes ~16px: a small drawn caret instead, so "Key: C#m" fits */
    .editor-band .editor-key-select {
        width: 76px; font-size: 0.82rem; -webkit-appearance: none; appearance: none; padding: 0 12px 0 4px;
        background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23888'/%3E%3C/svg%3E") no-repeat right 4px center;
    }
    .app-bottomband:has(.editor-band) { padding-left: 4px; padding-right: 4px; }
}
/* a {comment} row in Lyrics mode is tappable (its menu: Delete note), like a section label */
.le-mode-lyrics .le-cm .cl-comment { cursor: pointer; }
.le-mode-lyrics .le-cm .cl-comment:hover { color: var(--accent); }

/* ==========================================================================
   The tab editor's front door (/tab-editor/, G15c). It borrows the My tabs
   page's frame (.drafts-view) and rows (.draft-row); only the three actions
   and the privacy line are its own.
   ========================================================================== */

.tab-home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.tab-home-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.tab-home-card h2,
.tab-home-mytabs h2 {
    font-size: 1.05rem;
    margin: 0;
}

.tab-home-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tab-home-card .tab-home-matches:empty { display: none; }
.tab-home-card .tab-home-match { color: var(--text); }
.tab-home-card .tab-home-match a { white-space: nowrap; }

.tab-home-card label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tab-home-card input,
.tab-home-card select {
    font: inherit;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
}

.tab-home-card .qc-toggle-btn {
    margin-top: auto;
}

/* A file is being dragged over the page: the card that takes it says so
   (body.file-dragover already rings the page). */
body.file-dragover .tab-home-open {
    outline: 2px dashed var(--accent);
    outline-offset: 2px;
}

.tab-home-mytabs {
    margin-bottom: 1rem;
}

.tab-home-mytabs h2 {
    margin-bottom: 0.5rem;
}

.tab-home-none,
.tab-home-all,
.tab-home-privacy,
.tab-home-example {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.tab-home-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tab-home-actions a.qc-toggle-btn {
    text-decoration: none;
}

/* ============================================
   CHORD CHART on the song page (G18b2, docs/js/chord-chart-view.js; G19b)
   View ▸ Lyrics + Chart (wide screens: song-view.js CHART_WIDE_MQ) draws
   two columns, lyrics | chart; View ▸ Chart draws the chart alone. The chart
   has no controls of its own: they are Display ▸ Chart. Its text is em-sized
   so the dock's Size scales it (the chart sets font-size inline).
   ============================================ */

.cc-cols {
    display: grid;
    /* the lyrics' share of the two columns is --cc-left (G68: the divider sets it; half by default); the divider is the gap */
    grid-template-columns: minmax(0, calc((100% - 3.5rem) * var(--cc-left, 0.5))) 3.5rem minmax(0, 1fr);
    align-items: start;
}
.cc-divider { align-self: stretch; }
/* Lyric lines are `white-space: pre` so the chords stay over their syllables,
   so they cannot wrap. Without this the longest line runs straight across the
   gap and prints on top of the chart at large sizes (Mike, 2026-11-06). The
   column scrolls on its own instead; a reader who does not want that has
   Display ▸ Lyrics ▸ Show the chart beside the lyrics. */
.cc-cols > :first-child { min-width: 0; overflow-x: auto; }
.cc-chart-col {
    position: sticky;
    top: calc(var(--topbar-h, 48px) + 0.75rem);
    max-height: calc(100vh - var(--topbar-h, 48px) - var(--bottomband-h, 52px) - 1.5rem);
    overflow-y: auto;
}
.cc-colhead {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--text);
    font-size: var(--font-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
/* A tab page's chart column (G82a): the tab at two thirds by default (the divider sets --cc-left), the band's ▶ ■ Tempo in the column's head */
.cc-tabcols { --cc-left: 0.6667; }
.cc-tabcols > .cc-tabside { min-width: 0; overflow: visible; }
.cc-tabhead { display: flex; align-items: center; gap: 0.6rem; }
.cc-tabhead .dock-play, .cc-tabhead .dock-stop { flex: none; }
/* "Backtrack" in the chart's heading (G52 M1e): a link that reads as one, in the heading's own type */
.cc-backtrack-link { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--accent); cursor: pointer; }
.cc-backtrack-link:hover, .cc-backtrack-link:focus-visible { text-decoration: underline; }
/* the chart alone: a readable measure, not the width of the window */
/* No reading measure on a chart: it is a grid, not prose, and a wide screen
   should be able to carry a whole 8-cell row (Mike, 2026-11-06). Density is
   the reader's, through Display ▸ Chart ▸ Cells per row. */
.cc-tab { max-width: none; }

/* Chart sections and lines. A line is a grid of bars, a bar a row of cells,
   a cell a row of equal slots; --text rules are the bar lines. */
.cc-sec { margin: 0.9rem 0 1.1rem; }
.cc-cap {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
    font-size: 0.8em;
    margin-bottom: 0.25rem;
}
.cc-cap b { font-size: 0.9em; }
.cc-cap span { color: var(--text-secondary); }
.cc-line {
    display: grid;
    margin-bottom: 0.4rem;
    border-right: 2px solid var(--text);
    /* the body's face, not the lyrics' monospace */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}
.cc-bar { display: flex; border-left: 2px solid var(--text); min-width: 0; }
.cc-cell { display: flex; flex: 1; min-width: 0; }
.cc-cell + .cc-cell { border-left: 1px dashed var(--border); }
.cc-slot {
    flex: 1;
    min-width: 0;
    padding: 0.4em 0;
    text-align: center;
    font-size: 1.3em;
    font-weight: 500;
    line-height: 1.2;
}
.cc-slot.cc-hold { color: var(--text-secondary); opacity: 0.5; font-weight: 400; }
/* G62: a rest, a stop and a diamond, on the song page (.cc-*) and in the editor's grid (.ce-sl.*): the whole look is these rules */
.cc-slot.cc-rest, .ce-sl.rest { color: var(--text-secondary); font-weight: 400; }
/* G62e: a stop is the chord and a small x, a diamond the chord and a small diamond, to the right of the chord, in the text flow */
.cc-slot.cc-stop::after, .cc-slot.cc-diamond::after, .ce-sl.stop::after, .ce-sl.diamond::after { font-size: 0.55em; font-weight: 400; color: var(--text-secondary); margin-left: 0.25em; }
.cc-slot.cc-stop::after, .ce-sl.stop::after { content: '\00d7'; }
.cc-slot.cc-diamond::after, .ce-sl.diamond::after { content: '\25c7'; }
/* The backtrack follows along (G52, backtrack/play.js; G62e): the bar being played is tinted, and the slot has a box that flashes brighter on the
   downbeat (the slot's start, the boom: the `boom` class is added, with a reflow, each time the light lands on a slot). The song page's chart (also
   beside the lyrics, in My Book and from lists: one renderer) and the chart editor's grid (.ce-*) share these rules. */
.cc-cell.cc-playing { background: color-mix(in srgb, var(--accent) 22%, transparent); }
/* What is armed to play or loop (G52, backtrack/arm.js): an outline, so it never reads as the bar being played */
.cc-cell.cc-armed { outline: 2px solid var(--accent); outline-offset: -2px; }
.song-section.sec-armed { box-shadow: 0 0 0 2px var(--accent); border-radius: 6px; }
/* a bar, a caption and a lyric label can be pressed while the page has a backtrack (body.bt-armable); a drag across bars must not select text */
.bt-armable .cc-cell, .bt-armable .cc-cap, .bt-armable .song-section .section-label { cursor: pointer; }
.bt-armable .cc-cell { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cc-slot { position: relative; }
.cc-slot.cc-beat, .ce-sl.ce-beat { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 6px; }
.cc-slot.cc-boom, .ce-sl.ce-boom { animation: chart-boom 0.5s ease-out; }
@keyframes chart-boom {
    from { background: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: inset 0 0 0 2px var(--accent), 0 0 12px 2px var(--accent); }
    to { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
}
@media (prefers-reduced-motion: reduce) { .cc-slot.cc-boom, .ce-sl.ce-boom { animation: none; } }
.cc-form, .cc-note, .cc-by {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin: 0.4rem 0 0.9rem;
}
.cc-form b { color: var(--text); font-weight: 600; }
/* the Form line's entries are segments a loop can be armed on (G52, backtrack/arm.js): they get a target and the armed look */
.bt-armable .cc-form b { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; display: inline-block; padding: 0.35em 0.4em; margin: -0.35em -0.1em; border-radius: 4px; }
.cc-form b.cc-armed { outline: 2px solid var(--accent); outline-offset: -1px; }

/* =====================================   THE CHORD CHART EDITOR (G18c): the Chart chip's surface (js/chart-editor/)
   Two columns on a wide window with a mouse (the paired lyrics, the chart); the chart alone anywhere else. The picker is docked
   at the foot of the screen at every width. */
.editor-lead[data-mode="chart"] { display: none; }
.ce-root.hidden, .ce-root [hidden] { display: none; }
.ce-root { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; --ce-line: var(--text); }
/* two columns on a wide window with a mouse (G83): the LIVE lyrics editor beside the chart (`#editor-lead` moved in by chart-pane.js setLiveLyrics), or, for a chart
   for a tab, the TAB (G82b: `.ce-ref`, two thirds). Half and half to start for the lyrics; the divider moves it (--ce-left, a fraction of the two columns, kept in
   localStorage: `bgb-split-editor`, the tab's `bgb-editor-tab-split`); the first column is never narrower than 280px and never takes the 360px the chart needs,
   whatever its share (a tab's reaches 0.8). The picker is docked below, not a third column. A phone or a narrow window has the chart alone. */
.ce-root[data-layout="side"] { grid-template-columns: minmax(280px, min(calc((100% - 20px) * var(--ce-left, 0.5)), calc(100% - 20px - 360px))) 20px minmax(360px, 1fr); gap: 0; }
.ce-root[data-layout="side"][data-ref="hidden"] { grid-template-columns: minmax(0, 1fr); }
.ce-root[data-layout="split"] > .ce-ref, .ce-root[data-layout="split"] > .ce-divider, .ce-root[data-ref="hidden"] > .ce-divider { display: none; }
/* a chart for a tab shows its tab where the lyrics would be, and the lyrics editor stays where it was, hidden (G83 + G82b); a chip brings it back */
.editor-workspace:has(> .ce-root:not(.hidden)[data-refkind="tab"]) > .editor-lead { display: none; }
.ce-divider, .cc-divider { position: relative; align-self: stretch; cursor: col-resize; touch-action: none; display: flex; justify-content: center; outline: none; user-select: none; z-index: 3; }
.ce-divider::before, .cc-divider::before { content: ''; width: 2px; height: 100%; border-radius: 1px; background: var(--border); transition: background 0.12s, width 0.12s; }
.ce-divider:hover::before, .ce-divider:focus-visible::before, .ce-divider.dragging::before,
.cc-divider:hover::before, .cc-divider:focus-visible::before, .cc-divider.dragging::before { width: 4px; background: var(--accent); }
.ce-divreset, .cc-divreset { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); display: none; font: inherit; font-size: 11px; padding: 1px 7px; border: 0; border-radius: 999px; background: var(--bg); color: var(--accent); box-shadow: 0 0 0 1px var(--border); cursor: pointer; z-index: 1; }
.ce-divider:hover .ce-divreset, .ce-divider:focus .ce-divreset, .ce-divider:focus-within .ce-divreset,
.cc-divider:hover .cc-divreset, .cc-divider:focus .cc-divreset, .cc-divider:focus-within .cc-divreset { display: block; }

.ce-main { position: relative; min-width: 0; }
.ce-sheet { border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 8px; background: var(--bg); padding: 14px 20px 18px; }
.ce-status { min-height: 1.2em; margin: 6px 2px 0; font-size: 13px; color: var(--text-secondary); }
.ce-live { margin: 6px 2px 0; font-size: 13px; color: var(--text-primary); }
.ce-live:empty { display: none; }
#editor-live-line { color: var(--text-primary); }
#editor-live-line:empty { display: none; }
.ce-msg { color: var(--text-secondary); }
.ce-sub { font-size: 12px; color: var(--text-secondary); margin: 0 0 10px; }
.ce-faint, .ce-hint { color: var(--text-secondary); font-size: 12px; }
.ce-link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.ce-btn { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 7px; border: 0; box-shadow: inset 0 0 0 1px var(--border); background: var(--bg); color: var(--text); cursor: pointer; }
.ce-btn.prim { background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: none; }
.ce-btn.danger { color: var(--danger); }
.ce-btn:disabled, .ce-it:disabled { opacity: 0.4; cursor: default; }
.ce-error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }

.ce-sp { flex: 1; }
/* the reference column (G82b): the TAB beside a chart for a tab, a scroll box of its own (on a computer it is as tall as the room between the title and the action row). The lyrics
   beside a chart are the live editor (G83), not this column. */
.ce-ref { min-height: 0; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); padding: 0 14px 14px; }
.ce-rh { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 8px; padding: 10px 0 8px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.ce-rh .ce-pair { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 13px; color: var(--text); }
.ce-rh .ce-pill { max-width: 60%; }
.ce-rh .ce-hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ce-rh .ce-link { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 400; }
.ce-ref { scrollbar-gutter: stable; }          /* the box's width must not change when its scrollbar comes or goes */
/* the tab as a reference (G82b): the tab renderer's staff, read-only, in the same scroll box */
.ce-tabbox { pointer-events: none; padding-top: 6px; }
.ce-tabbox .tablature-track-section { margin: 0; }

/* settings row */
.ce-cset { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 2px 0 12px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.ce-cset b { color: var(--text); font-weight: 600; }
.ce-cset small { font-size: 12px; }
.ce-set { display: inline-flex; align-items: center; gap: 6px; }
.ce-grow { flex: 1; }
.ce-by { white-space: nowrap; }
.ce-credit { width: 17ch; max-width: 40vw; font: inherit; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.ce-credit:focus { border-color: var(--accent); outline: none; }
.ce-pill { font: inherit; font-size: 13px; color: var(--text); padding: 4px 8px; border-radius: 999px; border: 0; box-shadow: inset 0 0 0 1px var(--border); background: var(--bg-secondary); max-width: 16rem; }
.ce-name { font: inherit; font-size: 13px; padding: 4px 8px; width: 15rem; max-width: 100%; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); }
.ce-name:disabled { opacity: 0.6; }
.ce-seg { display: inline-flex; border-radius: 7px; box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; background: var(--bg-secondary); }
.ce-seg button { border: 0; background: none; font: inherit; font-size: 13px; padding: 4px 10px; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.ce-seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.ce-heads { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.ce-heads .ce-link { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }

/* sections and the grid */
.ce-sec { margin: 10px 0 6px; }
.ce-shd { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 10px 0 2px; }
.ce-grip { color: var(--text-secondary); font-size: 14px; letter-spacing: -2px; cursor: grab; width: 12px; user-select: none; }
.ce-slabel { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-weight: 700; font-size: 14px; padding: 2px 8px; border-radius: 6px; border: 0; box-shadow: inset 0 0 0 1px var(--border); background: var(--bg-secondary); color: var(--text); cursor: pointer; }
.ce-caret { font-size: 9px; color: var(--text-secondary); font-weight: 400; }
.ce-muted { color: var(--text-secondary); font-size: 12px; }
.ce-dots { border: 0; background: none; color: var(--text-secondary); font-size: 18px; line-height: 1; padding: 0 4px; cursor: pointer; }
.ce-line { display: flex; align-items: stretch; gap: 6px; margin: 3px 0; }
.ce-cl { display: grid; grid-template-columns: repeat(var(--bars, 4), minmax(0, 1fr)); border-right: 2px solid var(--ce-line); flex: 1; min-width: 0; }
.ce-cb { display: flex; border-left: 2px solid var(--ce-line); position: relative; min-width: 0; }
.ce-cc { display: flex; flex: 1; min-width: 0; }
.ce-sl { flex: 1; min-width: 0; padding: 8px 0; text-align: center; font: inherit; font-size: 19px; font-weight: 500; line-height: 1.2; border: 0; border-radius: 5px; background: none; color: var(--text); cursor: pointer; position: relative; appearance: none; -webkit-appearance: none; }
.ce-sl.hold { color: var(--text-secondary); opacity: 0.55; font-weight: 400; }
.ce-sl.empty { color: var(--text-secondary); opacity: 0.45; font-weight: 400; font-size: 15px; }
.ce-sl.selcell { background: var(--selection-wash); }
.ce-sl.sel { background: var(--selection-wash); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); opacity: 1; }
.ce-sl .cl-chord-glyph { color: inherit; }
.ce-typed { color: var(--accent); font-weight: 600; }
.ce-ovr { position: absolute; left: 4px; top: 2px; font: 700 10px/1 Georgia, serif; color: var(--text-secondary); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.ce-ovr i { font-style: normal; display: block; line-height: 0.95; }
.ce-addc { width: 26px; flex: none; display: grid; place-items: center; border-radius: 6px; border: 1.5px dashed var(--border); background: none; color: var(--text-secondary); font-size: 15px; cursor: pointer; }
.ce-addc.ghost { opacity: 0; pointer-events: none; }
.ce-addl { border: 0; background: none; font: inherit; font-size: 13px; color: var(--accent); padding: 4px 0 0 2px; cursor: pointer; }

/* the "Start a new chart for these lyrics?" ask (an app sheet): two buttons */
.ce-ask { display: flex; gap: 10px; padding: 4px 0 2px; }

/* the form panel and its chips */
.ce-ssel { font: inherit; font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 6px; border: 0; box-shadow: inset 0 0 0 1px var(--border); background: var(--bg); color: var(--text); }
.ce-ssel.add { color: var(--accent); font-weight: 600; }

/* the section menu: a popover on a computer, a sheet on a phone */
.ce-menuhost { position: absolute; left: 0; top: 0; width: 100%; height: 0; z-index: 70; }
.ce-scrim { display: none; }
.ce-smenu { position: fixed; left: var(--ce-menu-left, 0); top: var(--ce-menu-top, 0); width: 300px; max-width: calc(100vw - 24px); background: var(--bg); border-radius: 10px; box-shadow: 0 0 0 1px var(--border), 0 12px 32px rgba(0, 0, 0, 0.18); padding: 10px; font-size: 14px; }
.ce-sh-h { display: flex; align-items: center; justify-content: space-between; font-weight: 700; padding-bottom: 8px; }
.ce-sh-h .ce-x { border: 0; background: none; font-size: 20px; color: var(--text-secondary); cursor: pointer; }
.ce-types { display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.ce-types button { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 0; box-shadow: inset 0 0 0 1px var(--border); background: var(--bg); color: var(--text); cursor: pointer; }
.ce-types button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: none; }
.ce-ren { display: flex; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.ce-ren input { flex: 1; min-width: 0; font: inherit; padding: 6px 8px; border: 1.5px solid var(--accent); border-radius: 7px; background: var(--bg); color: var(--text); }
.ce-it { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; padding: 8px 4px; color: var(--text); cursor: pointer; }
.ce-it small { color: var(--text-secondary); font-size: 12px; margin-left: 6px; }
.ce-it.danger { color: var(--danger); border-top: 1px solid var(--border); margin-top: 4px; }
.ce-root[data-layout="split"] .ce-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.28); z-index: 1; }
.ce-root[data-layout="split"] .ce-smenu, .ce-bsheet { position: fixed; left: 0; right: 0; bottom: var(--bottomband-h, 56px); top: auto; width: auto; max-width: none; z-index: 2;
    border-radius: 14px 14px 0 0; padding: 12px 14px 16px; max-height: 70vh; overflow-y: auto; box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.25); background: var(--bg); }

/* the picker, as the chart has it: the Chords-mode panel with a row of this song's chords and the bar controls */
.ce-pal { padding: 0 2px 8px; }
.chm-chart .ce-pal { margin-bottom: 10px; }
@media (min-width: 641px) {
    .chm-chart.chm-split .chm-body {
        bottom: calc(var(--bottomband-h, 0px) + var(--ce-actions-h, 0px));
        left: 50%; right: auto; width: min(760px, calc(100% - 24px)); transform: translateX(-50%);
        border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0;
    }
}
/* the grid is selected by dragging across it, as text is: the browser's own text selection and drag stay out of it */
.ce-secs { -webkit-user-select: none; user-select: none; }
.ce-root.selecting, .ce-root.selecting * { cursor: default; }
.ce-sl { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.ce-pchip .ce-pto { font-size: 0.78em; opacity: 0.8; white-space: nowrap; }
.ce-plays { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 4px 0 8px; }
.ce-play { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ce-play.only { cursor: default; opacity: 0.75; }
.ce-play input { width: 18px; height: 18px; margin: 0; }
.ce-rowlab { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); margin: 2px 0 4px; }
.ce-palrow { display: flex; gap: 5px; flex-wrap: wrap; }
.ce-pc { min-width: 44px; height: 36px; padding: 0 9px; border: 0; border-radius: 8px; background: var(--bg); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, var(--border)); color: var(--text); font: 600 16px/1 -apple-system, sans-serif; cursor: pointer; }
.ce-pc.hold { font-family: var(--mono); color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--border); font-weight: 400; }
.ce-pc.hold small { font: 12px -apple-system, sans-serif; margin-left: 5px; }
.ce-foot-extra { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* "Back to the chart", on a phone, in the other modes */
.ce-backpill { position: fixed; z-index: 58; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomband-h, 56px) + var(--chm-picker-h, 0px) + 10px);
    display: inline-flex; align-items: baseline; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); cursor: pointer; white-space: nowrap; }
.ce-backpill small { font-weight: 400; font-size: 11px; opacity: 0.9; }
/* The pill floats above the band, over whatever is last on the page. Make room for it under the action row, so Submit is never under it
   (a new song has nothing after that row): the pill's height and the 10px it floats above the band, and a breath. */
body:has(#editor-chart-pill) #editor-panel { padding-bottom: calc(var(--chm-picker-h, 0px) + 3.25rem); }
.le-modeswitch button.has-place { position: relative; }
.le-modeswitch button.has-place::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.le-modeswitch button.on.has-place::after { background: var(--on-accent); }
/* the fourth chip (Chart): 360-400px keep one row by tightening the chips and the key list once more */
@media (max-width: 430px) {
    .editor-band .le-modeswitch button { padding: 0.3rem 0.17rem; font-size: 0.72rem; }
    .editor-band .editor-band-btn { min-width: 25px; padding: 0 2px; }
    .editor-band .editor-key-select { width: 64px; font-size: 0.78rem; }
    .editor-band .editor-display-pill .pill-btn { padding: 0.3rem 0.3rem; }
    .app-bottomband:has(.editor-band) { padding-left: 2px; padding-right: 2px; }
}
/* G52 M1b: ▶ ■ · Tempo in Chart mode (editor.js mountChartPlay, placeChartPlay): the band's last item from 640px up; below that the
   band holds one row only without it, so it is the first row of the Aa menu, labelled. */
.chart-play-group { gap: 6px; }
.chart-play-group .chart-play-label { display: none; }
.chart-play-group.in-menu { display: flex; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.chart-play-group.in-menu .chart-play-label { display: inline; flex: 1; }
.chart-play-group .bt-play { width: 36px; height: 36px; }
.chart-play-group .bt-stop { flex: none; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%; background: var(--bg-secondary); color: var(--text); font-size: 0.8rem; cursor: pointer; }
.chart-play-group .bt-stop:disabled { display: none; }
.chart-play-group .bt-play, .chart-play-group .bt-tempo { flex: none; }
/* the chart editor's bar being played (chart-pane.js applyLit), as the song page's .cc-playing; and the lyric section being played, in both */
.ce-cb.ce-playing { background: color-mix(in srgb, var(--accent) 22%, transparent); }
/* G83: in the live lyrics editor the lines under the lit section label are lit too (chart-pane.js liveSectionFor) */
.le-cm .sec-playing-body { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.song-section.sec-playing,
.section-repeat.sec-playing {
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 13%, transparent);
    border-radius: 6px;
}
/* G51: Chart mode shows one more button (#chart-chords-btn), so it runs out of room sooner than the other three
   modes. The block above applies the tightest set to every mode below 400px; this applies it, at any narrow width,
   only while that button is actually on the band — so Lyrics, Chords and ChordPro keep the roomier sizes at 440. */
@media (max-width: 780px) {
    .editor-band:has(.chart-chords-btn:not(.hidden)) .le-modeswitch button { padding: 0.3rem 0.17rem; font-size: 0.72rem; }
    .editor-band:has(.chart-chords-btn:not(.hidden)) .editor-band-btn { min-width: 25px; padding: 0 2px; }
    .editor-band:has(.chart-chords-btn:not(.hidden)) .editor-key-select { width: 64px; font-size: 0.78rem; }
    .editor-band:has(.chart-chords-btn:not(.hidden)) .editor-display-pill .pill-btn { padding: 0.3rem 0.3rem; }
    .app-bottomband:has(.editor-band .chart-chords-btn:not(.hidden)) { padding-left: 2px; padding-right: 2px; }
}
/* G51: ChordPro and Chart each put a fifth control on the band (the ? reference, the Chords toggle). At 360-400px
   that was ~15px more than the row holds, so the Display pill dropped to a second row on an iPhone 13/14/15/16 (390)
   and an SE (375) — the band's own comment claimed one row here, and it had not been true since the Chart chip. */
@media (max-width: 430px) {
    .editor-band:has(.chart-chords-btn:not(.hidden)) .le-modeswitch button,
    .editor-band:has(#chordpro-hints-btn:not(.hidden)) .le-modeswitch button {
        padding: 0.3rem 0.1rem; font-size: 0.68rem;
    }
    .app-bottomband .editor-band:has(.chart-chords-btn:not(.hidden)),
    .app-bottomband .editor-band:has(#chordpro-hints-btn:not(.hidden)) { gap: 4px 3px; }
}
/* the chart's picker has no head: no arrows, no Remove, no "where you are"; it starts at "In this song" */
.chm-menu.chm-chart .chm-head { display: none; }
/* the lyrics editor's Format Help is about the lyrics: the chart has its own */
#editor-panel:has(.ce-root:not(.hidden)) .editor-help-row { display: none; }
/* The picker floats over the page and takes no room, so toggling it moves nothing. On a phone the page always ends with room for
   it, so Submit can be scrolled clear of it. (On a computer the page does not scroll: see the desktop layout below.) */
@media not all and (min-width: 1100px) and (pointer: fine) {
    #editor-panel:has(.ce-root:not(.hidden)) { padding-bottom: calc(min(55vh, 440px) + 24px); }
}
/* DESKTOP LAYOUT (a wide window with a mouse: pane.js layoutNow() 'side'): the editor is laid out like an app, not a long page. The page does
   not scroll. The title row is at the top, the action row (Copy, Download, What changed?, Submit) sits just above the band, and the two columns
   fill the room between them, each a scroll box of its own. The picker floats over the foot of the columns and above the action row. */
@media (min-width: 1100px) and (pointer: fine) {
    .container:has(> #editor-panel:not(.hidden) .ce-root:not(.hidden)) {
        box-sizing: border-box; height: calc(100vh - var(--topbar-h, 48px)); overflow: hidden; display: flex; flex-direction: column;
        padding-bottom: var(--bottomband-h, 52px);
    }
    #editor-panel:has(.ce-root:not(.hidden)) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-top: 0; }
    #editor-panel:has(.ce-root:not(.hidden)) .editor-header { margin-bottom: 0.4rem; }
    #editor-panel:has(.ce-root:not(.hidden)) .editor-workspace { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0; }
    #editor-panel:has(.ce-root:not(.hidden)) .editor-actions { flex: none; padding: 0.5rem 0; border-top: 1px solid var(--border); background: var(--bg); }
    .editor-workspace > .ce-root { flex: 1 1 auto; min-height: 0; }
    .ce-root[data-layout="side"] { grid-template-rows: minmax(0, 1fr); align-items: stretch; }
    .ce-root[data-layout="side"] > .ce-ref, .ce-root[data-layout="side"] > .ce-main { height: 100%; min-height: 0; overflow-y: auto; }
    /* the chart's last bars can scroll clear of the picker: its height (the last measured, kept while it is hidden so showing it moves nothing) */
    .ce-root[data-layout="side"] > .ce-main { padding-bottom: var(--ce-picker-h, min(55vh, 440px)); }
}

/* G83: LYRICS AND CHART SIDE BY SIDE (desktop). The Chart chip shows the chart as a column beside the LIVE lyrics editor: `#editor-lead` is moved
   into `.ce-root` as the left column (chart-pane.js setLiveLyrics). The column is a scroll box like the chart's (the grid is above). */
.ce-root[data-lyrics="live"] > .editor-lead { min-width: 0; }
.ce-root[data-lyrics="live"] .le-cm .cm-editor { min-height: 40vh; }
@media (min-width: 1100px) and (pointer: fine) {
    .ce-root[data-lyrics="live"][data-layout="side"] > .editor-lead { height: 100%; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding-bottom: var(--chm-picker-h, 0px); }
}
/* the chart's picker has no head, but beside the live lyrics it keeps one thing from it: its Close, in the corner (the band has no Chords button for it there) */
body:has(.ce-root[data-lyrics="live"]:not(.hidden)) .chm-menu.chm-chart .chm-head { display: block; }
body:has(.ce-root[data-lyrics="live"]:not(.hidden)) .chm-menu.chm-chart .chm-row2,
body:has(.ce-root[data-lyrics="live"]:not(.hidden)) .chm-menu.chm-chart .chm-row3 > :not(.chm-close) { display: none; }
body:has(.ce-root[data-lyrics="live"]:not(.hidden)) .chm-menu.chm-chart .chm-row3 { justify-content: flex-end; }
/* Chords mode's picker with the chart beside it docks as the chart's does: above the action row, centred and narrower, over the foot of both columns */
@media (min-width: 641px) {
    body:has(.ce-root[data-lyrics="live"]:not(.hidden)) .chm-menu.chm-split:not(.chm-chart) .chm-body {
        bottom: calc(var(--bottomband-h, 0px) + var(--ce-actions-h, 0px));
        left: 50%; right: auto; width: min(760px, calc(100% - 24px)); transform: translateX(-50%);
        border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0;
    }
}

/* G18c: a stored line shows as rows of at most "Cells per row" bars (the song page's setting); the + sits at the end of its last row */
.ce-line { display: block; margin: 3px 0; }
.ce-row { position: relative; display: block; padding-right: 32px; margin: 3px 0 0; }
.ce-line > .ce-row:first-child { margin-top: 0; }
.ce-row .ce-cl { flex: none; width: calc(var(--fill, 1) * 100%); }
.ce-row .ce-addc { position: absolute; right: 0; top: 0; bottom: 0; }
.ce-row.cont::before { content: '\21b3'; position: absolute; left: -15px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text-secondary); }
.ce-cb.inrun { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 4px; }      /* a bar all of whose slots are selected */
.ce-foot-extra { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ce-footrow { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ce-clip .ce-btn { padding: 6px 10px; }
.ce-marks { display: inline-flex; align-items: center; gap: 6px; }
.ce-marks .ce-btn { padding: 6px 10px; }
.ce-mark-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }   /* G62: Rest, Stop and Diamond in the picker's foot */
.ce-mark-btn:disabled { opacity: 0.45; }
.ce-clip .ce-btn.prim { background: var(--accent); color: var(--on-accent); }
.ce-sl.typing { text-decoration: underline dotted; text-underline-offset: 4px; }   /* a chord still being typed: it is in the chart, and one step when it is done */
.ce-sl { user-select: none; -webkit-user-select: none; }

/* G18c: Playback Order (under the chart), the repeat button, and the lifted item of js/sortable.js */
.ce-grip, .ce-g { touch-action: none; user-select: none; -webkit-user-select: none; }
.ce-times { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border); background: var(--bg-secondary); }
.ce-times button { border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; line-height: 1; }
.ce-times button:disabled { opacity: 0.35; cursor: default; }
.ce-times-n { font-size: 13px; font-weight: 600; min-width: 1.6em; text-align: center; font-variant-numeric: tabular-nums; }
.ce-addsec { display: block; margin: 10px 0 0 2px; font-size: 13px; }
.ce-playback { margin: 18px 0 0; padding-top: 12px; border-top: 1px dashed var(--border); }
.ce-pb-h { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px; }
.ce-pb-row { display: flex; align-items: flex-start; gap: 8px; }
.ce-pb-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.ce-pchip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); font-weight: 600; font-size: 14px; }
.ce-pchip .ce-g { color: var(--text-secondary); font-weight: 400; letter-spacing: -2px; font-size: 12px; cursor: grab; padding: 2px 0; }
.ce-pchip button { border: 0; background: none; color: var(--text-secondary); font: inherit; padding: 0 4px; cursor: pointer; }
.ce-pchip.ro { padding: 4px 10px; color: var(--text-secondary); font-weight: 500; opacity: 0.75; }
/* the lyrics' chips (paired charts): the exact lyric label, and below it the chart section that plays it, in that section's colour */
.ce-sw { display: inline-block; flex: none; width: 10px; height: 10px; margin: 0 6px 0 2px; border-radius: 3px; background: hsl(var(--h, 212) 62% 50%); }
.ce-sw.none { background: none; box-shadow: inset 0 0 0 1.5px var(--border); }
.ce-pchip.lyr { flex-direction: column; align-items: flex-start; gap: 1px; padding: 4px 11px 5px 9px; border: 0; border-left: 4px solid hsl(var(--h, 212) 62% 50%); border-radius: 8px; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.ce-pchip.lyr:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.ce-pchip.lyr .ce-pl { font-size: 13px; font-weight: 600; line-height: 1.2; }
.ce-pchip.lyr .ce-ps { font-size: 11px; font-weight: 600; line-height: 1.2; color: color-mix(in srgb, hsl(var(--h, 212) 72% 42%) 62%, var(--text)); }
.ce-pchip.lyr.none { opacity: 0.5; border-left-color: var(--border); }                   /* no chart section plays this lyric section */
.ce-pchip.lyr.none .ce-ps { color: var(--text-secondary); }
.ce-chipmenu { width: 230px; }
.ce-it.ce-pick { display: flex; align-items: center; padding: 7px 6px; }
.ce-it.ce-pick.on { font-weight: 600; }
.ce-ren1 { padding: 6px 0 4px; border-bottom: 0; }
.ce-toast-undo { font: inherit; font-weight: 600; margin-left: 6px; border: 0; background: none; color: inherit; text-decoration: underline; cursor: pointer; }
.ce-pchip.fix { padding: 3px 6px 3px 10px; color: var(--text); font-weight: 500; opacity: 1; box-shadow: inset 0 0 0 1.5px var(--accent); }
.ce-pb-h .ce-pb-link { font: inherit; letter-spacing: inherit; text-transform: inherit; text-decoration: underline; }
.ce-pb-empty { font-size: 13px; color: var(--text-secondary); }
.ce-grp { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); margin: 8px 0 4px; }
.sortable-lifted { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); background: var(--bg); border-radius: 8px; opacity: 0.97; transform: scale(1.02); cursor: grabbing; }
.ce-sec.sortable-lifted { padding: 0 8px; }
.sortable-dragging, .sortable-dragging * { cursor: grabbing !important; user-select: none; }
.ce-lab { color: var(--text-secondary); margin-right: 4px; }

/* ---- Change history (work-history.js, recent-changes.js) ---- */
.change-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.change-row { border: 1px solid var(--border); border-radius: var(--radius-sm, 4px); background: var(--bg); }
.change-row.review-queue-item { padding: 0; }
.change-row.is-reverted .change-summary,
.change-row.is-patrolled { opacity: 0.6; }
.change-row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; width: 100%; padding: 0.55rem 0.75rem; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.change-song { font-weight: 600; }
.change-who { font-weight: 600; }
.change-when { color: var(--text-secondary); font-size: 0.85rem; }
.change-what { color: var(--text-secondary); font-size: 0.85rem; }
.change-reverted { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 3px; padding: 0 0.3rem; }
.change-summary { flex-basis: 100%; font-size: 0.9rem; }
.change-body { padding: 0 0.75rem 0.6rem; }
.change-diff-note { color: var(--text-secondary); font-size: 0.9rem; margin: 0.4rem 0; }
.change-diff { margin: 0; padding: 0.4rem 0; overflow-x: auto; font-family: var(--mono, monospace); font-size: 0.8rem; line-height: 1.4; }
.change-diff span { display: block; white-space: pre-wrap; overflow-wrap: anywhere; padding: 0 0.4rem; }
.change-diff-add { background: rgba(46, 160, 67, 0.18); }
.change-diff-del { background: rgba(248, 81, 73, 0.18); }
.change-diff-gap { color: var(--text-secondary); text-align: center; }
.change-fields { margin: 0.4rem 0; padding-left: 1.2rem; font-size: 0.9rem; }
.change-actions { padding: 0 0.75rem 0.6rem; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; }
.change-revert { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.change-revert-prompt { flex-basis: 100%; font-size: 0.9rem; }
.change-revert-status { font-size: 0.85rem; color: var(--text-secondary); }.change-show-all { display: block; margin: 0.3rem 0 0.6rem; font-size: 0.85rem; color: var(--text-secondary); }
.change-more { margin-top: 0.6rem; }
.change-diff-add .diff-word-add { background: rgba(46, 160, 67, 0.4); display: inline; padding: 0; }
.change-diff-del .diff-word-del { background: rgba(248, 81, 73, 0.4); display: inline; padding: 0; }
/* G44: a lead sheet's lines are chords over words, so they must not wrap; the
   rows scroll sideways together and each tint spans the longest line. */
.change-diff.is-chords > span { white-space: pre; overflow-wrap: normal; width: max-content; min-width: 100%; box-sizing: border-box; }
.change-diff-chords { color: var(--chord); font-weight: 600; }
/* G44: a diff needs the width. On a desktop the History card grows with the
   screen up to 1280px, and the Dungeon's review panel leaves the 800px page
   column for the same width, centred. Under that they fit the screen. */
@media (min-width: 768px) {
    #song-history-sheet { max-width: min(1280px, calc(100vw - 4rem)); }
}
@media (min-width: 900px) {
    .review-queue-panel {
        width: min(1280px, calc(100vw - 4rem));
        margin-left: calc((100% - min(1280px, calc(100vw - 4rem))) / 2);
    }
}
/* Side by side when the change's own box is wide enough for two columns of
   chords over words (or two staves); stacked otherwise, as on a phone. */
.change-body { container-type: inline-size; }
.change-split { display: none; }
.change-split-head { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-secondary); padding: 0.4rem 0.4rem 0.2rem; }
/* Bottom-aligned, so a cell with only words lines them up with its neighbour's words, under its chords. */
.change-split-cell { display: flex; flex-direction: column; justify-content: flex-end; padding: 0 0.4rem; overflow-x: auto; font-family: var(--mono, monospace); font-size: 0.8rem; line-height: 1.4; }
.change-split-line { white-space: pre; }
.change-split-del { background: rgba(248, 81, 73, 0.18); }
.change-split-add { background: rgba(46, 160, 67, 0.18); }
.change-split-del .diff-word-del { background: rgba(248, 81, 73, 0.4); }
.change-split-add .diff-word-add { background: rgba(46, 160, 67, 0.4); }
.change-split-gap { grid-column: 1 / -1; text-align: center; color: var(--text-secondary); font-family: var(--mono, monospace); font-size: 0.8rem; padding: 0.2rem 0; }
.tab-diff-run { margin: 0.6rem 0 1rem; }
.tab-diff-where { margin: 0 0 0.4rem; font-size: 0.9rem; font-weight: 600; }
.tab-diff-side { padding-left: 0.5rem; min-width: 0; }
.tab-diff-side + .tab-diff-side { margin-top: 0.75rem; }
.tab-diff-side[data-side="before"] { border-left: 3px solid rgba(248, 81, 73, 0.6); }
.tab-diff-side[data-side="after"] { border-left: 3px solid rgba(46, 160, 67, 0.6); }
.tab-diff-side-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-secondary); margin-bottom: 0.2rem; }
[data-side="before"] .tab-diff-tint { fill: rgb(248, 81, 73); fill-opacity: 0.16; }
[data-side="after"] .tab-diff-tint { fill: rgb(46, 160, 67); fill-opacity: 0.16; }
.tab-diff-file > summary { cursor: pointer; font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.4rem; }
@container (min-width: 880px) {
    .change-diff-views > .change-diff { display: none; }
    .change-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 4px; padding-bottom: 0.4rem; }
    .tab-diff-pair:not(.is-new) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
    .tab-diff-pair:not(.is-new) .tab-diff-side + .tab-diff-side { margin-top: 0; }
}
.change-caret { color: var(--text-secondary); font-size: 0.9rem; width: 0.9rem; }
.change-caret::before { content: '\25B8'; }
.change-row-head[aria-expanded="true"] .change-caret::before { content: '\25BE'; }
.change-size { color: var(--text-secondary); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* ============================================
   THE TAB EDITOR'S OWN PAGE (U14 step 2; work-view.js declareEditorTopBar,
   otf-editor/tab-bar.js, otf-editor/work-edit.js)
   One slim bar: ← · the title and a grey line · the main button · ⋯. The
   song page's header and take line leave the top of the editor (their
   facts are in the bar, Tab setup and the Submit step), and the bottom
   band is playback only.
   ============================================ */

.app-topbar[data-dock="tab"] .topbar-brand { display: none; }

/* The title is the one elastic part. The density ladder must not hide it. */
.app-topbar[data-dock="tab"] .topbar-title {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.tab-bar-id {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    min-width: 0;
}

.tab-bar-title {
    flex: 0 1 auto;
    min-width: 6ch;
    max-width: 100%;
    font: inherit;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

input.tab-bar-title {
    padding: 0.15rem 0.35rem;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

input.tab-bar-title:hover { border-color: var(--border); }
input.tab-bar-title:focus {
    outline: none;
    border: 1px solid var(--accent);
    background: var(--bg);
}

.tab-bar-meta {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-sm);
    font-weight: 400;
    color: var(--text-secondary);
}

/* The session's buttons, in the bar */
.tab-edit-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tab-edit-bar.is-compact { display: flex; align-items: center; }
.app-topbar .tab-edit-actions { flex-wrap: nowrap; gap: var(--space-xs); }

.app-topbar .tab-edit-submit,
.app-topbar .tab-save-main,
.app-topbar .tab-save-more .pill-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    white-space: nowrap;
}

.app-topbar .tab-edit-submit:hover,
.app-topbar .tab-save-main:hover,
.app-topbar .tab-save-more .pill-btn:hover { filter: brightness(1.08); }

.app-topbar .tab-edit-done { white-space: nowrap; }

/* Save .tef ▾: one button in two halves */
.tab-save-split { display: inline-flex; align-items: stretch; }
.tab-save-split .tab-save-main { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.tab-save-split .tab-save-more .pill-btn {
    height: 32px;
    padding: 0 0.5rem;
    margin-left: -1px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left-color: color-mix(in srgb, var(--on-accent) 35%, transparent);
}
.tab-save-split .pill-label { display: none; }
.tab-save-split .pill-caret { color: inherit; opacity: 0.9; font-size: 0.8em; }
.tab-save-split .pill-popover { left: auto; right: 0; min-width: 200px; }

/* What the bar has no room for hangs under it: an import's result, the
   "Discard edits?" question. */
.app-topbar .tab-edit-status {
    position: absolute;
    top: calc(100% + 4px);
    right: var(--space-md);
    z-index: 5;
    max-width: min(34rem, calc(100vw - 2rem));
    padding: 0.25rem 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.app-topbar .tab-edit-status:empty { display: none; }

.app-topbar .tab-edit-discard-confirm {
    position: absolute;
    top: calc(100% + 6px);
    right: var(--space-md);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* The Submit step (a sheet): the credit, the note, Send */
#tab-submit-sheet { max-height: 90vh; }
#tab-submit-sheet .notes-sheet-content { padding: var(--space-md); overflow-y: auto; }
#tab-submit-sheet .tab-credit { margin-top: 0; }
#tab-submit-sheet .tab-credit-field { flex: 1 1 100%; }
#tab-submit-sheet .tab-credit-label { min-width: 4.5rem; }
.tab-submit-field { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 var(--space-md); font-size: var(--font-sm); }
.tab-submit-field span { min-width: 4.5rem; color: var(--text-secondary); }
.tab-submit-field input {
    flex: 1;
    min-width: 0;
    font: inherit;
    color: inherit;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.4rem;
}
.tab-submit-field input:focus { border-style: solid; border-color: var(--accent); outline: none; }
.tab-submit-offer { margin: 0 0 var(--space-md); }
.tab-submit-offer-text { margin: 0; font-size: var(--font-sm); }
.tab-submit-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.tab-submit-actions .primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.tab-edit-submit-status { font-size: var(--font-sm); color: var(--text-secondary); }

@media (max-width: 640px) {
    /* One short button; the grey line and Done go (File ▸ Done stays) */
    .tab-bar-meta,
    .app-topbar .tab-edit-done { display: none; }
    .app-topbar .tab-edit-discard-confirm,
    .app-topbar .tab-edit-status { left: var(--space-sm); right: var(--space-sm); max-width: none; }
    .tab-submit-field { flex-wrap: wrap; }
    .tab-submit-field span { min-width: 100%; }
    #tab-submit-sheet .tab-credit-field { flex-wrap: wrap; }
    #tab-submit-sheet .tab-credit-label { min-width: 100%; }
}

/* Under the bar, the editor starts at once: the song page's header and the
   take's credit line are the bar's title and grey line now. What stays of the
   take header is a status ("Picked up where you left off…"). */
body.tab-editing .song-header,
body.tab-editing .song-lines { display: none; }

body.tab-editing .container { padding-top: 0; }
body.tab-editing .song-content { padding-top: 0; }
body.tab-editing .arr-host:not(:has(.arr-status)) { display: none; }
body.tab-editing .arr-host { margin-bottom: var(--space-sm); }
/* Track ▾ and the tuning stay just above the tab, close to it */
body.tab-editing .editor-canvas-container { padding-top: 6px; }
body.tab-editing .editor-renderer .track-info { margin-bottom: 2px; padding-bottom: 6px; }

/* ============================================
   The tab editor on paper (U7)
   ============================================ */

/* The title block above a printed tab: filled from the document at print time
   (editor.js), so it is off the screen. */
.tab-print-header { display: none; }

@media print {
    /* Only the tab: no menus, toolbar, status bar, cursor, overlays or sheets, and the
       blue card, its padding and its scrolling are gone so no row is cut off. */
    .otf-editor .editor-menu-container,
    .otf-editor .editor-toolbar-container,
    .otf-editor .editor-status-bar,
    .editor-grid-overlay,
    .editor-selection-overlay,
    .editor-cursor-overlay,
    .editor-ghost-note,
    .editor-refine-hint,
    .editor-help-overlay,
    .otf-context-menu,
    .menu-popup,
    .otf-popover-overlay,
    .notes-sheet,
    .notes-sheet-backdrop,
    #app-topbar {
        display: none !important;
    }

    .otf-editor-container,
    .otf-editor,
    .otf-editor .editor-canvas-container {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        padding: 0 !important;
        background: none !important;
    }

    /* The header a tab opens with (tab-print-header.js): the title centred, the tuning
       and tempo at the left, the writer over "Tab by" at the right. */
    .tab-print-header {
        display: block;
        margin: 0 0 14pt;
        color: #000;
        font-family: "Times New Roman", Times, serif;
    }

    .tab-print-header:empty {
        display: none;
    }

    .tph-title {
        font-size: 22pt;
        line-height: 1.15;
        text-align: center;
        margin-bottom: 12pt;
    }

    .tph-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 24pt;
        font-size: 12pt;
    }

    .tph-right {
        margin-left: auto;
        text-align: right;
    }

    .tph-tabby {
        font-size: 10pt;
    }

    /* where the tab is from: small, and it breaks inside a long address rather than widen the column */
    .tph-source,
    .tph-origin {
        font-size: 9pt;
        max-width: 3.6in;
        overflow-wrap: anywhere;
    }

    /* The header names the tuning and who tabbed it: the song page's own title, and
       the staff's name row (unless All tracks show, which need their names) go. */
    .song-content:has(.tab-print-header) .song-header,
    .tablature-all-tracks:not(.showing-all) .track-info,
    .editor-renderer .track-info,
    .tab-attribution {
        display: none !important;
    }
}

/* The census overlay (G40c, song-tree.js): kinds as rows, takes as leaves */
/* Tall enough that the richest song in the book (13 tabs over four
   instruments) can show every instrument at once; the long take lists scroll
   inside themselves rather than pushing the others off. */
.song-tree-sheet { max-height: 82vh; overflow-y: auto; }
/* One instrument with eleven tabs must not push the other instruments off the
   bottom: a long take list scrolls inside itself, so the kinds stay reachable
   however many takes a song gathers. */
.song-tree .tree-takes { max-height: min(40vh, 21rem); overflow-y: auto; overscroll-behavior: contain; }
.song-tree .tree-kind, .song-tree .tree-take {
    display: flex; align-items: center; gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.song-tree .tree-take { padding-left: 0.9rem; border-left: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); margin-left: 0.2rem; }
.song-tree .tree-pick {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 0; background: none; border: 0; color: var(--text);
    font: inherit; text-align: left; cursor: pointer;
}
.song-tree .tree-label { font-weight: 600; }
.song-tree .here > .tree-pick .tree-label, .song-tree .tree-take.here .tree-who { color: var(--accent); font-weight: 700; }
.song-tree .tree-who { font-weight: 600; }
.song-tree .tree-src { color: var(--text-secondary); font-size: var(--font-sm); }
.song-tree .tree-pin { width: 1.1em; color: var(--warning, #d97706); text-align: center; flex: none; }
.song-tree .tree-tick { color: var(--accent); font-weight: 700; margin-left: auto; }
.song-tree .tree-count, .song-tree .tree-add {
    flex: none; border: 1px solid var(--border); border-radius: 999px;
    background: none; color: var(--text-secondary); font: inherit; font-size: var(--font-sm); cursor: pointer;
}
.song-tree .tree-count { padding: 3px 9px; }
.song-tree .tree-branch.open .tree-count { color: var(--accent); border-color: var(--accent); }
.song-tree .tree-add { width: 28px; height: 28px; }
/* The vote on the reading line: small, beside the words it counts. */
.reading-vote { display: inline-flex; align-items: center; gap: 4px; margin-left: 0.5rem; vertical-align: middle; }
.reading-vote .vote-btn { width: 1.75rem; height: 1.5rem; }
/* The list picker is z-index 2100; the sheet is 3000 */
body:has(.song-tree-sheet) .list-picker-popup { z-index: 3100; }

/* ==========================================================================
   My Book (G55b): docs/js/my-book-view.js. Today's tokens and buttons; only
   the six folder colours are new (the marks on the mockups, light and dark).
   ========================================================================== */
:root { --f-rust: #c2410c; --f-green: #15803d; --f-blue: #1d4ed8; --f-gold: #a16207; --f-violet: #6d28d9; --f-teal: #0f766e; }
[data-theme="dark"] { --f-rust: #e0895f; --f-green: #74c47a; --f-blue: #6aa8f7; --f-gold: #e2b84f; --f-violet: #a98cf5; --f-teal: #3fd1bd; }

/* The page replaces the old Lists header and cards, and uses the full width. */
/* The page's own width: the library is wider than the 800px reading column that holds the other views. */
/* Only while My Book is on screen: leaving a view hides its panel (.hidden) but
   keeps its classes, and :has() would otherwise widen the shared column for
   home, search and songs too (2026-11-15). */
.container:has(> #song-lists-view.my-book-on:not(.hidden)) { max-width: none; padding-left: 0; padding-right: 0; }
#song-lists-view.my-book-on:not(.hidden) { max-width: none; padding: 0; }
#song-lists-view.my-book-on .manage-lists-header { display: none; }
#song-lists-view.my-book-on .manage-lists-content { display: block; }

.mb { color: var(--text); font-size: var(--font-base); }
.mb button { font: inherit; }
.mb-status { padding: 2rem; color: var(--text-secondary); }
.mb-error { margin: 0 0 var(--space-md); padding: 0.6rem 0.8rem; border-radius: var(--radius-lg); border: 1px solid var(--danger); color: var(--danger); }
.mb-empty { padding: 2rem 0; color: var(--text-secondary); }
.mb-hint { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--text-secondary); }
.mb-dim { color: var(--text-secondary); }

/* folder marks and the list glyph */
.mb-fd { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: none; position: relative; top: -1px;
    background: var(--text-secondary); margin-right: 0.45rem; }
.mb-c-rust { background: var(--f-rust); } .mb-c-green { background: var(--f-green); } .mb-c-blue { background: var(--f-blue); }
.mb-c-gold { background: var(--f-gold); } .mb-c-violet { background: var(--f-violet); } .mb-c-teal { background: var(--f-teal); }
.mb-lst { display: inline-block; width: 10px; margin-right: 0.45rem; color: var(--text-secondary); font-size: 12px; text-align: center; }
.mb-shared-mark { margin-left: 0.4rem; font-size: 10.5px; font-weight: 400; color: var(--text-secondary); }
.mb-more { background: none; border: 1px solid transparent; border-radius: var(--radius-md); color: var(--text-secondary);
    cursor: pointer; padding: 0.15rem 0.5rem; font-size: 1.1rem; line-height: 1; }
.mb-more:hover, .mb-more:focus-visible { border-color: var(--border); color: var(--text); }
.mb-more.action-btn { padding: 0.6rem 0.8rem; }

/* desktop: sidebar + table */
.mb-desktop { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1500px; margin: 0 auto; min-height: calc(100vh - var(--topbar-h, 48px) - 2rem); }
.mb-side { border-right: 1px solid var(--border); padding: 1.1rem 0.8rem; font-size: 14px; overflow-y: auto; }
.mb-side-h { margin: 1.2rem 0 0.35rem; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.mb-tree { list-style: none; margin: 0; padding: 0; }
.mb-tree-row { display: flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.4rem 0.1rem calc(0.4rem + var(--depth, 0) * 1.1rem); border-radius: var(--radius-md); }
.mb-tree-row.on { background: var(--bg-tertiary); }
.mb-tree-row.on .mb-tree-name { font-weight: 600; }
.mb-tree-row.drop-over, .mb-row.drop-over, .mb-prow.drop-over { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--selection-wash); }
.mb-tw { width: 1.1rem; flex: none; background: none; border: none; color: var(--text-secondary); font-size: 11px; padding: 0; text-align: center; cursor: pointer; }
span.mb-tw { cursor: default; }
.mb-tree-name { flex: 1; min-width: 0; display: flex; align-items: center; background: none; border: none; color: var(--text); cursor: pointer;
    padding: 0.3rem 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-tree-name .mb-nm { overflow: hidden; text-overflow: ellipsis; }
.mb-c { margin-left: auto; color: var(--text-secondary); font-size: 12px; }
.mb-side-link { display: block; margin-top: 1.4rem; background: none; border: none; padding: 0.2rem 0.4rem; color: var(--text-secondary); cursor: pointer; font-size: 13px; }
.mb-side-link:hover, .mb-side-link.on { color: var(--text); }
.mb-main { padding: 1.2rem 1.8rem; min-width: 0; }
.mb-crumb { font-size: 13px; color: var(--text-secondary); margin-bottom: 0.3rem; }
.mb-crumb a { color: var(--accent); text-decoration: none; }
.mb-crumb b { color: var(--text); font-weight: 500; }
.mb-head { display: flex; align-items: flex-end; gap: 0.9rem; }
.mb-head h1 { margin: 0; font-size: 1.6rem; }
.mb-grow { flex: 1; min-width: 0; }
.mb-btns { display: flex; gap: 0.5rem; align-items: center; }
.list-picker-warn { margin: 0 0.6rem 0.4rem; padding: 0.4rem 0.5rem; font-size: 12px; line-height: 1.35; color: var(--text); background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; }
.result-item.is-private { opacity: 0.75; cursor: default; }
.result-item.is-private .result-title { font-style: italic; color: var(--text-secondary); }
.mb-save .mb-choice { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.7rem; margin-bottom: 0.5rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.mb-save .mb-choice.on { border-color: var(--accent); background: var(--bg-secondary); }
.mb-save .mb-choice-body { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.mb-save .mb-choice-body > span { font-size: 12.5px; color: var(--text-secondary); }
.mb-save .mb-folderpick { flex-direction: row; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.mb-save .mb-folderpick label { font-size: 12px; color: var(--text-secondary); }
.mb-save .mb-folderpick select { flex: 1; min-width: 0; padding: 0.35rem 0.4rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.mb-offline { margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 13px; background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); }
.mb-parts { color: var(--text-secondary); }
.mb-parts b { color: var(--text); font-weight: 600; }
.mb-drift { margin: 0.6rem 0 0; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-lg, 10px); background: var(--bg-secondary); }
.mb-drift[hidden] { display: none; }
.mb-drift-line { margin: 0 0 0.5rem; font-size: var(--font-base, 14px); color: var(--text); }
.mb-drift-quiet { border-left-color: var(--border); }
.mb-drift-quiet .mb-drift-line { color: var(--text-secondary); font-size: 13px; }
.mb-drift-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mb-submit-name .mb-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 12.5px; color: var(--text-secondary); }
.mb-submit-name input[type=text] { width: 100%; box-sizing: border-box; padding: 0.55rem 0.7rem; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.mb-submit-name input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.mb-drift-diff { max-height: 60vh; overflow: auto; }
.mb-song-crumb { margin-bottom: 0.4rem; }
.mb-spacebar { margin-top: 0.3rem; font-size: 12.5px; color: var(--text-secondary); display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 0.75rem; row-gap: 0.15rem; }
.mb-spacebar .sp { flex: 1 1 0; }
.mb-spacebar a { color: var(--accent); }
/* The bar's action: the site's secondary pill (the same look as .pill-btn: Display, Key) */
.mb-spacelink { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: var(--font-sm); padding: 0.3rem 0.75rem; cursor: pointer; align-self: center; }
.mb-spacelink:hover { border-color: var(--accent); }
.mb-spacelink:disabled { opacity: 0.5; cursor: default; }
.mb-submit-problems { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: 13px; }
.mb-song-empty { padding: 2rem 0; text-align: center; color: var(--text-secondary); }
.mb-song-empty-btns { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 0.75rem; }
.mb-note { margin: 0.3rem 0 0; color: var(--text-secondary); white-space: pre-wrap; }
.mb-members { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; font-size: 13px; color: var(--text-secondary); }
.mb-av { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
    font-size: 10px; font-weight: 700; box-shadow: 0 0 0 2px var(--bg); margin-right: -6px; }
.mb-members .mb-av:last-of-type { margin-right: 0.25rem; }

.mb-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.mb-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary);
    padding: 0.4rem 0.8rem 0.4rem 0; border-bottom: 1px solid var(--text); white-space: nowrap; }
.mb-table td { padding: 0.55rem 0.8rem 0.55rem 0; border-bottom: 1px solid var(--border); vertical-align: baseline; }
.mb-name { font-weight: 600; }
.mb-link { background: none; border: none; color: var(--text); cursor: pointer; padding: 0; font-weight: 600; text-align: left; }
.mb-link:hover { color: var(--accent); }
.mb-act { text-align: right; padding-right: 0; }

/* Recently deleted */
.mb-trash { list-style: none; margin: 1rem 0 0; padding: 0; }
.mb-trash-row { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.mb-trash-main { flex: 1; min-width: 0; }
.mb-trash-main small { display: block; margin-top: 0.15rem; color: var(--text-secondary); font-size: 12.5px; }

/* phone: the tree is the page */
.mb-phone { padding: 0.8rem 0.9rem 4rem; }
.mb-phone-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.4rem; }
.mb-phone-head h1 { flex: 1; margin: 0; font-size: 1.5rem; }
.mb-phone .mb-head { align-items: center; }
.mb-notice { margin: 0.6rem 0; padding: 0.75rem; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-secondary); }
.mb-who { margin-top: 0.15rem; font-size: 12.5px; color: var(--text-secondary); }
.mb-acts { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.mb-ptree { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.mb-prow { display: flex; align-items: center; border-bottom: 1px solid var(--border); padding-left: calc(var(--depth, 0) * 1.4rem); }
.mb-prow-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 0.2rem; background: none; border: none; color: var(--text);
    padding: 0.75rem 0; text-align: left; cursor: pointer; font-size: 15px; }
.mb-prow-main .mb-tw { width: 1rem; }
.mb-prow-main .mb-nm { font-weight: 600; min-width: 0; }
.mb-prow-main small { display: block; font-weight: 400; font-size: 12.5px; color: var(--text-secondary); margin-top: 1px; }
.mb-phone .mb-more { padding: 0.5rem 0.7rem; }

/* sheets and dialogs */
.mb-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mb-opt { display: flex; align-items: baseline; gap: 0.6rem; width: 100%; background: none; border: none; border-top: 1px solid var(--border);
    color: var(--text); padding: 0.8rem 0; text-align: left; cursor: pointer; font-size: 15px; }
.mb-opts > li:first-child .mb-opt, .mb-opts > .mb-opt:first-child { border-top: none; }
.mb-opt[data-danger] { color: var(--danger); }
.mb-opt-glyph { width: 1.2rem; color: var(--accent); text-align: center; }
.mb-opt-label { font-weight: 600; }
.mb-opt-hint { display: block; font-weight: 400; font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.mb-pick .mb-opt { padding-left: calc(var(--depth, 0) * 1.1rem); align-items: center; }
.mb-pick { max-height: 50vh; overflow-y: auto; }
.mb-form { display: flex; flex-direction: column; gap: 0.5rem; }
.mb-label { font-size: 13px; color: var(--text-secondary); }
.mb-form input[type=text], .mb-form textarea, .mb-share input[type=text] { width: 100%; box-sizing: border-box; padding: 0.55rem 0.7rem; border-radius: var(--radius-lg);
    border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.mb-form input:focus, .mb-form textarea:focus, .mb-share input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.mb-form-acts { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.9rem; }
/* The tab question (G61c): its title is the question, "NAME's arrangement of TITLE", so it wraps rather than ending in an ellipsis. */
#tab-edit-question-sheet .notes-sheet-title { white-space: normal; }
#tab-edit-question-sheet .mb-form-acts { justify-content: flex-start; flex-wrap: wrap; margin-top: 0.4rem; }
/* The clash sheet (G75b): the title names who changed the song; each passage is the History diff with three choices under it. */
#clash-sheet .notes-sheet-title, #tab-clash-sheet .notes-sheet-title { white-space: normal; }
/* As wide as History, so a passage is drawn side by side (Theirs | Yours) where the screen has room, stacked on a phone. */
@media (min-width: 768px) {
    #clash-sheet, #tab-clash-sheet { max-width: min(1280px, calc(100vw - 4rem)); }
}
.clash-passage { margin-bottom: 1rem; }
.clash-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.clash-choice[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.mb-swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.mb-swatch { display: flex; align-items: center; gap: 0.3rem; padding: 0.65rem 0.8rem; border-radius: var(--radius-lg); border: 1px solid var(--border);
    background: none; color: var(--text); cursor: pointer; }
.mb-swatch[aria-checked=true] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mb-sub { margin: 0 0 0.6rem; font-size: 13px; color: var(--text-secondary); }
.mb-share-row { display: flex; gap: 0.5rem; margin-top: 0.3rem; }
.mb-notfound { color: var(--danger); min-height: 1.2em; }
.mb-notfound:not(.on) { visibility: hidden; height: 0; min-height: 0; margin: 0; }
.mb-members-list { margin-top: 0.8rem; }
.mb-mem { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.mb-mem .mb-av { margin-right: 0; }
.mb-mem-r { margin-left: auto; color: var(--text-secondary); font-size: 13px; }
.mb-role { padding: 0.3rem 0.4rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.mb-mem-r .mb-role { padding: 0.15rem 0.3rem; }
.mb-linkbtn { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; font-size: 13px; }
.mb-rule { margin: 0.8rem 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-secondary); }
.mb-link-box { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.mb-switch { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; cursor: pointer; }
.mb-switch input { width: 18px; height: 18px; accent-color: var(--accent); }

@media (max-width: 760px) {
    .mb-main { padding: 1rem; }
}

/* Signed out, My Book is Favorites only (Mike, 2026-11-14): no "+ New List", a prompt, and a line about lists kept on this device */
#song-lists-view.my-book-signed-out #create-list-btn { display: none; }
.list-picker-signin-btn { display: block; width: 100%; background: none; border: none; padding: 0.55rem 0.75rem; text-align: left;
    color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.list-picker-signin-btn:hover { background: var(--bg-tertiary); }

/* ==========================================================================
   A list inside My Book (G55f): docs/js/my-book-list-view.js. The same table
   as search and My Book's folders: handle · Song · Key · Part · Note · ⋯.
   ========================================================================== */
.mb-desktop:has(> .mb-side[hidden]) { grid-template-columns: minmax(0, 1fr); }
.lp-head { margin-top: 0.1rem; flex-wrap: wrap; row-gap: 0.5rem; }
.lp-head .mb-grow { flex: 1 1 12rem; }
.lp-head .list-badge { font-size: 0.7rem; margin-left: 0.5rem; vertical-align: middle; font-weight: 400; }
.lp-notfound { padding: 2rem 0; }
.lp-notfound p { color: var(--text-secondary); }
.lp-notfound .action-btn { margin-top: 0.75rem; }
.lp-empty { padding: 2.5rem 0; }
.lp-empty-title { margin: 0 0 0.8rem; font-weight: 600; }

.lp-table { table-layout: auto; }
/* .result-item is a flex card elsewhere; in this table it is a row (the same reset the search table makes) */
.lp-table tr.result-item { display: table-row; position: static; padding: 0; background: none; border: 0; border-radius: 0;
    transform: none; gap: 0; transition: none; }
.lp-table tr.result-item:hover { transform: none; border-color: transparent; }
.lp-table th.lp-grip, .lp-table td.lp-grip { width: 2.2rem; padding-right: 0.3rem; white-space: nowrap; }
.lp-table th.lp-more, .lp-table td.lp-more { width: 2rem; padding-right: 0; text-align: right; }
.lp-table tr.lp-row { cursor: pointer; }
.lp-table tr.lp-row.is-private { cursor: default; }
.lp-table tr.lp-row:hover td { background: var(--bg-secondary); }
.lp-song { font-weight: 600; }
.lp-song .result-title { font-weight: 600; }
.lp-private { display: block; margin-top: 2px; font-weight: 400; font-size: 12.5px; color: var(--text-secondary); font-style: normal; }
.lp-key { font-weight: 600; white-space: nowrap; }
.lp-key small { font-weight: 400; color: var(--text-secondary); margin-left: 0.3rem; }
.lp-part { color: var(--text-secondary); white-space: nowrap; }
.lp-note { max-width: 28rem; white-space: pre-line; }
.lp-note-edit { cursor: text; }
.lp-add-note { color: var(--text-secondary); opacity: 0; }
@media (hover: hover) { .lp-row:hover .lp-add-note { opacity: 0.7; } }
.lp-note-edit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lp-note-edit:focus-visible .lp-add-note { opacity: 0.7; }
.lp-note-input { display: block; width: 100%; box-sizing: border-box; padding: 0.4rem 0.5rem; border: none; border-radius: 6px;
    box-shadow: inset 0 0 0 1px var(--accent); background: var(--bg-secondary); color: var(--text); font: inherit; resize: vertical; }
.lp-note-input:focus { outline: none; }

/* The handle and the ✓ share one cell; the ✓ takes the handle's place while selecting */
.lp-table .drag-handle { display: inline-block; vertical-align: middle; width: 1rem; }
.lp-table .result-select-btn { display: none; vertical-align: middle; width: 1.5rem; height: 1.5rem; font-size: 0.8rem; margin: 0; }
.lp-selecting .result-select-btn { display: inline-flex; }
.lp-selecting .drag-handle { display: none; }
.lp-selecting .result-select-btn { opacity: 1; pointer-events: auto; }
.lp-table tr.result-item.selected { border-left: none; padding-left: 0; }
.lp-table tr.result-item.selected td { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.lp-table tr.result-item.dragging { transform: none; border-style: solid; opacity: 0.4; }
.lp-table tr.drag-over-above td { box-shadow: inset 0 3px 0 var(--accent); }
.lp-table tr.drag-over-below td { box-shadow: inset 0 -3px 0 var(--accent); }
.lp-table tr.drag-over-above::before, .lp-table tr.drag-over-below::after { content: none; }

/* The row's ⋯: shown on hover for a pointer that can hover, always on touch (G55 D4) */
.lp-row-menu { background: none; border: 1px solid transparent; border-radius: var(--radius-md); color: var(--text-secondary);
    cursor: pointer; padding: 0.1rem 0.5rem; font-size: 1.1rem; line-height: 1; opacity: 1; }
.lp-row-menu:hover, .lp-row-menu:focus-visible { border-color: var(--border); color: var(--text); }
@media (hover: hover) {
    .lp-row-menu { opacity: 0; }
    .lp-row:hover .lp-row-menu, .lp-row-menu:focus-visible, .lp-row-menu[aria-expanded="true"] { opacity: 1; }
}

/* The ⋯ popover (header and rows) */
.lp-menu { position: absolute; z-index: 3000; min-width: 12rem; padding: 0.35rem 0; border-radius: 10px;
    background: var(--bg-secondary); box-shadow: 0 0 0 1px var(--border), 0 14px 30px rgba(0, 0, 0, 0.35); }
.lp-menu-item { display: block; width: 100%; padding: 0.5rem 0.9rem; border: none; background: none; color: var(--text);
    font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.lp-menu-item:hover, .lp-menu-item:focus-visible { background: var(--bg-tertiary); outline: none; }
.lp-menu-item.danger { color: var(--danger); }
.lp-menu-sep { margin: 0.35rem 0; border-top: 1px solid var(--border); }
.lp-item-form .notes-field-full { margin-top: 0.8rem; }

/* A phone: the title with its note beneath it, the key on the right, ⋯ at the end */
@media (max-width: 760px) {
    .lp-table, .lp-table tbody { display: block; }
    .lp-table thead { display: none; }
    .lp-table tr.lp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; padding: 0.7rem 0;
        border-bottom: 1px solid var(--border); column-gap: 0.6rem; }
    .lp-table tr.lp-row td { display: block; padding: 0; border: 0; }
    .lp-table td.lp-song { grid-column: 1; grid-row: 1; font-size: 15px; }
    .lp-table td.lp-key { grid-column: 2; grid-row: 1; }
    .lp-table td.lp-more { grid-column: 3; grid-row: 1 / span 2; width: auto; align-self: center; }
    .lp-table td.lp-note { grid-column: 1 / span 2; grid-row: 2; max-width: none; margin-top: 2px; font-size: 13px; color: var(--text-secondary); }
    .lp-table tr.lp-row td.lp-part, .lp-table tr.lp-row td.lp-note:not(:has(.lp-note-text, textarea)) { display: none; }
    .lp-wanted { display: inline; margin-left: 0.5rem; font-size: 0.78rem; font-style: italic; font-weight: 400; color: var(--text-secondary); }
    .lp-add-note { display: none; }
    .lp-table tr.lp-row:hover td { background: none; }
    /* Select songs: the ✓ takes a left column (outside it rows carry no control) */
    .lp-table tr.lp-row td.lp-grip { display: none; }
    .lp-selecting tr.lp-row { grid-template-columns: 2.2rem minmax(0, 1fr) auto auto; }
    .lp-selecting tr.lp-row td.lp-grip { display: block; grid-column: 1; grid-row: 1; width: auto; padding: 0; align-self: center; }
    .lp-selecting td.lp-song { grid-column: 2; }
    .lp-selecting td.lp-key { grid-column: 3; }
    .lp-selecting td.lp-more { grid-column: 4; }
    .lp-selecting td.lp-note { grid-column: 2 / span 2; }
    .lp-head h1 { font-size: 1.5rem; }
    .lp-head .mb-btns { flex: none; }
}

/* The note of a list item beside the song, or above it on a phone (G55f): docs/js/list-note.js */
.list-note { font-size: 14.5px; line-height: 1.5; }
.list-note-head { all: unset; box-sizing: border-box; display: flex; align-items: baseline; gap: 0.5rem; width: 100%; }
.list-note-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.list-note-line, .list-note-caret { display: none; }
.list-note-text { white-space: pre-line; margin-top: 0.3rem; overflow-wrap: anywhere; }
.list-note-facts { margin-top: 0.3rem; color: var(--text-secondary); }
.list-note-next { margin-top: 1.6rem; padding-top: 0.75rem; border-top: 1px solid var(--border); font-size: 13.5px; }
.list-note-next span { display: block; color: var(--text-secondary); }
@media (min-width: 761px) {
    #song-content.has-list-note { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; column-gap: 2rem; align-items: start; }
    #song-content.has-list-note > :not(.list-note) { grid-column: 1; min-width: 0; }
    .list-note { grid-column: 2; grid-row: 1 / span 40; position: sticky; top: calc(var(--topbar-h, 48px) + 1rem);
        padding: 0.4rem 0 0 1.4rem; border-left: 1px solid var(--border); }
    .list-note-head { pointer-events: none; }
}
@media (max-width: 760px) {
    .list-note { margin: 0.6rem 0; padding: 0.6rem 0.75rem; border-radius: 10px; background: var(--bg-secondary); box-shadow: inset 0 0 0 1px var(--border); }
    .list-note-head { cursor: pointer; }
    .list-note-line { display: block; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .list-note-caret { display: block; margin-left: auto; color: var(--text-secondary); }
    .list-note[data-open="true"] .list-note-caret { transform: rotate(180deg); }
    .list-note[data-open="true"] .list-note-line { visibility: hidden; flex: 0; width: 0; }
    .list-note:not([data-open="true"]) .list-note-body { display: none; }
    .list-note-next { display: none; }
}

/* Signed out: the one sentence the My Book page says, under the header, in the page's own type */
.lp-device-line { margin: 0.9rem 0 0; font-size: var(--font-base); color: var(--text); }

/* =====================================
   G9: ⋯ ▸ Merge with… (merge-sheet.js; mockup design/ui-states/proposed/g9-merge.html)
   One grid, a row per detail: label | this song | the other | Merged.
   A phone stacks each row: label, the Merged field, then the two songs' values.
   ============================================ */
#merge-sheet { max-height: 88vh; }
#merge-sheet .notes-sheet-content { padding: var(--space-md) var(--space-lg) var(--space-lg); overflow-y: auto;
    max-height: calc(88vh - 60px); }
@media (min-width: 768px) {
    #merge-sheet { max-width: 820px; }
}
.merge-search { width: 100%; box-sizing: border-box; font-size: var(--font-base, 1rem);
    padding: 0.5rem 0.65rem; border-radius: var(--radius-md); border: 1px solid var(--accent);
    background: var(--bg); color: var(--text); }
.merge-results { list-style: none; margin: var(--space-sm) 0 0; padding: 0; }
.merge-result { display: block; width: 100%; text-align: left; background: none; border: 0;
    border-bottom: 1px solid var(--border); padding: 0.55rem 0.15rem; color: var(--text); cursor: pointer; font: inherit; }
.merge-result:hover, .merge-result:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.merge-result b { display: block; font-size: 0.95rem; }
.merge-result span { display: block; font-size: 0.82rem; color: var(--text-secondary); margin-top: 2px; }
.merge-empty { padding: 0.55rem 0.15rem; color: var(--text-secondary); font-size: 0.9rem; }

.merge-mode { display: flex; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--border);
    overflow: hidden; margin-bottom: var(--space-md); }
.merge-mode button { flex: 1; border: 0; background: none; color: var(--text); padding: 0.45rem 0.4rem;
    font: inherit; font-size: 0.9rem; cursor: pointer; }
.merge-mode button.is-on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.merge-narrow { display: none; }

.merge-row { display: grid; grid-template-columns: 7rem 1fr 1fr 1.25fr; gap: 0 var(--space-md);
    align-items: baseline; padding: 0.45rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.merge-grid.is-version .merge-row { grid-template-columns: 7rem 1fr 1fr; }
.merge-grid.is-version .merge-row > :nth-child(4) { display: none; }
.merge-row.is-wide .merge-chips { grid-column: 2 / -1; }
.merge-row.is-head { border-bottom: 1px solid var(--text); align-items: end; }
.merge-label { color: var(--text-secondary); }
.merge-text { color: var(--text-secondary); }
.merge-none { color: var(--text-secondary); }
.merge-result-head { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--text-secondary); }
.merge-stay { text-align: left; background: none; border: 0; padding: 0; color: var(--text); font: inherit; cursor: pointer; }
.merge-stay small { display: flex; align-items: center; gap: 0.4rem; font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 2px; }
.merge-stay b { font-size: 0.95rem; }
.merge-stay.is-on small { color: var(--accent); }
.merge-radio { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text-secondary); flex: none; }
.merge-stay.is-on .merge-radio { box-shadow: inset 0 0 0 4px var(--accent); }
.merge-src { background: none; border: 0; padding: 0; font: inherit; text-align: left; color: var(--text); cursor: pointer;
    text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.merge-src.is-used { color: var(--accent); text-decoration-color: var(--accent); }
.merge-field { width: 100%; box-sizing: border-box; font: inherit; padding: 0.3rem 0.5rem;
    border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text); }
.merge-field:focus { outline: none; border-color: var(--accent); }
.merge-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.merge-chip { display: inline-flex; align-items: center; gap: 0.35rem; border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--border); background: var(--bg-secondary); padding: 0.12rem 0.3rem 0.12rem 0.6rem; font-size: 0.85rem; }
.merge-chip-x { background: none; border: 0; color: var(--text-secondary); font: inherit; cursor: pointer; padding: 0 0.15rem; }
.merge-add { font: inherit; font-size: 0.85rem; width: 7.5rem; border-radius: 999px; border: 1px dashed var(--border);
    background: none; color: var(--text); padding: 0.12rem 0.6rem; }
.merge-add:focus { outline: none; border-style: solid; border-color: var(--accent); }
/* The same names row inside Edit details: the form's input style must not turn the "+ name" pill into a full-width box. */
.placeholder-editor-field .merge-add { font-size: 0.85rem; width: 7.5rem; border-radius: 999px; border: 1px dashed var(--border);
    background: none; padding: 0.12rem 0.6rem; }
.placeholder-editor-field .merge-add:focus { outline: none; border-style: solid; border-color: var(--accent); }
.merge-refusal { margin: var(--space-md) 0 0; color: var(--danger); font-size: 0.9rem; }
.merge-actions { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-md); }

@media (max-width: 640px) {
    .merge-wide { display: none; }
    .merge-narrow { display: inline; }
    .merge-row, .merge-grid.is-version .merge-row { grid-template-columns: 1fr 1fr;
        grid-template-areas: "label label" "field field" "a b"; row-gap: 0.3rem; }
    .merge-row > :nth-child(1) { grid-area: label; }
    .merge-row > :nth-child(2) { grid-area: a; }
    .merge-row > :nth-child(3) { grid-area: b; }
    .merge-row > :nth-child(4) { grid-area: field; }
    .merge-row.is-wide .merge-chips { grid-area: field; grid-column: auto; }
    .merge-row.is-info, .merge-row:has(.merge-chips) > .merge-text { display: none; }
    .merge-row.is-head { grid-template-areas: "a b"; border-bottom: 0; }
    .merge-row.is-head > :nth-child(1), .merge-result-head { display: none; }
    .merge-label { font-size: 0.78rem; }
}

/* G9: a song's other names, under its title (the song page; static pages say it in .prerender .aka) */
.song-aka { margin: 2px 0 0; font-size: var(--font-sm); color: var(--text-secondary); }
/* ===== G54 phase 3: adjusting a song's labels (label-form.js; mockup design/ui-states/proposed/g54-label-editing.html) ===== */

/* A row's genre is a filter button, for everyone: an outlined pill that reads as the chip it adds to the bar (the
   bar's chips are filled with the accent). It fills when pressed or on, and keeps a 44px target that does not move
   the row. */
.result-table .rt-song button.result-genre {
    display: block; width: fit-content; text-align: left; cursor: pointer; font: inherit; font-size: 0.75rem;
    color: var(--text-secondary); background: none;
    border: 1px solid color-mix(in srgb, var(--text-secondary) 55%, transparent); border-radius: 999px;
    padding: 0.1rem 0.6rem; margin: 0.15rem 0; position: relative;
}
.result-table .rt-song button.result-genre::after { content: ''; position: absolute; inset: -0.5rem -0.35rem; }
.result-table .rt-song button.result-genre:active {
    background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff);
}
/* Lit: its genre filter is on. Hollow, so a page of matching rows stays calm. */
.result-table .rt-song button.result-genre[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
@media (hover: hover) {
    .result-table .rt-song button.result-genre:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
}
.result-table .rt-song button.result-genre:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.result-table.rt-compact .rt-song button.result-genre {
    display: inline-block; margin: 0 0 0 auto; font-size: 0.75rem; white-space: nowrap;
}

/* The form: genre pills, the section (Bluegrass only), two ticks, the buttons. */
.lf { display: flex; flex-direction: column; gap: 1rem; padding: 0.25rem 0 0.5rem; }
.notes-sheet .lf { padding: 0 1rem 1rem; }
.lf-group { display: flex; flex-direction: column; gap: 0.45rem; }
.lf-section[hidden] { display: none; }
.lf-label { font-size: 0.85rem; color: var(--text-secondary); }
.lf-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.lf-pill {
    font: inherit; font-size: 0.95rem; padding: 0.5rem 0.85rem; min-height: 44px; border-radius: 999px;
    background: none; color: var(--text); border: 1px solid var(--border); cursor: pointer;
}
.lf-pill[aria-pressed="true"] {
    background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); font-weight: 600;
}
.lf-ticks { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.lf .lf-tick { color: var(--text); display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; font-weight: 400; min-height: 44px; cursor: pointer; }
.lf-tick input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.lf-actions { display: flex; gap: 0.6rem; padding-top: 0.25rem; }
.lf-save {
    font: inherit; font-size: 0.95rem; padding: 0.55rem 1.1rem; min-height: 44px; border-radius: 8px; border: 0;
    background: var(--accent); color: var(--on-accent, #fff); cursor: pointer;
}
.lf-save:disabled { opacity: 0.4; cursor: default; }
.lf-cancel {
    font: inherit; font-size: 0.95rem; padding: 0.55rem 1.1rem; min-height: 44px; border-radius: 8px;
    border: 1px solid var(--border); background: none; color: var(--text); cursor: pointer;
}
.lf-error { color: var(--danger); font-size: 0.9rem; }
.lf-error[hidden] { display: none; }

/* A label change waiting for review, in the Details sheet's Genre row. */
.info-state { color: var(--text-secondary); }

/* ===== G70 part 2: "As played by" (credit.js; mockup design/ui-states/proposed/g70-credits.html) ===== */

/* On the song page: the credit sits in the reading line, after who wrote the tab. The control is a quiet pill. */
.reading-credit { color: var(--text); }
.reading-credit .credit-artist { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.credit-btn {
    position: relative;
    font: inherit; font-size: 0.8rem; line-height: 1.2; padding: 0 0.55rem; cursor: pointer; vertical-align: baseline;
    border: 1px solid var(--border); border-radius: 999px; background: none; color: var(--text-secondary);
}
.credit-btn:hover { color: var(--text); border-color: var(--text-secondary); }
/* The same small pill on a phone as on a computer (it is no taller than the line it sits on); a finger gets an invisible
   larger target around it, about 44px tall, rather than a bigger box. */
.credit-btn::before { content: ''; position: absolute; inset: -12px -6px; }

/* The picker sheet, in the label form's shape. */
.credit-form { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.25rem 0 0.5rem; }
.credit-sub { margin: 0; color: var(--text-secondary); font-size: 0.9rem; }
.credit-parts { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.credit-part { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.7rem; border: 1px solid var(--border);
    border-radius: 999px; font-size: 0.9rem; cursor: pointer; }
.credit-part:has(input:checked) { border-color: var(--accent); }
.credit-part input { accent-color: var(--accent); }
.credit-opts { display: flex; flex-direction: column; }
.credit-opt { display: flex; align-items: center; gap: 0.7rem; min-height: 44px; border-bottom: 1px solid var(--border); font-size: 0.98rem; cursor: pointer; }
.credit-opt input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); flex: none; }
.credit-opt.muted { color: var(--text-secondary); border-bottom: 0; }
.credit-name { flex: 1; }
.credit-year { color: var(--text-secondary); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.credit-more-btn, .credit-add-tab {
    font: inherit; font-size: 0.9rem; background: none; border: 0; color: var(--text-secondary); min-height: 44px; padding: 0; text-align: left; cursor: pointer;
}
.credit-add-tab { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.credit-more[hidden], .credit-hidden[hidden] { display: none; }
.credit-search {
    width: 100%; box-sizing: border-box; font: inherit; font-size: 0.98rem; min-height: 44px; padding: 0 0.7rem;
    border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); margin: 0.35rem 0;
}
.credit-actions { display: flex; gap: 0.6rem; padding-top: 0.25rem; }
.credit-save {
    font: inherit; font-size: 0.95rem; padding: 0.55rem 1.1rem; min-height: 44px; border-radius: 8px; border: 0;
    background: var(--accent); color: var(--on-accent, #fff); cursor: pointer;
}
.credit-save:disabled { opacity: 0.4; cursor: default; }
.credit-cancel {
    font: inherit; font-size: 0.95rem; padding: 0.55rem 1.1rem; min-height: 44px; border-radius: 8px;
    border: 1px solid var(--border); background: none; color: var(--text); cursor: pointer;
}
.credit-error { color: var(--danger); font-size: 0.9rem; }
.credit-error[hidden] { display: none; }

/* The inline field in a submit form (Add Content): label and a select, the search under it when asked for. */
.credit-field { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0; }
.credit-field-row { display: flex; align-items: center; gap: 0.75rem; }
.credit-field-label { color: var(--text-secondary); font-size: 0.9rem; min-width: 6.5rem; }
.credit-field-select, .credit-field-else {
    flex: 1; min-width: 0; box-sizing: border-box; font: inherit; font-size: 0.95rem; min-height: 44px; padding: 0 0.6rem;
    border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text);
}
.credit-field-else[hidden] { display: none; }

/* G100: a songbook page for everyone: the header's buttons wrap, Add a song…'s sheet, the editors' Suggestions block */
.cur-page-head .mb-btns { flex-wrap: wrap; }
.sa-search { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; min-height: 44px; padding: 0 0.7rem;
    border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.sa-results { margin-top: 0.4rem; }
.sa-row { align-items: center; justify-content: space-between; }
.sa-row .mb-opt-label { flex: 1; min-width: 0; }
.sa-artist { font-weight: 400; color: var(--text-secondary); margin-left: 0.4rem; }
.sa-do { color: var(--accent); font-weight: 600; font-size: 14px; white-space: nowrap; }
.sa-there { cursor: default; }
.sa-there .sa-do { color: var(--text-secondary); font-weight: 400; }
.sa-note { padding: 0.8rem 0; color: var(--text-secondary); }
.lp-suggest { margin: 0 0 1.4rem; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.lp-suggest-h { margin: 0 0 0.4rem; font-size: 0.95rem; font-weight: 700; }
.lp-suggest-list { list-style: none; margin: 0; padding: 0; }
.lp-suggest-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.5rem 0; border-top: 1px solid var(--border); }
.lp-suggest-row:first-child { border-top: none; }
.lp-suggest-song { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; min-width: 0; }
.lp-suggest-wanted { font-size: 0.78rem; font-style: italic; color: var(--text-secondary); }
.lp-suggest-by { color: var(--text-secondary); }
.lp-suggest-acts { display: flex; gap: 0.4rem; flex-shrink: 0; }
@media (max-width: 760px) {
    .lp-suggest-row { flex-direction: column; align-items: stretch; }
    .lp-suggest-acts { justify-content: flex-end; }
}
