:root {
    --paper: #f4f0e8;
    --paper-deep: #e8e2d6;
    --card: #fffcf8;
    --ink: #1c1916;
    --muted: #6e665c;
    --line: #e4dcd0;
    --line-strong: #d3c8b6;
    --wine: #8d3b46;
    --wine-dark: #6d2c36;
    --wine-soft: #f8ecee;
    --navy: #183351;
    --navy-dark: #10243c;
    --green: #13241d;
    --green-2: #1c3329;
    --green-soft: #e7f1eb;
    --gold: #a6843d;
    --gold-soft: #f4ead4;
    --danger: #8f3030;
    --shadow: 0 1px 2px rgba(28, 25, 22, 0.04), 0 18px 40px rgba(28, 25, 22, 0.06);
    --field: #fff;
    --field-soft: #faf7f2;
    --hover: #faf6ef;
    --group: #f6f1e6;
    --sheet: #fffcf8;
    --sheet-edge: #e6dfd2;
    --toolbar: rgba(255, 252, 248, 0.92);
    --danger-soft: #fdf6f6;
    --danger-line: #e7c4c4;
    --flash-error-bg: #f8ecea;
    --flash-error-ink: #6d2424;
    --flash-error-line: #efd0cb;
    --flash-ok-line: #cfe0d6;
    --badge-ink: #6d5424;
    --chip-line: #ead3d7;
    --outside: #b7ad9f;
    --line-hover: #c4b59d;
    --selection: #f0dcc4;
    --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
    --sans: "Segoe UI", system-ui, sans-serif;
    --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
    --radius: 16px;
    color-scheme: light;
}

html[data-theme="dark"] {
    --paper: #121614;
    --paper-deep: #1a211c;
    --card: #1c2420;
    --ink: #f4efe6;
    --muted: #b7aa9c;
    --line: #314038;
    --line-strong: #425248;
    --wine: #e7a0a8;
    --wine-dark: #f0b8be;
    --wine-soft: #3a2629;
    --navy: #3e6e9c;
    --navy-dark: #5084b4;
    --green: #0c1411;
    --green-2: #c9e2d4;
    --green-soft: #1a2c24;
    --gold: #d4b36a;
    --gold-soft: #3a3222;
    --danger: #f0a3a3;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 18px 40px rgba(0, 0, 0, 0.34);
    --field: #24302b;
    --field-soft: #1e2924;
    --hover: #2a3832;
    --group: #24302b;
    --sheet: #1a221e;
    --sheet-edge: #2c3832;
    --toolbar: rgba(22, 28, 25, 0.92);
    --danger-soft: #3a2424;
    --danger-line: #6a3a3a;
    --flash-error-bg: #3a2424;
    --flash-error-ink: #f3c7c4;
    --flash-error-line: #6a3a3a;
    --flash-ok-line: #2d4a3c;
    --badge-ink: #f0e2c4;
    --chip-line: #5a3a40;
    --outside: #7d756c;
    --line-hover: #6d6254;
    --selection: #4a3b28;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background:
        radial-gradient(900px 420px at 100% -10%, rgba(166, 132, 61, 0.14), transparent 55%),
        var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}
a { color: var(--wine); text-underline-offset: 0.16em; }
a:hover { color: var(--wine-dark); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
h1 { margin: 0; font-size: clamp(1.8rem, 2vw, 2.15rem); }
h2 { margin: 0 0 0.75rem; font-size: 1.28rem; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.92em; }
::selection { background: var(--selection); }

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

.app { display: flex; min-height: 100vh; }

.side {
    width: 248px;
    flex: 0 0 248px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
        var(--green);
    color: #f6f1e6;
    padding: 1.35rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}
.brand {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    color: inherit;
    text-decoration: none;
    padding: 0.15rem 0.4rem;
}
.brand strong { display: block; font-family: var(--serif); font-size: 1.35rem; letter-spacing: -0.02em; }
.brand small { color: #d7c6a4; font-size: 0.82rem; }
.brand-mark {
    width: 2.4rem;
    height: 2.4rem;
    display: block;
    object-fit: cover;
    border-radius: 8px;
    border: 0;
    background: transparent;
    flex: 0 0 auto;
}
.nav { display: flex; flex-direction: column; gap: 0.3rem; }
.nav a {
    color: #f6f1e6;
    text-decoration: none;
    padding: 0.62rem 0.8rem;
    border-radius: 12px;
    font-weight: 600;
}
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a.is-active {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(237, 217, 173, 0.28);
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.7rem; }
.side-foot .legal-links { margin: 0; font-size: 0.82rem; }
.side-foot .legal-links a { color: #d7c6a4; }
.theme-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.18rem;
    padding: 0.22rem;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 0 0 1px rgba(237, 217, 173, 0.2);
}
.theme-switch button {
    appearance: none;
    border: 0;
    background: transparent;
    color: #e6d8c0;
    border-radius: 12px;
    min-height: 3.15rem;
    padding: 0.32rem 0.1rem 0.28rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.16rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
}
.theme-switch button svg { width: 1.05rem; height: 1.05rem; display: block; }
.theme-switch button:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.theme-switch button[aria-pressed="true"],
.theme-switch button[aria-pressed="true"]:hover {
    background: #edd9ad;
    color: #13241d;
}
.guest .theme-switch {
    margin-top: 1.35rem;
    background: var(--field-soft);
    box-shadow: inset 0 0 0 1px var(--line);
}
.guest .theme-switch button { color: var(--muted); }
.guest .theme-switch button:hover { background: var(--hover); color: var(--ink); }
.guest .theme-switch button[aria-pressed="true"],
.guest .theme-switch button[aria-pressed="true"]:hover {
    background: #edd9ad;
    color: #13241d;
}
html[data-theme="dark"] button.btn-primary,
html[data-theme="dark"] a.btn-primary,
html[data-theme="dark"] .moment-pick:has(input:checked),
html[data-theme="dark"] .date-day.is-selected,
html[data-theme="dark"] .date-day.is-selected:hover,
html[data-theme="dark"] button.reader-key-btn:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
html[data-theme="dark"] button.btn-primary:hover,
html[data-theme="dark"] a.btn-primary:hover,
html[data-theme="dark"] button.reader-key-btn:hover,
html[data-theme="dark"] button.reader-chords:hover {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    color: #fff;
}
.who-row { display: flex; align-items: center; gap: 0.65rem; padding: 0 0.25rem; }
.avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #edd9ad;
    color: var(--green);
    font-weight: 700;
    font-size: 0.9rem;
    flex: 0 0 auto;
    object-fit: cover;
}
img.avatar { display: block; background: transparent; }
.avatar-frame {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    overflow: hidden;
    flex: 0 0 auto;
    display: block;
    background: #edd9ad;
}
.avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.avatar-lg { width: 4.5rem; height: 4.5rem; font-size: 1.5rem; }
.profile-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.profile-actions { flex: 1 1 220px; display: flex; flex-direction: column; gap: 0.7rem; }
.who { margin: 0; color: #f6f1e6; font-size: 0.92rem; }
button.btn-quiet,
a.side-login {
    width: 100%;
    background: transparent;
    color: #f6f1e6;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: none;
}
button.btn-quiet:hover,
a.side-login:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
}

.main {
    flex: 1;
    min-width: 0;
    padding: 1.7rem 2rem 3rem;
    max-width: 1180px;
}
.top { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.35rem; }
.nav-toggle { display: none; }
.nav-backdrop { display: none; }

.lede { max-width: 42rem; color: var(--muted); margin: 0 0 1.25rem; }

.card, .table-wrap, .stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card, .table-wrap { padding: 1.1rem 1.15rem; }
.muted { color: var(--muted); }
.actions, .toolbar, .meta-grid, .split, .page-bar { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.actions { margin-bottom: 1rem; }
.page-bar { align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.library-tools { display: flex; flex-wrap: wrap; gap: 0.65rem 0.9rem; align-items: center; margin: -0.25rem 0 1rem; }
td.when { white-space: nowrap; }
.library-tools .inline-field select { min-width: 8.5rem; }
tr.group-head th {
    background: var(--group);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.05rem;
    letter-spacing: 0;
    text-transform: none;
    padding-top: 0.9rem;
}
tr.group-head th span {
    margin-left: 0.35rem;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 700;
}
.page-bar .actions { margin: 0; }
.meta-grid { margin-bottom: 0.85rem; }
.meta-grid > label,
.meta-grid > .meta-field {
    flex: 1 1 220px;
}
.meta-grid label,
.meta-grid .meta-field,
.form label,
#setlist-form > label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
}
.form label,
#setlist-form > label {
    flex: 0 0 auto;
}
#setlist-form > label { margin-bottom: 0.35rem; }
.split { align-items: stretch; }
.split + .card { margin-top: 0.75rem; }
.split > * { flex: 1 1 280px; }
.split > .card { display: flex; flex-direction: column; }
.form { display: flex; flex-direction: column; gap: 0.7rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="search"], input[type="date"], input[type="time"], input[type="file"], select, textarea, .date-face {
    width: 100%;
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 0.68rem 0.8rem;
    color: var(--ink);
    font-weight: 400;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover, select:hover, textarea:hover, .date-face:hover { border-color: var(--line-hover); }
input:focus, select:focus, textarea:focus, .date-face:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(166, 132, 61, 0.18);
}
label.suggest { position: relative; }
.suggest-list {
    position: absolute;
    z-index: 30;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0.25rem 0 0;
    padding: 0.3rem;
    list-style: none;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(28, 25, 22, 0.16);
    max-height: 14rem;
    overflow: auto;
}
.suggest-list [role="option"] {
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
}
.suggest-list [role="option"][aria-selected="true"] {
    background: rgba(166, 132, 61, 0.18);
}
.suggest-list [role="option"] small,
.suggest-list .suggest-more {
    display: block;
    margin-top: 0.12rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
}
.suggest-list .suggest-more {
    padding: 0.35rem 0.65rem 0.2rem;
    margin-top: 0;
}
.date-picker { position: relative; display: block; }
.date-face { display: block; text-align: left; cursor: pointer; font: inherit; }
input.date-value {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.date-popover {
    position: absolute;
    z-index: 8;
    top: calc(100% + 6px);
    left: 0;
    width: min(320px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 0.75rem;
}
.date-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.55rem; }
.date-nav strong { font-family: var(--serif); font-size: 1.05rem; }
.date-nav-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--field);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}
.date-nav-btn:hover { background: var(--field-soft); }
.date-weekdays, .date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-weekdays span {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    padding: 0.2rem 0 0.35rem;
}
.date-day {
    border: 0;
    background: transparent;
    border-radius: 999px;
    min-height: 2.15rem;
    cursor: pointer;
    color: var(--ink);
    font: inherit;
}
.date-day:hover { background: var(--group); }
.date-day.is-outside { color: var(--outside); }
.date-day.is-today { box-shadow: inset 0 0 0 1.5px var(--gold); }
.date-day.is-selected, .date-day.is-selected:hover { background: var(--navy); color: #fff; }
textarea { resize: vertical; }
input[type="file"] { background: var(--field-soft); padding: 0.55rem; }
.form label.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 7.5rem;
    padding: 1.1rem 1rem;
    border: 1.5px dashed var(--line-strong);
    border-radius: 14px;
    background: var(--field-soft);
    text-align: center;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--muted);
}
.form label.dropzone:hover,
.form label.dropzone.is-drag {
    border-color: var(--gold);
    background: var(--gold-soft);
    color: var(--ink);
}
.form label.dropzone.is-busy { opacity: 0.7; }
.dropzone-copy { display: flex; flex-direction: column; gap: 0.15rem; }
.dropzone-copy strong { color: var(--ink); font-size: 0.98rem; }
.dropzone-name { color: var(--ink); font-size: 0.85rem; word-break: break-all; }
.dropzone-error { color: var(--danger); font-size: 0.82rem; }
.form label.dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    background: transparent;
}

.btn, button.btn {
    border: 1px solid var(--line-strong);
    background: var(--field);
    border-radius: 12px;
    min-height: 40px;
    padding: 0.45rem 0.95rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 0 rgba(28, 25, 22, 0.03);
}
.btn:hover { background: var(--field-soft); border-color: var(--line-hover); color: var(--ink); }
button.btn-primary, a.btn-primary {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
button.btn-primary:hover, a.btn-primary:hover {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    color: #fff;
}
button.btn-danger, a.btn-danger {
    color: var(--danger);
    border-color: var(--danger-line);
    background: var(--field);
}
button.btn-danger:hover, a.btn-danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.linkish {
    background: none;
    border: 0;
    color: var(--navy);
    cursor: pointer;
    padding: 0;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}
.check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.inline-field { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.82rem; }
.toolbar select, .inline-field select { width: auto; min-width: 9.5rem; }

.flash {
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    margin: 0 0 0.9rem;
    border: 1px solid transparent;
}
.flash-ok { background: var(--green-soft); color: var(--green-2); border-color: var(--flash-ok-line); }
.flash-error { background: var(--flash-error-bg); color: var(--flash-error-ink); border-color: var(--flash-error-line); }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 240px));
    gap: 0.85rem;
    margin-bottom: 1.15rem;
}
.stat { padding: 1rem 1.15rem 1.05rem; }
.stat strong {
    display: block;
    font-family: var(--serif);
    font-size: 2.15rem;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.35rem;
}
.stat span { color: var(--muted); font-size: 0.9rem; }

.plain { list-style: none; margin: 0; padding: 0; }
.plain li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.plain li:last-child { border-bottom: 0; padding-bottom: 0.15rem; }
.plain li:first-child { padding-top: 0.15rem; }
.plain a { font-weight: 600; text-decoration: none; }
.plain a:hover { text-decoration: underline; }
.plain small { color: var(--muted); text-align: right; }
.plain li > a:first-child { min-width: 0; }
.setlist-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    flex: 0 0 auto;
}
.setlist-meta small { white-space: nowrap; }
a.btn-icon.setlist-read { color: var(--navy); }

.table-wrap { padding: 0.35rem 0.5rem 0.5rem; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.8rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover); }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.12rem 0.55rem;
    background: var(--gold-soft);
    color: var(--badge-ink);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.12rem 0.55rem;
    background: var(--green-soft);
    color: var(--green-2);
    font-size: 0.78rem;
    font-weight: 700;
}
.pill-quiet {
    background: var(--gold-soft);
    color: var(--badge-ink);
}
.place {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.85rem 1.25rem;
    margin: 0;
}
.place dt { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.15rem; }
.place dd { margin: 0; font-weight: 600; }
.inline-form { display: flex; gap: 0.45rem; align-items: center; }
.inline-form select { width: auto; min-width: 9.5rem; }
.search { display: flex; gap: 0.5rem; margin: 0; flex: 1 1 280px; align-items: center; }
.search input { max-width: none; }
.search > .btn-icon {
    align-self: stretch;
    width: 2.75rem;
    min-width: 2.75rem;
    height: auto;
    min-height: 2.75rem;
}
a.btn-icon.btn-primary,
button.btn-icon.btn-primary {
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    color: #fff;
}
#copy-setlist .icon-done { display: none; }
#copy-setlist.is-copied .icon-idle { display: none; }
#copy-setlist.is-copied .icon-done { display: contents; }
button#copy-setlist.is-copied,
button#copy-setlist.is-copied:hover {
    background: var(--green-soft);
    border-color: var(--green-2);
    color: var(--green-2);
}
p.card.muted { padding: 1.4rem 1.2rem; }

.toolbar {
    position: sticky;
    top: 0.6rem;
    z-index: 2;
    margin: 0.9rem 0 0.7rem;
    padding: 0.55rem;
    background: var(--toolbar);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    align-items: center;
}
.tool-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.toolbar .tool-group + .tool-group {
    padding-left: 0.55rem;
    border-left: 1px solid var(--line);
}
button.btn-icon,
a.btn-icon {
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
    position: relative;
}
button.btn-icon svg,
a.btn-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    display: block;
}
a.btn-icon:hover { text-decoration: none; }
button.btn-icon[data-tip]::after,
a.btn-icon[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 0.45rem);
    transform: translateX(-50%);
    padding: 0.28rem 0.5rem;
    border-radius: 8px;
    background: var(--green);
    color: #f6f1e6;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    z-index: 4;
}
button.btn-icon[data-tip]:hover::after,
button.btn-icon[data-tip]:focus::after,
a.btn-icon[data-tip]:hover::after,
a.btn-icon[data-tip]:focus-visible::after {
    opacity: 1;
}
.chords { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 0.9rem; }
.chip {
    border: 1px solid var(--chip-line);
    background: var(--field);
    color: var(--wine);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    font-family: var(--mono);
    font-weight: 700;
}
.chip:hover { background: var(--wine-soft); }
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}
.editor-pane {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--ink);
}
.editor-pane > span {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
#song-content, .preview {
    min-height: 68vh;
    font-family: var(--mono);
    font-size: 14.5px;
    line-height: 1.5;
    white-space: pre;
    overflow: auto;
    tab-size: 4;
}
.preview {
    margin: 0;
    background:
        linear-gradient(90deg, rgba(141, 59, 70, 0.35) 0 3px, transparent 3px),
        var(--sheet);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 0.85rem 0.9rem 0.85rem 1.05rem;
    white-space: normal;
}
.preview .chord, .preview .chord-line { color: var(--wine); font-weight: 700; }
.preview .section-line { color: var(--green-2); font-weight: 700; font-family: var(--serif); }
.preview .sheet-row.refrain .lyric-line,
.reader-body .sheet-row.refrain .lyric-line { font-weight: 700; }
.preview-original { min-height: 8rem; max-height: 24rem; }
.save-status { color: var(--green-2); min-height: 1.4rem; font-size: 0.92rem; }

.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(800px 420px at 0% 0%, rgba(166, 132, 61, 0.2), transparent 55%),
        radial-gradient(700px 380px at 100% 100%, rgba(141, 59, 70, 0.1), transparent 50%),
        var(--paper);
}
.guest-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
    min-height: 540px;
}
.guest-hero {
    background:
        radial-gradient(420px 240px at 20% 20%, rgba(237, 217, 173, 0.18), transparent 60%),
        var(--green);
    color: #f7f3ea;
    padding: 2.6rem 2.2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.75rem;
}
.guest-hero h1 {
    font-size: clamp(1.55rem, 2.15vw, 2.15rem);
    color: #fff;
    max-width: none;
    white-space: nowrap;
}
.guest-hero p:last-child { margin: 0; max-width: 26ch; color: #e6d8c0; }
.guest { padding: 2.3rem 2rem; display: flex; flex-direction: column; justify-content: center; }
.guest .card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}
.guest .btn-primary, .guest .btn-google { width: 100%; min-height: 46px; }
.legal-links { margin: 0.2rem 0 0; font-size: 0.88rem; }
.legal-links a { font-weight: 600; }
.legal { max-width: 40rem; }
.legal h2 { font-size: 1.35rem; margin: 1.5rem 0 0.35rem; }
.legal p, .legal li { line-height: 1.55; }
.legal ul { margin: 0.3rem 0 0.8rem; padding-left: 1.15rem; }
.legal .legal-links { margin-top: 1.6rem; }
.auth-or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.15rem 0;
    color: var(--muted);
    font-size: 0.82rem;
}
.auth-or::before, .auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.btn-google { gap: 0.65rem; }
.btn-google svg { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; }
.guest-logo {
    width: 4.75rem;
    height: 4.75rem;
    border-radius: 1.15rem;
    display: block;
}
.brand-kicker {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #edd9ad;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
}

.moment {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.95rem 1rem 0.55rem;
    margin: 0.75rem 0;
    box-shadow: var(--shadow);
}
#setlist-form { counter-reset: moment; }
.moment { counter-increment: moment; }
.moment-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; }
.moment h2 {
    font-size: 1.18rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.moment.moment-special {
    counter-increment: none;
    border-color: var(--gold);
}
.moment.moment-special h2::before {
    content: "✦";
    letter-spacing: 0;
}
.moment h2::before {
    content: counter(moment, decimal-leading-zero);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--wine);
    background: var(--wine-soft);
    border-radius: 999px;
    padding: 0.22rem 0.48rem;
}
.slot {
    background: var(--field-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem;
    margin: 0.65rem 0 0.2rem;
    display: grid;
    gap: 0.5rem;
}
.slot-search { position: relative; }
.song-results {
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow: auto;
}
.song-hit {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    background: var(--field);
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.55rem 0.75rem;
    cursor: pointer;
}
.song-hit:hover, .song-hit:focus { background: var(--gold-soft); }
.hit-note { color: var(--wine); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.song-empty { margin: 0; padding: 0.7rem 0.8rem; color: var(--muted); font-size: 0.88rem; }
.moment-picks {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    padding: 0.85rem 1rem 1rem;
    margin: 0 0 0.9rem;
}
.moment-picks legend {
    font-family: var(--serif);
    font-size: 1.2rem;
    padding: 0 0.25rem;
}
.moment-picks .muted { margin: 0 0 0.7rem; }
.moment-picks-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.moment-pick {
    position: relative;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line-strong);
    background: var(--field);
    border-radius: 999px;
    padding: 0.32rem 0.75rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}
.moment-pick input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
.moment-pick:has(input:checked) {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
.moment-pick:has(input:focus-visible) {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
.moment-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
body.reader-open { overflow: hidden; }
.reader {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    padding: 0.85rem 1rem 1rem;
    background:
        radial-gradient(900px 420px at 50% -10%, rgba(166, 132, 61, 0.28), transparent 55%),
        rgba(19, 36, 29, 0.94);
}
.reader[hidden] { display: none; }
.reader:fullscreen {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background:
        radial-gradient(900px 420px at 50% -10%, rgba(166, 132, 61, 0.28), transparent 55%),
        #13241d;
}
.reader-bar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.55rem;
    width: min(100%, 48rem);
    max-width: 48rem;
    margin: 0 auto 0.75rem;
    color: #f6f1e6;
}
.reader-count {
    flex: 1 1 auto;
    margin: 0;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
button.reader-nav { flex: 0 0 auto; background: var(--field); color: var(--ink); }
button.reader-close,
a.reader-close {
    flex: 0 0 auto;
    text-decoration: none;
}
.setlist-label { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.setlist-label strong { font-weight: 600; }
.plain li > a.btn-icon { margin-left: auto; flex: 0 0 auto; }
.reader-stage {
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.reader-page {
    width: min(100%, 48rem);
    max-width: 48rem;
    height: 100%;
    overflow: auto;
    touch-action: pan-y;
    background: var(--sheet);
    color: var(--ink);
    border-radius: 4px 18px 18px 4px;
    box-shadow: -16px 0 0 var(--sheet-edge), -18px 0 0 1px rgba(28, 25, 22, 0.08), 0 22px 50px rgba(0, 0, 0, 0.28);
    padding: 1.15rem 1.35rem 1rem 1.5rem;
    outline: none;
}
.reader-kicker[hidden] { display: none; }
.reader-kicker {
    margin: 0 0 0.35rem;
    color: var(--wine);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.reader-page h2 { margin: 0 0 0.2rem; }
.reader-artist { margin: 0 0 0.85rem; color: var(--muted); }
.reader-artist[hidden] { display: none; }
.reader-key {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding: 0.15rem 0 0.45rem;
    background: linear-gradient(var(--sheet) 75%, transparent);
}
button.reader-key-btn {
    width: 2.45rem;
    height: 2.45rem;
    min-height: 0;
    padding: 0;
    border-radius: 999px;
    color: var(--navy);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1;
}
button.reader-key-btn:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.reader-key-label {
    min-width: 8.5rem;
    text-align: center;
    color: var(--wine);
    font-weight: 700;
    font-size: 0.95rem;
}
button.reader-chords {
    margin-left: auto;
    width: 2.45rem;
    min-width: 2.45rem;
    height: 2.45rem;
    min-height: 2.45rem;
    border-radius: 999px;
    color: var(--navy);
}
button.reader-chords .icon-off { display: none; }
button.reader-chords[aria-pressed="false"] {
    color: var(--muted);
    background: var(--field);
}
button.reader-chords[aria-pressed="false"] .icon-on { display: none; }
button.reader-chords[aria-pressed="false"] .icon-off { display: block; }
button.reader-chords:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
td.song-go { width: 1%; text-align: right; white-space: nowrap; }
.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;
}
.reader-body {
    margin: 0;
    width: 100%;
    white-space: normal;
    font-family: var(--mono);
    font-size: 16px;
    line-height: 1.15;
    letter-spacing: 0;
}
button.reader-gear {
    width: 2.6rem;
    height: 2.6rem;
    min-height: 0;
    padding: 0;
    border-radius: 999px;
    background: var(--field);
    color: var(--ink);
}
button.reader-gear svg { width: 1.25rem; height: 1.25rem; }
button.reader-gear[aria-expanded="true"] { background: var(--gold); border-color: var(--gold); color: #1c1916; }
.reader-settings {
    position: sticky;
    top: 3.2rem;
    z-index: 2;
    display: grid;
    gap: 0.75rem;
    margin: -0.35rem 0 1rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--sheet);
    box-shadow: 0 10px 24px rgba(28, 25, 22, 0.08);
}
.reader-settings[hidden],
.reader-speed[hidden] { display: none !important; }
.reader-setting {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.reader-setting > span { flex: 1; font-weight: 650; }
.reader-setting strong { min-width: 1.6rem; text-align: center; }
button.reader-step {
    width: 2.3rem;
    height: 2.3rem;
    min-height: 0;
    padding: 0;
    border-radius: 999px;
    font-size: 1.2rem;
    line-height: 1;
}
.reader-switch {
    position: relative;
    display: inline-block;
    width: 2.8rem;
    height: 1.6rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--field);
}
.reader-switch span {
    position: absolute;
    left: 0.16rem;
    top: 0.15rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: var(--muted);
    transition: left 0.15s ease, background 0.15s ease;
}
.reader-switch[aria-checked="true"] { background: var(--green); border-color: var(--green); }
.reader-switch[aria-checked="true"] span { left: 1.35rem; background: #fff; }
.reader-speed { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.92rem; }
.reader-speed input { width: 100%; accent-color: var(--wine); }
.reader-probe {
    position: absolute;
    visibility: hidden;
    pointer-events: none;
    font-family: var(--mono);
    font-size: inherit;
    letter-spacing: 0;
    white-space: pre;
}
.reader-gap { height: 0.55rem; }
.reader-gap.is-double { height: 1.1rem; }
.reader-staff { margin: 0 0 0.35rem; }
.reader-staff.refrain .lyric-line { font-weight: 700; }
.reader-tail { height: 42vh; }
.sheet-probe {
    position: absolute;
    visibility: hidden;
    white-space: pre;
    pointer-events: none;
}
.sheet-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 32px;
    margin: 0 0 0.28rem;
}
.sheet-unit { flex: 0 0 auto; max-width: 100%; }
.chord-line, .lyric-line {
    display: block;
    white-space: pre;
    margin: 0;
    line-height: 1.05;
}
.lyric-line { line-height: 1.15; margin-top: 0; }
.sheet-break { height: 0.28rem; }
.reader-body .chord, .reader-body .chord-line { color: var(--wine); font-weight: 700; }
.reader-body .section-line { display: block; color: var(--green-2); font-weight: 700; font-family: var(--serif); letter-spacing: 0.04em; text-transform: uppercase; margin: 0.7rem 0 0.25rem; }
@media (max-width: 720px) {
    .reader { padding: 0.55rem 0.4rem 0.7rem; }
    .reader-page { padding: 0.85rem 0.7rem 0.75rem 0.85rem; }
}
.reader-missing { color: var(--muted); font-family: var(--sans); }
.reader-hint { margin: 1.4rem 0 0; color: var(--muted); font-size: 0.82rem; }
.reader-empty { margin: 0; color: #f6f1e6; font-size: 1.05rem; }
button.reader-nav:disabled { opacity: 0.35; }
.slot-tools { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.slot-count { margin: 0.35rem 0 0.15rem; }
.message {
    min-height: 16rem;
    font-family: var(--mono);
    white-space: pre;
    line-height: 1.45;
}
.actionbar {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.75rem 0.9rem;
    margin-top: 0.85rem;
    box-shadow: var(--shadow);
}
.actionbar .save-status { margin-right: auto; }
details.card { margin-top: 0.85rem; }
details summary { cursor: pointer; font-family: var(--serif); font-size: 1.05rem; }
details summary:hover { color: var(--wine); }
form[data-confirm] { margin-top: 1.25rem; }
section.card + section.card { margin-top: 1rem; }
.form label.choice {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.7rem;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    background: var(--field);
}
.form label.choice input { width: auto; margin-top: 0.15rem; }
.form label.choice small { display: block; margin-top: 0.15rem; font-weight: 500; color: var(--muted); }
.form label.choice.is-disabled { opacity: 0.62; }
.mfa-setup {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) auto;
    gap: 1.6rem;
    align-items: center;
    margin: 0.2rem 0 1.2rem;
}
.mfa-kicker {
    margin: 0;
    color: var(--gold);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
}
.mfa-lead h3 { margin: 0.35rem 0 0.9rem; font-size: 1.85rem; }
.mfa-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.mfa-steps li { display: flex; gap: 0.75rem; align-items: flex-start; line-height: 1.4; }
.mfa-steps span {
    flex: 0 0 auto;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    background: var(--green);
    color: #f4efe6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
}
.mfa-plate {
    margin: 0;
    background: #fff;
    color: #183351;
    border-radius: 28px;
    padding: 1.05rem 1.05rem 0.7rem;
    border: 1px solid #eadfce;
    box-shadow: 0 18px 40px rgba(24, 51, 81, 0.12);
    text-align: center;
}
.mfa-qr { width: 232px; height: 232px; }
.mfa-qr svg { display: block; width: 100%; height: 100%; }
.mfa-plate figcaption {
    margin: 0.45rem 0 0.15rem;
    font-family: var(--serif);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.72rem;
}
.mfa-key {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    border: 1px dashed var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--paper) 70%, #fff);
}
.mfa-key p { margin: 0; color: var(--muted); }
.mfa-key code { font-size: 1.02rem; letter-spacing: 0.14em; }
@media (max-width: 760px) {
    .mfa-setup { grid-template-columns: 1fr; }
    .mfa-plate { justify-self: center; }
}
.app-download { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.app-download > div { flex: 1 1 16rem; min-width: 16rem; }
.app-download h2 { margin-top: 0; }
.app-download-link { gap: 0.45rem; }
.btn .btn-glyph { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.app-qr-wrap { margin: 0; }
.app-qr { width: 220px; height: 220px; background: #fff; border-radius: 12px; padding: 8px; border: 1px solid var(--line); }
.app-qr svg { display: block; width: 100%; height: 100%; }
.app-qr-wrap figcaption { margin-top: 0.45rem; color: var(--muted); font-size: 0.88rem; text-align: center; }
.qr { width: 196px; background: #fff; border-radius: 12px; padding: 8px; border: 1px solid var(--line); }
.qr svg { display: block; width: 180px; height: 180px; }
.secret code, .recovery code { font-size: 1rem; letter-spacing: 0.08em; }
.recovery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.45rem; }

@media (max-width: 900px) {
    .editor-grid { grid-template-columns: 1fr; }
    #song-content, .preview { min-height: 42vh; }
    .guest-shell { grid-template-columns: 1fr; min-height: 0; }
    .guest-hero { min-height: 210px; padding: 1.6rem 1.3rem; }
    .guest-hero h1 { white-space: normal; font-size: 2rem; }
    .guest { padding: 1.4rem 1.2rem 1.6rem; }
    .nav-toggle { display: inline-flex; }
    .nav-backdrop { position: fixed; inset: 0; background: rgba(19, 16, 12, 0.46); z-index: 4; }
    body.nav-open .nav-backdrop { display: block; }
    .side {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 5;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow);
    }
    body.nav-open .side { transform: none; }
    .main { padding: 1rem 0.9rem 2.5rem; }
    .plain li { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
    .plain li:has(> .setlist-label) { flex-direction: row; align-items: center; gap: 0.75rem; }
    .plain small { text-align: left; }
    .toolbar { position: static; }
}

@media (prefers-reduced-motion: reduce) {
    .side { transition: none; }
}

.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.song-pick {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.95rem 1rem;
    margin: 0 0 0.7rem;
    cursor: pointer;
}
.song-pick input { margin-top: 0.25rem; }
.song-pick span { display: flex; flex-direction: column; align-items: flex-start; gap: 0.28rem; }
.badge-new { background: var(--green-soft); color: var(--green-2); }
.import-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.4rem; }
