@font-face {
  font-family: "FF Neuwelt";
  src: url("/neuwelt-light.ttf") format("truetype");
  font-weight: 300 500;
  font-display: swap;
}
@font-face {
  font-family: "FF Neuwelt";
  src: url("/neuwelt-bold.ttf") format("truetype");
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: "FF Neuwelt";
  src: url("/neuwelt-black.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --page: #101010;
  --panel: #191919;
  --raised: #252525;
  --line: #383838;
  --muted: #b5b5b5;
  --soft: #e6e6e6;
  --accent: #0070b9;
  --gut: clamp(1rem, 3.9vw, 4rem);
  font-family: "FF Neuwelt", Montserrat, Inter, Helvetica, Arial, sans-serif;
  font-weight: 400;
  color: var(--soft);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button, select, input {
  border: 1px solid #454545;
  border-radius: 9px;
  background: var(--raised);
  padding: .58rem .88rem;
  min-height: 42px;
}
button, select, summary { cursor: pointer; }
button { font-weight: 700; transition: background-color .15s, border-color .15s; }
button:hover:enabled { background-color: #363636; }
button:disabled { cursor: default; }
button:disabled:not(.set-row) { opacity: .58; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid #88c4ff;
  outline-offset: 3px;
}
select {
  appearance: none;
  padding-right: 1.9rem;
  background-image: linear-gradient(45deg, transparent 50%, #ccc 50%), linear-gradient(135deg, #ccc 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
#appHeader { padding-top:env(safe-area-inset-top); background: #090909; border-bottom: 1px solid #2b2b2b; }
main, footer { max-width: 1500px; margin-inline: auto; padding-inline: var(--gut); }
.top { display: flex; gap: clamp(1.2rem,4vw,4rem); align-items: center; min-height: 46px; width:100%; }
.brand { display: flex; align-items: center; }
.brand img { width: 102px; height: auto; display: block; }
nav { display: flex; align-items: stretch; gap: 1.3rem; align-self: stretch; }
nav button {
  border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; padding: 0 .12rem; color: var(--muted); font-size: .95rem;
}
nav button.active { color: white; border-color: var(--soft); }
nav button:hover:enabled { background: transparent; color: white; }
#identity { margin-left: auto; display: flex; align-items: center; gap: .55rem; font-weight: 700; }
.avatar {
  height: 32px; width: 32px; display: grid; place-items: center; border-radius: 50%;
  background: #333; border: 1px solid #555; font-size: .875rem;
}
h1, h2, h3, p { margin: 0; }
h1 { color: #fff; font-weight: 900; letter-spacing: -.052em; line-height: .98; text-transform: uppercase; }
h1 { font-size: clamp(2.7rem,5.2vw,5rem); }
h2 { font-size: 1.4rem; line-height: 1.15; }
.eyebrow, .section-name {
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .115em;
}
body.is-live {
  height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
}
body.is-live footer, body.is-live #alert { display: none; }
body.is-live main { width: 100%; max-width: none; }
body.is-live main { min-height: 0; padding: 0; overflow: hidden; }
.top, .activity-row { padding-inline: max(.9rem, env(safe-area-inset-left)) max(.9rem, env(safe-area-inset-right)); }

#desk { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr); padding-bottom: var(--bar-height, 37px); }
.layout {
  display: grid; grid-template-columns: clamp(216px, 27%, 390px) minmax(0,1fr);
  min-height: 0; gap: 1px; background: var(--line);
  margin-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}
.rail { background: #161616; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); }
.music, .sheet { min-height: 0; min-width: 0; }
.list-heading { display: flex; align-items: center; gap: .6rem; }
.list-heading { padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.list-heading h2 { font-size: 1.15rem; }
#orderToggle { display: none; }
#setlist, #lyrics {
  min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
#setlist { padding: 0; }
.count { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.editor-layout { display: grid; grid-template-columns: minmax(210px,.72fr) minmax(0,1.9fr); gap: 1rem; align-items: start; }
.card, .access { background: var(--panel); border-radius: 14px; }
.title-row, .form-end, .add-row, .settings { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
summary { font-weight: 700; }
.band-dot, #macLed { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; }
.set-row {
  display: grid; grid-template-columns: auto minmax(0,1fr) 8px; align-items: center; gap: .55rem;
  width: 100%; min-height: 60px; border: 0; border-bottom: 1px solid #525252; border-radius: 0; background: transparent;
  padding: .66rem .7rem; text-align: left;
}
.set-row.chosen { background: #333; }
.set-row:hover:enabled { background: #292929; }
.set-row.chosen:hover:enabled { background: #393939; }
.num { color: #aaa; font-variant-numeric: tabular-nums; font-size: .85rem; font-weight: 400; }
.chosen .num, .chosen strong { color: #fff; }
.set-row strong, .set-row small { display: block; }
.set-row strong, .overview-row strong { font-size: 1.06rem; line-height: 1.15; }
.set-row small, .overview-row small { color: var(--muted); font-weight: 400; font-size: .81rem; margin-top: .15rem; }
.band-dot { background: #e6e6e6; }
.primary { color: white; background: var(--accent); border: 0; padding-inline: 1.35rem; border-radius: 99px; }
.primary:hover:enabled { background: #00639f; }
#followMe { flex: none; }
#followMe[data-state="leading"] { background: white; color: #111; }
#followMe[data-state="following"] { background: var(--connected); color: #071609; }
#followMe[data-state="lost"] { background: #ff363e; color: #111; opacity: 1; }
#followMe { transition: background-color .2s; }
.sheet { height: 100%; display: grid; grid-template-rows: minmax(0,1fr); border-radius: 0; overflow: hidden; }
.set-heading { margin: 0; padding: .4rem .85rem; color: #c5c5c5; background: #202020; font-size: .82rem; }
.set-row .num { min-width: 1.8rem; padding: .16rem; text-align: center; color: #eee; border: 1.5px solid #ddd; border-radius: 5px; }
.set-row strong { font-weight: 600; overflow-wrap: anywhere; }
.settings label, .size { display: inline-flex; align-items: center; gap: .2rem; }
.settings label { font-size: .76rem; color: #ccc; }
.settings select, .size button { min-height: 30px; font-size: .8rem; padding: .15rem .5rem; }
.settings select { padding-right: 1.45rem; }
.size button { background: transparent; border: 0; }
#lyrics { padding: 1.4rem clamp(1.2rem,2.5vw,2.6rem) .5rem; }
.stanza { margin-bottom: 1.5rem; }
.section-name { color: #bbb; margin: 0 0 .9rem; }
.phrase { color: #f4f4f4; line-height: 1.4; margin-bottom: .35em; overflow-wrap: anywhere; }
.chord { display: block; color: #ccc; font-size: .71em; font-weight: 700; line-height: 1.35; }
.activity-bar {
  position: fixed; inset: auto 0 0; z-index: 4; background: #131313; border-top: 1px solid #454545;
}
.activity-row { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; min-height: 36px; gap: .6rem; }
.status-group, .communications { display: flex; align-items: center; gap: clamp(.35rem,1vw,1rem); }
.communications { justify-self: end; }
.activity-row strong { font-size: .76rem; }
.activity-row small { display: block; color: #bdbdbd; font-size: .68rem; line-height: 1.1; }
.connection strong { display: inline-flex; align-items: center; gap: .45rem; }
#macLed { background: #ff363e; }
:root { --connected: #27ec67; --lyric-blue: #008cf9; }
#macLed.on { background: var(--connected); }
.freshness { font-size: .74rem; }
#syncNote:empty { display: none; }
#syncNote, #deskAlert { color: #f6d694; }
#deskAlert { position: absolute; bottom: 100%; right: 0; padding: .4rem .9rem; background: #242424; border: 1px solid var(--line); border-radius: .5rem .5rem 0 0; }


.check { position: relative; }
.check summary { display: flex; align-items: center; cursor: pointer; }
.check summary::-webkit-details-marker { display: none; }
.check-content {
  position: absolute; z-index: 5; right: 0; bottom: 100%; width: min(18rem,90vw);
  padding: .85rem; border: 1px solid #555; border-radius: 10px; background: #242424;
  box-shadow: 0 4px 24px #0008; max-height: 55dvh; overflow: auto;
}
.check-content label { display: flex; align-items: center; justify-content: space-between; }
.check-content button { margin: .65rem 0; width: 100%; }
.check-content small { margin-top: .35rem; }
.check p, .mast p, .access p, .empty p { color: var(--muted); line-height: 1.45; margin-block: .55rem 1rem; }
footer { padding-block: 1.4rem; color: var(--muted); font-size: .8rem; }
footer span { margin-inline: .4rem; }
.access, .empty { padding: clamp(1.25rem,3vw,3rem); }
.access { max-width: 510px; margin: 10vh auto; }
.access h1 { margin: .5rem 0; }
.access input, .editor input:not([type="checkbox"]) { display: block; width: 100%; margin: .4rem 0 1rem; }
.mast { display: flex; justify-content: space-between; align-items: center; gap: .9rem; padding-block: 2rem 1rem; }
.mast h1 { margin-top: .45rem; }
.mast > button { flex-shrink: 0; }
.notice, #alert { border: 1px solid #515151; background: #292929; color: white; padding: .85rem 1.1rem; border-radius: 10px; margin-bottom: .8rem; }
#alert { position: sticky; top: 5px; z-index: 3; margin-top: .6rem; }
.catalog-row { padding: 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .7rem; border-bottom: 1px solid var(--line); }
.catalog-row:last-child { border: 0; }
.catalog-row small { display: block; color: #ccc; margin-top: .2rem; }
.editor-menu, .editor { padding: 1.3rem; }
.editor h2, .editor-menu h2 { margin-bottom: .75rem; }
.editor-menu button { display: block; width: 100%; margin-top: .3rem; text-align: left; }
.editor-menu .active { background: #383838; border-color: #888; }
.edit-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.edit-row strong { flex: 1; min-width: 7rem; }
.set-break { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; }
.set-break input { min-height: auto; }
.edit-row button { padding-inline: .65rem; }
.form-end, .add-row { margin-top: 1rem; }
.add-row select { flex: 1; min-width: 0; }
#prompt {
  position: fixed; z-index: 20; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0;
  background: #101010; color: white; display: flex; flex-direction: column; gap: 1rem;
  align-items: center; justify-content: center;
}
#prompt strong { font-size: clamp(3rem,10vw,8rem); line-height: 1; font-weight: 900; text-transform: uppercase; }
#prompt span:nth-of-type(2) { font-size: 1.7rem; }
#prompt small { color: #ccc; }
/* Keep stage gestures local to the sheet and its controls. */
body, #setlist, #lyrics, button, summary, select { touch-action: manipulation; }
.size button { touch-action: none; }
#resetSize { display: inline-grid; place-items: center; }
#desk { position: relative; }
#followMe, #conduct, .check summary {
  min-height: 30px; padding: .25rem .65rem; font-size: .76rem; border-radius: 7px;
}
#conductPanel {
  position: absolute; z-index: 5; right: max(.55rem, env(safe-area-inset-right)); bottom: calc(100% + .3rem);
  width: min(21rem, calc(100% - 1.1rem)); max-height: 65dvh; overflow: auto;
  padding: .8rem; border: 1px solid #595959; border-radius: 12px;
  background: #222; box-shadow: 0 6px 24px #0009;
}
.conduct-head { display: flex; justify-content: space-between; align-items: center; }
.conduct-head h2 { font-size: 1.1rem; }
.conduct-head button { min-height: 30px; padding: .1rem .6rem; font-size: 1.1rem; }
#conductPanel fieldset { margin: .65rem 0 0; padding: 0; border: 0; }
#conductPanel legend { font-size: .8rem; color: #ddd; margin-bottom: .3rem; }
.cue-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .35rem; }
#cueTargets { display: flex; flex-wrap: wrap; }
.cue-grid button { padding: .4rem .6rem; font-size: .9rem; }
#cueTargets [aria-pressed=true] { background: #164568; border-color: #85cfff; }
#cueBanner {
  position: absolute; z-index: 3; top: .6rem; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 1rem); display: flex; align-items: center;
  gap: 1.1rem; border: 1px solid #ffd272; border-radius: 10px; padding: .6rem .8rem;
  background: #302718; box-shadow: 0 4px 18px #0008;
}
#cueBanner small, #cueBanner strong { display: block; }
#cueBanner small { color: #ffcf70; font-weight: 700; }
#cueBanner strong { color: white; font-size: clamp(1.3rem, 3vw, 2.6rem); }
#dismissCue { background: transparent; border: 0; font-size: 1.4rem; padding: .2rem .6rem; }

@media (max-width: 900px) {


  .activity-row { gap: .8rem; }
}
@media (max-width: 650px) {
  .top { gap: .7rem; }
  .brand img { width: 85px; }
  nav { gap: .65rem; }
  nav button { font-size: .84rem; }
  #identity { gap: .3rem; font-size: .88rem; }
  .avatar { display: none; }
  .layout { grid-template: auto minmax(0,1fr) / minmax(0,1fr); }
  .list-heading { min-height: 44px; padding: 0 .9rem; }
  #orderToggle { display: block; margin-left: auto; background: transparent; border: 0; min-height: 44px; }
  #setlist { max-height: min(25dvh, 180px); }
  .activity-bar { padding-bottom: env(safe-area-inset-bottom); }
  .activity-row { grid-template-columns: auto 1fr; gap: .2rem; padding: .15rem .4rem; }
  .status-group { grid-column: 1 / -1; justify-content: space-between; }
  .connection { display: flex; align-items: center; gap: .4rem; }
  .settings, .communications { gap: .08rem; }
  .settings label { font-size: .7rem; }
  .size button, #followMe, #conduct, .check summary { padding-inline: .32rem; }
  .check { position: static; }
  .check-content { right: .5rem; }
  .editor-layout { display: flex; flex-direction: column; gap: .65rem; }
  .editor-menu, .editor { width: 100%; }
  .mast { align-items: start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none; }
}

.imported-sheet { padding-bottom: 1rem; }
.chart-line, .arrangement-note {
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; min-height: .7em;
}
.chart-line:empty { min-height: .75em; }
.chart-line ruby { ruby-align: start; ruby-position: over; }
.chart-line rt { text-align: start; font-size: .72em; line-height: 1.1; }
.chart-chord, .chart-melody { font-weight: 700; color: #e6e6e6; }
.chart-cue, .arrangement-note { color: #f2ce91; font-weight: 700; }
.arrangement-note { font-size: .85em; margin-bottom: .6em; }
.arrangement-row { font-size: 1em; }
.source-bold { font-weight: 700; }
.imported-sheet hr { margin: .65em 0; border: 0; border-top: 1px solid #535353; }
.imported-sheet [data-ink="#247CBF"] { color: var(--lyric-blue); }
.imported-sheet [data-ink="#32C1F1"] { color: #87c3ef; }
.imported-sheet [data-ink="#008CF9"] { color: var(--lyric-blue); }
.imported-sheet [data-ink="#595959"] { color: #b8b8b8; }
.imported-sheet [data-ink="#D72629"] { color: #ff898a; }
.imported-sheet [data-ink="#F0BE03"] { color: #f0c84a; }

.chart-line ruby { ruby-overhang: none; }
.imported-sheet ruby rt .chart-chord, .chord { color: var(--lyric-blue); }
.imported-sheet ruby[data-blue-lyric="true"] rt .chart-chord { color: #fff; }
.imported-sheet .chart-cue { color: #f2ce91; }

.set-row.cue-row { background: #26231d; }
.set-row.cue-row strong, .running-cue small { color: #f2ce91; }
.set-row.cue-row.chosen { background: #403826; }
.running-cue { padding-block: 1rem; }
.running-cue h2 { margin: .35em 0; }

/* Member and library workspaces share the performance desk's type and fixed activity row. */
body.signed-in:not(.is-live) { padding-bottom: max(65px, env(safe-area-inset-bottom)); }
body:not(.is-live) .activity-bar .settings, body:not(.is-live) .activity-bar .communications { display:none; }
#barAction { grid-column:3; justify-self:end; min-height:30px; padding:.2rem .8rem; font-size:.76rem; }
.workspace-page { max-width:1180px; margin:auto; padding:clamp(2rem,5vh,4.2rem) 0 2rem; }
.workspace-page h1 { font-size:clamp(2.3rem,4.8vw,4.4rem); }
.workspace-page > h2 { margin:clamp(1.2rem,3.5vh,2.4rem) 0 .8rem; font-size:1.15rem; }
.workspace-page > p, .favorites > p { color:var(--muted); margin-block:1rem; }
.page-head, .actions, .field-pair { display:flex; gap:1rem; align-items:center; flex-wrap:wrap; }
.page-head { justify-content:space-between; }
.tile-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:clamp(.55rem,1.2vw,1rem); }
.tile { min-width:0; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-end;
  text-align:left; gap:.25rem; padding:clamp(.8rem,1.5vw,1.4rem); min-height:105px; border:1px solid #3a3b3d;
  background:linear-gradient(132deg,#25272a,#18191b); border-radius:14px; }
.tile strong { color:white; font-size:clamp(1.05rem,1.6vw,1.5rem); line-height:1.15; overflow-wrap:anywhere; }
.tile small, .browse-list small, .series-list small { color:#b6bcc2; font-size:.85rem; font-weight:400; }
.tile-symbol { margin-bottom:auto; font:1.65rem/1 system-ui,sans-serif; color:#95c5eb; padding-bottom:.6rem; }
.dashboard, .profiles { margin-top:2rem; }
.dashboard { grid-template-columns:repeat(2,minmax(0,1fr)); }
.dashboard .tile { min-height:clamp(115px,19vh,200px); }
.dashboard [data-workspace="hub"] { background:linear-gradient(90deg,#111c25ed,#12182089),url("/band.jpg") center 38%/cover; }
.profiles { grid-template-columns:repeat(5,minmax(0,1fr)); }
.profiles .tile { min-height:145px; }
.profiles .tile-symbol { width:2.6rem; height:2.6rem; padding:0; display:grid; place-items:center; font-weight:600; font-size:1.2rem; color:#ddd; background:#32373d; border-radius:50%; }
.favorites { display:flex; gap:.7rem; overflow-x:auto; padding:.2rem .15rem .65rem; overscroll-behavior-x:contain; }
.favorites .tile { flex:0 0 clamp(150px,18vw,223px); min-height:90px; }
.favorites .tile-symbol { color:#e7bd75; font-size:1rem; }
.favorites .tile strong { font-size:1.06rem; }
.stage-link { color:#a8e8bd; border-color:#3b5944; background:#1a2920; }
.code-form, .detail-form { max-width:620px; background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:1.2rem; margin:1rem 0; }
.code-form p { color:var(--muted); padding:.7rem 0; overflow-wrap:anywhere; }
.workspace-page label { display:block; margin:.6rem 0; }
.workspace-page label input, .workspace-page textarea { display:block; width:100%; margin-top:.35rem; }
.workspace-page textarea { background:var(--raised); border:1px solid #454545; border-radius:9px; color:inherit; font:inherit; padding:.65rem; }
.field-pair > label { flex:1; min-width:100px; }
.library-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:1rem; align-items:start; }
.browse-list, .series-list { max-height:62dvh; overflow:auto; overscroll-behavior:contain; }
.browse-list button, .series-list details { display:block; width:100%; text-align:left; background:var(--panel); border:0; border-bottom:1px solid var(--line); border-radius:0; padding:.7rem 1rem; }
.browse-list small { display:block; margin-top:.15rem; }
.series-list { margin-top:1rem; }
.series-list small { margin-left:1rem; }
.series-list summary { padding:.35rem 0; }
#seriesOrder button { margin:.1rem .5rem; }
#libraryCount { display:flex; align-items:center; gap:.6rem; }
.favorite-field { display:flex; align-items:center; gap:.5rem; }
.favorite-field input { min-height:22px; width:22px; }
@media(max-width:650px) {
  .tile-grid, .profiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .profiles .tile { min-height:96px; }
  .library-layout { grid-template-columns:1fr; }
  .browse-list { max-height:38dvh; }
  .top { gap:.5rem; } nav { gap:.45rem; }
  body:not(.is-live) .activity-row { display:flex; justify-content:space-between; padding-inline:.65rem; }
}

body.signed-in:not(.is-live) { height:100vh; height:100dvh; display:grid; grid-template-rows:auto minmax(0,1fr); overflow:hidden; padding-bottom:0; }
body.signed-in:not(.is-live) main { min-height:0; width:100%; overflow:auto; padding-bottom:calc(4rem + env(safe-area-inset-bottom)); }
body.signed-in:not(.is-live) #alert { position:fixed; top:auto; right:1rem; bottom:3.5rem; z-index:6; }

#chartEditor { margin:.8rem 0; }
#chartEditor select { width:100%; display:block; min-width:0; }
#seriesSong, #seriesPick { max-width:100%; }
.detail-form { min-width:0; }


/* The viewport is the app shell. Long content has a named, bounded pane. */
html, body { height:100%; overflow:hidden; overscroll-behavior:none; }
body { display:grid; grid-template-rows:auto minmax(0,1fr); height:100vh; height:100dvh; }
main, body.signed-in:not(.is-live) main { width:100%; min-height:0; min-width:0; overflow:hidden; }
body.signed-in:not(.is-live) main { padding-bottom:var(--bar-height, 40px); }
.workspace-page { width:100%; height:100%; min-height:0; margin-inline:auto; display:flex; flex-direction:column;
  padding-block:clamp(.7rem,3vh,2rem) .65rem; overflow:hidden; }
.workspace-page > h1, .workspace-page > .page-head, .workspace-page > label { flex:none; }
#profiles, #workspaces, #browseTiles, #codeForm, #seriesForm, .smart-groups, #catalog, #gigList, #editItems,
#songRows, #songForm, #seriesList { min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; }
#profiles, #workspaces, #browseTiles { align-content:start; }
#favorites { flex:none; max-height:25vh; }
#smartGroups { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:.6rem; align-content:start; }
#smartGroups .tile { min-height:66px; }
.library-layout { flex:1; min-height:0; align-items:stretch; }
#songRows, #songForm, #seriesList { max-height:none; margin-block:0; }
#seriesForm { max-height:45%; flex:none; }
#seriesList article { border-bottom:1px solid var(--line); padding:.6rem .85rem; }
#seriesList ol { display:flex; flex-wrap:wrap; gap:.2rem 1.8rem; padding-left:1.35rem; margin:.4rem 0; color:#c8c8c8; }
#seriesList h2 { position:sticky; top:0; padding:.45rem .8rem; background:#252525; color:#f3cc8e; font-size:1rem; }
#seriesList h3 { font-size:1.06rem; }
#studio, #downloads { height:100%; display:flex; flex-direction:column; overflow:hidden; min-height:0; padding-bottom:.4rem; }
#studio .mast, #downloads .mast { padding:.55rem 0; flex:none; align-items:center; flex-direction:row; }
#studio .mast h1, #downloads .mast h1 { font-size:clamp(1.4rem,3.3vw,2.7rem); margin:0; }
.editor-layout { flex:1; display:grid; min-height:0; align-items:stretch; gap:.65rem; }
.editor-menu, .editor { min-height:0; min-width:0; padding:clamp(.4rem,1.2vw,.9rem); }
.editor-menu { display:flex; flex-direction:column; }
#gigList, #editItems { flex:1; }
#editForm { display:flex; flex-direction:column; position:relative; }
#editForm > label { flex:none; }
#editForm .title-row h2, .editor-menu h2 { font-size:1.1rem; margin:0 0 .35rem; }
.editor input#editTitle { margin:.15rem 0; min-height:34px; padding-block:.25rem; }
.editor-actions { flex:none; display:flex; align-items:center; justify-content:space-between; gap:.4rem; border-top:1px solid var(--line); padding-top:.3rem; }
.editor-actions .form-end { margin:0; display:flex; gap:.35rem; }
.order-divider { height:0; border:0; border-top:2px solid #888; margin:.55rem .7rem; }
.divider-edit strong { display:flex; align-items:center; gap:.45rem; font-size:.85rem; color:var(--muted); }
.divider-edit strong::after { content:""; flex:1; border-top:1px solid #999; }
.edit-row textarea { flex:1 0 100%; color:inherit; background:#222; border:1px solid #555; border-radius:6px; padding:.5rem; font:inherit; }
.announcement-notes { white-space:pre-wrap; overflow-wrap:anywhere; margin-top:.75em; line-height:1.45; }
#returnBand { margin-left:auto; min-height:30px; padding:.2rem .45rem; font-size:.76rem; }
@media(max-width:650px) {
  .editor-layout { grid-template: minmax(74px,.55fr) minmax(0,2fr) / minmax(0,1fr); }
  #studio .mast .actions { gap:.25rem; }
  #studio .mast button, .editor-actions button { padding:.35rem .5rem; font-size:.85rem; }
  #studio .mast h1 { font-size:1.25rem; }
  .library-layout { display:flex; flex-direction:column; min-height:0; }
  #songRows { flex:1; }
  #songForm { flex:1.4; max-width:none; }
  .list-heading h2 { min-width:0; overflow-wrap:anywhere; }
}
@media(max-height:540px) {
  .workspace-page h1 { font-size:1.5rem; }
  .workspace-page > h2 { margin:.45rem 0; }
  .workspace-page { padding-block:.35rem; }
  .tile { min-height:70px; }
  .favorites .tile { min-height:56px; }
  .favorites .tile-symbol { display:none; }
  #studio .mast button, .editor-actions button { min-height:30px; }
}
.edit-row input[aria-label^="Announcement title"] { flex:1; min-width:8rem; width:auto!important; margin:0!important; }
.running-cue p.announcement-notes { font-size:1em; color:var(--soft); }

/* Section navigation shares occurrence IDs and numbering with the overview. */
.set-heading { width:100%; display:flex; align-items:center; gap:.65rem; min-height:38px; border:0;
  border-bottom:1px solid var(--line); border-radius:0; padding:.3rem .7rem; text-align:left; color:#eee; }
.set-heading[aria-expanded="true"] { background:#2b2b2b; }
.section-badge { flex:none; display:inline-grid; place-items:center; min-width:2.1em; height:1.55em;
  border:1px solid #848484; border-radius:4px; color:#ddd; font-size:.78rem; font-weight:600; }
.disclosure { margin-left:auto; font-size:1.35rem; line-height:1; color:#bbb; }
.set-overview { font-size:calc(1rem * var(--reader-scale, 1)); margin:0 0 1.2em; }
.set-overview h2 { font-size:1.1em; }
.set-overview h2, .running-cue .announcement-title { margin:0 0 .45em; color:#f2ce91; }
.running-cue .announcement-title { font-size:1.08em; }
.overview-row { display:flex; width:100%; text-align:left; align-items:center; gap:.85em; border:0; border-radius:0;
  border-bottom:1px solid var(--line); background:transparent; padding:.36em 0; font-size:inherit; }
.overview-row strong, .overview-row small { display:block; }
.overview-row strong { font-size:1.06em; }
.overview-row small { font-size:.81em; }
.overview-row .num { font-size:.85em; }
.set-overview .announcement-notes { font-size:1.375em; }

.overview-row:disabled { opacity:1!important; }
.set-overview .announcement-notes { margin:.5em 0 1.2em; }
.set-edit { flex-wrap:nowrap; padding:.25rem 0; }
.edit-row.set-edit input { flex:1; min-width:0; width:auto; margin:0; }
.page-actions, .editor-switches { display:flex; align-items:center; gap:.55rem; }
.page-actions { grid-column:3; grid-row:1; justify-self:end; }
.editor-switches { grid-column:2; grid-row:1; justify-self:center; }
.editor-switches label { display:inline-flex; align-items:center; gap:.3rem; min-height:32px; font-size:.8rem; }
.editor-switches input { width:16px; height:16px; min-height:0; margin:0; accent-color:#eee; }
.page-actions button { min-height:30px; font-size:.76rem; padding:.2rem .6rem; }
#addSeparator { margin-top:.4rem; }
@media(max-width:650px) {
  body.is-editor .activity-row { display:grid; grid-template-columns:1fr auto; padding:.2rem .4rem; }
  .is-editor .editor-switches, .is-editor .page-actions { grid-row:2; }
  .is-editor .editor-switches { grid-column:1; justify-self:start; }
  .is-editor .page-actions { grid-column:2; }
  .is-editor .activity-row { gap:.12rem; }
}

.implicit-set { display:flex; align-items:center; gap:.65rem; padding:.35rem 0; color:#ccc; font-size:.85rem; }

.live-set > .set-heading { position:sticky; top:0; z-index:1; }
#lyrics { touch-action:pan-y pinch-zoom; }
#lyrics:has(.stanza), #lyrics:has(.chart-line) { -webkit-user-select:none; user-select:none; }
#editItems .edit-row { padding:.1rem 0; gap:.3rem; min-height:36px; }
#editItems .edit-row strong { font-size:.88rem; min-width:0; overflow-wrap:anywhere; line-height:1.2; }
#editItems .edit-row > button { min-height:32px; padding:.13rem .44rem; }
#editItems .set-break { font-size:.72rem; white-space:nowrap; }
#editItems .drag-handle { cursor:grab; touch-action:none; user-select:none; color:#bbb; font-size:1.2rem; background:none; border:0; }
#editItems .drag-source { opacity:.55; }
#editItems .drop-before { box-shadow:inset 0 2px #70bafa; }
#editItems .drop-after { box-shadow:inset 0 -2px #70bafa; }
#openComponents { margin-left:auto; font-weight:700; }
#componentPicker { color:#f5f5f5; background:#191919; border:1px solid #565656; border-radius:14px;
  padding:0; width:min(860px,96vw); max-width:96vw; height:min(660px,86dvh); max-height:94dvh; overflow:hidden; }
#componentPicker[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
#componentPicker::backdrop { background:#000b; }
.picker-head,.picker-bottom { position:static; display:flex; align-items:center; gap:.6rem; padding:.65rem .9rem; }
.picker-head { border-bottom:1px solid var(--line); justify-content:space-between; background:#1f1f1f; }
.picker-head h2 { font-size:1.25rem; }
#cancelPicker { font-size:1.25rem; background:none; border:0; min-width:38px; }
.picker-body { min-height:0; display:grid; grid-template-columns:minmax(0,1fr) minmax(145px,30%); }
.picker-source,.picker-side { min-height:0; min-width:0; }
.picker-source { display:flex; flex-direction:column; }
#componentList,#mcComposer,#structurePicker,#componentQueue { overflow:auto; overscroll-behavior:contain; min-height:0; }
#componentList { flex:1; }
#componentList h3,.picker-side h3 { margin:0; padding:.55rem .7rem; font-size:.82rem; color:#e9ca91; }
.component-choice { width:100%; display:flex; align-items:center; justify-content:space-between; gap:.4rem; text-align:left;
  padding:.5rem .8rem; background:none; border:0; border-bottom:1px solid #393939; border-radius:0; min-height:44px; }
.component-choice strong,.component-choice small { display:block; }
.component-choice small { font-size:.78rem; margin-top:.12rem; font-weight:400; color:#b6b6b6; }
.component-choice > span:last-child { color:#bbb; }
#componentList details > summary { padding:.7rem; cursor:pointer; background:#232323; border-bottom:1px solid #444; }
#componentList details .component-choice { padding-left:1.1rem; }
.picker-side { display:flex; flex-direction:column; border-left:1px solid #454545; background:#202020; overflow:auto; }
#componentTabs { display:grid; gap:.15rem; padding:.4rem; flex:none; }
#componentTabs button { border:0; border-radius:5px; padding:.4rem .6rem; text-align:left; color:#ccc; min-height:35px; }
#componentTabs button[aria-pressed=true] { background:#eee; color:#161616; }
.picker-side h3 { border-top:1px solid #444; }
#componentQueue { margin:0; padding:0 .35rem .5rem 1.75rem; font-size:.82rem; flex:1 0 50px; }
#componentQueue li { padding:.2rem 0; overflow-wrap:anywhere; }
#componentQueue button { margin-left:.2rem; border:0; background:transparent; color:#ccc; min-height:28px; padding:.1rem .35rem; }
.picker-bottom { border-top:1px solid #444; flex-wrap:wrap; }
.picker-bottom label { flex:1; min-width:0; font-size:.78rem; color:#ccc; }
#insertAt { display:block; width:100%; min-height:32px; }
#pickerError { color:#ffbca8; font-size:.8rem; }
#pickerError:empty { display:none; }
#mcComposer,#structurePicker { padding:.8rem; }
#mcComposer label,#structurePicker label { display:block; margin-bottom:.6rem; font-size:.85rem; }
#mcComposer input,#mcComposer select,#mcComposer textarea,#structurePicker input { display:block; width:100%; margin-top:.2rem; }
#mcNotes { resize:vertical; font:inherit; color:inherit; border:1px solid #666; background:#202020; border-radius:5px; padding:.55rem; }
#noteTools { display:flex; gap:.25rem; margin:.6rem 0; }
#noteTools button,#structurePicker button { min-height:32px; padding:.25rem .55rem; }
@media(max-width:650px) {
  #componentPicker { width:98vw; max-width:98vw; height:90dvh; }
  .picker-body { grid-template-columns:minmax(0,1fr) minmax(108px,30%); }
  .picker-head,.picker-bottom { padding:.45rem; }
  .component-choice { padding:.35rem .5rem; }
  #componentTabs button { font-size:.8rem; padding:.3rem; }
  #editItems .set-break { font-size:.65rem; }
  #editItems .edit-row { gap:.15rem; }
  #editItems .edit-row > button { padding:.1rem .35rem; }
}

.setlist-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(8.5rem,.5fr); gap:.55rem; flex:none; }
.setlist-fields label { min-width:0; font-size:.83rem; }
.editor .setlist-fields input#editDate { min-width:0; margin:.15rem 0; min-height:34px; padding:.25rem .45rem; }
.activity-bar { padding-bottom:env(safe-area-inset-bottom, 0px); }
@media (any-pointer:coarse), (display-mode:standalone) {
  .activity-bar { padding-bottom:max(12px, env(safe-area-inset-bottom, 0px)); }
}

#nav { min-width:0; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none; }
#nav::-webkit-scrollbar { display:none; }
#nav button, .top > .brand, #identity { flex:none; }
.settings-pane { min-height:0; overflow:auto; overscroll-behavior:contain; }
.settings-pane h2 { margin:1rem 0 .65rem; }
.swatches { list-style:none; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));
  gap:1px; margin:0; padding:0; background:var(--line); }
.swatches li { background:var(--panel); display:flex; align-items:center; gap:.65rem; padding:.65rem .8rem; }
.swatches i { width:1.25rem; height:1.25rem; border-radius:4px; flex:none; }
.swatches strong,.swatches small { display:block; }
.swatches small { margin-top:.15rem; font-size:.8rem; color:var(--muted); }
