:root {
  color-scheme: light;
  --ink: #20382f;
  --muted: #748078;
  --paper: #f5f6f2;
  --panel: #fff;
  --line: #dfe5dd;
  --accent: #346c51;
  --accent-2: #527965;
  --shadow: 0 8px 28px #20382f08;
  font-family:
    "Avenir Next",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:hover {
  background: #f0f4ee;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.primary:hover {
  background: #285640;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #89b39a;
  outline-offset: 3px;
}
input,
select,
textarea {
  min-height: 46px;
  padding: 11px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #9fbea9;
  outline-offset: 1px;
}
textarea {
  min-height: 110px;
  line-height: 1.6;
  resize: vertical;
}
textarea[name="body"] {
  min-height: 360px;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
}
label {
  display: grid;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #58695e;
}
[hidden] {
  display: none !important;
}
h2,
h3,
p {
  margin-top: 0;
}
p {
  line-height: 1.6;
}
a {
  color: var(--accent);
}
.ui-icon {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}
.shell {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 30px 16px 18px;
  display: flex;
  flex-direction: column;
  background: #eef1e9;
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 42px;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  border-radius: 11px;
  width: 42px;
  height: 42px;
}
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand small {
  display: block;
  font-size: 0.43rem;
  letter-spacing: 0.1em;
  margin-top: 5px;
  font-weight: 600;
}
.main-nav {
  display: grid;
  gap: 7px;
}
.nav-item {
  border: 0;
  background: transparent;
  justify-content: start;
  padding: 13px 14px;
  color: #657369;
}
.nav-item.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.nav-item.active .ui-icon {
  color: var(--accent);
}
.nav-item small {
  margin-left: auto;
  background: #e9efe5;
  padding: 2px 7px;
  border-radius: 5px;
}
.sidebar-note {
  padding: 24px 14px;
  margin-top: 46px;
}
.tiny-label,
.eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--muted);
}
.sidebar-note p {
  font-family: Georgia, serif;
  font-size: 1.27rem;
  margin: 14px 0;
  line-height: 1.4;
}
.sidebar-note button {
  background: none;
  padding: 0;
  border: 0;
  font-size: 0.75rem;
  color: var(--accent);
}
.sidebar-news-copy { margin-top: 14px; }
.sidebar-news-copy strong { display: block; font-family: Georgia, serif; font-weight: 400; font-size: 1.14rem; line-height: 1.3; overflow-wrap: anywhere; }
.sidebar-note .sidebar-news-copy p { max-height: 10rem; overflow-y: auto; margin: 9px 0 14px; font-family: inherit; font-size: .76rem; line-height: 1.5; color: #52665a; white-space: pre-wrap; overflow-wrap: anywhere; }
.sidebar-news-dots { display: flex; gap: 0; align-items: center; overflow-x: auto; padding: 4px 2px; }
.sidebar-note .sidebar-news-dots button { flex: 0 0 28px; width: 28px; height: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.sidebar-note .sidebar-news-dots button::after { content: ""; display: block; width: 8px; height: 8px; margin: auto; border-radius: 50%; background: #b7c7b8; }
.sidebar-note .sidebar-news-dots button[aria-current="true"]::after { background: var(--accent); }
.sidebar-note .sidebar-news-dots button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.profile-link {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 4px;
  justify-content: start;
  width: 100%;
  font-size: 0.8rem;
}
.profile-link small {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 400;
  margin-top: 3px;
}
.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background: #d8e2d1;
}
.logout-link {
  border: 0;
  background: none;
  min-height: 36px;
  font-size: 0.7rem;
  margin-left: 38px;
  color: var(--muted);
}
.main {
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}
.breadcrumb strong {
  color: var(--ink);
  font-weight: 600;
}
.workspace-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.text-button {
  background: none;
  border: 0;
  padding: 0;
  min-height: 40px;
  color: var(--muted);
  font-size: 0.75rem;
}
.instrument-chip {
  font-size: 0.68rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 12px;
  white-space: nowrap;
}
.workspace {
  min-width: 0;
}
.chart {
  padding: 36px clamp(20px, 3vw, 48px) 64px;
  max-width: 1440px;
  margin: auto;
}
.page-heading,
.reader-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}
.chart h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(2.1rem, 3.5vw, 3.25rem);
  line-height: 1.14;
  letter-spacing: -0.045em;
  margin: 9px 0 12px;
}
.page-heading p,
.reader-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.actions,
.segmented,
.stage-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.library-heading-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.library-modes { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.library-mode-label { display: flex; align-items: center; gap: 10px; }
.library-mode-label > .ui-icon { width: 20px; height: 20px; color: var(--accent); }
.library-mode-label span { display: grid; gap: 2px; }
.library-mode-label strong { font-size: .88rem; }
.library-mode-label small { color: var(--muted); font-size: .76rem; }
@media (max-width: 550px) { .library-modes { align-items: flex-start; flex-direction: column; } }
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 8px 0 26px;
}
.library-filters {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 720px;
}
.library-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}
.library-search .ui-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  width: 18px;
}
.library-search input {
  padding-left: 43px;
  background: #fff;
}
.library-scope select { min-width: 132px; }
.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; }
.search-clear-field { position: relative; display: block; flex: 1; min-width: 0; }
.search-clear-field > input { width: 100%; padding-right: 38px !important; }
.search-clear-field > input::-webkit-search-cancel-button,
.search-clear-field > input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-clear-button { position: absolute; z-index: 1; top: 50%; right: 6px; display: grid; width: 28px; min-width: 28px; height: 28px; min-height: 28px; padding: 0; transform: translateY(-50%); border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.search-clear-button:hover, .search-clear-button:focus-visible { background: #00000012; color: var(--ink); }
.library-toolbar > span {
  font-size: 0.75rem;
  white-space: nowrap;
}
.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 20px;
}
.library-toolbar > .muted { display: none; }
.library-view-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -12px 0 14px; }
.library-view-controls > span { font-size: .75rem; }
.song-grid.song-list { grid-template-columns: 1fr; gap: 8px; }
.song-list .song-card { display: flex; align-items: stretch; min-height: 76px; }
.song-list .song-art { flex: 0 0 80px; height: auto; min-height: 76px; }
.song-list .song-art .ui-icon { width: 32px; height: 32px; }
.song-list .song-card-content { flex: 1; min-width: 0; padding: 10px 14px; }
.song-list .song-card h3 { margin: 2px 0; }
.song-list .song-card p { margin: 0; }
.song-list .song-card-footer { border: 0; padding-top: 4px; }
.song-list .ensemble-song-card, .song-compact .ensemble-song-card { border: 0; border-left: 6px solid #bd6079; }
.song-grid.song-compact { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 6px; }
.song-compact .song-card { display: flex; align-items: stretch; min-height: 52px; border-radius: 10px; }
.song-compact .song-card:hover { transform: none; }
.song-compact .song-art { flex: 0 0 52px; height: auto; min-height: 52px; }
.song-compact .song-art::before { inset: 8px 0; background-size: auto 11px; }
.song-compact .song-art .ui-icon { width: 24px; height: 24px; }
.song-compact .song-art > span { right: 3px; bottom: 3px; padding: 0 3px; border-radius: 4px; font-size: .55rem; }
.song-compact .song-card-content { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 7px 10px; }
.song-compact .song-card .tiny-label, .song-compact .song-card-footer { display: none; }
.song-compact .song-card h3 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.song-compact .song-card p { min-width: 0; max-width: 42%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; }
.song-card {
  display: block;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.song-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px #20382f0d;
  background: white;
}
.ensemble-song-card { background: #fff0f3; border-color: #cf7f93; box-shadow: inset 4px 0 #bd6079; }
.ensemble-song-card:hover { background: #fce2e8; }
.ensemble-song-card .tiny-label { color: #87384e; }
.song-art {
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #e7ecdf;
  color: #789571;
}
.song-art .ui-icon {
  width: 52px;
  height: 52px;
  stroke-width: 1;
  transform: rotate(-7deg);
}
.song-art::before {
  content: "";
  position: absolute;
  inset: 22px 0;
  background: repeating-linear-gradient(
    transparent 0 16px,
    #9aaa8b1c 16px 17px
  );
}
.song-art > span {
  position: absolute;
  bottom: 12px;
  right: 14px;
  border: 1px solid #fff8;
  background: #ffffff90;
  border-radius: 8px;
  color: #4a6444;
  padding: 5px 10px;
  font-size: 0.75rem;
}
.art-1 {
  background: #eee6db;
  color: #b59a77;
}
.art-2 {
  background: #e3e9ed;
  color: #8d9faa;
}
.art-3 {
  background: #eae4ed;
  color: #a195ad;
}
.song-card-content {
  padding: 20px;
}
.song-card h3 {
  font-size: 1.05rem;
  margin: 9px 0 6px;
  letter-spacing: -0.025em;
}
.song-card p {
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 400;
  margin-bottom: 22px;
}
.song-card-footer {
  border-top: 1px solid #edf0ea;
  padding-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  font-size: 0.64rem;
  color: var(--muted);
  font-weight: 400;
}
.song-card-footer span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-badge { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 3px 7px; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1; }
.workflow-badge .ui-icon { width: 14px; height: 14px; }
.workflow-green { background: #dff4e5; color: #17673a; }
.workflow-blue { background: #e2efff; color: #195da8; }
.workflow-amber { background: #fff0ca; color: #8c5d00; }
.workflow-purple { background: #eee5ff; color: #6542a3; }
.workflow-rose { background: #fde5e9; color: #a13c56; }
.workflow-gray { background: #ecefed; color: #526158; }
.workflow-select { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; }
.workflow-select select { width: auto; min-width: 130px; }
.is-loading .ui-icon { animation: gigalong-spin .8s linear infinite; }
@keyframes gigalong-spin { to { transform: rotate(360deg); } }
.empty-state {
  padding: 56px 20px;
  text-align: center;
  grid-column: 1/-1;
  color: var(--muted);
}
.empty-state .ui-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
}
.muted {
  color: var(--muted);
}
.surface,
.item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.form-grid {
  display: grid;
  gap: 18px;
  max-width: 960px;
}
.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.small-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.disclosure {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  margin-bottom: 24px;
}
.disclosure summary {
  padding: 17px 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.disclosure summary .muted {
  font-weight: 400;
  font-size: 0.75rem;
  margin-left: 12px;
}
.disclosure-body {
  padding: 6px 20px 22px;
}
.reader-heading {
  margin-bottom: 18px;
}
.chart-facts {
  display: flex;
  gap: 10px 22px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 24px;
}
.chart-facts strong {
  color: var(--ink);
}
.reader-controls {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}
.text-size {
  margin-top: 14px;
}
.practice-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  grid-column: 1/-1;
}
.practice-controls input {
  width: 150px;
}
.chart-body {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 28px;
  font-size: var(--chart-size, 20px);
  line-height: 1.75;
}
.chart-sharing {
  margin-top: 24px;
}
.chart-sharing .disclosure-body {
  display: grid;
  gap: 16px;
  max-width: 600px;
}
.danger-text {
  color: #a3463e;
}
.section {
  color: var(--accent-2);
  font-size: 0.8em;
  font-weight: 700;
  margin-top: 18px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.notice {
  background: #fff4e8;
  border: 1px solid #e9d6b9;
  border-radius: 10px;
  color: #755b32;
  padding: 14px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.pill {
  background: #edf2e9;
  border-radius: 20px;
  display: inline-block;
  padding: 6px 10px;
  font-size: 0.72rem;
  margin: 8px 4px 0 0;
}
.ensemble-forms {
  margin-bottom: 28px;
}
.ensemble-forms h3 {
  font-size: 1.1rem;
  margin: 0;
}
.online-form,
.online-import {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 24px 0;
}
.online-form label,
.online-import label {
  flex: 1;
}
.online-results {
  display: grid;
  gap: 18px;
}
.online-artist-group { display: grid; gap: 8px; }
.online-artist-group h3, .performance-artist-group h3 { margin: 0; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.online-result {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  padding: 20px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.online-result-info {
  display: grid;
  gap: 6px;
}
.online-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.online-result-button { padding: 8px 12px; font-size: .8rem; }
.online-result-button .ui-icon { width: 20px; height: 20px; flex: none; }
.online-rating { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; font-size: 0.94rem; }
.online-rating-star { color: #b77513; font-size: 1.2rem; line-height: 1; }
.online-rating-scale { color: var(--muted); font-weight: 400; font-size: .78rem; }
.online-rating-votes { color: var(--muted); font-size: .78rem; margin-left: 4px; }
.online-result small,
.online-result > span:last-child {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.76rem;
}
.online-preview .chart-body {
  margin-top: 20px;
}
.online-preview .stage-tools {
  margin-top: 16px;
}
.online-detail { --online-size: 16px; }
.online-detail-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.online-detail-header h2 { font-size: 1.25rem; margin: 6px 0 2px; }
.online-detail-header p { font-size: .82rem; color: var(--muted); margin: 0; }
.online-detail-header .tiny-label { display: block; margin-top: 8px; }
.online-detail-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.online-detail .online-import { margin: 0; gap: 8px; }
.online-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 16px; }
.online-detail .online-chart { font-size: var(--online-size); line-height: 1.45; }
.online-controls { display: grid; min-width: 0; gap: 10px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; position: sticky; top: 170px; }
.online-controls p { margin: 0; }
.online-controls .transpose-control { flex-wrap: wrap; }
.online-formats { width: 100%; }
.online-controls .online-formats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.online-controls .online-formats button { min-width: 0; min-height: 44px; padding: 8px; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; font-size: .76rem; }
.online-controls .online-formats button:nth-child(odd) { border-left: 0; }
.online-controls .online-formats button:nth-child(n + 3) { border-top: 1px solid var(--line); }
.online-stage-dark .online-controls .online-formats button { border-color: #fff; }
body.online-preview-active { background: #fff; }
.online-stage { min-height: 100dvh; padding: 8px; background: #fff; color: #111; }
.online-stage .online-detail-header, .online-stage .online-controls { box-shadow: none; border-color: #aaa; }
.online-stage .online-chart { border: 0; box-shadow: none; padding: 4px; background: transparent; color: inherit; }
.online-stage-dark { background: #000; color: #fff; }
.online-stage-dark .online-detail-header, .online-stage-dark .online-controls { background: #000; color: #fff; border-color: #fff; }
.online-stage-dark .online-detail-header p, .online-stage-dark .field-hint, .online-stage-dark label, .online-stage-dark .segment-chord, .online-stage-dark .chordpro-token, .online-stage-dark .section, .online-stage-dark a { color: #fff; }
.online-stage-dark button, .online-stage-dark select { background: #000; color: #fff; border-color: #fff; }
.online-stage-dark .format-control button[aria-pressed="true"], .online-stage-dark button.primary { background: #fff; color: #000; }
@media (max-width: 740px) {
  .online-detail-header { align-items: start; flex-wrap: wrap; }
  .online-detail-layout { grid-template-columns: 1fr; }
  .online-controls { position: static; order: -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .online-controls > strong, .online-controls > .field-hint, .online-controls > a, .online-controls > .online-formats { grid-column: 1 / -1; }
  .online-detail .online-import { flex-wrap: nowrap; }
}
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(ellipse at top left, #dce7d6, transparent 60%), var(--paper);
}
.auth-card {
  width: 100%;
  max-width: 470px;
  display: grid;
  gap: 20px;
  padding: 40px;
  border-radius: 22px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 20px 70px #20382f0c;
}
.auth-card h1 {
  font-family: Georgia, serif;
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.04em;
  margin: 0;
}
.auth-card p {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}
.install-landing {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: radial-gradient(ellipse at top left, #dce7d6, transparent 60%), var(--paper);
}
.install-card {
  width: 100%;
  max-width: 470px;
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 20px 70px #20382f0c;
  text-align: center;
}
.install-card h1 { margin: 0; font: 400 2.4rem/1.05 Georgia, serif; letter-spacing: -0.04em; }
.install-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.install-card .language-picker { width: 100%; max-width: none; }
.install-card [data-install-app] { justify-self: center; }
.install-languages { display: flex; gap: 8px; }
.install-languages button { min-height: 44px; min-width: 44px; padding: 6px; font-size: 1.5rem; background: transparent; }
.install-languages button[aria-pressed="true"] { border-color: var(--accent); }
.install-instructions { font-size: .85rem; }
.segmented {
  background: #f1f4ef;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.segmented button {
  flex: 1;
  border: 0;
  background: none;
}
.segmented button.active {
  background: white;
  box-shadow: var(--shadow);
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .sidebar {
    padding: 24px 10px 16px;
  }
  .brand {
    font-size: 1.1rem;
    gap: 8px;
    margin-left: 4px;
  }
  .brand small {
    font-size: 0.38rem;
  }
  .sidebar-note {
    padding: 20px 10px;
  }
  .topbar {
    padding: 12px 24px;
  }
  .song-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .song-card-content {
    padding: 16px;
  }
}
@media (max-width: 740px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    margin: 0 0 15px;
  }
  .main-nav {
    display: flex;
    gap: 4px;
  }
  .nav-item {
    flex: 1;
    justify-content: center;
    padding: 12px 4px;
    font-size: 0.72rem;
    gap: 6px;
    border-radius: 9px 9px 0 0;
  }
  .nav-item .ui-icon {
    width: 18px;
  }
  .nav-item small {
    display: none;
  }
  .sidebar-footer {
    position: absolute;
    right: 16px;
    top: 12px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .profile-link {
    width: 40px;
    padding: 0;
  }
  .profile-link > span:last-child,
  .logout-link,
  .sidebar-note {
    display: none;
  }
  .topbar {
    min-height: 58px;
    padding: 12px 20px;
  }
  .chart {
    padding: 26px 20px 48px;
  }
  .page-heading {
    margin-bottom: 24px;
  }
  .page-heading .actions {
    width: 100%;
  }
  .library-heading-actions { align-items: flex-start; }
  .reader-controls {
    grid-template-columns: 1fr;
  }
  .cols {
    grid-template-columns: 1fr;
  }
  .disclosure summary .muted {
    display: block;
    margin: 6px 0 0;
  }
  .song-grid {
    gap: 12px;
  }
  .song-art {
    height: 105px;
  }
  .song-card h3 {
    font-size: 0.95rem;
  }
  .song-card .tiny-label {
    font-size: 0.52rem;
  }
  .instrument-chip {
    font-size: 0.6rem;
  }
  .online-form,
  .online-import {
    flex-wrap: wrap;
  }
  .online-form label {
    min-width: 100%;
  }
}
@media (max-width: 400px) {
  .song-grid {
    grid-template-columns: 1fr;
  }
  .auth-card, .install-card {
    padding: 28px;
  }
  .nav-item {
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.format-control {
  display: inline-flex;
  flex-wrap: nowrap;
  width: 100%;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.format-control button {
  border: 0;
  border-radius: 0;
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  padding: 8px 3px;
  font-size: clamp(0.58rem, 2vw, 0.76rem);
}
.format-control button + button {
  border-left: 1px solid var(--line);
}
.format-control button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
}
.chart-line {
  white-space: pre-wrap;
}
.chord-word { display: inline-flex; max-width: 100%; vertical-align: bottom; }
.chord-segment {
  display: inline-grid;
  grid-template-rows: 1.1em auto;
  vertical-align: bottom;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr);
}
.segment-chord {
  color: var(--accent);
  font-weight: 400;
  line-height: 1.1;
  white-space: pre;
}
.segment-lyric {
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.plain-line,
.chordpro-line {
  min-height: 1.4em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chordpro-token {
  color: var(--accent);
  font-weight: 400;
}

.chord-only {
  padding-right: 0.6em;
}

.key-control {
  display: grid;
  gap: 10px;
  max-width: 440px;
}
.key-control-info {
  color: var(--muted);
  font-size: 0.8rem;
}
.transpose-control {
  display: flex;
  gap: 8px;
  align-items: center;
}
.transpose-control > span {
  font-size: 0.82rem;
  font-weight: 700;
}
.transpose-control button {
  min-width: 42px;
}

/* The stage is an unframed reading surface; secondary actions live in the menu. */
body.performance {
  background: #fff;
}
html.stage-fits,
html.stage-fits body.performance {
  overflow-y: hidden;
  overscroll-behavior-y: none;
}
.performance .stage {
  --stage-drawer-width: min(340px, 45vw);
  background: #fff;
  color: #111;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  touch-action: pan-y;
}
.performance .stage-content {
  padding: 0;
  touch-action: pan-y;
}
.performance .stage.drawer-open .stage-content {
  margin-left: calc(var(--stage-drawer-width) + 8px);
}
.performance .stage-content h1 {
  font-size: clamp(1.7rem, 5vw, 3.3rem);
  line-height: 1.05;
  margin: 0;
  padding: 56px 8px 0;
}
.performance .stage-song-meta {
  font-size: 0.85rem;
  padding: 4px 8px;
}
.performance .stage-content .chart-body {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0 8px;
  max-width: none;
}
.performance .stage-content .section {
  margin-top: 0.25em;
  line-height: 1.2;
}
.performance .stage-compact .chart-body {
  line-height: 1.1;
  column-gap: 12px;
}
.stage-compact .chord-segment {
  grid-template-rows: 1em auto;
}
.stage-compact .segment-chord,
.stage-compact .segment-lyric {
  line-height: 1;
}
.stage-compact .plain-line,
.stage-compact .chordpro-line {
  min-height: 1em;
}
.stage-compact .section {
  margin-top: 0.35em;
}
.stage-compact .chord-only {
  padding-right: 0.2em;
}
.stage-menu #stageCompact[aria-pressed="true"] {
  background: #111;
  color: #fff;
}
.stage-dark .stage-menu #stageCompact[aria-pressed="true"] {
  background: #fff;
  color: #000;
}
.stage-menu {
  position: fixed;
  z-index: 11;
  top: 52px;
  right: 4px;
  height: auto;
  max-height: calc(100dvh - 60px);
  width: min(340px, calc(100vw - 16px));
  border: 1px solid #111;
  border-radius: 8px;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.2);
  background: #fff;
  color: #111;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.stage-menu-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2rem;
}
.stage-menu-heading button {
  font-size: 1.2rem;
}
.stage-menu-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #aaa;
}
.stage-menu-section > span {
  font-weight: 800;
}
.stage-menu-section label {
  color: inherit;
  text-transform: none;
}
.stage-menu-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stage-appearance-row { display: flex; align-items: end; gap: 14px; }
.stage-appearance-row > label { flex: 1; min-width: 0; }
.stage-font-controls { display: grid; gap: 7px; font-size: .8rem; font-weight: 600; }
.stage-font-controls > div { display: flex; }
.stage-font-controls button, .stage-dark .stage-menu .stage-font-controls button { border: 0; padding: 8px; background: transparent; }
.stage-menu .format-control {
  width: 100%;
}
.projection-controls { display: grid; gap: 8px; }
.projection-controls small { line-height: 1.4; }
.projection-settings { margin-top: 20px; max-width: 340px; }
.spotify-settings { margin-top: 20px; }
.spotify-panel { display: grid; gap: 10px; min-width: 0; }
.spotify-panel p { margin: 0; }
.spotify-panel details > * + * { margin-top: 10px; }
.spotify-callback-url { display: block; white-space: normal; overflow-wrap: anywhere; font-size: .78rem; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.spotify-devices, .spotify-search { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.spotify-devices label, .spotify-search input { flex: 1; min-width: 120px; }
.spotify-results { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
.spotify-results button { display: flex; text-align: left; justify-content: space-between; }
.spotify-results small { display: block; font-weight: 400; margin-top: 4px; }
.spotify-chart { margin-bottom: 16px; }
.stage-dark .spotify-panel a { color: #fff; }
.stage-exit {
  margin-top: auto;
}
body.stage-dark,
.stage-dark .stage,
.stage-dark .stage-content,
.stage-dark .stage-content .chart-body {
  background: #000;
  color: #fff;
}
.stage-dark .stage-content .section,
.stage-dark .stage-content .segment-chord,
.stage-dark .stage-content .chordpro-token {
  color: #fff;
}
.stage-dark .stage-menu {
  background: #000;
  color: #fff;
  border: 1px solid #fff;
}
.stage-dark .stage-menu button,
.stage-dark .stage-menu select,
.stage-dark .stage-menu input {
  background: #000;
  color: #fff;
  border-color: #fff;
}
.stage-dark .stage-menu .format-control {
  border-color: #fff;
}
.stage-dark .stage-menu .format-control button[aria-pressed="true"] {
  background: #fff;
  color: #000;
}
.stage-dark .stage-menu-section {
  border-color: #fff;
}
.stage-dark .key-control-info {
  color: #fff;
}

.stage-dark .stage-menu input[type="range"] {
  accent-color: #fff;
}

/* Keep lines together while the browser balances the chart into fitting columns. */
.chart-body {
  column-width: auto;
  column-count: 1;
  column-gap: clamp(24px, 4vw, 64px);
  column-fill: balance;
}
.chart-body > .chart-line,
.chart-body > .chordpro-line,
.chart-body > .section {
  break-inside: avoid;
}
.chart-body > .section {
  break-after: avoid;
}

/* Keep the chart readable while the non-modal performance controls are open. */

.stage-toolbar {
  position: fixed;
  top: 4px;
  right: 4px;
  z-index: 12;
  display: flex;
  gap: 4px;
}
.stage-drawer-toggle {
  position: fixed;
  top: 4px;
  left: 4px;
  z-index: 12;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid #111;
  border-radius: 5px;
  background: #fff;
  color: #111;
  font-size: 1.4rem;
}
.stage-drawer {
  position: fixed;
  top: 52px;
  left: 4px;
  z-index: 11;
  width: var(--stage-drawer-width);
  max-height: calc(100dvh - 60px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #111;
  border-radius: 8px;
  background: #fff;
  color: #111;
  box-shadow: 0 4px 22px #0003;
}
.stage-drawer-list {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
}
.stage-drawer-footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.stage-drawer-footer button { width: 46px; height: 46px; padding: 10px; }
.stage-drawer-footer .ui-icon { width: 24px; height: 24px; }
.stage-drawer-list button {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 2px;
  text-align: left;
}
.stage-drawer-list small {
  font-weight: 400;
}
.stage-drawer-list button[aria-current="true"] {
  background: #111;
  color: #fff;
}
.stage-dark .stage-drawer-toggle,
.stage-dark .stage-drawer,
.stage-dark .stage-drawer button {
  background: #000;
  color: #fff;
  border-color: #fff;
}
.stage-dark .stage-drawer-list button[aria-current="true"] {
  background: #fff;
  color: #000;
}
.stage-toolbar button,
.stage-navigation button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid #111;
  border-radius: 5px;
  background: #fff;
  color: #111;
  font-weight: 800;
  font-size: 1rem;
}
.stage-navigation {
  position: fixed;
  z-index: 12;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}
.stage-navigation button { font-size: 1.8rem; line-height: 1; }
.stage-toolbar #stageMenuToggle {
  font-size: 1.4rem;
}
.stage-toolbar #stageScroll {
  font-size: 1.5rem;
}
.stage-toolbar #stageScroll[aria-pressed="true"] {
  background: #111;
  color: #fff;
}
.stage-dark .stage-toolbar button,
.stage-dark .stage-navigation button {
  border-color: #fff;
  background: #000;
  color: #fff;
}
.stage-dark .stage-toolbar #stageScroll[aria-pressed="true"] {
  background: #fff;
  color: #000;
}

@media (min-width: 900px) {
  .performance .stage.menu-open .stage-content {
    width: calc(100% - 352px);
  }
}
@media (max-width: 899px) {
  .stage-menu {
    top: 52px;
    bottom: auto;
    max-height: calc(100dvh - 60px);
  }
}

/* Use normal-weight chords and high-contrast white notation on the dark stage. */

.stage-dark .stage-content,
.stage-dark .stage-content .chart-body,
.stage-dark .stage-content .section,
.stage-dark .stage-content .segment-chord,
.stage-dark .stage-content .segment-lyric,
.stage-dark .stage-content .chordpro-token {
  color: #fff;
}

.setlist-list {
  margin-top: 24px;
}
.setlist-page-controls { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.setlists-editing { position: fixed; z-index: 80; inset: 0; overflow: auto; padding: clamp(18px, 5vw, 56px); background: var(--panel); color: var(--ink); }
.setlists-editing > .page-heading, .setlists-editing > .setlist-page-controls { display: none; }
.setlists-editing .setlist-list { max-width: 920px; margin: 0 auto; }
.setlists-editing .setlist-card { min-height: calc(100dvh - 2 * clamp(18px, 5vw, 56px)); }
.setlist-view-toggle { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.setlist-view-toggle button { display: grid; place-items: center; width: 40px; min-width: 40px; height: 38px; min-height: 38px; padding: 8px; border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.setlist-view-toggle button + button { border-left: 1px solid var(--line); }
.setlist-view-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.setlist-view-toggle .ui-icon { width: 19px; height: 19px; }
.setlist-create-dialog { width: min(720px, calc(100vw - 32px)); max-height: min(88dvh, 760px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); box-shadow: 0 18px 60px #0006; }
.setlist-create-dialog::backdrop { background: #0008; }
.setlist-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.setlist-dialog-heading h3 { margin: 0; }
.setlist-dialog-heading button { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; }
.setlist-card {
  padding: 16px;
}
.setlist-cards { display: grid; grid-template-columns: repeat(auto-fill, min(100%, 280px)); align-items: stretch; }
.shell .setlist-cards .setlist-card { display: flex; flex-direction: column; height: 360px; }
.setlist-cards .setlist-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px 6px; }
.setlist-cards .setlist-heading > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.setlist-cards .setlist-heading .actions { grid-column: 1 / -1; grid-row: 2; display: flex; width: 100%; margin: 0; flex-wrap: nowrap; gap: 6px; }
.setlist-cards .setlist-heading .actions [data-edit-setlist] { order: 0; }
.setlist-cards .setlist-heading .actions [data-play-setlist] { order: 1; flex: 1 1 0; min-width: 0; overflow: hidden; padding-inline: 4px; font-size: .85rem; }
.setlist-cards .setlist-heading .actions [data-delete-setlist] { order: 2; }
.setlist-cards .offline-badge { display: block; color: var(--muted); font-size: .7rem; }
.setlist-cards .setlist-heading .setlist-offline-actions { grid-column: 2; grid-row: 1; }
.setlist-cards .setlist-items { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-bottom: 10px; }
.setlist-cards .setlist-card::after { content: attr(data-song-count); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; font-weight: 700; }
.setlist-perform-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setlist-compact .setlist-heading { cursor: pointer; }
.setlist-compact .setlist-heading::after { content: "⌄"; margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.setlist-compact .setlist-collapsed > :not(.setlist-heading) { display: none; }
.setlist-compact .setlist-collapsed .setlist-heading::after { transform: rotate(-90deg); }
.setlist-name-editor { display: grid; gap: 6px; max-width: 440px; font-size: .85rem; font-weight: 700; }
.setlist-name-editor > span { display: flex; gap: 6px; }
.setlist-name-editor input { flex: 1; min-width: 0; }
.setlist-name-editor button { width: 38px; min-width: 38px; min-height: 38px; padding: 6px; }
.setlist-name-editor #applySetlistName { color: var(--accent); }
.setlist-name-edit { display: inline-grid; place-items: center; width: 30px; min-width: 30px; height: 30px; min-height: 30px; margin-left: 6px; padding: 6px; vertical-align: middle; }
.setlist-name-edit .ui-icon { width: 16px; height: 16px; }
.setlist-icon-action { display: inline-grid; place-items: center; width: 38px; min-width: 38px; height: 38px; min-height: 38px; padding: 8px; }
.setlist-icon-action .ui-icon { width: 18px; height: 18px; }
.setlist-icon-action.danger { color: #bd3c35; border-color: #d98580; }
.setlist-heading {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.setlist-heading .actions { margin-left: auto; }
.setlist-items {
  padding-left: 1.8rem;
}
.setlist-items li {
  padding: 5px 0;
}
.setlist-items li > span:first-child {
  display: inline-block;
  min-width: 14ch;
}
.setlist-reorder {
  display: inline-flex;
  gap: 6px;
  margin-left: 12px;
}
.setlist-reorder button {
  min-width: 42px;
  font-size: 1.1rem;
}
.performance .segment-chord,
.performance .chordpro-token {
  font-weight: 600;
}

.setlist-items li[data-drag-row] {
  position: relative;
  padding: 7px 0;
}
.setlist-items .setlist-title {
  display: inline-block;
  min-width: 14ch;
}
.setlist-drag {
  touch-action: none;
  cursor: grab;
  min-width: 38px;
  font-size: 1.2rem;
  letter-spacing: -3px;
  margin-right: 10px;
}
.setlist-drag.dragging {
  cursor: grabbing;
}
.setlist-items .drop-before::before,
.setlist-items .drop-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-2);
}
.setlist-items .drop-before::before {
  top: 0;
}
.setlist-items .drop-after::after {
  bottom: 0;
}
.setlist-add {
  display: flex;
  gap: 8px;
  align-items: end;
  margin: 16px 0;
}
.setlist-add label {
  flex: 1;
}
.setlist-add #addSetlistSong { display: none; }
.offline-badge, .offline-readiness { display: none; }
.setlist-offline-actions { position: relative; display: inline-flex; gap: 6px; }
.setlist-offline-actions button { display: grid; place-items: center; width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 6px; }
.setlist-cards .setlist-offline-actions button { width: 24px; min-width: 24px; height: 24px; min-height: 24px; padding: 3px; font-size: .8rem; }
.setlist-heading .setlist-offline-actions { margin-left: 0; align-self: flex-start; }
.setlist-offline-popover { position: absolute; z-index: 5; top: calc(100% + 8px); right: 0; width: min(300px, 70vw); padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); box-shadow: 0 8px 24px #0003; font-size: .8rem; font-weight: 500; line-height: 1.4; }
.setlist-edit-hint { margin: 0; font-size: .85rem; line-height: 1.4; }
.setlist-note {
  font-size: 0.85rem;
}
@media (max-width: 640px) {
  .setlist-page-controls { align-items: stretch; flex-direction: column; }
  .setlist-view-toggle { align-self: flex-start; }
  .setlist-add {
    flex-wrap: wrap;
  }
  .setlist-add label {
    min-width: 100%;
  }
}

.stage-progress {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: #fff;
  color: #111;
  padding: 0 8px;
}
.stage-dark .stage-progress {
  background: #000;
  color: #fff;
}
@media (max-width: 590px) {
  .stage-navigation {
    left: 50px;
    transform: none;
  }
  .stage-progress {
    padding: 0 2px;
    font-size: 0.85rem;
  }
}
@media (max-width: 420px) {
  .stage-toolbar { gap: 2px; }
  .stage-toolbar button, .stage-navigation button { width: 34px; }
}
.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}
.editor-save {
  position: sticky;
  bottom: 8px;
  display: flex;
  gap: 10px;
  background: #ffffffed;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.song-picker {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 320px;
  overflow: auto;
}
.song-picker legend {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 8px;
  margin-left: 10px;
  color: #58695e;
}
.song-picker label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #edf0ea;
  cursor: pointer;
  min-height: 58px;
}
.song-picker label:last-child {
  border-bottom: 0;
}
.song-picker input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: var(--accent);
}
.song-picker small {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  color: var(--muted);
}
.picker-key {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
}
.import-settings {
  margin-top: 24px;
}
.import-settings p {
  color: var(--muted);
  font-size: 0.85rem;
}
.documentation-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.documentation-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; box-sizing: border-box; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; }
.documentation-actions a:hover { border-color: var(--accent); color: var(--accent); }
.profile-signout {
  margin-top: 24px;
}
.profile-details { display: grid; max-width: 960px; margin: 0 0 16px; }
.profile-details-block { display: grid; gap: 14px; padding: 22px 24px; }
.profile-details #settingsForm { max-width: none; margin: 0; }
.profile-name-summary { display: flex; align-items: center; gap: 4px; }
.profile-name-summary strong { font-size: 1.05rem; }
.profile-name-editor { display: grid; gap: 6px; max-width: 440px; font-size: .85rem; font-weight: 700; }
.profile-name-editor > span { display: flex; gap: 6px; }
.profile-name-editor input { flex: 1; min-width: 0; }
.profile-name-editor button { width: 38px; min-width: 38px; min-height: 38px; padding: 6px; }
.profile-name-editor #applyProfileName { color: var(--accent); }
.profile-language { align-content: start; }
.profile-language > small, .profile-data > small { color: var(--muted); font-size: .76rem; }
.profile-data p { margin: 0; color: var(--muted); font-size: .85rem; }
.profile-data button { justify-self: start; }
.profile-panel { padding: 22px 24px; }
.trash-panel { max-width: 720px; }
.profile-panel-heading h3 { margin: 0; }
.profile-panel-heading p { margin: 6px 0 0; }
.trash-list, .security-stack { display: grid; gap: 10px; margin-top: 18px; }
.trash-list { max-height: 310px; overflow-y: auto; padding-right: 4px; scrollbar-gutter: stable; }
.clear-trash-button { margin-top: 16px; }
.trash-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.trash-entry-copy { min-width: 0; display: grid; gap: 3px; }
.trash-entry-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-entry-copy span { color: var(--muted); font-size: .78rem; }
.trash-entry-actions { display: flex; flex-wrap: nowrap; gap: 8px; }
.trash-entry-actions button { min-height: 38px; white-space: nowrap; }
.empty-panel-message { display: block; padding: 14px 0 2px; color: var(--muted); }
.security-block { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.security-block > div > strong { font-size: .9rem; }
.security-block p { margin: 4px 0 0; }
.security-block > button { justify-self: start; }
.security-revoke { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 10px; }
.security-revoke label { display: grid; gap: 6px; font-size: .8rem; font-weight: 700; }
.security-revoke small { grid-column: 1 / -1; }
input,
select,
textarea {
  font-weight: 400;
}
.file-import {
  min-width: 200px;
  flex: 1;
}
.file-import input {
  font-size: 0.78rem;
}
.data-transfer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.data-transfer-action { display: grid; align-content: start; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.data-transfer-action strong { font-size: .88rem; }
.data-transfer-action p { min-height: 2.6em; margin: 0; }
.data-transfer-action button, .data-transfer-action .file-import { box-sizing: border-box; width: 100%; min-width: 0; min-height: 42px; margin-top: auto; }
.data-transfer-action .file-import { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: .8rem; font-weight: 700; }
.data-transfer-action .file-import input { min-width: 0; flex: 1; font-weight: 400; }

@media (max-width: 740px) {
  .chart-body {
    padding: 18px;
  }
  .reader-heading .actions {
    width: 100%;
  }
  .online-result {
    flex-wrap: wrap;
  }
  .setlist-heading .actions {
    width: 100%;
  }
  .setlist-reorder {
    margin-left: 0;
  }
  .profile-panel { padding: 18px; }
  .trash-entry { grid-template-columns: 1fr; gap: 10px; }
  .trash-entry-actions { width: 100%; }
  .trash-entry-actions button { flex: 1; min-width: 0; padding-inline: 8px; }
  .security-revoke { grid-template-columns: 1fr; }
  .security-revoke button { justify-self: start; }
}
.connection-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-status-actions { position: relative; display: inline-flex; gap: 4px; }
.topbar-status-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 7px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent);
}
.topbar-status-button:hover { background: transparent; }
.topbar-status-button .ui-icon { width: 18px; height: 18px; }
.topbar-status-button.offline, .topbar-status-button.not-ready {
  color: #9a640d;
}
.topbar-status-popover {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  width: min(300px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 8px 24px #0003;
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: pre-line;
}
.sync-button {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 0.7rem;
}
.offline-toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 50;
  max-width: min(420px, 90vw);
  box-shadow: 0 8px 30px #0003;
}
@media (max-width: 740px) {
  .connection-area {
    gap: 6px;
  }
  .instrument-chip {
    display: none;
  }
}
.language-settings {
  margin-bottom: 18px;
  max-width: 960px;
}
.language-picker {
  max-width: 340px;
}
.appearance-picker {
  max-width: 340px;
  margin-top: 18px;
}
.scroll-finish-setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.scroll-finish-stepper { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.scroll-finish-stepper button { display: grid; place-items: center; width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; font-size: 1.1rem; }
.scroll-finish-stepper input { width: 3.2ch; min-width: 3.2ch; height: 34px; min-height: 34px; padding: 0 3px; border: 0; background: transparent; text-align: right; font-variant-numeric: tabular-nums; }
.scroll-finish-stepper > span { display: inline-grid; place-items: center; width: 1ch; height: 34px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .data-transfer-actions { grid-template-columns: 1fr; } }
.auth-card .language-picker {
  max-width: none;
}
.offline-badge {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 6px;
}
@media (max-width: 740px) {
  .connection-status {
    white-space: normal;
    max-width: 170px;
  }
}

.spotify-modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: #000a; display: grid; place-items: center; padding: 16px; }
.spotify-modal { background: var(--surface, white); color: var(--text, #111); border: 1px solid var(--line); border-radius: 16px; padding: 20px; width: min(100%, 620px); max-height: 85vh; overflow: auto; display: grid; gap: 12px; }
.spotify-modal-head { display: flex; align-items: center; justify-content: space-between; }

/* Spotify recording and playback controls */
.spotify-recording { padding: 18px; border: 1px solid #d9e5de; border-radius: 18px; background: linear-gradient(135deg, #f4fbf6, #fff); color: #163429; }
.spotify-recording-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.spotify-recording-heading > div { display: grid; min-width: 0; gap: 2px; }
.spotify-recording-heading small { color: #21844c; font-size: .68rem; font-weight: 800; letter-spacing: .12em; }
.spotify-recording-heading strong, .spotify-recording-heading span { overflow: hidden; text-overflow: ellipsis; }
.spotify-recording-heading span { font-size: .86rem; opacity: .75; }
.spotify-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #1d9b54; color: white; flex: none; }
.spotify-recording > [data-spotify-action="open-search"] { justify-self: start; }
.spotify-stage-setting { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .84rem; }
.spotify-stage-setting input { width: auto; }
.spotify-stage-setting small { flex-basis: 100%; padding-left: 26px; opacity: .7; }
.spotify-playbar { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 14px; background: #163429; color: white; }
.spotify-playbar button, .stage-dark .spotify-playbar button { display: grid; place-items: center; flex: none; width: 38px; height: 38px; min-height: 0; padding: 9px; border: 0; border-radius: 50%; background: transparent; color: white; }
.spotify-playbar .spotify-play-button, .stage-dark .spotify-playbar .spotify-play-button { background: #1ed760; color: #10261a; }
.spotify-progress { display: grid; flex: 1; gap: 3px; min-width: 70px; }
.spotify-progress input { width: 100%; margin: 0; accent-color: #1ed760; }
.spotify-progress span { font-size: .69rem; font-variant-numeric: tabular-nums; opacity: .8; }
.spotify-bar-brand { font-weight: 750; font-size: .75rem; }
.spotify-playbar-floating { position: fixed; z-index: 20; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(480px, calc(100vw - 24px)); box-shadow: 0 8px 30px #0005; }
.stage-dark .spotify-recording { background: #111; border-color: #777; color: #fff; }
.stage-dark .spotify-playbar-floating { background: #000; border: 1px solid #fff; }
.stage-dark .spotify-playbar .spotify-play-button { background: #fff; color: #000; }
.stage-dark .spotify-progress input { accent-color: #fff; }

/* Performance song drawer */
.stage-drawer { top: 52px; bottom: 8px; max-height: none; gap: 0; padding: 0; border-color: #d9dedb; border-radius: 14px; box-shadow: 0 12px 34px #0003; }
.drawer-header { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; padding: 18px 16px 12px; }
.drawer-pin { flex: none; width: 40px; height: 40px; min-height: 40px; padding: 9px; border-radius: 10px; }
.drawer-pin .ui-icon { width: 20px; height: 20px; }
.drawer-pin[aria-pressed="true"] { background: #346c51; color: #fff; border-color: #346c51; }
.stage-dark .stage-drawer .drawer-pin[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }
.drawer-heading { display: grid; gap: 3px; min-width: 0; }
.drawer-heading strong { font-size: 1.12rem; line-height: 1.2; overflow-wrap: anywhere; }
.drawer-heading small { font-size: .74rem; color: #68736d; }
.drawer-kicker { color: #65756b; font-size: .64rem; font-weight: 800; letter-spacing: .12em; }
.drawer-icon { flex: none; width: 34px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 10px; background: #f1f4f2; }
.drawer-search { display: flex; align-items: center; gap: 8px; margin: 0 12px 10px; padding: 0 10px; background: #f1f4f2; border-radius: 10px; color: #68736d; }
.drawer-search .ui-icon { width: 17px; height: 17px; }
.drawer-search input { min-width: 0; height: 40px; padding: 0; border: 0; outline: 0; background: transparent; color: #111; font-size: .86rem; }
.drawer-search-row { display: flex; align-items: center; gap: 8px; margin: 0 12px 10px; }
.drawer-search-row .drawer-search { flex: 1; min-width: 0; margin: 0; }
.drawer-sort { display: flex; align-items: center; gap: 6px; flex: none; height: 40px; color: #68736d; }
.drawer-sort .ui-icon { width: 19px; height: 19px; }
.drawer-sort select { width: 82px; height: 40px; min-height: 40px; padding: 0 6px; border: 0; border-radius: 10px; background: #f1f4f2; color: #18231c; font-size: .76rem; font-weight: 700; }
.stage-drawer-list { display: block; flex: 1; padding: 0 8px; overscroll-behavior: contain; }
.stage-drawer-list .drawer-song { display: flex; flex-direction: row; align-items: center; width: 100%; min-height: 52px; padding: 6px 10px; gap: 10px; border: 0; border-radius: 10px; background: transparent; color: #18231c; }
.stage-drawer-list .drawer-song[hidden], .drawer-empty[hidden] { display: none; }
.drawer-number { width: 24px; flex: none; color: #89938d; font-size: .73rem; font-variant-numeric: tabular-nums; }
.drawer-song-text { display: grid; min-width: 0; gap: 3px; flex: 1; }
.drawer-song-text strong, .drawer-song-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-song-text strong { font-size: .9rem; }
.drawer-song-text small { color: #738078; font-size: .75rem; }
.stage-drawer-list .drawer-song[aria-current="true"] { background: #e7f1e9; color: #163c25; }
.stage-drawer-list .drawer-song[aria-current="true"] .drawer-number, .drawer-playing { color: #248c51; }
.drawer-playing { font-size: .55rem; }
.drawer-empty { padding: 14px 10px; color: #68736d; font-size: .85rem; }
.stage-drawer-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 12px; border-top: 1px solid #e6eae7; }
.stage-drawer-add-actions, .drawer-footer-navigation { display: flex; gap: 8px; }
.stage-drawer-footer > span { margin: 0; justify-self: center; }
.drawer-footer-navigation { justify-self: end; }
.stage-drawer-footer button { width: 40px; height: 40px; min-height: 40px; border: 0; border-radius: 10px; background: #f1f4f2; }
.stage-drawer-footer .ui-icon { width: 20px; height: 20px; }
.stage-drawer-footer span { color: #748078; font-size: .76rem; font-variant-numeric: tabular-nums; }
.stage-dark .stage-drawer { border-color: #555; }
.stage-dark .drawer-search, .stage-dark .drawer-sort select, .stage-dark .drawer-icon, .stage-dark .stage-drawer-footer button { background: #1a1a1a; }
.stage-dark .drawer-search input, .stage-dark .drawer-sort, .stage-dark .drawer-sort select, .stage-dark .drawer-heading small, .stage-dark .drawer-kicker, .stage-dark .drawer-song-text small, .stage-dark .drawer-number, .stage-dark .stage-drawer-footer span { color: #bbb; }
.stage-dark .stage-drawer-list .drawer-song { color: #fff; }
.stage-dark .stage-drawer-list .drawer-song[aria-current="true"] { background: #fff; color: #000; }
.stage-dark .stage-drawer-list .drawer-song[aria-current="true"] .drawer-number, .stage-dark .drawer-playing { color: #333; }
.stage-dark .stage-drawer-list .drawer-song[aria-current="true"] small { color: #444; }
.stage-dark .stage-drawer-footer { border-color: #444; }

/* Spotify card and search */
.spotify-recording { gap: 14px; }
.spotify-card-actions { display: grid; gap: 2px; }
.spotify-recording .spotify-manage { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 2px; color: #234434; background: transparent; border: 0; border-bottom: 1px solid #e2ebe4; border-radius: 0; text-align: left; font-size: .88rem; font-weight: 650; }
.spotify-manage .ui-icon { width: 19px; height: 19px; color: #61786a; }
.spotify-manage span:nth-child(2) { flex: 1; }
.spotify-manage span:last-child { font-size: 1.4rem; color: #84978a; }
.spotify-stage-setting { display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 12px; padding: 12px 2px 2px; cursor: pointer; }
.spotify-setting-copy { display: grid; gap: 4px; }
.spotify-stage-setting small { padding: 0; font-size: .73rem; color: #6a7c70; }
.spotify-stage-setting input, .notes-reminder-setting input { appearance: none; flex: none; width: 42px; height: 24px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 20px; background: #bcc8c0; position: relative; cursor: pointer; }
.spotify-stage-setting input::after, .notes-reminder-setting input::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: transform .18s; box-shadow: 0 1px 3px #0003; }
.spotify-stage-setting input:checked, .notes-reminder-setting input:checked { background: #328658; }
.spotify-stage-setting input:checked::after, .notes-reminder-setting input:checked::after { transform: translateX(18px); }
.spotify-stage-setting input:focus-visible, .notes-reminder-setting input:focus-visible, .spotify-progress input:focus-visible { outline: 2px solid #1e9660; outline-offset: 3px; }
.spotify-status:empty { display: none; }
.spotify-playbar { background: #26312b; }
.spotify-playbar .spotify-play-button { background: #f3f6f4; color: #24332a; }
.spotify-playbar.has-progress .spotify-play-button { background: #1ed760; color: #10261a; }
.spotify-progress input { appearance: none; height: 5px; min-height: 5px; border: 0; border-radius: 5px; padding: 0; background: linear-gradient(to right, #1ed760 var(--played, 0%), #a4afa8 var(--played, 0%)); cursor: pointer; }
.spotify-progress input::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; background: white; border-radius: 50%; }
.spotify-progress input::-moz-range-thumb { width: 12px; height: 12px; background: white; border: 0; border-radius: 50%; }
.spotify-progress input:disabled { opacity: 1; cursor: default; }
.spotify-modal-backdrop { background: #14221dcc; backdrop-filter: blur(4px); }
.spotify-modal { width: min(100%, 600px); max-height: min(85dvh, 720px); padding: clamp(20px, 4vw, 30px); gap: 16px; background: #fff; color: #20382f; border: 0; border-radius: 22px; box-shadow: 0 24px 70px #0004; }
.spotify-modal-head { align-items: flex-start; gap: 12px; }
.spotify-modal-head h2 { margin: 4px 0; font-size: clamp(1.25rem, 3vw, 1.6rem); letter-spacing: -.03em; }
.spotify-modal-head p, .spotify-modal-hint { margin: 0; color: #718078; font-size: .85rem; }
.spotify-modal-eyebrow { color: #25804d; font-size: .68rem; letter-spacing: .13em; font-weight: 800; }
.spotify-modal .spotify-modal-close { width: 38px; height: 38px; min-height: 38px; padding: 0; border: 0; border-radius: 50%; color: #4b6154; background: #eff4f0; font-size: 1.5rem; line-height: 1; }
.spotify-modal-search, .spotify-link-input { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 5px 5px 12px; background: #f1f5f2; border: 1px solid #e2eae4; border-radius: 12px; }
.spotify-modal-search > span { display: flex; color: #718078; }
.spotify-modal-search .ui-icon { width: 19px; height: 19px; }
.spotify-modal-search input, .spotify-link-input input { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; background: transparent; color: #20382f; outline: 0; }
.spotify-modal-search:focus-within, .spotify-link-input:focus-within { border-color: #48936a; box-shadow: 0 0 0 3px #48936a22; }
.spotify-modal .spotify-primary, .spotify-modal .spotify-link-button { flex: none; padding: 10px 16px; min-height: 40px; border: 0; border-radius: 9px; color: white; background: #286b47; font-size: .84rem; font-weight: 700; }
.spotify-results-heading { color: #718078; font-weight: 700; font-size: .73rem; text-transform: uppercase; letter-spacing: .06em; }
.spotify-modal .spotify-results { max-height: 260px; gap: 4px; }
.spotify-modal .spotify-results button { display: flex; align-items: center; justify-content: initial; gap: 11px; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: #f7f9f7; color: #20382f; text-align: left; }
.spotify-modal .spotify-results button:hover { background: #eaf4ed; }
.spotify-result-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; color: #397a54; background: #e0eee4; }
.spotify-result-icon .ui-icon { width: 20px; height: 20px; }
.spotify-result-icon img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.spotify-result-text { display: grid; flex: 1; min-width: 0; gap: 3px; }
.spotify-result-text strong, .spotify-result-text small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.spotify-modal .spotify-result-text small { margin: 0; color: #75847a; font-size: .76rem; }
.spotify-result-add { color: #2e8151; font-size: 1.45rem; }
.spotify-link-section { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid #edf1ee; color: #63756a; font-size: .8rem; font-weight: 650; }
.spotify-modal .spotify-unlink { justify-self: start; padding: 4px 0; min-height: 0; border: 0; background: none; color: #9a514c; font-size: .8rem; }
.stage-dark .spotify-recording .spotify-manage { color: white; border-color: #555; }
.stage-dark .spotify-setting-copy small { color: #bbb; }
.stage-dark .spotify-progress input { background: linear-gradient(to right, #fff var(--played, 0%), #777 var(--played, 0%)); }

/* Compact, movable performance player */
.spotify-playbar-floating { width: min(310px, calc(100vw - 20px)); gap: 5px; padding: 5px 7px; border-radius: 12px; }
.spotify-playbar-floating button, .stage-dark .spotify-playbar-floating button { width: 31px; height: 31px; padding: 6px; }
.spotify-playbar-floating .spotify-progress { min-width: 48px; gap: 2px; }
.spotify-playbar-floating .spotify-progress span { font-size: .64rem; }
.spotify-drag-handle { display: grid; place-items: center; flex: none; width: 24px; height: 36px; color: #c8d1cb; font-size: 1.3rem; cursor: grab; touch-action: none; user-select: none; }
.spotify-drag-handle:active { cursor: grabbing; }
.spotify-docked { display: inline-flex; }
.spotify-docked .ui-icon { width: 20px; height: 20px; }

/* Chart player and recording selector */
.spotify-player-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.spotify-player-row .spotify-playbar { flex: 1 1 240px; width: min(100%, 380px); max-width: 380px; min-height: 62px; }
.spotify-player-row .spotify-progress { position: relative; display: flex; align-items: center; min-height: 24px; }
.spotify-player-row .spotify-progress span { position: absolute; left: 0; top: calc(50% + 7px); white-space: nowrap; }
.spotify-recording .spotify-change-recording { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 12px; border: 1px solid #d6e4d9; border-radius: 11px; color: #315841; background: #fff; font-size: .8rem; font-weight: 650; }
.spotify-change-recording .ui-icon { width: 17px; height: 17px; flex: none; }
.spotify-settings .spotify-stage-setting { padding: 14px 2px; border-top: 1px solid var(--line); }
.stage-dark .spotify-recording .spotify-change-recording { background: #000; color: #fff; border-color: #777; }
@media (max-width: 480px) { .spotify-player-row .spotify-playbar { flex-basis: 190px; } .spotify-change-recording span { display: none; } }
.spotify-player-row .spotify-bar-time { flex: none; font-size: .7rem; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .85; }
.spotify-recording .spotify-change-recording { width: 42px; height: 42px; min-height: 42px; padding: 10px; }
.spotify-recording .spotify-change-recording .ui-icon { width: 20px; height: 20px; }

/* Performance playback controls */
.spotify-playbar-floating .spotify-progress { display: flex; align-items: center; }
.spotify-playbar-floating .spotify-bar-time { flex: none; white-space: nowrap; font-size: .62rem; font-variant-numeric: tabular-nums; opacity: .85; }
.spotify-playbar-floating [data-spotify-action="dock"] .ui-icon, .stage-toolbar #stageBackToChart .ui-icon, .stage-toolbar #stageHome .ui-icon { width: 20px; height: 20px; }
.performance .spotify-recording-heading > div { flex: 1; }
.spotify-docked button { touch-action: manipulation; -webkit-touch-callout: none; user-select: none; }
@media (max-width: 740px) { .stage-toolbar { gap: 2px; } .stage-toolbar button { width: 32px; } }
.spotify-playbar-floating .spotify-play-button, .stage-dark .spotify-playbar-floating .spotify-play-button { display: grid; place-items: center; padding: 0; line-height: 1; }
.spotify-playbar-floating .spotify-play-button .ui-icon { display: block; width: 19px; height: 19px; }
.stage-practice-row { display: flex; align-items: end; gap: 8px; }
.stage-menu .stage-practice-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; min-height: 42px; padding: 9px; }
.stage-practice-icon .ui-icon { width: 22px; height: 22px; }
.stage-menu .stage-practice-icon[aria-pressed="true"] { background: #183e2b; color: white; }
.stage-dark .stage-menu .stage-practice-icon[aria-pressed="true"] { background: #fff; color: #000; }
.stage-tempo { display: grid; gap: 4px; font-size: .75rem; }
.stage-tempo input { width: 85px; min-height: 42px; }
.stage-duration { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .78rem; }
.stage-menu .stage-duration-edit { min-height: 0; padding: 3px 5px; border: 0; text-decoration: underline; background: transparent; }
.stage-duration-form { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; }
.stage-duration-form[hidden] { display: none; }
.stage-duration-form label { display: grid; flex: 1; gap: 4px; min-width: 110px; font-size: .75rem; }
.stage-duration-form input { min-width: 0; }
#stagePlaybackError:empty { display: none; }
.stage-menu .stage-narrow-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.stage-menu .stage-narrow-toggle input { appearance: none; position: relative; flex: none; width: 42px; height: 24px; min-height: 24px; padding: 0; border: 1px solid #777; border-radius: 14px; background: #ddd; }
.stage-menu .stage-narrow-toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0005; transition: transform .15s; }
.stage-menu .stage-narrow-toggle input:checked { background: #111; border-color: #111; }
.stage-menu .stage-narrow-toggle input:checked::after { transform: translateX(18px); }
.stage-dark .stage-menu .stage-narrow-toggle input { background: #222; border-color: #aaa; }
.stage-dark .stage-menu .stage-narrow-toggle input:checked { background: #fff; }
.stage-dark .stage-menu .stage-narrow-toggle input:checked::after { background: #111; }
.stage-menu .stage-narrow-toggle input:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* Performance title and key dialog */
.performance .stage-content h1 { font-size: clamp(1.5rem, 4.2vw, 2.8rem); }
.performance .stage-song-meta { font-size: 1rem; }
.stage-key-button { display: inline; min-height: 0; padding: 2px 3px; border: 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 3px; }
.stage-key-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.stage-key-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: #0008; }
.stage-key-dialog { width: min(100%, 440px); padding: 20px; border: 1px solid #ccc; border-radius: 14px; color: #111; background: #fff; box-shadow: 0 12px 36px #0005; }
.stage-key-dialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.stage-key-dialog header button { min-width: 40px; min-height: 40px; padding: 4px; }
.stage-key-dialog .key-control { display: grid; gap: 12px; }
.stage-key-dialog .key-control label { display: grid; gap: 5px; }
.stage-key-dialog .transpose-control { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stage-dark .stage-key-dialog { color: #fff; background: #000; border-color: #fff; }
.stage-dark .stage-key-dialog button, .stage-dark .stage-key-dialog select { color: #fff; background: #000; border-color: #fff; }
.stage-key-dialog .stage-key-controls { gap: 14px; }
.stage-key-facts { display: grid; gap: 4px; font-size: .82rem; }
.stage-key-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(145px, 1.1fr); gap: 14px; align-items: start; }
.stage-key-dialog .stage-key-grid > label, .stage-key-transpose { display: grid; gap: 6px; font-size: .85rem; }
.stage-key-transpose .stage-key-steps { display: flex; align-items: center; gap: 8px; }
.stage-key-steps button { min-width: 38px; min-height: 38px; padding: 4px; }
.stage-key-steps strong { min-width: 28px; text-align: center; }
.stage-key-dialog .stage-key-reset { justify-self: end; min-height: 0; padding: 3px 6px; font-size: .8rem; }
.chart-font-control { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 10px 0; color: var(--muted); font-size: .8rem; }
.chart-font-control button { min-width: 38px; min-height: 38px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font-weight: 700; }
.chart-font-control output { min-width: 2ch; text-align: center; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Chart reading workspace */
.reader-page .reader-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 16px; }
.reader-page .reader-title { min-width: 0; }
.reader-page .reader-title h2 { margin: 7px 0 3px; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.08; letter-spacing: -.035em; overflow-wrap: anywhere; }
.reader-page .reader-title p { margin: 0; font-size: 1rem; color: var(--muted); }
.reader-main-actions { flex: none; align-items: center; }
.reader-main-actions .primary { display: inline-flex; align-items: center; gap: 7px; }
.reader-main-actions .ui-icon { width: 17px; height: 17px; }
.reader-page .chart-facts { align-items: center; gap: 7px; margin-bottom: 18px; }
.reader-page .chart-facts span { padding: 6px 10px; background: #eef3ee; border-radius: 8px; color: #6c7b70; }
.reader-page .chart-facts strong { margin-left: 3px; color: #274435; }
.reader-tools { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.reader-display { display: flex; align-items: center; gap: 14px; }
.reader-tool-label { flex: none; color: #728178; font-size: .74rem; font-weight: 700; }
.reader-display .format-control { max-width: 520px; }
.reader-options { margin-top: 10px; }
.reader-options summary { display: flex; align-items: center; gap: 8px; width: fit-content; list-style: none; cursor: pointer; font-size: .8rem; font-weight: 700; color: #426650; }
.reader-options summary::-webkit-details-marker { display: none; }
.reader-options summary .ui-icon { width: 17px; height: 17px; }
.reader-chevron { font-size: 1rem; transition: transform .15s; }
.reader-options[open] .reader-chevron { transform: rotate(180deg); }
.reader-options .reader-controls { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr); gap: 20px; padding-top: 16px; margin-top: 12px; border-top: 1px solid #edf1ed; }
.reader-options .practice-controls { grid-column: auto; align-content: start; }
.reader-options .practice-controls label { display: grid; gap: 6px; flex: 1 1 150px; font-size: .8rem; }
.reader-options .practice-controls input { width: 100%; }
.reader-page .spotify-chart { margin-bottom: 16px; }
.reader-page .spotify-recording { gap: 10px; }
.chart-paper { background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 30px #20382f08; overflow: hidden; }
.chart-paper-toolbar { display: flex; justify-content: flex-end; padding: 10px 16px 0; }
.chart-paper .chart-font-control { margin: 0; }
.chart-paper .chart-body { border: 0; border-radius: 0; background: transparent; padding: 12px clamp(16px, 3vw, 32px) 32px; }
@media (max-width: 700px) {
  .reader-page .reader-heading { align-items: flex-start; flex-direction: column; }
  .reader-display { align-items: stretch; flex-direction: column; gap: 8px; }
  .reader-options .reader-controls { grid-template-columns: 1fr; }
}
@media print { .chart-paper-toolbar, .reader-tools { display: none; } .chart-paper { border: 0; box-shadow: none; } }

/* Song notes */
.chart-notes { margin-top: 20px; }
.song-notes-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 0 20px 20px; }
.song-notes-editor form, .song-notes-editor label { display: grid; gap: 8px; }
.song-notes-editor textarea { resize: vertical; min-height: 84px; }
.song-notes-editor small { color: var(--muted); font-size: .76rem; }
.song-notes-editor button { justify-self: start; }
.song-notes-editor p { margin: 0; font-size: .8rem; }
.song-notes-editor p:empty { display: none; }
.notes-reminder-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.notes-reminder-setting input { order: 1; }
.stage-notes p, .stage-notes-reminder p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 10px; font-size: .86rem; }
.stage-notes strong, .stage-notes-reminder strong { font-size: .8rem; }
.stage-notes-reminder { position: fixed; z-index: 90; top: 58px; left: 50%; transform: translateX(-50%); width: min(440px, calc(100vw - 28px)); max-height: min(45dvh, 320px); overflow: auto; padding: 14px 16px; border: 1px solid #ddd; border-radius: 12px; background: #fff; color: #111; box-shadow: 0 10px 32px #0005; }
.stage-notes-reminder-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.stage-notes-reminder-head button { width: 30px; height: 30px; min-height: 30px; padding: 0; }
.stage-dark .stage-notes-reminder { background: #000; color: #fff; border-color: #fff; }
.stage-dark .stage-notes-reminder button { background: #000; color: #fff; border-color: #fff; }
@media (max-width: 700px) { .song-notes-editor { grid-template-columns: 1fr; } }

/* Compact key controls */
.stage-key-dialog { width: min(100%, 340px); padding: 16px; }
.stage-key-dialog header { margin-bottom: 10px; }
.stage-key-dialog .stage-key-controls, .reader-options .stage-key-controls { display: grid; gap: 10px; max-width: 340px; }
.stage-key-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.stage-key-transpose .stage-key-steps { gap: 4px; }
.stage-key-steps button { min-width: 36px; min-height: 38px; }
.stage-key-footer { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 8px; }
.stage-key-footer .stage-key-reset { min-height: 34px; padding: 5px 10px; border-radius: 8px; font-size: .78rem; }
.stage-key-grid select { min-width: 0; width: 100%; min-height: 40px; padding: 8px 42px 8px 10px; border: 1px solid #d7e3d9; border-radius: 9px; color: #20382f; background-color: #f7faf7; }
.stage-dark .stage-key-dialog .stage-key-grid select { color: #fff; background-color: #000; border-color: #fff; }
.reader-options .stage-key-facts { color: #718078; }
.reader-options .stage-key-facts strong { color: var(--ink); }
.reader-options .stage-key-grid { align-items: end; }
.reader-options .practice-controls { gap: 9px; padding: 12px; border-radius: 12px; background: #f5f8f5; }
.reader-options .practice-controls button { min-height: 40px; }

/* Chart practice controls */
.reader-tools { padding-top: 20px; }
.reader-options { margin-top: 16px; }
.reader-options summary { width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 9px; background: #f3f7f3; }
.reader-options summary > span:nth-child(2) { flex: 1; }
.reader-options summary .reader-chevron { display: grid; place-items: center; width: 28px; height: 28px; }
.reader-options summary .reader-chevron .ui-icon { width: 22px; height: 22px; }
.reader-options .practice-controls .reader-practice-icon { display: grid; place-items: center; width: 42px; height: 42px; min-height: 42px; padding: 9px; }
.reader-practice-icon .ui-icon { width: 22px; height: 22px; }
.reader-options .practice-controls .reader-practice-icon[aria-pressed="true"] { color: white; background: var(--accent); border-color: var(--accent); }
.reader-tempo { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.reader-options .practice-controls input[type="range"] { accent-color: var(--accent); }

/* Chart controls sit beside the first lines rather than above the song. */
.chart-paper .chart-body { display: flow-root; padding-top: 16px; }
.chart-paper-toolbar { float: right; display: flex; align-items: center; gap: 8px; padding: 0; margin: 0 0 6px 12px; font-size: .8rem; line-height: 1.2; }
.chart-paper-toolbar #autoScroll { display: grid; place-items: center; width: 38px; height: 38px; min-height: 38px; padding: 8px; border-radius: 9px; }
.chart-paper-toolbar #autoScroll[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.chart-paper-toolbar #autoScroll .ui-icon { width: 20px; height: 20px; }
.reader-options .practice-controls .reader-tempo { display: grid; flex: 0 1 105px; gap: 4px; }
.reader-options .practice-controls .reader-tempo input { width: 88px; min-height: 40px; }
#chartTempoError:empty { display: none; }
:is(.chart-notes, .chart-sharing) summary { list-style: none; }
:is(.chart-notes, .chart-sharing) summary::-webkit-details-marker { display: none; }
:is(.chart-notes, .chart-sharing) summary > span:first-child { flex: 1; }
:is(.chart-notes, .chart-sharing) summary .reader-chevron { display: grid; place-items: center; width: 28px; height: 28px; }
:is(.chart-notes, .chart-sharing) summary .reader-chevron .ui-icon { width: 22px; height: 22px; }
:is(.chart-notes, .chart-sharing)[open] .reader-chevron { transform: rotate(180deg); }
@media print { .chart-paper-toolbar { display: none; } }

/* Album artwork */
.song-art { overflow: hidden; position: relative; }
.song-art img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.song-art > span { position: relative; z-index: 1; }
.cover-editor { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 14px; align-items: center; }
.cover-editor-preview { display: grid; place-items: center; overflow: hidden; width: 90px; height: 90px; border-radius: 12px; background: #edf4ed; color: #63806e; }
.cover-editor-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-editor p { margin: 4px 0 8px; color: var(--muted); font-size: .85rem; }
.cover-editor small { display: block; margin-top: 8px; color: var(--muted); font-size: .73rem; }
#coverResults { grid-column: 1 / -1; font-size: .83rem; }
.cover-results { display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.cover-results button { justify-content: flex-start; text-align: left; }
.online-cover-status { margin: 8px 0 12px; color: var(--muted); font-size: .78rem; }
.online-stage-dark .online-cover-status { color: #ddd; }

/* The chart is a viewport-sized, independently scrollable reading pane. */
.reader-page .chart-paper { height: 100vh; height: 100dvh; overflow-y: auto; overflow-x: hidden; }
@media print { .reader-page .chart-paper { height: auto; overflow: visible; } }
.reader-page .chart-paper-toolbar { position: sticky; top: 8px; z-index: 2; border-radius: 10px; background: #fff; }
.cover-results button { display: flex; align-items: center; gap: 12px; min-height: 70px; }
.cover-results button img { flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: 7px; background: #edf4ed; }
.cover-results button img[hidden], .online-cover-preview img[hidden] { display: none; }
.cover-results button span { display: grid; gap: 4px; min-width: 0; }
.cover-results button small { color: var(--muted); font-size: .75rem; }
.online-cover-preview { display: flex; align-items: center; gap: 10px; }
.online-cover-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.song-art > span { position: absolute; }

/* Standard search preview follows the reading layout and stays visibly distinct. */
.online-chart-preview { padding: clamp(12px, 2vw, 20px); border: 1px solid #e7d5a6; border-radius: 16px; background: #fbf6e8; }
.online-chart-preview .online-detail-header { position: static; background: #fffdf7; border-color: #eadfbe; }
.online-chart-preview .online-detail-header .tiny-label { color: #80651f; }
.online-preview-tools { margin-bottom: 16px; padding: 18px 16px 14px; border: 1px solid #e8ddbe; border-radius: 14px; background: #fffdf7; }
.online-preview-tools .reader-display .format-control { max-width: 520px; }
.online-key-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 14px 2px 2px; }
.online-key-controls .field-hint { flex-basis: 100%; margin: 0; }
.online-key-controls > label { display: grid; gap: 5px; min-width: 110px; }
.online-key-controls .transpose-control { flex-wrap: wrap; }
.online-preview-paper { min-height: min(100dvh, 720px); padding: 16px clamp(16px, 3vw, 32px) 32px; border: 1px solid #e8ddbe; border-radius: 14px; background: white; }
.online-preview-paper .online-chart { border: 0; padding: 0; background: transparent; }
.online-preview-font { display: flex; justify-content: flex-end; align-items: center; gap: 7px; margin: 0 0 12px; font-size: .8rem; color: var(--muted); }
.online-preview-font button { min-width: 38px; min-height: 38px; padding: 5px; }
.online-preview-font output { min-width: 2ch; text-align: center; }
.online-source { display: inline-block; margin-top: 12px; font-size: .8rem; }
@media (max-width: 700px) { .online-preview-tools .reader-display { flex-direction: column; align-items: stretch; gap: 8px; } }

/* Recording artwork choices */
.online-cover-well { margin: 0 0 16px; padding: 15px; border: 1px solid #e8ddbe; border-radius: 14px; background: #fffdf7; }
.online-cover-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.online-cover-heading strong { font-size: .9rem; }
.online-cover-heading p { margin: 3px 0 0; color: #718078; font-size: .77rem; }
.online-cover-heading small { color: #718078; font-size: .73rem; }
.online-cover-options { display: flex; gap: 10px; overflow-x: auto; padding: 3px 3px 6px; }
.online-cover-choice, .online-stage .online-cover-choice { display: grid; flex: 0 0 108px; align-content: start; gap: 6px; padding: 5px; min-width: 0; border: 2px solid transparent; border-radius: 11px; background: transparent; color: #233b2d; text-align: left; }
.online-cover-choice[aria-pressed="true"], .online-stage .online-cover-choice[aria-pressed="true"] { border-color: #258653; background: #eaf5ed; }
.online-cover-choice:focus-visible { outline: 2px solid #176439; outline-offset: 2px; }
.online-cover-image { display: grid; place-items: center; width: 94px; aspect-ratio: 1; overflow: hidden; border-radius: 7px; background: #e7ecdf; color: #789571; }
.online-cover-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.online-cover-none .online-cover-image .ui-icon { width: 40px; height: 40px; stroke-width: 1; transform: rotate(-7deg); }
.online-cover-name { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.2em; font-size: .7rem; line-height: 1.1; overflow-wrap: anywhere; }
.online-stage-dark .online-cover-well { background: #000; border-color: #fff; color: #fff; }
.online-stage-dark .online-cover-choice { color: #fff; }
.online-stage-dark .online-cover-choice[aria-pressed="true"] { border-color: #1ed760; background: #162b1c; }

/* Collapsible navigation */
.sidebar-toggle { width: 100%; min-height: 40px; justify-content: flex-start; gap: 10px; margin-top: auto; padding: 9px 12px; border: 0; background: transparent; color: #657369; font-size: .74rem; }
.sidebar-toggle .ui-icon { width: 19px; height: 19px; }
.sidebar-toggle + .sidebar-footer { margin-top: 8px; }
.logout-link .ui-icon { display: none; }
.shell.sidebar-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
.sidebar-collapsed .sidebar { padding: 24px 9px 14px; }
.sidebar-collapsed .brand { justify-content: center; margin: 0 0 32px; }
.sidebar-collapsed .brand > span:last-child, .sidebar-collapsed .nav-item > span, .sidebar-collapsed .nav-item small, .sidebar-collapsed .sidebar-note, .sidebar-collapsed .sidebar-toggle span, .sidebar-collapsed .profile-link > span:last-child, .sidebar-collapsed .logout-link span { display: none; }
.sidebar-collapsed .brand-mark { flex: none; }
.sidebar-collapsed .main-nav { display: grid; gap: 7px; }
.sidebar-collapsed .nav-item { width: 48px; height: 46px; min-height: 46px; justify-content: center; padding: 10px; border-radius: 10px; }
.sidebar-collapsed .sidebar-toggle { width: 48px; justify-content: center; padding: 9px; }
.sidebar-collapsed .sidebar-toggle .ui-icon { transform: rotate(180deg); }
.sidebar-collapsed .sidebar-footer { position: static; display: grid; justify-items: center; gap: 5px; padding-top: 10px; border-top: 1px solid var(--line); }
.sidebar-collapsed .profile-link { width: 44px; min-height: 40px; justify-content: center; padding: 4px; }
.sidebar-collapsed .logout-link { display: grid; place-items: center; width: 44px; min-height: 40px; margin: 0; padding: 8px; }
.sidebar-collapsed .logout-link .ui-icon { display: block; width: 19px; height: 19px; }
@media (max-width: 740px) {
  .shell:not(.sidebar-collapsed) .sidebar-toggle { position: absolute; top: 12px; right: 64px; width: 40px; min-height: 40px; padding: 8px; justify-content: center; }
  .shell:not(.sidebar-collapsed) .sidebar-toggle span { display: none; }
  .shell.sidebar-collapsed .sidebar { position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line); border-bottom: 0; }
  .shell.sidebar-collapsed .nav-item { flex: none; }
  .shell.sidebar-collapsed .sidebar-footer { position: static; }
}

/* First-visit guide */
.quick-guide { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: clamp(24px, 5vw, 40px); border: 1px solid #dce7dc; border-radius: 24px; background: #fff; color: var(--ink); box-shadow: 0 24px 80px #17271c40; }
.quick-guide::backdrop { background: #17251db3; }
.quick-guide-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .12em; }
.quick-guide-top button { min-height: 40px; padding: 8px; border: 0; background: transparent; color: #56705e; font-size: .8rem; letter-spacing: 0; }
.quick-guide-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 28px 0 22px; border-radius: 20px; background: #e7f1e8; color: #316c4a; }
.quick-guide-icon .ui-icon { width: 32px; height: 32px; }
.quick-guide-count { margin: 0 0 8px; color: #6a8671; font-size: .75rem; font-weight: 700; }
.quick-guide h2 { margin: 0 0 10px; font-size: clamp(1.65rem, 4vw, 2.2rem); letter-spacing: -.035em; line-height: 1.15; }
.quick-guide-description { min-height: 3em; margin: 0; color: #62746a; font-size: .95rem; line-height: 1.6; }
.quick-guide-dots { display: flex; gap: 6px; margin: 24px 0; }
.quick-guide-dots span { width: 7px; height: 7px; border-radius: 10px; background: #d9e5d9; }
.quick-guide-dots span.active { width: 22px; background: #397953; }
.quick-guide-actions { display: flex; justify-content: space-between; gap: 12px; }

/* Shared workspace design */
.shell { --workspace-radius: 15px; --workspace-shadow: 0 8px 28px #20382f0b; }
.shell .workspace { background: var(--paper); }
.shell .chart > .page-heading, .shell .chart > .reader-heading { align-items: end; gap: 16px; margin-bottom: 22px; }
.shell .page-heading h2, .shell .reader-heading h2, .shell .online-search > h2 { margin: 8px 0 7px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(1.9rem, 3.7vw, 2.85rem); line-height: 1.1; letter-spacing: -.04em; }
.shell .page-heading p, .shell .reader-heading p, .shell .online-search > p { max-width: 64ch; margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.shell .eyebrow { color: #72877a; letter-spacing: .11em; }
.shell .surface, .shell .item, .shell .disclosure, .shell .online-result, .shell .reader-tools, .shell .chart-paper { border-color: #dfe8df; border-radius: var(--workspace-radius); box-shadow: var(--workspace-shadow); }
.shell .surface, .shell .item { padding: clamp(18px, 2.4vw, 24px); }
.shell .surface h3, .shell .item h3 { margin: 0; font-size: 1.08rem; letter-spacing: -.02em; }
.shell .disclosure summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 16px 18px; border-radius: var(--workspace-radius); }
.shell .disclosure summary .muted { margin-left: 4px; }
.shell .disclosure[open] summary { border-bottom: 1px solid #edf2ed; border-radius: 15px 15px 0 0; }
.shell .disclosure-body { padding: 16px 18px 20px; }
.shell .form-grid { gap: 16px; }
.shell input:not([type="range"]):not([type="checkbox"]), .shell select, .shell textarea { border-color: #dce6dd; border-radius: 10px; background-color: #fcfdfb; }
.shell .page-heading .actions, .shell .reader-main-actions { gap: 8px; }
.shell .song-card { border-radius: 15px; box-shadow: var(--workspace-shadow); }
.shell .song-card:focus-visible, .shell .online-result:focus-within { outline: 2px solid #89b39a; outline-offset: 2px; }
.shell .setlist-card { display: grid; gap: 12px; }
.shell .setlist-heading > div > strong { font-size: 1.08rem; letter-spacing: -.02em; }
.shell .setlist-items { margin: 0; color: #52665a; }
body.app-dark:not(.performance) .shell .setlist-items,
body.app-dark:not(.performance) .shell .setlist-items .setlist-title { color: var(--ink); }
.shell .ensemble-forms .surface { align-content: start; }
.shell .ensemble-forms .surface button { justify-self: start; }
.shell .online-search > .eyebrow { display: block; margin-bottom: 8px; }
.shell .online-form { padding: 14px; border: 1px solid #dfe8df; border-radius: 15px; background: #fff; box-shadow: var(--workspace-shadow); }
.shell .online-result { padding: 16px 18px; }
.shell .online-chart-preview { background: #fbf6e8; }
.shell .language-settings, .shell #settingsForm, .shell .profile-details, .shell .spotify-settings, .shell .import-settings { max-width: 960px; margin: 0 0 16px; }
.shell .profile-details { padding: 0; overflow: hidden; }
.shell .profile-details #settingsForm { max-width: none; margin: 0; }
.shell .language-settings { display: grid; gap: 14px; }
.shell .language-settings h3, .shell #settingsForm h3 { margin: 0 0 2px; }
.shell .language-settings .appearance-picker { margin-top: 0; }
.shell .language-settings > small { color: var(--muted); font-size: .76rem; }
.shell #settingsForm button { justify-self: start; }
.shell .import-settings p { margin: 8px 0 14px; }
.shell .profile-signout { margin-top: 4px; }
.auth-card { box-shadow: 0 20px 70px #20382f12; border-color: #dfe8df; }
@media (max-width: 700px) {
  .shell .chart > .page-heading, .shell .chart > .reader-heading { align-items: flex-start; }
  .shell .online-form { flex-wrap: wrap; }
  .shell .online-form label { min-width: 100%; }
}

/* Setlists show which collection is being managed. */
.setlist-scope { display: grid; gap: 6px; max-width: 320px; margin: 0 0 20px; }
.ensemble-setlist-context .sidebar { background: #e1ebf3; border-color: #b5cddd; }
.ensemble-setlist-context .nav-item[data-tab="setlists"] { color: #174b6a; }

.storage-notice:not([hidden]) { position: fixed; z-index: 10000; bottom: 16px; left: 16px; right: 16px; max-width: 720px; margin: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; background: #fff; color: #20382f; border: 1px solid #b9ccc0; border-radius: 12px; box-shadow: 0 8px 32px #0003; }
.storage-notice p { flex: 1 1 320px; margin: 0; }
.privacy-document { max-width: 800px; margin: 0 auto; padding: 32px 20px 80px; line-height: 1.6; }
.privacy-document h2 { margin-top: 2em; }

.auth-methods, .social-providers { display: grid; gap: .5rem; }
.auth-methods h2 { margin: 0 0 4px; padding-top: 16px; border-top: 1px solid var(--line); font: inherit; font-size: .82rem; font-weight: 700; color: var(--muted); }
.auth-methods small:empty { display: none; }
.auth-methods small { color: var(--muted, #66716b); line-height: 1.4; }
.auth-methods button:disabled { opacity: .55; cursor: not-allowed; }

.frontend-version { display: block; color: #53645a; font-size: 0.7rem; line-height: 1.4; text-align: center; }
.frontend-version:empty { display: none; }
.sidebar > .frontend-version { flex: 0 0 auto; margin-top: 10px; }
@media (min-width: 741px) { .sidebar { overflow-y: auto; } .sidebar-note { flex-shrink: 1; min-height: 0; overflow-y: auto; } }
@media (max-width: 740px) { .sidebar > .frontend-version { margin: 4px 0; } }

.auth-method-button { width: 100%; min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr) 22px; align-items: center; gap: 10px; text-align: center; }
.auth-method-icon { width: 20px; height: 20px; display: block; }

/* Chord diagrams */
.chord-trigger { appearance: none; border: 0; background: transparent; padding: 0; min-height: 0; border-radius: 0; font: inherit; line-height: 1.1; color: var(--accent); display: inline; text-align: left; cursor: pointer; }
.chord-trigger:hover, .chord-trigger:focus-visible { background: transparent; text-decoration: underline; }
.chord-dialog { width: min(640px, calc(100% - 32px)); max-height: 90vh; border: 1px solid #d7c2c7; border-radius: 16px; padding: 22px; color: #30272a; background: #fffaf9; box-shadow: 0 15px 60px #0005; }
.chord-dialog::backdrop { background: #0009; }
.chord-dialog-header { display: flex; justify-content: space-between; align-items: center; font-size: 1.5rem; }
.chord-dialog-header button { min-height: 40px; }
.chord-dialog p { margin: 8px 0 16px; }
.chord-voicings { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.chord-voicings svg { width: min(160px, 100%); }
.chord-piano { display: flex; justify-content: center; }
.chord-piano svg { width: min(100%, 360px); }
.chord-piano .piano-white { fill: #fff; stroke: #333; }
.chord-piano .piano-white.piano-selected { fill: #c77b89; }
.chord-piano .piano-black { fill: #222; }
.chord-piano .piano-black.piano-selected { fill: #a63d56; }
.chord-piano .piano-label { fill: #221b1d; }
.chord-dialog.chord-dialog-dark { color-scheme: dark; color: #f3f6f3; background: #1d2921; border-color: #586b5d; }
.chord-dialog.chord-dialog-dark .chord-dialog-header button { background: #304239; color: #f3f6f3; border-color: #586b5d; }
.chord-dialog.chord-dialog-dark .piano-white { fill: #e8eee8; stroke: #425248; }
.chord-dialog.chord-dialog-dark .piano-white.piano-selected { fill: #a6d7b4; }
.chord-dialog.chord-dialog-dark .piano-black { fill: #202923; }
.chord-dialog.chord-dialog-dark .piano-black.piano-selected { fill: #4c9a68; }
.chord-dialog.chord-dialog-dark .piano-label { fill: #1b2820; }
.ensemble-setlist-context .sidebar { background: #f2e4e7; border-color: #d6b6bf; }
.ensemble-setlist-context .nav-item[data-tab="setlists"] { color: #762e43; }

/* Spotify search should remain readable inside the dark performance menu. */
.stage-dark .spotify-modal-backdrop { background: #000c; }
.stage-dark .spotify-modal { background: #1b211e; color: #f4f7f5; border: 1px solid #47544c; box-shadow: 0 24px 70px #000a; }
.stage-dark .spotify-modal-head p, .stage-dark .spotify-modal-hint, .stage-dark .spotify-results-heading, .stage-dark .spotify-modal .spotify-result-text small { color: #b5c2ba; }
.stage-dark .spotify-modal-eyebrow, .stage-dark .spotify-result-add { color: #70dc98; }
.stage-dark .stage-menu .spotify-modal .spotify-modal-close { background: #303b34; color: #f4f7f5; border: 0; }
.stage-dark .spotify-modal-search, .stage-dark .spotify-link-input { background: #2a342e; border-color: #58685e; }
.stage-dark .spotify-modal-search > span { color: #b5c2ba; }
.stage-dark .stage-menu .spotify-modal-search input, .stage-dark .stage-menu .spotify-link-input input { background: transparent; color: #f4f7f5; border: 0; }
.stage-dark .spotify-modal input::placeholder { color: #b5c2ba; opacity: 1; }
.stage-dark .stage-menu .spotify-modal .spotify-primary, .stage-dark .stage-menu .spotify-modal .spotify-link-button { background: #70dc98; color: #132419; border: 0; }
.stage-dark .stage-menu .spotify-modal .spotify-results button { background: #29332d; color: #f4f7f5; border: 0; }
.stage-dark .stage-menu .spotify-modal .spotify-results button:hover { background: #3b4d41; }
.stage-dark .spotify-result-icon { background: #395442; color: #9be3b5; }
.stage-dark .spotify-link-section { color: #c5d0c9; border-color: #47544c; }
.stage-dark .stage-menu .spotify-modal .spotify-unlink { background: transparent; color: #f3a69d; border: 0; }

/* Two rows keep all display labels readable in the narrow performance menu. */
.stage-menu .format-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stage-menu .format-control button { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; min-height: 44px; }
.stage-menu .format-control button:nth-child(odd) { border-left: 0; }
.stage-menu .format-control button:nth-child(n + 3) { border-top: 1px solid var(--line); }
.stage-dark .stage-menu .format-control button { border-color: #fff; }

/* Center the single-column chart as a block, with its lines left-aligned. */
.performance .stage-content.single-column h1,
.performance .stage-content.single-column .stage-song-meta { text-align: center; }
.performance .stage-content.single-column .chart-body { width: fit-content; max-width: 100%; margin-inline: auto; text-align: left; }

/* Spotify recording search in the performance toolbar and overlay. */
.stage-toolbar .spotify-stage-link .ui-icon { width: 22px; height: 22px; }
.stage-dark .spotify-modal .spotify-modal-close { background: #303b34; color: #f4f7f5; border: 0; }
.stage-dark .spotify-modal-search input, .stage-dark .spotify-link-input input { background: transparent; color: #f4f7f5; border: 0; }
.stage-dark .spotify-modal .spotify-primary, .stage-dark .spotify-modal .spotify-link-button { background: #70dc98; color: #132419; border: 0; }
.stage-dark .spotify-modal .spotify-results button { background: #29332d; color: #f4f7f5; border: 0; }
.stage-dark .spotify-modal .spotify-results button:hover { background: #3b4d41; }
.stage-dark .spotify-modal .spotify-unlink { background: transparent; color: #f3a69d; border: 0; }

/* The app theme is independent of the performance theme. */
body.app-dark:not(.performance) {
  color-scheme: dark;
  --ink: #e5eee7; --muted: #aabbb0; --paper: #101914; --panel: #1c2921;
  --line: #384b3e; --accent: #86c99c; --accent-2: #a3d8b2; --shadow: 0 8px 28px #0004;
  background: var(--paper); color: var(--ink);
}
body.app-dark:not(.performance) :is(button, input, select, textarea) { background-color: #25362b; color: var(--ink); border-color: var(--line); }
body.app-dark:not(.performance) button.setlist-icon-action.danger { color: #ff6b63; }
body.app-dark:not(.performance) button:hover:not(:disabled) { background-color: #354d3c; }
body.app-dark:not(.performance) .sidebar-note .sidebar-news-dots button,
body.app-dark:not(.performance) .sidebar-note .sidebar-news-dots button:hover:not(:disabled) { background: transparent; border: 0; box-shadow: none; }
body.app-dark:not(.performance) button.primary { background: #397b54; border-color: #397b54; color: #fff; }
body.app-dark:not(.performance) :is(label, .nav-item, .sidebar-toggle, .sidebar-news-copy p, .frontend-version, .field-hint, .breadcrumb) { color: #b7c8bc; }
body.app-dark:not(.performance) :is(.sidebar, .segmented) { background: #18241c; }
/* Keep the shared-setlist workspace visibly distinct from the personal one in dark mode. */
body.app-dark:not(.performance) .ensemble-setlist-context .sidebar { background: #2e2025; border-color: #754a57; }
body.app-dark:not(.performance) .ensemble-setlist-context .nav-item[data-tab="setlists"] { color: #ffb4c6; }
body.app-dark:not(.performance) :is(.nav-item.active, .segmented button.active, .song-card, .surface, .item, .disclosure, .online-result, .auth-card, .quick-guide) { background: #213128; color: var(--ink); border-color: var(--line); }
body.app-dark:not(.performance) .ensemble-song-card { background: #4a252f; border-color: #c96d83; box-shadow: inset 4px 0 #ef8da6; }
body.app-dark:not(.performance) .ensemble-song-card:hover { background: #5a2c38; }
body.app-dark:not(.performance) .ensemble-song-card .tiny-label { color: #ffc0cf; }
body.app-dark:not(.performance) :is(.song-list, .song-compact) .ensemble-song-card { border: 2px solid #ef8da6; border-left-width: 6px; }
/* The ensemble outline must win over the shared dark card surface in every Library layout. */
:is(body.app-dark:not(.performance), body.stage-dark) .shell .song-card.ensemble-song-card {
  background: #4a252f !important;
  border: 0 !important;
  border-left: 6px solid #ffb2c5 !important;
  box-shadow: none !important;
}
:is(body.app-dark:not(.performance), body.stage-dark) .shell :is(.song-list, .song-compact) .song-card.ensemble-song-card {
  border-left-width: 6px !important;
}
body.app-dark:not(.performance) :is(.main, .workspace, .chart, .topbar) { background-color: var(--paper); color: var(--ink); }
body.app-dark:not(.performance) :is(.library-search, .chart-paper, .reader-controls, .online-detail-header, .online-controls, .spotify-modal, .song-picker, .online-cover-well) { background: var(--panel); color: var(--ink); border-color: var(--line); }
body.app-dark:not(.performance) :is(.song-card h3, .chart h2, .breadcrumb strong, .quick-guide h2, .spotify-recording-heading strong, .online-cover-choice) { color: var(--ink); }
body.app-dark:not(.performance) :is(.song-card p, .song-card-footer, .page-heading p, .reader-heading p, .quick-guide-description, .import-settings p, .spotify-setting-copy small, .online-cover-heading p, .online-cover-heading small) { color: var(--muted); }
body.app-dark:not(.performance) :is(.pill, .instrument-chip, .nav-item small, .avatar) { background: #314637; color: #d6ead9; }
body.app-dark:not(.performance) :is(.section, .segment-chord, .chordpro-token, a) { color: #9cddaf; }
body.app-dark:not(.performance) .notice { background: #493b26; color: #ffe0a7; border-color: #765e39; }
body.app-dark:not(.performance) :is(.auth, .install-landing) { background: radial-gradient(ellipse at top left, #273c2e, transparent 60%), var(--paper); }
body.app-dark:not(.performance) :is(.auth-card, .install-card) { border-color: var(--line); }
body.app-dark:not(.performance) .spotify-recording { background: #1d2d24; color: var(--ink); border-color: #405647; }
body.app-dark:not(.performance) .spotify-playbar { background: #16251c; border: 1px solid #405647; }
body.app-dark:not(.performance) .spotify-playbar button:hover:not(:disabled) { background-color: #30483a; }
body.app-dark:not(.performance) .spotify-playbar .spotify-play-button,
body.app-dark:not(.performance) .spotify-playbar .spotify-play-button:hover:not(:disabled) { background: #91d7a6; color: #102219; }
body.app-dark:not(.performance) .online-cover-choice[aria-pressed="true"] { background: #294d35; border-color: #80c998; }
/* Full-screen online previews retain their separate performance appearance. */
body.app-dark:not(.performance) .online-stage:not(.online-stage-dark), body.app-dark:not(.performance) .online-stage:not(.online-stage-dark) .online-chart { background: #fff; color: #111; }
body.app-dark:not(.performance) .online-stage:not(.online-stage-dark) :is(.online-detail-header, .online-controls, button, select) { background: #fff; color: #111; border-color: #aaa; }
body.app-dark:not(.performance) .online-stage:not(.online-stage-dark) :is(.segment-chord, .chordpro-token, .section, label, a) { color: #111; }
body.app-dark:not(.performance) .shell input:not([type="range"]):not([type="checkbox"]),
body.app-dark:not(.performance) .shell select,
body.app-dark:not(.performance) .shell textarea { background-color: #25362b; color: #e5eee7; border-color: #43584a; }
body.app-dark:not(.performance) .library-search { background: #25362b; border-color: var(--line); }
body.app-dark:not(.performance) .library-search input { background: transparent; color: var(--ink); }
body.app-dark:not(.performance) :is(.editor-save, .reader-page .chart-paper-toolbar, .storage-notice:not([hidden]), .spotify-modal-search, .spotify-link-input) { background: #25362b; color: var(--ink); border-color: var(--line); }
body.app-dark:not(.performance) :is(.spotify-modal-search input, .spotify-link-input input) { background: transparent; color: var(--ink); }
body.app-dark:not(.performance) :is(.notes-reminder-setting, .spotify-stage-setting) input:checked { background: #438f60; }
body.app-dark:not(.performance) :is(input, textarea)::placeholder { color: #aabbb0; opacity: 1; }
body.app-dark:not(.performance) :is(.reader-tools, .online-preview-tools, .online-preview-paper) { background: var(--panel); color: var(--ink); border-color: var(--line); }
body.app-dark:not(.performance) :is(.reader-options summary, .reader-page .chart-facts span) { background: #304237; color: #c3d4c7; }
/* The practice-controls background is set after the base reader styles, so it
   needs its own dark-mode surface rather than falling back to its light tint. */
body.app-dark:not(.performance) .reader-options .practice-controls { background: #25362b; }
body.app-dark:not(.performance) .reader-options .reader-controls { border-color: var(--line); }
body.app-dark:not(.performance) .reader-page .chart-facts strong { color: #e5eee7; }
body.app-dark:not(.performance) .format-control button[aria-pressed="true"] { background: #83c49a; color: #102219; border-color: #83c49a; }

.theme-toggle { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 7px; }
.theme-toggle svg { display: block; width: 20px; height: 20px; }

.live-chart-notice { position: fixed; z-index: 2000; right: 16px; bottom: 16px; max-width: min(440px, calc(100vw - 32px)); display: flex; align-items: center; flex-wrap: wrap; gap: 10px; box-shadow: 0 8px 28px #0004; }

.drawer-song-row { display: flex; align-items: center; }
.drawer-song-row[hidden] { display: none; }
.stage-drawer-list .drawer-song-row .drawer-song { flex: 1; width: auto; min-width: 0; touch-action: pan-y; }
.drawer-options-dialog { display: grid; gap: 10px; }
.drawer-options-dialog > button { width: 100%; text-align: left; }
.performance-song-search { width: min(620px, calc(100% - 32px)); max-height: min(80dvh, 680px); display: grid; gap: 14px; overflow: auto; }
.performance-song-search header > div { display: grid; gap: 3px; }
.performance-song-search header small { color: #68736d; font-size: .82rem; font-weight: 400; }
.performance-song-search-form { display: flex; align-items: end; gap: 8px; }
.performance-song-search-form label { display: grid; flex: 1; gap: 5px; font-size: .85rem; }
.performance-song-search-form input { min-width: 0; }
.performance-song-search-results { display: grid; gap: 6px; }
.performance-library-picker { width: min(520px, calc(100% - 32px)); max-height: min(80dvh, 680px); display: grid; gap: 14px; overflow: auto; }
.performance-library-picker header > div, .performance-library-picker > label, .performance-library-songs { display: grid; gap: 5px; }
.performance-library-picker select { padding-right: 42px; }
.performance-library-picker header small, .performance-library-songs small { color: #68736d; font-size: .82rem; font-weight: 400; }
.performance-library-songs { gap: 6px; }
.performance-library-songs > button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px; text-align: left; }
.performance-library-songs > button > span { display: grid; min-width: 0; gap: 2px; }
.performance-library-songs strong, .performance-library-songs small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-artist-group { display: grid; gap: 2px; }
.performance-artist-group h3 { padding: 8px 0 4px; }
.performance-song-search-results article { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid #d9dedb; }
.performance-song-search-results article > div:first-child { display: grid; min-width: 0; gap: 2px; }
.performance-song-search-results strong, .performance-song-search-results small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-song-search-results small { color: #68736d; font-size: .78rem; }
.performance-search-rating { color: #a16b15; font-size: .72rem; font-weight: 700; }
.performance-search-actions { display: flex; flex: none; gap: 5px; }
.performance-search-actions button, .performance-search-add { display: grid; place-items: center; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 7px; border-radius: 9px; }
.performance-search-actions .ui-icon, .performance-search-add .ui-icon { width: 19px; height: 19px; }
.performance-song-search-preview { display: grid; min-width: 0; gap: 12px; }
.performance-song-search-chart { max-width: 100%; max-height: 48dvh; overflow-x: hidden; overflow-y: auto; column-count: 1; column-width: auto; column-fill: auto; padding: 14px; border: 1px solid #d9dedb; border-radius: 12px; background: #fff; color: #18231c; font-size: clamp(1rem, 2.3vw, 1.35rem); }
.performance-song-search-chart .chord-trigger { background: transparent; border: 0; color: #286b47; }
.stage-dark .performance-search-rating { color: #e8c475; }
.stage-dark .performance-song-search-chart { border-color: #4a5b50; background: #152019; color: #f4f7f5; }
.stage-dark .performance-song-search-chart .section { color: #a9cbb4; }
.stage-dark .performance-song-search-chart .chord-trigger { background: transparent; border: 0; color: #9fe2b5; }
.stage-dark .performance-song-search header small, .stage-dark .performance-song-search-results small { color: #bbb; }
.stage-dark .performance-library-picker header small, .stage-dark .performance-library-songs small { color: #bbb; }
.stage-dark .performance-song-search-results article { border-color: #444; }
@media (max-width: 520px) {
  .performance-song-search-form { align-items: stretch; flex-direction: column; }
  .performance-song-search-form button { width: 100%; }
}
.local-recording { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.local-recording strong, .local-recording small { flex-basis: 100%; }
.local-recording-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.local-recording-choose { cursor: pointer; padding: 8px 12px; border: 1px solid currentColor; border-radius: 8px; }
.local-recording-toggle { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 10px; border-radius: 50%; }
.local-recording-toggle .ui-icon { width: 20px; height: 20px; }
.local-recording input[type=range] { min-width: 80px; flex: 1; }
.local-recording-floating { position: fixed; z-index: 20; bottom: 18px; left: 50%; transform: translateX(-50%); width: min(420px, 90vw); padding: 10px; border-radius: 12px; background: #25362b; color: white; box-shadow: 0 4px 20px #0007; }
.local-recording-floating p:empty { display: none; }
.local-recording-floating:has(~ .spotify-playbar-floating) { bottom: 72px; }

/* Keep the search context visible while reading either kind of preview. */
.online-search-context { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 9px 12px; border: 1px solid #bd8b42; border-radius: 12px; background: #fff3d5; color: #47310d; box-shadow: 0 4px 14px #4e340d18; }
.online-search-context #onlineBack { flex: none; min-height: 40px; padding: 8px 12px; border: 1px solid #99702e; border-radius: 9px; background: #fffaf0; color: #4a330f; font-weight: 700; }
.online-search-context-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.online-search-context-copy strong { font-size: .72rem; letter-spacing: .09em; }
.online-search-context-copy span { font-size: .78rem; }
.online-search-mode { flex: none; padding: 5px 9px; border-radius: 99px; background: #f5dfa9; color: #54380b; font-size: .72rem; font-weight: 700; }
.online-stage .online-detail-header { position: static; }
.online-stage-dark .online-search-context, body.app-dark:not(.performance) .online-chart-preview .online-search-context { background: #4b3518; border-color: #c9984d; color: #fff5db; }
.online-stage-dark .online-search-context #onlineBack, body.app-dark:not(.performance) .online-chart-preview .online-search-context #onlineBack { background: #694b22; border-color: #e4bd78; color: #fff; }
.online-stage-dark .online-search-mode, body.app-dark:not(.performance) .online-chart-preview .online-search-mode { background: #725126; color: #fff5db; }
@media (max-width: 600px) {
  .online-search-context { gap: 8px; padding: 7px 8px; }
  .online-search-context #onlineBack { padding: 7px 8px; font-size: .74rem; }
  .online-search-context-copy strong { font-size: .65rem; }
  .online-search-context-copy span { font-size: .7rem; }
  .online-search-mode { display: none; }
}

/* Phone workspace: keep navigation close to the thumb and songs easy to scan. */
@media (max-width: 600px) {
  .shell, .shell.sidebar-collapsed { display: block; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .shell .sidebar, .shell.sidebar-collapsed .sidebar {
    position: static; height: auto; padding: 10px 16px; border: 0;
    border-bottom: 1px solid var(--line);
  }
  .shell .brand, .shell.sidebar-collapsed .brand { justify-content: flex-start; margin: 0; font-size: 1.05rem; }
  .shell .brand-mark { width: 34px; height: 34px; }
  .shell .brand > span:last-child, .shell.sidebar-collapsed .brand > span:last-child { display: block; }
  .shell .brand small { display: none; }
  .shell .sidebar-toggle, .shell.sidebar-collapsed .sidebar-toggle,
  .shell .sidebar > .frontend-version { display: none; }
  .shell .sidebar-footer, .shell.sidebar-collapsed .sidebar-footer {
    position: absolute; right: 16px; top: 8px; display: block; padding: 0; margin: 0; border: 0;
  }
  .shell .profile-link, .shell.sidebar-collapsed .profile-link { width: 40px; min-height: 40px; padding: 4px; }
  .shell .profile-link > span:last-child { display: none; }
  .shell .main-nav, .shell.sidebar-collapsed .main-nav {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    display: flex; gap: 2px; padding: 5px 5px env(safe-area-inset-bottom);
    background: var(--paper); border-top: 1px solid var(--line);
  }
  .shell .nav-item, .shell.sidebar-collapsed .nav-item {
    flex: 1; width: auto; height: auto; min-width: 0; min-height: 54px;
    display: flex; flex-direction: column; justify-content: center; gap: 3px;
    padding: 5px 2px; border-radius: 9px; font-size: .62rem; line-height: 1.1;
  }
  .shell .nav-item > span, .shell.sidebar-collapsed .nav-item > span { display: block; text-align: center; }
  .shell .nav-item .ui-icon { width: 20px; height: 20px; }
  .shell .nav-item small { display: none; }
  .shell .topbar { min-height: 42px; padding: 5px 16px; }
  .shell .connection-area { gap: 6px; }
  .shell .topbar-status-actions { gap: 4px; }
  .shell .sync-button { min-height: 34px; padding: 5px 9px; font-size: .7rem; }
  .shell .theme-toggle { width: 34px; height: 34px; min-height: 34px; padding: 7px; }
  .shell .chart { padding: 20px 16px 36px; }
  .shell .chart > .page-heading, .shell .chart > .reader-heading { gap: 12px; margin-bottom: 16px; }
  .shell .page-heading h2, .shell .reader-heading h2 { font-size: 1.85rem; }
  .shell .page-heading p { font-size: .82rem; }
  .shell .library-heading-actions { width: 100%; }
  .shell .library-heading-actions .actions { display: flex; flex-wrap: nowrap; }
  .shell .library-heading-actions button { flex: 1; min-width: 0; padding: 9px 6px; font-size: .75rem; }
  .shell .library-modes { flex-direction: row; align-items: center; padding: 8px 0; margin-bottom: 10px; }
  .shell .library-mode-label small { display: none; }
  .shell .library-mode-label strong { font-size: .75rem; }
  .shell .library-modes > button { padding: 8px; font-size: .72rem; }
  .shell .library-toolbar { gap: 8px; margin: 8px 0 14px; }
  .shell .library-filters { gap: 6px; }
  .shell .library-scope select { min-width: 0; max-width: 130px; padding-inline: 8px; font-size: .76rem; }
  .shell .library-toolbar > span { font-size: .68rem; }
  .shell .song-grid { grid-template-columns: 1fr; gap: 8px; }
  .shell .song-card { display: flex; align-items: stretch; min-height: 76px; border-radius: 12px; }
  .shell .song-card:hover { transform: none; }
  .shell .song-art { flex: 0 0 72px; height: auto; min-height: 76px; }
  .shell .song-art .ui-icon { width: 32px; height: 32px; }
  .shell .song-art > span { position: absolute; bottom: 4px; right: 4px; padding: 1px 5px; font-size: .65rem; }
  .shell .song-card-content { flex: 1; min-width: 0; padding: 11px 12px; }
  .shell .song-card .tiny-label { display: none; }
  .shell .song-card h3 { margin: 0 0 3px; font-size: .92rem; }
  .shell .song-card p { margin: 0; font-size: .76rem; }
  .shell .song-card-footer { border: 0; padding: 3px 0 0; font-size: .65rem; }
  .shell .song-card-footer span:last-child { display: none; }
  .shell .song-grid:not(.song-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shell .song-grid:not(.song-list) .song-card { display: block; }
  .shell .song-grid:not(.song-list) .song-art { height: 100px; }
  .shell .song-grid:not(.song-list) .song-card-content { padding: 11px; }
}

/* On phones the list overlays the chart; on tablets it leaves more room for music. */
@media (min-width: 601px) and (max-width: 1050px) {
  .performance .stage { --stage-drawer-width: min(280px, 35vw); }
}
@media (max-width: 600px) {
  .performance .stage { --stage-drawer-width: min(320px, calc(100vw - 32px)); }
  .performance .stage.drawer-open .stage-content { margin-left: 0; }
  .performance .stage-drawer { z-index: 20; }
  .performance .stage-drawer-toggle { z-index: 21; }
}

.recording-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.recording-file-button { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-size: .9rem; font-weight: 600; cursor: pointer; }
.recording-file-button:focus-within { outline: 3px solid #89b39a; outline-offset: 3px; }
.recording-file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.recording-spotify-track { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: .88rem; }
.recording-spotify-track span { color: var(--muted); }
.stage-dark .recording-file-button { background: #000; color: #fff; border-color: #777; }

.stage-dark .stage-menu .notes-reminder-setting input { background: #777; }
.stage-dark .stage-menu .notes-reminder-setting input:checked { background: #328658; }

/* The catalog and performance modes share one consistent switch. */
.topbar-with-mode { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.topbar-with-mode .connection-area { justify-self: end; }
.mode-switch { display: flex; gap: 3px; padding: 3px; background: var(--line); border-radius: 10px; }
.mode-switch button { min-height: 38px; padding: 7px 12px; border-color: transparent; background: transparent; font-size: .78rem; white-space: nowrap; }
.mode-switch .mode-switch-current { background: var(--panel); border-color: var(--line); }
.mode-switch .ui-icon { width: 17px; height: 17px; }
body.app-dark:not(.performance) .mode-switch button { background: transparent; }
body.app-dark:not(.performance) .mode-switch .mode-switch-current { background: var(--panel); }
@media (max-width: 800px) {
  .topbar-with-mode { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar-with-mode .mode-switch { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .topbar-with-mode .connection-area { grid-column: 2; grid-row: 1; }
}

/* Give stage controls a full touch target. Put the toolbar on its own row on phones. */
.performance .stage-toolbar button, .performance .stage-navigation button, .performance .stage-drawer-toggle { width: 44px; height: 44px; min-height: 44px; }
@media (max-width: 740px) {
  .performance .stage-toolbar { top: 52px; right: 4px; gap: 2px; max-width: calc(100vw - 8px); overflow-x: auto; }
  .performance .stage-toolbar button { flex: 0 0 44px; }
  .performance .stage-content h1 { padding-top: 104px; }
}
.offline-readiness { margin: 10px 0; font-size: .9rem; }
.offline-readiness summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.offline-readiness ul { padding-left: 1.4em; }

.stage-next-reminder { position: fixed; z-index: 89; top: 58px; left: 50%; transform: translateX(-50%); display: grid; gap: 2px; justify-items: start; width: max-content; max-width: min(340px, calc(100vw - 32px)); min-height: 0; padding: 8px 14px; border: 1px solid #b9cabe; border-radius: 10px; background: #f6faf5; color: #20382f; box-shadow: 0 4px 16px #0002; text-align: left; }
.stage-next-reminder-label { font-size: .7rem; font-weight: 600; opacity: .75; }
.stage-next-reminder strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.stage-dark .stage-next-reminder { background: #18271f; color: #f3f7f2; border-color: #73917c; }

.conflict-dialog { width: min(960px, calc(100vw - 24px)); max-height: 90dvh; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); }
.conflict-dialog::backdrop { background: #0009; }
.conflict-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.conflict-columns pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
@media (max-width: 600px) { .conflict-columns { grid-template-columns: 1fr; } }

/* Keep chart format choices legible when the available reading width is narrow. */
@media (max-width: 600px) {
  .reader-display .format-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reader-display .format-control button { min-height: 44px; padding: 8px; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
  .reader-display .format-control button:nth-child(odd) { border-left: 0; }
  .reader-display .format-control button:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* Make chords easier to pick out while reading on stage. */
.performance .stage-content .segment-chord { font-weight: 700; }

.spotify-playback-error { position: fixed; z-index: 91; left: 50%; bottom: 88px; transform: translateX(-50%); width: max-content; max-width: min(420px, calc(100vw - 32px)); padding: 10px 14px; border: 1px solid #d69a91; border-radius: 10px; background: #fff4f2; color: #7a261e; box-shadow: 0 4px 16px #0003; font-size: .85rem; }
.spotify-playback-error:empty { display: none; }

.version-notice { width: min(420px, calc(100vw - 32px)); padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 80px #0b24183d; }
.version-notice::backdrop { background: #10291db3; }
.version-notice-brand { display: flex; align-items: center; gap: 12px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.version-notice-brand img { display: block; width: 42px; height: 42px; border-radius: 10px; }
.version-notice h2 { margin: 22px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 1.9rem; font-weight: 400; line-height: 1.15; letter-spacing: -.03em; }
.version-notice p { margin: 0 0 24px; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.version-notice-actions { display: flex; gap: 10px; }
.version-notice-actions button { flex: 1; }
body.app-dark:not(.performance) .version-notice { background: var(--panel); color: var(--ink); }
body.app-dark:not(.performance) .version-notice-brand { color: #a6d7b4; }

/* Give phone charts the full reading width even in single-column mode. */
@media (max-width: 600px) {
  .performance .stage-content.single-column .chart-body { width: 100%; }
}

.ensemble-controls { display: flex; justify-content: flex-end; margin: 20px 0; }
.ensemble-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.ensemble-card { min-width: 0; }
.ensemble-card-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.ensemble-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0; color: var(--muted); font-size: .9rem; }
.ensemble-invite { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ensemble-management { margin-top: 12px; }
.ensemble-management summary { cursor: pointer; color: var(--muted); }
.ensemble-management .small-list { margin-top: 12px; }
.ensemble-secondary-actions { margin-top: 12px; }
.ensemble-compact .ensemble-card { padding: 10px 16px; }
.ensemble-compact .ensemble-stats { margin: 6px 0; }
.ensemble-cards .ensemble-card-heading { align-items: flex-start; }
.ensemble-cards .ensemble-card-heading strong { flex: 1 1 100%; }
.app-notification .app-notification-message { margin: 22px 0 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.app-toast { position: fixed; z-index: 1000; top: max(16px, env(safe-area-inset-top)); left: 50%; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px; color: #fff; font-size: .875rem; font-weight: 700; text-align: center; transform: translateX(-50%); box-shadow: 0 4px 16px #0b241833; }
.app-toast-success { background: rgb(32 112 62 / .6); }
.app-toast-error { background: rgb(173 42 42 / .6); }
.setlists-editing .setlist-heading { align-items: flex-start; }
.setlists-editing .setlist-heading .setlist-offline-actions { margin-left: auto; }
.setlist-add .setlist-library { flex: 0 1 220px; }
@media (max-width: 640px) { .setlist-add .setlist-library { flex-basis: 100%; } }
