:root {
  --bg: #f3f0e8;
  --panel: #fbfaf6;
  --ink: #20242a;
  --muted: #6a6f76;
  --line: #d9d3c5;
  --accent: #0f5c5c;
  --accent-ink: #ffffff;
  --desk: #cfcabd;
  --danger: #a32020;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", Menlo, monospace;
  --ui: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.4 var(--ui);
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button, select, input, textarea { font: inherit; color: inherit; }
button, select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover, select:hover { border-color: #a9a290; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { filter: brightness(1.12); }
button.danger { color: var(--danger); background: transparent; border-color: transparent; padding: 3px 6px; }
button.danger:hover { border-color: var(--danger); }
input[type=text], input[type=number], input[type=search] {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
}
kbd, code {
  font: 12px var(--mono);
  background: #ece8dc;
  border-radius: 4px;
  padding: 1px 4px;
}

/* ---------- barra superior ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: .01em; margin-right: auto; white-space: nowrap; }
.brand-mark { color: var(--accent); }
.actions { display: flex; gap: 6px; overflow-x: auto; }
.tabs { display: none; }

/* ---------- três áreas ---------- */
.app {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(340px, 1fr) minmax(380px, 1.15fr);
}
.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.list { background: var(--panel); border-right: 1px solid var(--line); padding: 10px; gap: 8px; }
#songList { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#songList button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 4px;
  background: transparent;
  padding: 6px 8px;
  white-space: normal;
}
#songList button:hover { background: #efebe0; }
#songList button[aria-current=true] { background: #e6efec; border-left-color: var(--accent); }
#songList .t { display: block; font-weight: 600; }
#songList .a { display: block; color: var(--muted); font-size: 12px; }
#songList .empty { color: var(--muted); padding: 8px; }

.editor { padding: 10px 12px; gap: 8px; border-right: 1px solid var(--line); }
.meta { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px 8px; }
.meta label, .pv-tools label, .more-grid label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.meta .f-title, .meta .f-artist { grid-column: span 3; }
.meta label:nth-child(n+3) { grid-column: span 2; }
.meta label.f-yt { grid-column: 1 / -1; }

.toolbar { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.help { font-size: 13px; color: #3c4046; }
.help summary, .more summary { cursor: pointer; color: var(--accent); font-weight: 600; width: fit-content; }
.help ul { margin: 6px 0 0; padding-left: 18px; }
.help li { margin-bottom: 4px; }

#text {
  flex: 1;
  min-height: 160px;
  resize: none;
  font: 14px/1.45 var(--mono);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  tab-size: 4;
}
.editor-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }

.preview { background: var(--desk); }
.pv-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.pv-tools > label { flex-direction: row; align-items: center; gap: 6px; }
.stepper output { min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; }
.more { position: relative; align-self: center; }
.more-grid {
  position: absolute;
  z-index: 5;
  top: 26px;
  left: 0;
  width: 250px;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
}
.palette { flex: none; background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.pal-groups { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pal-group { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pal-title { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pal-empty { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-weight: 700; padding: 4px 9px; min-width: 38px; cursor: grab; border-color: #b9b29f; }
.chip:active { cursor: grabbing; }
.pal-group.borrowed .chip { border-style: dashed; background: #f4efe2; }
.pal-group.dominants .chip { background: #eaf1ef; }
.pal-group.others .chip { font-weight: 600; background: transparent; }
.pal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pal-foot #palNew { width: 180px; }
.pal-foot .chk { display: flex; flex-direction: row; align-items: center; gap: 4px; font-size: 13px; color: var(--ink); }
#palHint { color: var(--muted); font-size: 12px; }
button:disabled { opacity: .45; cursor: default; }

/* alvos na folha */
#pvScroll .c { cursor: cell; border-radius: 2px; }
#pvScroll .ch[data-cl], #pvScroll .ch[data-cl] * { cursor: grab; }
#pvScroll .c:hover { background: #e6efec; }
#pvScroll .c.sel { background: #bfe0d8; box-shadow: 0 0 0 1px var(--accent); }
#pvScroll .c.over { background: #ffd978; box-shadow: 0 0 0 1px #b88a00; }
#pvScroll .ch.sel { background: #bfe0d8; box-shadow: 0 0 0 1px var(--accent); border-radius: 2px; }

#pageInfo { margin-left: auto; align-self: center; color: var(--muted); font-size: 12px; }
.only-mob { display: none; }

.pv-scroll { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
#pages { margin: 0 auto; width: fit-content; }
#flow { display: none; }

/* ---------- a folha ---------- */
.page {
  position: relative;
  width: 210mm;
  height: 297mm;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .28);
  margin-bottom: 14px;
  overflow: hidden;
}
.page-num { position: absolute; left: 0; right: 0; bottom: 5mm; text-align: center; font-size: 8pt; color: #555; }
.cols { display: flex; gap: 8mm; }
.col { flex: none; }

.cifra { color: #000; line-height: 1.22; font-size: var(--fs, 11pt); font-family: var(--cf, Arial, Helvetica, sans-serif); }
.cifra .hd { padding-bottom: 1em; }
.cifra .hd h1 { margin: 0; font-size: 1.65em; line-height: 1.15; }
.cifra .hd .artist { font-size: 1.05em; color: #333; }
.cifra .hd .info { font-size: .9em; color: #333; margin-top: .25em; }
.cifra .hd .info b { color: #000; }
.cifra .block { padding-bottom: 1.22em; break-inside: avoid; }
.cifra .block.part { padding-bottom: 0; }
.cifra .sec-label { font-weight: 700; font-size: .82em; letter-spacing: .07em; text-transform: uppercase; padding-bottom: .2em; }
.cifra .sec-label .rep { font-weight: 400; text-transform: none; letter-spacing: 0; }
.cifra .chorus > .body { border-left: 1.5pt solid #888; padding-left: .7em; }
.cifra .line { min-height: 1.22em; }
.cifra .pair { display: flex; flex-wrap: wrap; align-items: flex-end; }
.cifra .word { display: inline-flex; align-items: flex-end; }
.cifra .seg { display: inline-flex; flex-direction: column; }
.cifra .ch, .cifra .chordline, .cifra .notes {
  font-weight: 700;
  color: var(--chord, #000);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.cifra .ch { white-space: pre; padding-right: .45em; min-height: 1.22em; }
.cifra .tx { white-space: pre; }
.cifra .chordline { white-space: pre-wrap; }
.cifra .lyric { white-space: pre-wrap; }
.cifra .notes { white-space: pre-wrap; font-style: italic; font-weight: 600; }
.cifra .memo { text-align: right; font-size: .85em; color: #555; white-space: pre-wrap; }
.cifra .line-row { display: flex; align-items: flex-start; gap: 1em; }
.cifra .line-row > .line { flex: 1; min-width: 0; }
.cifra .memo.side { flex: none; max-width: 45%; }

.cifra .notes::before { content: "♪ "; font-style: normal; }

/* ---------- modo palco ---------- */
#stage {
  --st-bg: #ffffff; --st-ink: #17191c; --st-muted: #868c95; --st-rule: #e2e3e6; --st-bar: #ffffff; --st-btn: #f1f2f4;
  /* top/left/right/bottom em vez de inset: iPhones com iOS mais antigo não entendem inset */
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; z-index: 30;
  display: flex; flex-direction: column;
  background: var(--st-bg); color: var(--st-ink);
}
#stage[hidden] { display: none; }
#stage[data-theme=dark] {
  --st-bg: #0f1113; --st-ink: #eceef0; --st-muted: #8e959e; --st-rule: #2a2e33; --st-bar: #15181b; --st-btn: #23272c;
}
#stage button { background: var(--st-btn); color: var(--st-ink); border-color: var(--st-rule); }
.st-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); background: var(--st-bar); }
#stage .st-icon { flex: none; border: 0; background: transparent; font-size: 24px; line-height: 1; padding: 6px 12px; -webkit-appearance: none; appearance: none; }
#stage .st-opts { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 36px; padding: 0; border: 1px solid var(--st-rule); border-radius: 8px; background: var(--st-btn); color: var(--st-ink); -webkit-appearance: none; appearance: none; }
#stage .st-opts svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.st-key { flex: none; }
#stage .st-key.shifted { border-color: #d0822d; color: #d0822d; font-weight: 700; }
.st-note small { color: var(--st-muted); font-size: 12px; flex: 1; }
#stage .st-note button { min-width: 0; font-size: 13px; padding: 6px 10px; }
.st-title { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-key { border: 1px solid var(--st-rule); border-radius: 6px; padding: 3px 9px; font-weight: 600; }
.st-menu {
  position: absolute; z-index: 2; top: 50px; right: 10px; padding: 12px; display: grid; gap: 10px;
  background: var(--st-bar); border: 1px solid var(--st-rule); border-radius: 10px; box-shadow: 0 8px 26px rgba(0, 0, 0, .3);
}
.st-menu[hidden] { display: none; }
.st-row { display: flex; align-items: center; gap: 6px; }
.st-row span { width: 52px; color: var(--st-muted); font-size: 13px; }
.st-row button { min-width: 62px; padding: 8px 10px; }
#stage .st-row button[aria-pressed=true] { border-color: var(--st-ink); font-weight: 700; }
.st-nav {
  flex: none; display: flex; gap: 10px; padding: 6px 14px 10px; overflow-x: auto;
  background: var(--st-bar); border-bottom: 1px solid var(--st-rule); scrollbar-width: none;
}
.st-nav[hidden] { display: none; }
.st-nav::-webkit-scrollbar { display: none; }
#stage .st-chip, .st-badge {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--k); border-radius: 50%; background: transparent; color: var(--st-ink); font-weight: 600; padding: 0;
}
#stage .st-chip { width: 40px; height: 40px; font-size: 14px; position: relative; }
#stage .st-chip.on { background: var(--st-btn); background: color-mix(in srgb, var(--k) 22%, transparent); }
#stage .st-chip.on::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -9px; height: 3px; border-radius: 2px; background: var(--k); }
.k-intro { --k: #8a8f98; } .k-verse { --k: #2f80d6; } .k-chorus { --k: #d64545; } .k-bridge { --k: #d0822d; } .k-other { --k: #3f9f55; }
/* position: relative faz o offsetTop das seções contar a partir desta área, e não do topo da tela */
.st-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px 60vh; color: var(--st-ink); --chord: var(--c-auto); line-height: 1.3; scroll-behavior: auto; }
#stage { --c-auto: var(--st-ink); --c-ink: var(--st-ink); --c-blue: #1d4ed8; --c-green: #15803d; --c-red: #b91c1c; --c-orange: #c2410c; --c-purple: #7e22ce; }
#stage[data-theme=dark] { --c-auto: #ffd166; --c-blue: #7db3ff; --c-green: #6fd28a; --c-red: #ff8a80; --c-orange: #ffab6b; --c-purple: #cf9bff; }
#stage[data-chord=ink] .st-body { --chord: var(--c-ink); }
#stage[data-chord=blue] .st-body { --chord: var(--c-blue); }
#stage[data-chord=green] .st-body { --chord: var(--c-green); }
#stage[data-chord=red] .st-body { --chord: var(--c-red); }
#stage[data-chord=orange] .st-body { --chord: var(--c-orange); }
#stage[data-chord=purple] .st-body { --chord: var(--c-purple); }
#stage .st-row .st-sw { min-width: 0; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--st-rule); background: var(--sw); }
#stage .st-row .st-sw[aria-pressed=true] { border-color: var(--st-bar); box-shadow: 0 0 0 2px var(--st-ink); }
.st-sw[data-c=auto] { --sw: var(--c-auto); } .st-sw[data-c=ink] { --sw: var(--c-ink); } .st-sw[data-c=blue] { --sw: var(--c-blue); }
.st-sw[data-c=green] { --sw: var(--c-green); } .st-sw[data-c=red] { --sw: var(--c-red); } .st-sw[data-c=orange] { --sw: var(--c-orange); } .st-sw[data-c=purple] { --sw: var(--c-purple); }
.st-body > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.st-info { color: var(--st-muted); font-size: .8em; padding-bottom: .6em; }
.st-sec { padding-bottom: .3em; }
/* faixa da seção no modo palco, de ponta a ponta */
.st-head { display: flex; align-items: center; justify-content: center; margin: 0 -18px .7em; padding: .45em 1em; background: #0F3B5F; }
.st-head .st-badge, .st-head .st-rule { display: none; }
.st-label { font-size: .9em; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #73D0FF; text-align: center; }
.st-rule { flex: 1; height: 1px; background: var(--st-rule); }
.st-para { padding-bottom: 1.3em; }
/* anotações no modo palco: faixa com barra à esquerda, logo abaixo da seção */
.st-body .memo .as-typed { text-transform: none; letter-spacing: .02em; }
.st-body .memo-row { display: flex; flex-wrap: wrap; gap: .45em; margin: .1em 0 .55em; }
.st-body .memo { display: inline-block; text-align: left; margin: 0; padding: .4em .85em .4em .75em; background: #123D3B; color: #68E0D2; border-left: 4px solid #24C7A6; border-radius: 6px; font-size: .7em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.3; }
.st-body .ch { padding-top: .25em; }
body.stage-on > .topbar, body.stage-on > .tabs, body.stage-on > .app { visibility: hidden; }

/* ---------- grupo ---------- */
.group-btn.is-on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.group-btn.is-off { border-color: #b88a00; color: #8a6400; }
.dlg { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; width: min(440px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.dlg::backdrop { background: rgba(20, 22, 26, .45); }
.dlg h2 { margin: 0 0 8px; font-size: 18px; }
.dlg p { margin: 0 0 12px; color: #3c4046; }
.dlg-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.dlg-field input { font-size: 16px; }
.dlg-msg { min-height: 1.4em; margin-top: 8px !important; font-size: 13px; color: var(--danger) !important; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dlg-actions .danger { margin-right: auto; }
.dlg-actions [hidden] { display: none; }

#measure { position: absolute; left: -99999px; top: 0; visibility: hidden; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #20242a;
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  max-width: min(520px, 90vw);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 20;
}
#toast.on { opacity: 1; }

/* ---------- celular e tablet ---------- */
@media (max-width: 899px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px; }
  .actions { width: 100%; padding-bottom: 2px; }
  .tabs { display: flex; flex: none; background: var(--panel); border-bottom: 1px solid var(--line); }
  .tabs button { flex: 1; border: 0; border-radius: 0; border-bottom: 3px solid transparent; background: transparent; padding: 9px 4px; }
  body[data-tab=list] .tabs [data-tab=list],
  body[data-tab=edit] .tabs [data-tab=edit],
  body[data-tab=view] .tabs [data-tab=view] { border-bottom-color: var(--accent); font-weight: 700; }
  .app { display: block; }
  .pane { display: none; height: 100%; border: 0; }
  body[data-tab=list] .list, body[data-tab=edit] .editor, body[data-tab=view] .preview { display: flex; }
  .meta { grid-template-columns: repeat(3, 1fr); }
  .meta .f-title, .meta .f-artist { grid-column: span 3; }
  .meta label:nth-child(n+3) { grid-column: span 1; }
  .preview { background: #fff; }
  .pv-scroll { padding: 14px 16px 40px; }
  #pages { display: none; }
  #flow { display: block; max-width: 720px; margin: 0 auto; }
  .only-desk, .pv-tools > label { display: none; }
  .only-mob { display: flex; }
  .more-grid { left: auto; right: 0; }
  /* no celular, artista, tom, capotraste, andamento, mover acorde, transposição e ajuda ficam atrás do botão "Mais" */
  body:not(.tools-open) .extra-tool { display: none; }
  #btnTools[aria-expanded=true] { border-color: var(--accent); color: var(--accent); }
  .pal-groups { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .pal-group { flex: none; }
  .pal-group .chips { flex-wrap: nowrap; }
  #palHint { display: none; }
  button, select { padding: 7px 11px; }
}

/* ---------- impressão ---------- */
@page { size: A4; margin: 0; }
@media print {
  html, body { height: auto; overflow: visible; background: #fff; display: block; }
  .topbar, .tabs, .list, .editor, .pv-tools, .palette, #flow, #toast, #measure, #stage { display: none !important; }
  body.stage-on > .app { visibility: visible; }
  #pvScroll .c, #pvScroll .ch { background: none !important; box-shadow: none !important; }
  .app, .pane.preview, .pv-scroll { display: block !important; height: auto; overflow: visible; padding: 0; margin: 0; background: #fff; }
  #pages { display: block !important; zoom: 1 !important; width: auto; margin: 0; }
  .page { box-shadow: none; margin: 0; break-after: page; height: 296.6mm; }
  .page:last-child { break-after: auto; }
}

/* lista vazia */
#songList .empty p { margin: 4px 0 10px; }
#songList .empty button { color: var(--ink); display: block; width: 100%; margin-bottom: 6px; text-align: center; border: 1px solid var(--line); background: #fff; padding: 8px; }
#songList .empty button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- repertórios ---------- */
.lseg { display: flex; background: #ebe7dc; border-radius: 8px; padding: 3px; gap: 3px; flex: none; }
.lseg button { flex: 1; border: 0; background: transparent; border-radius: 6px; padding: 6px 4px; font-weight: 600; color: var(--muted); }
.lseg button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.set-pane { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.set-pane[hidden], #search[hidden], #songList[hidden] { display: none; }
.set-new { width: 100%; }
.set-empty { color: var(--muted); font-size: 13px; margin: 4px 2px; }
.set-list, .set-songs { list-style: none; margin: 0; padding: 0; }
.set-card, .set-songs button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; border-left: 3px solid transparent; border-radius: 4px; background: transparent; padding: 7px 8px; white-space: normal; }
.set-card:hover, .set-songs button:hover { background: #efebe0; }
.set-card .t, .set-songs .t { font-weight: 600; }
.set-card .a, .set-songs .a, .set-head .a { color: var(--muted); font-size: 12px; }
.set-card.past { opacity: .6; }
.set-back { align-self: flex-start; border: 0; background: transparent; color: var(--accent); font-weight: 600; padding: 2px 0; }
.set-head h3 { margin: 0; font-size: 17px; }
.set-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.set-songs button { flex-direction: row; align-items: center; gap: 10px; }
.set-songs .n { width: 24px; height: 24px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #e6efec; color: var(--accent); font-weight: 700; font-size: 12px; }
.set-songs .tt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.set-songs .k { flex: none; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-weight: 600; font-size: 12px; }

.set-dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.set-meta { display: grid; grid-template-columns: 1fr 150px; gap: 8px; margin-bottom: 10px; }
.set-sub { font-size: 13px; color: var(--muted) !important; margin: 4px 0 6px !important; }
.set-items, .set-found { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.set-items li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid #eee9de; }
.set-items li:last-child, .set-found li:last-child { border-bottom: 0; }
.set-items .n { width: 22px; color: var(--muted); font-weight: 700; text-align: right; flex: none; }
.set-items .t { flex: 1; min-width: 0; }
.set-items button { padding: 3px 9px; }
.set-items button.danger { border-color: transparent; }
.set-none { padding: 10px; color: var(--muted); font-size: 13px; }
.set-found { max-height: 220px; overflow-y: auto; margin-top: 6px; }
.set-found li { border-bottom: 1px solid #eee9de; }
.set-found button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; border-radius: 0; background: transparent; text-align: left; padding: 7px 10px; white-space: normal; }
.set-found button:hover { background: #f3f0e8; }
.set-found .t { font-weight: 600; }
.set-found .a { font-size: 12px; color: var(--accent); }
.set-found button.in .a { color: var(--muted); }
@media (max-width: 520px) { .set-meta { grid-template-columns: 1fr; } }

/* barra do repertório no palco */
.st-setbar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: var(--st-bar); border-top: 1px solid var(--st-rule); }
.st-setbar[hidden] { display: none; }
#stage .st-setbar button { flex: none; width: 52px; height: 44px; font-size: 26px; line-height: 1; border-radius: 10px; padding: 0; }
#stage .st-setbar button:disabled { opacity: .35; }
.st-setinfo { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; }
.st-setinfo small { color: var(--st-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-setinfo span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- perfis ---------- */
body.role-musico .ed-only { display: none !important; }
body.role-musico .pane.editor, body.role-musico .palette, body.role-musico .pv-tools { display: none !important; }
@media (min-width: 900px) { body.role-musico .app { grid-template-columns: 220px 1fr; } }
.g-role { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0 4px; padding: 6px 10px 8px; }
.g-role legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.g-role label { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding: 4px 0; cursor: pointer; }
.g-role small { color: var(--muted); width: 100%; padding-left: 22px; }
.g-role[hidden], .dlg-field[hidden] { display: none; }
.dlg-field + .dlg-field { margin-top: 8px; }

/* ---------- YouTube no modo palco ---------- */
.meta label.f-yt { grid-column: 1 / -1; }
#stage .st-yt { background: #c4302b; border-color: #c4302b; color: #fff; }
#stage .st-yt[aria-pressed=true] { background: var(--st-btn); border-color: var(--st-rule); color: #c4302b; }
.st-player { flex: none; background: #000; border-bottom: 1px solid var(--st-rule); }
.st-player[hidden] { display: none; }
.st-video { position: relative; width: min(100%, calc(30vh * 16 / 9)); margin: 0 auto; aspect-ratio: 16 / 9; }
.st-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.st-player-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 12px; background: var(--st-bar); font-size: 13px; }
.st-player-bar a { color: var(--st-muted); }
#stage .st-player-bar button { padding: 5px 10px; font-size: 13px; }
#stage .st-opts[hidden] { display: none; }

/* ---------- áudio de ensaio no palco ---------- */
#stage .st-aud { color: var(--st-ink); }
#stage .st-aud.has { background: #24C7A6; border-color: #24C7A6; color: #0b1f1c; }
#stage .st-aud[aria-pressed=true] { box-shadow: 0 0 0 2px var(--st-ink); }
.st-audio { flex: none; background: var(--st-bar); border-bottom: 1px solid var(--st-rule); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; color: var(--st-ink); font-size: 14px; }
.st-audio[hidden], .st-audio [hidden] { display: none; }
.st-audio p { margin: 0; }
.au-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#stage .st-audio button { padding: 7px 11px; border-radius: 8px; }
#stage .st-audio .au-primary { background: #24C7A6; border-color: #24C7A6; color: #0b1f1c; font-weight: 700; }
#stage .st-audio .au-play { width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 18px; background: #24C7A6; border-color: #24C7A6; color: #0b1f1c; }
#auSeek { flex: 1; min-width: 120px; accent-color: #24C7A6; }
.au-time { font-variant-numeric: tabular-nums; color: var(--st-muted); font-size: 13px; min-width: 86px; text-align: right; }
.au-lbl { color: var(--st-muted); font-size: 13px; }
.au-sp { margin-left: 8px; }
#auPitch { min-width: 72px; text-align: center; font-weight: 700; }
#auPitch.on { color: #d0822d; }
.au-speeds { display: inline-flex; gap: 4px; }
#stage .au-speeds button[aria-pressed=true] { border-color: var(--st-ink); font-weight: 700; }
.au-warn { color: #d0822d; font-size: 12px; }
.au-foot small { flex: 1; min-width: 0; color: var(--st-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-msg { color: var(--st-muted); font-size: 13px; min-height: 0; }
.au-msg:empty { display: none; }

/* trocar acorde */
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.rep-grid select, .rep-grid input { font-size: 16px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
