/* ==========================================================================
   Setlistmaker — "stage" theme
   Warm graphite, hairline rules, one amber signal colour.
   Serif for display, mono for labels and figures.
   ========================================================================== */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-wght-normal-XNcuA7u.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}
@font-face {
    font-family: "Instrument Serif";
    src: url("../fonts/instrument-serif-latin-400-normal-Mk_Cyu2.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Instrument Serif";
    src: url("../fonts/instrument-serif-latin-400-italic-pXHJ7As.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jetbrains-mono-latin-wght-normal-cZcB97x.woff2") format("woff2");
    font-weight: 100 800;
    font-display: swap;
}

/* Template fonts for exports (readable from a distance; OFL, see assets/fonts/licenses).
   Browsers only download a font when something on the page uses it. */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal-2tcpIt-.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal--Us-gGc.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-hyperlegible-latin-400-italic-mlvzl6I.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("../fonts/overpass-latin-400-normal-1nudJSg.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("../fonts/overpass-latin-700-normal-QKhpMPj.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("../fonts/overpass-latin-400-italic-2geZu0N.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "B612"; src: url("../fonts/b612-latin-400-normal-XRi8HmT.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "B612"; src: url("../fonts/b612-latin-700-normal-VFUuDQB.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "B612"; src: url("../fonts/b612-latin-400-italic-DZ5WhLq.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../fonts/lexend-latin-400-normal-UQBIWfp.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../fonts/lexend-latin-700-normal-5qqu1Qn.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-latin-400-normal-tgeBUz0.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-latin-700-normal-QPABG8D.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-latin-400-italic-KuOvAlp.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/andika-latin-400-normal-KhRN-8Q.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/andika-latin-700-normal-Rl6J65j.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../fonts/andika-latin-400-italic-R_1Hb3O.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-400-normal-l053MFU.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-700-normal-7Gl9FFm.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-400-italic-RE1xFki.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Fira Sans"; src: url("../fonts/fira-sans-latin-400-normal-XqRftkq.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fira Sans"; src: url("../fonts/fira-sans-latin-700-normal-t5IMnNz.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fira Sans"; src: url("../fonts/fira-sans-latin-400-italic-bPmw7YI.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-400-normal-dCzU-sz.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-700-normal-zdWo2v5.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-400-italic-eMjXh-T.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/open-sans-latin-400-normal-wXCs6kL.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/open-sans-latin-700-normal-3H8Il7f.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/open-sans-latin-400-italic-in1pGoG.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans-latin-400-normal-FdCi-lj.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans-latin-700-normal-UeV5zpK.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans-latin-400-italic-Y9SVINf.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("../fonts/roboto-latin-400-normal-xRBWAAv.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("../fonts/roboto-latin-700-normal-hVJMMUj.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("../fonts/roboto-latin-400-italic-7N9CTPt.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
    --bg: #0d0d0c;
    --bg-sunk: #0a0a09;
    --panel: #131312;
    --panel-raised: #191917;
    --hover: #1e1e1c;
    --line: #262623;
    --line-strong: #363632;

    --text: #ecebe5;
    --text-2: #b9b7ae;
    --muted: #8d8b82;
    --faint: #5e5d57;

    --signal: #f2a33a;
    --signal-hover: #f7b65c;
    --signal-ink: #171206;
    --signal-dim: rgba(242, 163, 58, 0.12);
    --signal-line: rgba(242, 163, 58, 0.38);

    --ok: #8cc084;
    --danger: #e8705e;
    --danger-dim: rgba(232, 112, 94, 0.1);
    --danger-line: rgba(232, 112, 94, 0.38);

    --r: 4px;
    --r-lg: 6px;

    --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --serif: "Instrument Serif", ui-serif, Georgia, serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --sidebar: 248px;
    --gutter: 16px;

    color-scheme: dark;
}

@media (min-width: 768px) {
    :root { --gutter: 40px; }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute must always win: classes like .btn set their own display, which would
   otherwise show "hidden" buttons (e.g. OK in the upload dialog while uploading) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14.5px;
    line-height: 1.55;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p { margin: 0; }
h2 { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.005em; }

a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }

::selection { background: var(--signal); color: var(--signal-ink); }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.icon { flex-shrink: 0; display: block; }
.mono { font-family: var(--mono); font-size: 0.82rem; letter-spacing: -0.01em; color: var(--text-2); }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Display type */
.display {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
}
.display em { font-style: italic; color: var(--signal); }
.display-xl { font-size: clamp(2.8rem, 1.8rem + 4.5vw, 5.2rem); line-height: 0.98; letter-spacing: -0.02em; }

/* Mono micro-label */
.eyebrow,
.nav-label,
.readout dt,
.kv dt,
.table th,
.alert-tag,
.setlist-sheet .sheet-kicker,
.setlist-sheet .sheet-meta,
.form-group-label,
.field label {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.eyebrow { color: var(--muted); margin-bottom: 10px; }

/* ---------- Brand ---------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.brand-mark {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: var(--r);
    background: var(--signal);
}
.brand-mark i { display: block; height: 2px; border-radius: 1px; background: var(--signal-ink); }
.brand-mark i:last-child { width: 65%; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--r);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, color .12s;
}

.btn-primary { background: var(--signal); color: var(--signal-ink); }
.btn-primary:hover { background: var(--signal-hover); }

.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-outline:hover { background: var(--hover); border-color: #4a4a45; }

.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--hover); color: var(--text); }

.btn-danger { background: transparent; border-color: var(--danger-line); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #1a0d0a; }

.btn-sm { height: 30px; padding: 0 12px; font-size: 0.82rem; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 0.95rem; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.link-quiet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.84rem;
    text-decoration: none;
}
.link-quiet:hover { color: var(--text); }

/* Back button: top left on every page (templates/_back.html.twig) */
/* A page head that starts with the back button: "← Back  Title ✎" on one row */
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; min-width: 0; }
.title-row .display { overflow-wrap: anywhere; min-width: 0; }
.title-row-status { align-self: center; }
.title-row-icon { display: inline-grid; place-items: center; color: var(--muted); } /* a label, not a button: no border */
@media (max-width: 960px) {
    .title-row-back { display: none; } /* phones: the back button is in the top bar */
}
.back-row { margin: -16px 0 20px; }
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px 0 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    color: var(--text-2);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
}
.back-btn:hover { color: var(--text); background: var(--hover); border-color: #4a4a45; }
.back-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
@media (pointer: coarse) {
    .back-btn { height: 40px; padding: 0 14px 0 10px; }
}

/* ---------- App shell ---------- */

.shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--sidebar);
    background: var(--bg-sunk);
    border-right: 1px solid var(--line);
}

.sidebar-head { padding: 22px 20px 26px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 12px; }
.nav-section + .nav-section { margin-top: 24px; }
.nav-label { padding: 0 10px 8px; color: var(--faint); }

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--r);
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.is-active { background: var(--panel-raised); color: var(--text); }
.nav-item.is-active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--signal);
}
.nav-item.is-active .icon { color: var(--signal); }

.sidebar-foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 12px;
    border-top: 1px solid var(--line);
}
.sidebar-foot form { margin: 0; }
.sidebar-foot .btn { justify-content: flex-start; padding: 0 10px; }

.account {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    min-width: 0;
    border-radius: var(--r);
    color: var(--text);
    text-decoration: none;
}
.account:hover { background: var(--hover); }
.account.is-active { background: var(--panel-raised); }
.account.is-active .avatar { border-color: var(--signal); }
.account-text { min-width: 0; }
.account-name { font-weight: 550; font-size: 0.88rem; }
.account-email { color: var(--muted); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shell-main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }

.content {
    flex: 1;
    width: 100%;
    max-width: 1160px;
    padding: 44px var(--gutter) 72px;
}
.content-wide { max-width: 1680px; }
@media (min-width: 1440px) {
    .content-wide .picker { gap: 28px; }
}

.mobile-bar { display: none; }
.scrim { display: none; }

@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .shell.nav-open .sidebar { transform: none; }

    .scrim {
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(0, 0, 0, 0.6);
    }
    .shell.nav-open .scrim { display: block; }

    .shell-main { margin-left: 0; }

    .mobile-bar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 58px;
        padding: 0 var(--gutter);
        background: rgba(13, 13, 12, 0.9);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--line);
    }

    .content { padding-top: 28px; }

    /* Phones/tablets: the back button sits in the top bar instead of the logo */
    .mobile-bar-start { display: flex; align-items: center; min-width: 0; }
    .mobile-bar-start .back-btn:not([hidden]) + .brand { display: none; }
    .back-row { display: none; }
}

/* ---------- Page head ---------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 28px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--line);
}

/* ---------- Avatar ---------- */

.avatar {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: var(--r);
    background: var(--panel-raised);
    border: 1px solid var(--line-strong);
    color: var(--text-2);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
}
.avatar-lg { width: 56px; height: 56px; font-size: 1rem; }

/* ---------- Readout (stats strip) ---------- */

.readout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 32px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--panel);
}
.readout-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.readout-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.readout > div { padding: 18px 22px 20px; }
.readout > div + div { border-left: 1px solid var(--line); }
.readout dt { color: var(--muted); }
.readout dd {
    margin: 10px 0 0;
    font-family: var(--mono);
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.readout dd:not(:only-child) { word-break: break-word; }
.readout:not(.readout-4):not(.readout-2) > div:not(:first-child) dd { font-size: 1.05rem; padding-top: 0.35em; letter-spacing: -0.01em; }

@media (max-width: 720px) {
    .readout, .readout-4, .readout-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .readout > div + div { border-left: 0; }
    .readout > div:nth-child(even) { border-left: 1px solid var(--line); }
    .readout > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .readout:not(.readout-4):not(.readout-2) > div:first-child { grid-column: 1 / -1; }
    .readout:not(.readout-4):not(.readout-2) > div:nth-child(2) { border-left: 0; border-top: 1px solid var(--line); }
    .readout:not(.readout-4):not(.readout-2) > div:nth-child(3) { border-left: 1px solid var(--line); }
}

/* ---------- Panels ---------- */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 22px;
}
.panel-flush { padding: 0; overflow: hidden; }
.panel-flush > .panel-head { padding: 16px 22px; margin: 0; border-bottom: 1px solid var(--line); }

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-danger { border-color: var(--danger-line); }
.panel-danger h2 { color: var(--danger); }
.panel-text { color: var(--muted); margin-bottom: 18px; font-size: 0.9rem; }

.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split-edit { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 1080px) {
    .split, .split-edit { grid-template-columns: 1fr; }
}

/* Key / value list */
.kv { margin: 0; }
.kv > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}
.kv > div:first-child { border-top: 0; padding-top: 0; }
.kv > div:last-child { padding-bottom: 0; }
.kv dt { color: var(--muted); flex-shrink: 0; }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

/* Empty state: a blank numbered setlist */
.empty { padding: 28px 22px 32px; text-align: center; }
.empty-lines { list-style: none; margin: 0 auto 22px; padding: 0; max-width: 300px; }
.empty-lines li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line-strong);
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--faint);
}
.empty-lines i { flex: 1; height: 6px; border-radius: 3px; background: var(--hover); }
.empty-lines li:nth-child(2) i { flex: 0.7; }
.empty-lines li:nth-child(3) i { flex: 0.85; }
.empty-title { font-weight: 600; }
.empty-text { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* ---------- Tags, status, alerts ---------- */

.tag {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    color: var(--text-2);
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.tag-signal { border-color: var(--signal-line); color: var(--signal); background: var(--signal-dim); }

.led { display: inline-flex; align-items: center; gap: 8px; font-size: 0.86rem; }
.led::before { content: ""; width: 6px; height: 6px; border-radius: 1px; }
.led-on::before { background: var(--ok); box-shadow: 0 0 6px rgba(140, 192, 132, 0.6); }
.led-off { color: var(--muted); }
.led-off::before { background: var(--faint); }

.alert {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 24px;
    border: 1px solid var(--line-strong);
    border-left-width: 2px;
    border-radius: var(--r);
    background: var(--panel);
    font-size: 0.9rem;
}
.alert-success { border-left-color: var(--ok); }
.alert-success .alert-tag { color: var(--ok); }
.alert-error { border-left-color: var(--danger); }
.alert-error .alert-tag { color: var(--danger); }
.alert-tag { flex-shrink: 0; }

.note {
    padding: 12px 14px;
    margin-bottom: 22px;
    border-left: 2px solid var(--signal);
    background: var(--signal-dim);
    color: var(--text-2);
    font-size: 0.86rem;
}

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 20px; }
.form > div:not([class]) { display: flex; flex-direction: column; gap: 20px; } /* repeated-field wrapper */

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { color: var(--text-2); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    background: var(--bg-sunk);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    color: var(--text);
    font: inherit;
    transition: border-color .12s, box-shadow .12s;
}
input::placeholder { color: var(--faint); }
input:hover:not(:disabled) { border-color: #4a4a45; }
input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-dim); }
input:disabled { color: var(--muted); background: transparent; border-style: dashed; cursor: not-allowed; }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--bg-sunk) inset; -webkit-text-fill-color: var(--text); }

.has-error input { border-color: var(--danger); }
.has-error input:focus { box-shadow: 0 0 0 3px var(--danger-dim); }

.field-help { color: var(--muted); font-size: 0.8rem; }
.field-errors { list-style: none; margin: 0; padding: 0; color: var(--danger); font-size: 0.82rem; }
.form > .field-errors { padding: 10px 12px; border-left: 2px solid var(--danger); background: var(--danger-dim); }

/* Checkbox rows */
.field-check { flex-direction: row; align-items: flex-start; gap: 12px; }
.field-check label {
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
    cursor: pointer;
}
.field-check .field-help { margin-top: 2px; }
.field-check.is-disabled label { color: var(--muted); cursor: not-allowed; }

.check {
    appearance: none;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    background: var(--bg-sunk);
    cursor: pointer;
}
.check::after {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--signal-ink);
    clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%);
    transform: scale(0);
    transition: transform .1s;
}
.check:checked { background: var(--signal); border-color: var(--signal); }
.check:checked::after { transform: scale(1); }
.check:disabled { opacity: 0.5; cursor: not-allowed; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.form-group-label { color: var(--muted); }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.search { position: relative; width: 100%; max-width: 300px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { height: 38px; padding-left: 36px; }

@media (max-width: 600px) {
    .search { max-width: none; }
}

/* ---------- People ---------- */

.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-text { min-width: 0; }
.who-name { font-weight: 550; }
.who-email { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; }
.who-lg { gap: 18px; }
.who-lg .eyebrow { margin-bottom: 6px; }

/* ---------- Table ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    padding: 11px 22px;
    text-align: left;
    color: var(--faint);
    background: var(--bg-sunk);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 14px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .1s; }
.table tbody tr:hover { background: var(--panel-raised); }
.table tbody tr.row-clickable { cursor: pointer; }
.row-clickable:hover .cell-link { color: var(--signal); }
.cell-actions { text-align: right; width: 1%; }

@media (max-width: 760px) {
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { padding: 16px 18px; border-bottom: 1px solid var(--line); }
    .table tbody tr:last-child { border-bottom: 0; }
    .table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; }
    .table td[data-label]::before {
        content: attr(data-label);
        color: var(--faint);
        font-family: var(--mono);
        font-size: 0.68rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }
    .table td.cell-main { padding-bottom: 12px; }
    .table td.cell-main::before { content: none; }
    .cell-actions { width: 100%; padding-top: 12px !important; }
    .cell-actions .btn { width: 100%; }
}

/* ---------- Auth (split screen) ---------- */

.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }

.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px 48px;
    background: var(--bg-sunk);
    border-right: 1px solid var(--line);
    overflow: hidden;
}
/* Faint staff lines */
.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(255, 255, 255, 0.025) 27px 28px);
    pointer-events: none;
}
.auth-aside > * { position: relative; }

.auth-quote {
    font-family: var(--serif);
    font-size: clamp(2.2rem, 1.2rem + 2.4vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.015em;
}
.auth-quote em { color: var(--signal); }

.cue-list { list-style: none; margin: 0; padding: 0; max-width: 360px; }
.cue-list li {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.78rem;
}
.cue-list li span:first-child { color: var(--faint); }

.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px var(--gutter);
}
.auth-panel { width: 100%; max-width: 380px; }
.auth-sub { color: var(--muted); margin: 12px 0 32px; }
.auth-switch { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.auth-mobile-brand { display: none; }
.auth-main { position: relative; }
.auth-lang { position: absolute; top: 20px; right: var(--gutter); }
.auth-back { position: absolute; top: 20px; left: var(--gutter); }
.site-bar-start { display: flex; align-items: center; gap: 14px; }
@media (max-width: 960px) {
    /* Phones: the back button (only shown after coming from another page) replaces the logo */
    .site-bar-start .back-btn:not([hidden]) + .brand { display: none; }
}

/* Language switch (visitors): EN · NL */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; margin: 0; }
.lang-option {
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: var(--r);
    background: none;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    cursor: pointer;
}
.lang-option:hover { color: var(--text); background: var(--hover); }
.lang-option.is-active { color: var(--signal); }
.site-nav .lang-switch { margin-right: 6px; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { justify-content: flex-start; padding-top: 28px; }
    /* The back button takes the logo's place at the top */
    .auth-mobile-brand { display: none; }
    .auth-back { position: static; align-self: flex-start; margin-bottom: 56px; }
    .auth-lang, .auth-back { top: 26px; }
}

/* ---------- Landing ---------- */

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

.site-bar { border-bottom: 1px solid var(--line); }
.site-bar-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.site-nav { display: flex; align-items: center; gap: 6px; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
    padding: clamp(48px, 9vw, 120px) 0 clamp(48px, 7vw, 96px);
}
.hero-lead { max-width: 500px; margin-top: 28px; color: var(--text-2); font-size: 1.08rem; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }

.setlist-sheet {
    margin: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}
.setlist-sheet .sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}
.setlist-sheet .sheet-kicker { color: var(--faint); }
.setlist-sheet .sheet-title { margin-top: 4px; font-family: var(--serif); font-size: 1.5rem; line-height: 1.1; }
.setlist-sheet .sheet-meta { padding: 3px 8px; border: 1px solid var(--signal-line); border-radius: 3px; color: var(--signal); }

.setlist-sheet .sheet-rows { list-style: none; margin: 0; padding: 6px 0; }
.setlist-sheet .sheet-rows li {
    display: grid;
    grid-template-columns: 36px 1fr 42px 48px;
    align-items: baseline;
    padding: 10px 22px;
    font-size: 0.95rem;
}
.setlist-sheet .sheet-rows li + li { border-top: 1px solid var(--line); }
.setlist-sheet .sheet-rows .n, .setlist-sheet .sheet-rows .k, .setlist-sheet .sheet-rows .d { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }
.setlist-sheet .sheet-rows .k { color: var(--muted); }
.setlist-sheet .sheet-rows .d { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.setlist-sheet .sheet-rows .is-cue .t { color: var(--signal); font-style: italic; font-size: 0.88rem; }

.setlist-sheet .sheet-foot {
    display: flex;
    justify-content: space-between;
    padding: 14px 22px;
    border-top: 1px solid var(--line-strong);
    background: var(--bg-sunk);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.78rem;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.setlist-sheet .sheet-foot strong { color: var(--text); font-weight: 600; }

.principles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    margin-bottom: 96px;
}
.principle { padding: 28px 28px 32px 0; }
/* three per row: a line between the columns, not before the first of a row */
.principle:not(:nth-child(3n+1)) { padding-left: 28px; border-left: 1px solid var(--line); }
.principle:nth-child(n+4) { border-top: 1px solid var(--line); }
.principle-n { font-family: var(--mono); font-size: 0.75rem; color: var(--signal); }
.principle h2 { margin: 14px 0 8px; font-family: var(--serif); font-weight: 400; font-size: 1.6rem; letter-spacing: -0.01em; }
.principle p { color: var(--muted); max-width: 300px; }

.site-foot { padding: 28px 0; border-top: 1px solid var(--line); color: var(--faint); font-family: var(--mono); font-size: 0.75rem; }

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 48px; }
    .principles { grid-template-columns: 1fr; margin-bottom: 64px; }
    .principle, .principle + .principle { padding: 24px 0; border-left: 0; }
    .principle + .principle { border-top: 1px solid var(--line); }
}

@media (max-width: 480px) {
    .site-nav .btn-quiet { display: none; }
    .setlist-sheet .sheet-rows li { grid-template-columns: 30px 1fr 36px 44px; padding: 10px 16px; font-size: 0.9rem; }
    .setlist-sheet .sheet-head, .setlist-sheet .sheet-foot { padding-left: 16px; padding-right: 16px; }
}

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

/* ==========================================================================
   Setlists, songs, templates
   ========================================================================== */

/* ---------- Additional form controls ---------- */

input[type="date"],
input[type="number"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0 12px;
    background: var(--bg-sunk);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    color: var(--text);
    font: inherit;
    transition: border-color .12s, box-shadow .12s;
}
input[type="date"], input[type="number"], input[type="url"], select { height: 42px; }
textarea { padding: 10px 12px; line-height: 1.5; resize: vertical; min-height: 84px; }
input[type="date"] { color-scheme: dark; }
select {
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d8b82' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}
select:hover, textarea:hover { border-color: #4a4a45; }
select:focus, textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-dim); }
.has-error select, .has-error textarea { border-color: var(--danger); }
input.is-invalid { border-color: var(--danger) !important; }

.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) {
    .field-grid { grid-template-columns: 1fr 1fr; }
    .field-grid > :last-child { grid-column: 1 / -1; }
}

.radio {
    appearance: none;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--bg-sunk);
    cursor: pointer;
}
.radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); transform: scale(0); transition: transform .1s; }
.radio:checked { border-color: var(--signal); }
.radio:checked::after { transform: scale(1); }

.choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; }
.choice-list-inline { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.choice-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.choice-item label {
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
    cursor: pointer;
}
.choice-item .check { margin: 0; }
.choice-item.is-locked label { color: var(--muted); cursor: default; }
.choice-item.is-locked .check:disabled { opacity: 0.55; }
@media (max-width: 480px) {
    .choice-list { grid-template-columns: 1fr; }
}

/* ---------- Page bits ---------- */

.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-head-main { min-width: 0; }
.page-head-main .display { overflow-wrap: anywhere; }
.page-intro { max-width: 640px; margin: -12px 0 28px; color: var(--muted); }
.panel-narrow { max-width: 640px; }
.empty-action { margin-top: 18px; }
.alt-title { color: var(--muted); font-weight: 400; }
.cell-link { color: var(--text); text-decoration: none; }
.cell-link:hover { color: var(--signal); }
.truncate { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-actions-inner { display: flex; justify-content: flex-end; gap: 6px; }

.readout dd.readout-sm { font-size: 1.05rem; padding-top: 0.35em; letter-spacing: -0.01em; }

@media (max-width: 600px) {
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
}

/* Simple linked rows (home: recent setlists) */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line); }
.row-link {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 16px;
    padding: 14px 22px;
    color: var(--text);
    text-decoration: none;
}
.row-link:hover { background: var(--panel-raised); }
.row-main { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-date, .row-meta { color: var(--muted); }
@media (max-width: 560px) {
    .row-link { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
    .row-date { grid-column: 1 / -1; }
}

/* Home: four panels in a 2×2 grid (one column on smaller screens) */
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 1080px) {
    .home-grid { grid-template-columns: minmax(0, 1fr); }
}
.home-grid .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.home-grid .panel-head h2 .icon { color: var(--signal); }
.home-figures dd a { color: inherit; text-decoration: none; }
.home-figures dd a:hover { color: var(--signal); }
.empty-compact { padding: 24px 22px; }
.row-with-action { display: flex; align-items: center; }
.row-with-action .row-link { flex: 1; min-width: 0; }
.row-with-action .row-action { flex-shrink: 0; margin-right: 18px; }
.row-link-song { grid-template-columns: minmax(0, 1fr) auto; }
.shortcuts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.shortcuts a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); color: var(--text); text-decoration: none; }
.shortcuts a:hover { background: var(--hover); }
.shortcuts .icon { color: var(--muted); }

/* Templates */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.template-card { display: flex; flex-direction: column; }
.template-card .panel-head h2 { overflow-wrap: anywhere; }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; }
.template-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.template-actions form { margin: 0; }

/* ---------- Setlist editor ---------- */


/* Title + details line on the setlist page: both open the details dialog */
[data-setlist-title] { cursor: pointer; }
/* Account page: change email / password side by side */
.account-security { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 960px) {
    .account-security { grid-template-columns: minmax(0, 1fr); }
}

/* Setlist page: info and delete in one panel at the bottom */
.setlist-info { margin-top: 20px; }
.info-delete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.info-delete .panel-text { margin: 0; }

/* Info + compact delete panel side by side at the bottom of an item page */
.page-foot { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 760px) {
    .page-foot { grid-template-columns: 1fr; }
}
[data-setlist-title]:hover { color: var(--signal); }
.setlist-title-edit {
    width: 32px;
    height: 32px;
    margin-left: 6px;
    vertical-align: 0.15em;
    border-color: transparent;
    color: var(--muted);
}
.setlist-title-edit:hover,
.setlist-title-edit:focus-visible { border-color: var(--line-strong); color: var(--signal); }
.setlist-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    max-width: 640px;
    margin: 12px 0 0 -8px;
    padding: 6px 8px;
    border: 0;
    border-radius: var(--r);
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.setlist-meta:hover { background: var(--hover); }
.setlist-meta-desc { white-space: pre-line; overflow-wrap: anywhere; color: var(--muted); }
.setlist-meta-desc.is-empty { color: var(--faint); font-style: italic; }

.save-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    color: var(--faint);
    text-transform: none;
    letter-spacing: 0;
}
.save-status::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--ok); }
.save-status[data-state="dirty"]::before,
.save-status[data-state="saving"]::before { background: var(--signal); animation: blink 0.9s infinite alternate; }
.save-status[data-state="error"] { color: var(--danger); }
.save-status[data-state="error"]::before { background: var(--danger); }
@keyframes blink { to { opacity: 0.25; } }

.summary { color: var(--muted); font-size: 0.78rem; }

.items { list-style: none; margin: 0; padding: 0; }
.item {
    display: grid;
    grid-template-columns: auto 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 10px 14px 10px 8px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--panel-raised); }
.item.is-new { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--signal-dim); } }

.item-handle {
    display: grid;
    place-items: center;
    width: 28px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--r);
    background: transparent;
    color: var(--faint);
    cursor: grab;
    touch-action: none;
}
.item-handle:hover, .item-handle:focus-visible { color: var(--text); background: var(--hover); }
.item-n { font-family: var(--mono); font-size: 0.8rem; color: var(--signal); text-align: center; }
.item-body { min-width: 0; padding: 0 6px; }
.item-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { display: flex; gap: 14px; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.item-length { color: var(--text-2); min-width: 40px; text-align: right; }
.item-action {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: var(--r);
    background: transparent;
    color: var(--faint);
    cursor: pointer;
}
.item-action:hover { color: var(--text); background: var(--hover); }
.item-remove:hover { color: var(--danger); }

.item-placeholder { background: var(--bg-sunk); }
.item-placeholder .item-n { color: var(--faint); }
.item-placeholder-text { grid-template-columns: minmax(0, 1fr); }
.item-text { color: var(--signal); font-style: italic; font-weight: 700; font-size: 1.06rem; overflow-wrap: anywhere; } /* stands out from the songs */
.item-placeholder-text:hover .item-text { text-decoration: underline; text-underline-offset: 3px; }
.item-actions { display: flex; align-items: center; gap: 2px; }

.item.is-ghost { opacity: 0.35; }
.item.is-chosen { background: var(--panel-raised); box-shadow: inset 2px 0 0 var(--signal); }

.items-empty { padding: 36px 22px; text-align: center; }

/* ---------- Two-sided picker: running order ⇄ library ---------- */

.picker-wrap { container-type: inline-size; }
.picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.picker-pane { container-type: inline-size; }

/* Wide enough: side by side, each list scrolls on its own */
@container (min-width: 760px) {
    .picker { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    /* .picker prefix: must beat the plain .picker-tabs rule further down */
    .picker .picker-tabs { display: none; }
    /* The play order shows in full; the library scrolls on its own */
    .picker .lib-list { max-height: min(68vh, 720px); overflow-y: auto; overscroll-behavior: contain; }
}
/* Narrow (phones, portrait tablets): two tabs, one pane at a time */
@container (max-width: 759.98px) {
    .picker[data-active="setlist"] [data-pane="library"],
    .picker[data-active="library"] [data-pane="setlist"] { display: none; }
}

.picker-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--panel);
}
.picker-tab {
    flex: 1;
    height: 40px;
    border: 0;
    border-radius: var(--r);
    background: none;
    color: var(--muted);
    font: inherit;
    font-weight: 550;
    cursor: pointer;
}
.picker-tab[aria-selected="true"] { background: var(--panel-raised); color: var(--text); }
.picker-count { margin-left: 4px; font-family: var(--mono); font-size: 0.78rem; color: var(--signal); }

.picker-hint { margin: 0; padding: 9px 22px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 0.8rem; }
.picker-tools { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.picker-tool { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.picker-tool-search { flex: 1; }
.picker-tools .picker-search { width: 100%; height: 38px; }
.picker-sort select { height: 38px; width: auto; max-width: 48vw; }
@media (max-width: 420px) {
    .picker-tools { flex-direction: column; }
    .picker-sort select { width: 100%; max-width: none; }
}
.picker-foot { display: flex; flex-direction: column; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.picker-foot-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }

.panel-head-end { display: inline-flex; align-items: center; gap: 12px; }

/* Placeholder dialog: texts used before, as buttons */
.placeholder-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.placeholder-choice {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: var(--bg-sunk);
    color: var(--signal);
    font: inherit;
    font-style: italic;
    font-weight: 600;
    cursor: pointer;
}
.placeholder-choice:hover { border-color: var(--signal-line); background: var(--signal-dim); }
.placeholder-choice:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* A song row in the running order: the song itself is the "move to library" button */
.item-move,
.lib-move {
    display: grid;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 4px 6px;
    border: 0;
    border-radius: var(--r);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.item-move { grid-template-columns: minmax(0, 1fr) auto; }
/* Play order: grab a row anywhere to drag it */
.items[data-items] .item { cursor: grab; touch-action: pan-y; }
.items[data-items] .item.is-chosen { cursor: grabbing; }
.items[data-items] .item-move { cursor: inherit; }
.item-move .item-body { padding: 0; }
.item-move .item-title, .item-move .item-sub,
.lib-body .item-title, .lib-body .item-sub { display: block; }
.lib-arrow { display: grid; color: var(--faint); transition: color .12s, transform .12s; }
.item-move:focus-visible, .lib-move:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }

/* A song in the library pane */
.lib-song { border-bottom: 1px solid var(--line); background: var(--panel); }
.lib-song:last-child { border-bottom: 0; }
.lib-song:hover { background: var(--panel-raised); }
.lib-move { grid-template-columns: auto minmax(0, 1fr) auto; padding: 10px 14px; border-radius: 0; }
.lib-body { min-width: 0; }
.lib-move:hover .lib-arrow, .lib-move:focus-visible .lib-arrow { color: var(--signal); transform: translateX(-2px); }
.lib-song.is-pending { opacity: 0.45; }
.lib-song.is-pending .lib-move { cursor: progress; }

/* Narrow panes: song details move under the title */
@container (max-width: 480px) {
    .item { grid-template-columns: auto 26px minmax(0, 1fr) auto; padding-right: 8px; }
    .item-move { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
    .item-move .item-meta { grid-column: 1; grid-row: 2; }
    .lib-move { grid-template-columns: auto minmax(0, 1fr); row-gap: 2px; }
    .lib-move .item-meta { grid-column: 2; grid-row: 2; }
    .lib-arrow { grid-row: 1 / span 2; }
}
/* Touch screens: bigger targets */
@media (pointer: coarse) {
    .item-move, .lib-move { min-height: 48px; }
    .item-handle { width: 34px; height: 44px; }
}

.add-label {
    color: var(--text-2);
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.add-controls { display: flex; gap: 8px; }
.add-controls > :first-child { flex: 1; min-width: 0; }
.add-controls .btn { height: 42px; }
.add-error { margin-top: 14px; }

/* ---------- Dialog ---------- */

.dialog {
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.7);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.dialog .form { gap: 0; }
.dialog-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 14px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}
.dialog-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; }
.dialog-body { display: flex; flex-direction: column; gap: 18px; padding: 22px; }
.dialog-intro { color: var(--muted); font-size: 0.88rem; }
.dialog-foot {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.link-danger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--danger);
    font: inherit;
    font-size: 0.85rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.link-danger:hover { text-decoration-thickness: 2px; }
.link-danger:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }
.track-current { flex-wrap: wrap; }
/* Right behind the file name, a little apart from it */
.track-delete { margin-left: 6px; font-size: 0.8rem; }

/* Upload progress (song form with a reference track) */
.upload-bar {
    width: 100%;
    height: 10px;
    appearance: none;
    border: 0;
    border-radius: var(--r);
    background: var(--bg-sunk);
    overflow: hidden;
    accent-color: var(--signal);
}
.upload-bar::-webkit-progress-bar { background: var(--bg-sunk); }
.upload-bar::-webkit-progress-value { background: var(--signal); transition: width .2s; }
.upload-bar::-moz-progress-bar { background: var(--signal); }
.upload-status { margin: 0; color: var(--text-2); font-size: 0.9rem; overflow-wrap: anywhere; }

/* Number behind a page title, e.g. "Songs (53)" */
.title-count { color: var(--faint); font-size: 0.6em; letter-spacing: 0; vertical-align: 0.15em; }

/* Song list: search bar above the table, sortable headers, play / link column */
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); margin: 0; }
.table-search { max-width: none; flex: 1; }
.table-sort { display: none; }
.table-sort select { height: 38px; width: auto; }

.th-sort { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; white-space: nowrap; }
.th-sort:hover, .th-sort.is-sorted { color: var(--text); }
.th-sort-icon { color: var(--faint); font-size: 0.85em; }
.th-sort.is-sorted .th-sort-icon { color: var(--signal); }
.th-sort:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 2px; }

.cell-media { width: 1%; white-space: nowrap; }
.song-media { display: flex; align-items: center; gap: 6px; }
.song-play {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--signal-line);
    border-radius: var(--r);
    background: var(--signal-dim);
    color: var(--signal);
    cursor: pointer;
}
.song-play .icon { transform: translateX(1px); }
.song-play:hover { background: var(--signal); color: #171206; }
.song-play:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.song-media-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    color: var(--muted);
    text-decoration: none;
}
.song-media-btn:hover { color: var(--text); border-color: #4a4a45; }
.song-edit { display: inline-grid; margin-left: auto; }
.song-media-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

@media (max-width: 760px) {
    /* Cards without headers: sort with the dropdown instead */
    .table-sort { display: block; }
    .table-toolbar { flex-wrap: wrap; }
    .table-sort, .table-sort select { width: 100%; }
    .cell-media { width: auto; }
    .cell-media:empty { display: none; }

    /* Song list on phones: one compact line per song — title … ▶ ↗ Edit.
       Length, genre and setlist count are left out here. */
    .table-songs tr {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas: "title media actions";
        align-items: center;
        column-gap: 8px;
        padding: 8px 14px;
    }
    .table-songs td { display: block; width: auto; padding: 0; }
    .table-songs td[data-label]::before { content: none; }
    .table-songs .cell-title { grid-area: title; min-width: 0; }
    .table-songs .cell-title .who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .table-songs .cell-title .alt-title,
    .table-songs .cell-title .who-email,
    .table-songs .cell-length,
    .table-songs .cell-genre,
    .table-songs .cell-usage { display: none; }
    .table-songs .cell-media { grid-area: media; }
    .table-songs .cell-media:empty { display: block; width: 0; }
    .table-songs .cell-actions { grid-area: actions; width: auto; padding: 0 !important; margin-left: 10px; } /* a bit apart from ▶ ↗ */
    .table-songs .cell-actions .song-edit { width: 40px; height: 40px; }
    /* Other lists with clickable rows (setlists): on phones the name's link covers the card */
    .table-linked-rows tr { position: relative; }
    .table-linked-rows .cell-link::after { content: ""; position: absolute; inset: 0; }
    .table-linked-rows .cell-actions .btn { position: relative; z-index: 1; }
    /* The whole line is the title link (a real link tap on every phone);
       the buttons sit above it and keep their own action */
    .table-songs .cell-link::after { content: ""; position: absolute; inset: 0; }
    .table-songs .song-media,
    .table-songs .song-edit { position: relative; z-index: 1; }
}
@media (pointer: coarse) {
    .song-play { width: 44px; height: 44px; }
    .song-media-btn { width: 40px; height: 40px; }
}

/* ---------- Template form: font picker (dropdown with previews) ---------- */

.font-picker { position: relative; }
.font-picker-current {
    display: flex;
    align-items: baseline;
    gap: 14px;
    min-height: 46px;
    padding: 10px 40px 10px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: var(--bg-sunk);
    cursor: pointer;
    list-style: none;
}
.font-picker-current::-webkit-details-marker { display: none; }
.font-picker-current:hover { border-color: #4a4a45; }
.font-picker-current:focus-visible { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-dim); }
.font-picker-name { font-weight: 700; white-space: nowrap; }
.font-picker-sample { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.font-picker-chevron {
    position: absolute;
    right: 14px;
    top: 22px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-50%) rotate(45deg);
}
.font-picker[open] .font-picker-chevron { transform: translateY(-20%) rotate(225deg); }
.font-picker-list {
    margin-top: 6px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: var(--panel);
    max-height: 420px;
    overflow-y: auto;
}
.field label.font-option { font: inherit; letter-spacing: normal; text-transform: none; color: inherit; }
.font-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    cursor: pointer;
}
.font-option:first-child { border-top: 0; }
.font-option:hover { background: var(--panel-raised); }
.font-option:has(input:checked) { background: var(--signal-dim); }
.font-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.font-option-name { color: var(--muted); font-size: 0.78rem; font-family: var(--mono); letter-spacing: 0.02em; }
.font-option-sample { font-size: 1.35rem; font-weight: 700; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }

/* ---------- Genre field: dropdown + Add / Edit dialogs ---------- */

.genre-row { display: flex; gap: 8px; }
.genre-row select { flex: 1; min-width: 0; }
.genre-btn { flex-shrink: 0; height: 42px; }
.genre-remove:hover { color: var(--danger); }

.dialog-small { width: min(420px, calc(100vw - 24px)); }
.dialog-foot-split { justify-content: space-between; flex-wrap: wrap; }
.dialog-foot-actions { display: flex; gap: 8px; margin-left: auto; }

@media (max-width: 480px) {
    .genre-row { flex-wrap: wrap; }
    .genre-row select { flex-basis: 100%; }
    .genre-btn { flex: 1; }
}

/* ---------- Vocalists field ---------- */

.vocalist-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.vocalist-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 2px 2px 10px;
    border: 1px solid var(--signal-line);
    border-radius: var(--r);
    background: var(--signal-dim);
    color: var(--text);
    font-size: 0.88rem;
}
.vocalist-name { margin-right: 4px; overflow-wrap: anywhere; }
.vocalist-chip-btn {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: var(--r);
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.vocalist-chip-btn:hover { color: var(--text); background: var(--hover); }
.vocalist-chip-btn[data-vocalist-off]:hover { color: var(--danger); }
.vocalist-chip-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
@media (pointer: coarse) {
    .vocalist-chip-btn { width: 36px; height: 36px; }
}

/* ---------- Tools ---------- */

.section-title { margin: 0 0 6px; font-size: 1.05rem; }
.tool-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.tool-card .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.tool-card .panel-head .icon { color: var(--signal); }
.tool-card .form { gap: 16px; }
.form-actions-start { justify-content: flex-start; }

.import-result { margin-bottom: 20px; }
.import-result.has-problems { border-color: var(--danger-line); }
.import-figures { margin-bottom: 16px; }
.import-subhead { margin: 18px 0 8px; font-size: 0.9rem; }
.import-errors { list-style: none; margin: 0; padding: 0; }
.import-errors > li { padding: 10px 0; border-top: 1px solid var(--line); }
.import-errors > li > .mono { margin-right: 8px; }
.import-errors .field-errors { margin-top: 4px; }
.import-renamed { margin: 0; padding-left: 18px; color: var(--text-2); }
.import-renamed .icon { vertical-align: -2px; color: var(--faint); }

/* Import: songs that are already in the library */
.import-dialog { width: min(640px, calc(100vw - 24px)); }
.import-stage { display: flex; flex-direction: column; gap: 14px; }
.import-preview { max-height: min(40vh, 360px); overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.import-preview:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
.import-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.import-table th { position: sticky; top: 0; padding: 8px 10px; background: var(--panel-raised); color: var(--muted); text-align: left; font-weight: 500; }
.import-table td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.import-table .tag { margin-left: 6px; }
.import-details { color: var(--text-2); font-size: 0.9rem; }
.import-details summary { cursor: pointer; }
.import-details > ul { margin-top: 8px; }
.import-done .import-figures { margin: 0; }
.conflict-progress { margin: 0; color: var(--faint); }
.conflict-question { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.conflict-step { display: flex; flex-direction: column; gap: 16px; }
.conflict-choice { display: flex; flex-direction: column; gap: 8px; }
.conflict-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.conflict-buttons .btn { white-space: normal; height: auto; min-height: 42px; text-align: left; overflow-wrap: anywhere; }
.conflict-list { display: flex; flex-direction: column; gap: 12px; }
.conflict { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); }
.conflict legend { padding: 0 6px; }
.conflict legend .mono { margin-left: 6px; color: var(--faint); }

/* ---------- Reference track: upload field + player ---------- */

input[type="file"] {
    width: 100%;
    min-width: 0;
    padding: 6px;
    background: var(--bg-sunk);
    border: 1px dashed var(--line-strong);
    border-radius: var(--r);
    color: var(--muted);
    font: inherit;
    font-size: 0.88rem;
}
input[type="file"]::file-selector-button {
    height: 30px;
    margin-right: 12px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: var(--panel-raised);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
input[type="file"]:hover { border-color: #4a4a45; }
input[type="file"]:focus-visible { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-dim); }

.track-row { display: flex; gap: 8px; align-items: stretch; }
.track-row input[type="file"] { flex: 1; }
.track-play { flex-shrink: 0; height: auto; min-height: 42px; }
.track-play .icon { color: var(--signal); }
.track-current { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.track-current .icon { flex-shrink: 0; }

.dialog-player { width: min(480px, calc(100vw - 24px)); }
.player { gap: 14px; }
.player-file { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.player-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.player-toggle {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: var(--r-lg);
    background: var(--signal);
    color: #171206;
    cursor: pointer;
}
.player-toggle:hover { filter: brightness(1.08); }
.player-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.player-toggle:disabled { background: var(--panel-raised); color: var(--faint); cursor: not-allowed; }
.player-icon-play, .player-icon-pause { display: grid; }
.player-toggle .player-icon-pause,
.player-toggle.is-playing .player-icon-play { display: none; }
.player-toggle.is-playing .player-icon-pause { display: grid; }
.player-icon-play .icon { transform: translateX(2px); }
.player-seek { width: 100%; height: 28px; margin: 0; accent-color: var(--signal); cursor: pointer; }
.player-time { white-space: nowrap; font-size: 0.8rem; }
.player-error { margin: 0; }

@media (max-width: 480px) {
    .track-row { flex-direction: column; }
    .player-controls { grid-template-columns: auto minmax(0, 1fr); }
    .player-time { grid-column: 2; grid-row: 2; justify-self: end; margin-top: -8px; }
    .player-toggle { grid-row: 1 / span 2; }
}

/* ---------- Export (printable, light, big type) ---------- */

.page-export { background: #2a2a27; }

.export-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    padding: 12px var(--gutter);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.export-bar .back-btn { margin: 0; }
.export-template { display: flex; align-items: center; gap: 10px; }
.export-template label { color: var(--muted); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.export-template select { height: 34px; min-width: 200px; }
.export-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
@media (max-width: 720px) {
    .export-actions { margin-left: 0; width: 100%; }
    .export-template { width: 100%; }
    .export-template select { flex: 1; min-width: 0; }
}

.export-warning {
    max-width: 210mm;
    margin: 20px auto 0;
    padding: 12px 14px;
    border-left: 2px solid var(--signal);
    background: var(--panel);
    color: var(--text-2);
    font-size: 0.88rem;
}
.export-warning a { color: var(--signal); }

/* Each page is a real A4 sheet. Text shrinks per page (--fit, set by app.js) until
   the content fits, so printing never adds page breaks of its own. */
.sheets {
    --sheet-scale: 1;
    --preview: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 28px 0 64px;
}
.sheet {
    --fit: 1;
    position: relative;
    flex-shrink: 0;
    width: 210mm;
    height: 297mm;
    padding: 14mm 16mm;
    overflow: hidden;
    background: #fff;
    color: #111;
    font-family: var(--sheet-font, var(--sans));
    font-size: calc(20pt * var(--sheet-scale) * var(--fit));
    line-height: 1.22;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
    /* Scaled preview on narrow screens; layout (and the fit calculation) stays A4 */
    zoom: var(--preview);
}
.sheet-content { display: flow-root; }
.sheet-header { padding-bottom: 0.5em; margin-bottom: 0.3em; border-bottom: 3px solid #111; }
.sheet-header h1 { font-family: var(--sheet-font, var(--serif)); font-weight: 400; font-size: 1.9em; line-height: 1.05; }
.sheets[data-font] .sheet-header h1 { font-weight: 700; font-size: 1.7em; }
.sheet-date { margin-top: 0.25em; font-size: 0.6em; color: #555; font-family: var(--sheet-font, var(--mono)); text-transform: uppercase; letter-spacing: 0.06em; }
.sheet-running {
    padding-bottom: 0.4em;
    margin-bottom: 0.3em;
    border-bottom: 2px solid #111;
    font-family: var(--sheet-font, var(--mono));
    font-size: 0.55em;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.sheet-list { list-style: none; margin: 0; padding: 0; }
.sheet-item {
    display: grid;
    grid-template-columns: 2em minmax(0, 1fr);
    gap: 0.35em;
    padding: 0.28em 0;
    border-bottom: 1px solid #d6d6d2;
}
.sheet-n { font-family: var(--sheet-font, var(--mono)); font-weight: 700; color: #111; font-variant-numeric: tabular-nums; }
/* All of a song on one line: the title never shrinks; the rest ends in … when it doesn't fit */
.sheet-list .sheet-line { display: flex; align-items: baseline; gap: 0.6em; min-width: 0; white-space: nowrap; }
.sheet-list .sheet-title { flex: 0 0 auto; max-width: 100%; font-family: var(--sheet-font, var(--serif)); overflow: hidden; text-overflow: ellipsis; font-size: 1.15em; font-weight: 750; letter-spacing: -0.01em; line-height: 1.1; }
.sheet-list .sheet-alt { font-weight: 400; color: #555; }
.sheet-list .sheet-meta { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 0.68em; color: #333; font-family: var(--sheet-font, var(--mono)); font-variant-numeric: tabular-nums; }
.sheet-placeholder { background: #f1f0ec; border-bottom-style: dashed; }
.sheet-list .sheet-placeholder .sheet-title { font-size: 0.85em; font-weight: 500; font-style: italic; color: #555; }
.sheet-empty { padding: 2em 0; color: #666; }
.sheet-footer {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    margin-top: 0.5em;
    font-family: var(--sheet-font, var(--mono));
    font-size: 0.55em;
    color: #555;
}
.sheet-pageno {
    position: absolute;
    right: 16mm;
    bottom: 7mm;
    font-family: var(--sheet-font, var(--mono));
    font-size: 9pt;
    color: #888;
}

@media print {
    @page { size: A4; margin: 0; }
    .page-export { background: #fff; }
    .export-bar, .export-warning { display: none; }
    .sheets { display: block; padding: 0; }
    .sheet { zoom: 1; box-shadow: none; break-after: page; }
    .sheet:last-child { break-after: auto; }
}
