/* Site de Cifra v9: o app (barra, lista, louvor, editor, listas, configurações, celular) e a tela de entrar online */
:root {
  --bg: #14161a;
  --bg-panel: #1c1f25;
  --bg-panel-2: #23272f;
  --border: #30343d;
  --text: #e8e6e1;
  --text-dim: #9aa0ab;
  /* destaque: o azul acinzentado do "+ Novo louvor" (antes era amarelo) */
  --accent: #3b6782;
  --accent-hover: #467592;
  --on-accent: #ffffff;
  --accent-2: #6fb1ff;
  --danger: #e0665a;
  --ok: #3fb06b;
  --chord-color: #ef4444;
  --radius: 10px;
  --font-size-cifra: 18px;
  --font-cifra: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
/* tema claro: azul bem claro e dessaturado (antes era bege) */
:root[data-theme="light"] {
  --bg: #f1f4f7;
  --bg-panel: #ffffff;
  --bg-panel-2: #e8edf2;
  --border: #d3dbe3;
  --text: #1a2129;
  --text-dim: #5d6b78;
  --accent: #3b6782;
  --accent-hover: #467592;
  --accent-2: #1d6fbf;
  --danger: #b3392f;
  --ok: #22794a;
  --chord-color: #d92d20;
}
* { box-sizing: border-box; }
/* overscroll: puxar a tela pra baixo no celular não recarrega a página no meio da música */
html, body { height: 100%; overscroll-behavior-y: none; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
}
/* dvh: no celular, 100vh passa por baixo da barra do navegador e esconde o fim da tela */
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
/* toque: sem zoom no toque duplo (ex: + + pra transpor) e sem o flash azul */
button, select, .list-item, .home-row { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
header h1 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: .3px; }
header .spacer { flex: 1; }
header .hint { font-size: 12px; color: var(--text-dim); }

button {
  font: inherit;
  cursor: pointer;
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  white-space: nowrap;
}
button:hover { border-color: var(--accent-2); }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--danger); }
button.icon { padding: 6px 8px; }
button.active { border-color: var(--accent-2); background: var(--bg-panel); box-shadow: inset 0 0 0 1px var(--accent-2); }
button:disabled { opacity: .4; cursor: default; }

input, textarea, select {
  font: inherit;
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
textarea { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; line-height: 1.5; }
label { display: block; font-size: 12px; color: var(--text-dim); margin: 12px 0 4px; }
label:first-child { margin-top: 0; }

#body-wrap { display: flex; flex: 1; min-height: 0; }

#sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: margin-left .15s ease;
}
#body-wrap.sidebar-hidden #sidebar { display: none; }

.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tabs button {
  flex: 1; border: none; border-radius: 0; background: transparent;
  padding: 10px; color: var(--text-dim); border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; background: transparent; box-shadow: none; }

#panel-songs, #panel-setlists { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.sidebar-toolbar { padding: 10px; display: flex; gap: 8px; }
.sidebar-toolbar input { flex: 1; }

.list { flex: 1; overflow-y: auto; padding: 0 6px 10px; }
.list-item {
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.list-item:hover { background: var(--bg-panel-2); }
.list-item.selected { background: var(--bg-panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.list-item.sub { padding-left: 26px; font-size: 13px; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .title:has(.version-dots) { display: flex; align-items: center; gap: 6px; }
.list-item .title .title-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.version-dots { flex-shrink: 0; display: inline-flex; gap: 2px; }
.version-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.25; }
.list-item .subtitle { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-empty { padding: 20px 14px; color: var(--text-dim); font-size: 13px; }
/* minhas listas em cima; a linha "Listas padrões" separa as de todo mundo, embaixo */
.lists-divider { display: flex; align-items: center; gap: 10px; margin: 12px 10px 6px; color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.lists-divider::before, .lists-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.lists-divider:first-child { margin-top: 4px; }
.lists-more {
  display: block; width: calc(100% - 20px); margin: 2px 10px 4px; padding: 7px 10px; font-size: 13px; text-align: left;
  color: var(--accent-2); background: transparent; border: 1px dashed var(--border); border-radius: 8px;
}
.lists-more.home { width: 100%; margin: 0 0 6px; text-align: center; }
.home .lists-divider { margin: 16px 0 10px; }
.menu-heading {
  margin: 4px 0 0; padding: 8px 10px 4px; border-top: 1px solid var(--border);
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; color: var(--text-dim);
}
.menu-pop > .menu-heading:first-child { border-top: none; margin-top: 0; }

#main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); position: relative; }

/* tela sem música aberta: busca + listas */
.home { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 24px 40px; }
.home-inner { max-width: 720px; margin: 0 auto; }
.home-inner input { font-size: 15px; padding: 11px 14px; }
.home h3 { margin: 26px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); }
.home-results { margin-top: 10px; }
.home-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; background: var(--bg-panel);
}
.home-row:hover { border-color: var(--accent-2); }
.home-row .info { flex: 1; min-width: 0; }
.home-row .title { font-weight: 600; }
.home-row .subtitle { font-size: 12px; color: var(--text-dim); }
.home-row .count { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.home-empty { color: var(--text-dim); font-size: 13px; padding: 4px 2px; }
.home-hint { margin-top: 30px; font-size: 12px; color: var(--text-dim); }
.home-hint kbd {
  background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 6px; font-size: 12px;
}

/* painel de configurações: sobe de baixo pra cima ocupando a tela toda */
.sheet {
  position: fixed; inset: 0; z-index: 90; background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateY(100%); visibility: hidden;
  transition: transform .3s ease, visibility 0s linear .3s;
}
.sheet.open { transform: translateY(0); visibility: visible; transition: transform .3s ease, visibility 0s; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg-panel);
}
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-body {
  flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 28px; align-items: start;
  padding: 22px 24px 40px;
}
.sheet-section { margin-bottom: 26px; }
.sheet-section h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); }
.sheet-hint { margin: 8px 0 0; font-size: 12px; color: var(--text-dim); }
.size-control { display: inline-flex; align-items: center; gap: 6px; }
.size-control button { width: 40px; height: 40px; padding: 0; font-size: 20px; }
.size-control .size-value { min-width: 52px; text-align: center; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; }
.swatch .dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.font-card { text-align: left; white-space: normal; padding: 12px 14px; font-size: 14px; }
.swatch.selected, .font-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sheet-preview {
  position: sticky; top: 0; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; background: var(--bg-panel);
}
.sheet-preview .preview-label { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
@media (max-width: 860px) {
  .sheet-body { grid-template-columns: minmax(0, 1fr); }
  .sheet-preview { position: static; order: -1; }
}

.editor { max-width: 1100px; margin: 0 auto; padding: 14px 24px 0; overflow-y: auto; width: 100%; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.editor h2 { margin: 0 0 4px; font-size: 18px; }
.editor .row2 { display: flex; gap: 12px; margin-top: 10px; }
.editor .row2 > div { flex: 1; }
.editor .row2 > .f-grow { flex: 2; }
.editor .title-row > .f-version { flex: 0 0 200px; }
.field-hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.field-hint:empty { display: none; }
.lbl-short { display: none; }
/* botões no rodapé, sempre à vista, mesmo quando o editor precisa rolar */
.editor .actions {
  position: sticky; bottom: 0; z-index: 2; display: flex; gap: 8px; flex-shrink: 0;
  margin-top: 10px; padding: 10px 0 14px; background: var(--bg); border-top: 1px solid var(--border);
}
.editor .actions .spacer { flex: 1; }
.editor-body { display: flex; gap: 16px; margin-top: 4px; flex: 1; min-height: 200px; }
.editor-col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
/* respiro no fim dos dois lados: qualquer linha consegue chegar ao topo, então a rolagem casa até o final.
   No texto, o JS calcula pelo tamanho da caixa (fitEditorPadding): um respiro fixo de 60vh deixava a caixa
   maior que o espaço dela em tela de notebook e ela passava por cima dos botões. Na prévia é um bloco no fim. */
.editor-col textarea { flex: 1; min-height: 160px; resize: none; white-space: pre; overflow-wrap: normal; overflow: auto; }
.editor-preview {
  flex: 1; min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; overflow-y: auto; background: var(--bg-panel-2); position: relative;
  font-size: var(--font-size-cifra); font-family: var(--font-cifra);
}
.editor-preview::after { content: ''; display: block; height: 60vh; }

.song-header {
  padding: 12px 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  border-bottom: 1px solid var(--border); background: var(--bg-panel);
}
.song-header-left { min-width: 0; flex: 1 1 240px; }
.song-header h2 { margin: 0; font-size: 22px; }
/* nome numa linha só; se não couber, passa devagar de um lado pro outro (JS mede e liga a classe marquee) */
.song-header h2 { overflow: hidden; white-space: nowrap; }
.song-header h2 .title-inner { display: inline-block; }
.song-header h2.marquee .title-inner { animation: title-marquee var(--marquee-dur, 8s) ease-in-out infinite alternate; }
@keyframes title-marquee {
  0%, 15% { transform: translateX(0); }
  85%, 100% { transform: translateX(var(--marquee-dist, 0)); }
}
@media (prefers-reduced-motion: reduce) {
  .song-header h2.marquee { overflow-x: auto; }
  .song-header h2.marquee .title-inner { animation: none; }
}
/* versão ao lado do ano: texto em negrito, mais claro que o artista, num fundo arredondado mais escuro, do
   mesmo tamanho do artista e do álbum. Discreto, mas com cara de botão: clicar abre o menu das versões */
.version-btn, .version-tag {
  display: inline-block; vertical-align: baseline; width: auto; margin: 0; padding: 1px 9px;
  font: inherit; font-weight: 700; line-height: inherit; color: #e8e6e17a;
  border: none; border-radius: 999px; background: var(--bg);
}
/* no tema claro, o mesmo texto meio transparente, mas escuro (o claro sumiria no fundo branco) */
:root[data-theme="light"] .version-btn, :root[data-theme="light"] .version-tag { color: #1a21297a; }
:root[data-theme="light"] .version-btn:hover, :root[data-theme="light"] .version-btn.open { color: var(--accent-2); }
.version-btn { cursor: pointer; transition: background .12s, color .12s; }
.version-btn:hover, .version-btn.open { border: none; background: var(--bg-panel-2); color: var(--accent-2); }
/* dentro da lista também dá pra trocar de versão: o louvor continua na lista, na versão escolhida */

/* menu que abre embaixo do botão (versões e "Adicionar à lista"), no lugar do dropdown do navegador */
.menu-pop {
  display: none; position: fixed; z-index: 60; width: max-content; max-width: min(340px, calc(100vw - 16px));
  overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.menu-pop.open { display: block; animation: menu-in .12s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes hover-actions-in { from { opacity: 0; transform: translateY(-50%) translateX(8px); } to { opacity: 1; transform: translateY(-50%); } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin: 0;
  border: none; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; text-align: left;
}
.menu-item:hover, .menu-item:focus-visible { border: none; background: var(--bg-panel-2); outline: none; }
/* nome e, logo ao lado, o hint (álbum · tom), os dois alinhados à esquerda; o ✓ vai pro fim da linha */
.menu-item .menu-label { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.menu-item .menu-hint { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--text-dim); text-align: left; overflow: hidden; text-overflow: ellipsis; }
.menu-item.selected .menu-label { font-weight: 700; color: var(--accent-2); }
.menu-item.selected::after { content: '✓'; margin-left: auto; padding-left: 6px; color: var(--accent-2); font-size: 12px; font-weight: 700; }
.menu-item.action { color: var(--accent-2); font-weight: 600; }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--border); }
@media (pointer: coarse) { .menu-item { padding: 11px 12px; font-size: 15px; } }

/* lista de louvores: parando 1 segundo em cima de um, aparecem a lupa (Google) e o YouTube */
.list-item { position: relative; }
.list-hover-actions {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 2;
  display: flex; gap: 2px; padding: 3px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,.3); animation: hover-actions-in .22s ease-out;
}
.list-hover-actions button {
  width: 28px; height: 28px; padding: 0; border: none; border-radius: 999px; background: transparent; color: var(--text-dim);
  display: inline-flex; align-items: center; justify-content: center;
}
.list-hover-actions button:hover { border: none; background: var(--bg-panel-2); color: var(--accent-2); }
.list-hover-actions svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.song-header .artist { color: var(--text-dim); margin-top: 2px; }
.song-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* balão das tags, aberto pelo ícone de tag da barra */
.song-header { position: relative; }
.tags-pop {
  display: none; position: absolute; z-index: 30; width: max-content; min-width: 180px; max-width: min(320px, calc(100vw - 32px));
  padding: 12px 14px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.tags-pop.open { display: block; }
.tags-pop-title { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.tags-pop-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { padding: 3px 10px; border-radius: 999px; background: var(--bg-panel-2); border: 1px solid var(--border); font-size: 13px; }
.tags-pop-empty { font-size: 13px; color: var(--text-dim); }
/* história do louvor: o mesmo balão das tags, mais largo, rolando por dentro quando é comprida */
.story-pop { width: min(560px, calc(100vw - 32px)); max-width: none; max-height: min(60vh, 520px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px; }
.story-pop .story-text p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-line; }
.story-pop .story-text p:last-child { margin-bottom: 0; }
.editor .f-story { margin-top: 10px; }
.editor .f-story textarea { font-family: inherit; min-height: 54px; line-height: 1.45; }
/* grupos da barra: no computador não existem (contents); no celular separam ícones e controles em duas linhas */
.tb-part { display: contents; }
#view-song:fullscreen { background: var(--bg); }

/* barra de ícones: tudo com 32px de altura; grupos são uma pílula com os botões dentro */
.tb-btn {
  width: 32px; height: 32px; padding: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1;
}
.tb-btn svg, .tb-symbol svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.tb-btn svg.fill { fill: currentColor; stroke: none; }
.btn-icon-text { display: inline-flex; align-items: center; gap: 8px; }
.btn-icon-text svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.tb-group {
  display: inline-flex; align-items: center; height: 32px; padding: 0 2px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-panel-2);
}
.tb-group .tb-btn { width: 28px; height: 28px; border: none; background: transparent; border-radius: 6px; }
.tb-group .tb-btn:hover:not(:disabled) { background: var(--bg-panel); }
.tb-symbol { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 28px; color: var(--text-dim); }
.tb-value { min-width: 32px; text-align: center; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.tb-group.disabled { opacity: .4; }
.tb-select {
  width: auto; max-width: 190px; height: 32px; padding: 0 28px 0 10px; font-size: 13px; cursor: pointer;
  -webkit-appearance: none; appearance: none; border-radius: 8px;
  text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--bg-panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0ab' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 9px center / 12px;
}
.tb-select:hover { border-color: var(--accent-2); }


.presentation-nav {
  display: flex; align-items: center; gap: 10px; padding: 8px 20px;
  background: var(--bg-panel-2); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.presentation-nav .pos { color: var(--text-dim); font-size: 13px; }

.song-scroll { flex: 1; overflow-y: auto; padding: 14px 20px 60px; }
.chord-sheet-wrap { font-size: var(--font-size-cifra); font-family: var(--font-cifra); max-width: 900px; }
.chord-sheet-wrap.columns { max-width: none; }
.chord-sheet-wrap.columns .chord-sheet { column-count: 3; column-gap: 32px; }
#body-wrap.sidebar-hidden .chord-sheet-wrap.columns .chord-sheet,
#view-song:fullscreen .chord-sheet-wrap.columns .chord-sheet { column-count: 4; }
.chord-sheet-wrap.columns .chord-sheet .paragraph {
  break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid;
}
.chord-sheet-wrap .title { display: none; }
.chord-sheet-wrap.lyrics-only .chord,
.chord-sheet-wrap.lyrics-only .beat-mark,
.chord-sheet-wrap.lyrics-only .row.chord-row,
.chord-sheet-wrap.lyrics-only .paragraph.chord-paragraph { display: none; }
.chord-sheet .paragraph { margin-bottom: 1.4em; }
.chord-sheet .row { display: flex; flex-wrap: wrap; }
.chord-sheet .column { display: flex; flex-direction: column; }
/* o respiro à direita separa acordes seguidos, que antes ficavam colados */
.chord-sheet .chord { color: var(--chord-color) !important; white-space: pre; padding-right: .5em; }
/* altura de linha fixa em acorde e letra: cada fonte do Google tem uma altura natural diferente, e sem isso
   a letra embaixo de acorde descia em relação à letra sem acorde */
.chord-sheet .chord, .chord-sheet .lyrics { line-height: 1.35; min-height: 1.35em; }
/* break-spaces: linha comprida quebra em vez de sair da tela (celular, colunas), e o espaço no fim de cada
   pedaço continua ocupando lugar — com pre-wrap ele "some" e as palavras colam ("Hojeo Senhor") */
.chord-sheet .lyrics { white-space: break-spaces; }
.chord-sheet .beat-mark { color: var(--chord-color); }
.chord-sheet .comment {
  /* sem opacidade aqui: ela apagava os acordes da Introdução/Instrumentos, que têm de ter a cor exata dos outros */
  color: var(--accent-2); font-style: italic; margin: .3em 0;
}
.chord-sheet .comment strong { color: var(--text); font-style: normal; }
.chord-sheet .comment .inline-chords { color: var(--chord-color); font-style: normal; }
.chord-sheet .row.section-label {
  color: var(--text); font-weight: 700; margin: 1em 0 .2em;
}
/* texto solto entre linhas vazias ("Repetir o coro") ou rótulo de repetição colado no verso ("Cantar 2x"): negrito automático */
.chord-sheet .loose-text .lyrics { font-weight: 700; color: var(--text); }
/* introdução que é parte da letra ([intro/] ... [/intro]): sublinhado bem clarinho, na cor dos acordes.
   É uma linha no pé da letra de cada coluna, na largura toda da coluna: assim não falha embaixo do espaço que
   sobra quando o acorde é mais largo que a sílaba. Coluna em que a introdução começa ou termina no meio
   (intro-split): só o pedaço da introdução, e ele estica até o fim da coluna se a introdução continua depois */
:root { --intro-line: color-mix(in srgb, var(--chord-color) 38%, transparent); }
.chord-sheet .lyrics.intro-all, .chord-sheet .lyrics.intro-split > .intro-part {
  background: linear-gradient(var(--intro-line), var(--intro-line)) left bottom / 100% 2px no-repeat;
}
.chord-sheet .lyrics.intro-split { display: flex; align-items: flex-end; }
.chord-sheet .lyrics.intro-split > .intro-grow { flex-grow: 1; }

/* ---------- editor visual (1.1.4): mexer nos acordes direto na cifra ----------
   a cifra aparece igual à tela normal; o que muda fica só na tela até clicar em Salvar */
.ve-bar {
  display: none; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0;
  padding: 8px 20px; background: var(--bg-panel-2); border-bottom: 1px solid var(--border);
}
#view-song.ve-active .ve-bar { display: flex; }
#view-song.ve-active .song-header-right,
#view-song.ve-active .float-ctl,
#view-song.ve-active #song-render { display: none !important; }
.ve-bar .ve-title { font-weight: 700; font-size: 14px; white-space: nowrap; }
.ve-bar .ve-hint { flex: 1 1 280px; min-width: 0; font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.ve-bar .ve-status { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.ve-bar .ve-status.dirty { color: var(--accent-2); font-weight: 600; }
.ve-bar .ve-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ve-bar .ve-actions button { height: 32px; display: inline-flex; align-items: center; gap: 6px; }
.ve-bar .ve-actions svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ve-sheet { display: none; position: relative; user-select: none; -webkit-user-select: none; }
#view-song.ve-active .ve-sheet { display: block; }
.ve-sheet .chord-sheet .paragraph { margin-bottom: 0; }
.ve-sheet .row { position: relative; border-radius: 4px; }
.ve-sheet .row[data-kind="lyric"] { cursor: text; touch-action: pan-y; }
.ve-sheet .row[data-kind="label"], .ve-sheet .row[data-kind="key"],
.ve-sheet .row[data-kind="instr"], .ve-sheet .row[data-kind="list"] { cursor: pointer; }
.ve-sheet .row[data-kind="label"]:hover, .ve-sheet .row[data-kind="key"]:hover,
.ve-sheet .row[data-kind="instr"]:hover, .ve-sheet .row[data-kind="list"]:hover { background: var(--bg-panel-2); }
/* [intro/] ou [/intro] sozinho na linha: na tela normal não aparece; no editor, discreto, pra dar pra tirar */
.ve-sheet .row.ve-imark {
  cursor: pointer; padding: 1px 4px; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 11px;
  font-style: italic; color: var(--text-dim); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--chord-color) 38%, transparent);
}
.ve-sheet .row.ve-imark:hover { background: var(--bg-panel-2); }
.ve-sheet .row.ve-selected { background: color-mix(in srgb, var(--accent-2) 20%, transparent); box-shadow: -6px 0 0 color-mix(in srgb, var(--accent-2) 20%, transparent); }
/* acorde: clicar troca, arrastar muda de lugar */
.ve-sheet .ve-chord, .ve-sheet .ve-chip { cursor: grab; border-radius: 4px; touch-action: none; }
.ve-sheet .ve-chip { cursor: pointer; padding: 0 2px; }
.ve-sheet .ve-chord:hover, .ve-sheet .ve-chip:hover { background: var(--bg-panel-2); box-shadow: 0 0 0 1px var(--border); }
.ve-sheet .ve-chord.ve-dragging { opacity: .3; }
.ve-sheet .ve-chip-add {
  display: inline-flex; align-items: center; justify-content: center; width: auto; height: 1.3em; padding: 0 .45em; margin-left: .35em;
  font-size: .8em; font-style: normal; vertical-align: middle; color: var(--text-dim); background: transparent; border: 1px dashed var(--border); border-radius: 6px;
}
.ve-sheet .ve-chip-add:hover { color: var(--accent-2); border-color: var(--accent-2); }
/* espaço entre estrofes (e no começo e no fim): clicar insere introdução, instrumentos, texto... */
.ve-gap { position: relative; height: 1.4em; border-radius: 6px; cursor: pointer; }
.ve-gap.ve-gap-edge { height: 1em; }
.ve-gap::after {
  content: '+ inserir aqui'; position: absolute; inset: 3px 0; display: flex; align-items: center; padding-left: 10px;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 12px; color: var(--text-dim);
  border: 1px dashed var(--border); border-radius: 6px; opacity: 0; transition: opacity .12s;
}
.ve-gap:hover::after, .ve-gap.ve-gap-active::after { opacity: 1; }
.ve-gap.ve-gap-active::after { color: var(--accent-2); border-color: var(--accent-2); }
/* traço de onde o acorde vai entrar; segue o mouse (ou o dedo) */
.ve-caret {
  position: absolute; z-index: 5; width: 2px; margin-left: -1px; border-radius: 1px; pointer-events: none; display: none;
  background: var(--chord-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--chord-color) 25%, transparent);
}
.ve-caret.show { display: block; }
.ve-ghost {
  position: fixed; z-index: 95; pointer-events: none; display: none; padding: 0 6px; border-radius: 6px;
  font-family: var(--font-cifra); font-size: var(--font-size-cifra); color: var(--chord-color);
  background: var(--bg-panel); border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.ve-ghost.show { display: block; }

/* popup do editor visual: trocar/adicionar acorde, marcar linhas, inserir entre estrofes */
.ve-pop {
  position: fixed; z-index: 70; width: min(400px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto;
  overscroll-behavior: contain; padding: 12px 14px 14px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.4); animation: menu-in .12s ease-out;
}
.ve-pop.ve-pop-menu { width: max-content; min-width: 220px; max-width: min(340px, calc(100vw - 16px)); padding: 8px 6px 6px; }
.ve-pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ve-pop-menu .ve-pop-head { padding: 0 6px; margin-bottom: 4px; }
.ve-pop-head strong { flex: 1; min-width: 0; font-size: 14px; }
.ve-pop-head .ve-x { width: 28px; height: 28px; padding: 0; border: none; background: transparent; color: var(--text-dim); font-size: 18px; line-height: 1; }
.ve-pop-head .ve-x:hover { color: var(--text); }
.ve-intro-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 8px; border-radius: 8px;
  background: var(--bg-panel-2); background-image: linear-gradient(var(--intro-line), var(--intro-line));
  background-repeat: no-repeat; background-position: left bottom; background-size: 100% 2px;
}
.ve-intro-row span { font-size: 12px; color: var(--text-dim); margin-right: 2px; }
.ve-intro-row button { padding: 3px 10px; font-size: 13px; }
.ve-sec { margin-top: 10px; }
.ve-sec-t { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); margin-bottom: 5px; }
.ve-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ve-chips button { padding: 4px 9px; font-size: 14px; font-weight: 600; color: var(--chord-color); }
.ve-chips.in-key button { background: color-mix(in srgb, var(--chord-color) 12%, var(--bg-panel-2)); border-color: color-mix(in srgb, var(--chord-color) 40%, var(--border)); }
.ve-step { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.ve-step > span { flex: 0 0 62px; padding-top: 6px; font-size: 12px; color: var(--text-dim); }
.ve-step .ve-opts { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.ve-step .ve-opts button { min-width: 32px; padding: 4px 7px; font-size: 13px; }
.ve-step .ve-opts button.in-key { border-color: color-mix(in srgb, var(--chord-color) 55%, var(--border)); color: var(--chord-color); font-weight: 700; }
.ve-step .ve-opts button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ve-type { display: flex; gap: 6px; margin-top: 12px; }
.ve-type input { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; color: var(--chord-color); }
.ve-warn { min-height: 0; margin-top: 4px; font-size: 12px; color: var(--danger); }
.ve-warn:empty { display: none; }
.ve-seq { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 34px; padding: 6px 8px; border: 1px dashed var(--border); border-radius: 8px; }
.ve-seq-empty { font-size: 12px; color: var(--text-dim); }
.ve-seq .ve-seq-item { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; font-weight: 600; color: var(--chord-color); }
.ve-seq .ve-seq-item b { font-weight: 400; color: var(--text-dim); padding: 0 3px; }
.ve-pop-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.ve-pop-foot .spacer { flex: 1; }
.ve-pop-foot label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--text); }
.ve-pop-foot label input { width: auto; }
.ve-pop .menu-item.danger { color: var(--danger); }

.setlist-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.setlist-search-row { display: flex; gap: 8px; margin: 10px 0 14px; }
.setlist-search-row input { flex: 1; }
/* busca da página da lista: lupa dentro do campo e o resultado num quadro que rola por dentro */
.setlist-search-row { position: relative; }
.search-field { position: relative; flex: 1; display: flex; }
.search-field input { padding-right: 42px; }
/* enquanto digita (esperando o 1 segundo pra buscar): uma linha correndo no pé do campo, de um lado pro outro */
.search-field::after {
  content: ''; position: absolute; left: 6px; right: 6px; bottom: 1px; height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent) no-repeat; background-size: 35% 100%;
  opacity: 0; transition: opacity .15s;
}
.search-field.busy::after { opacity: 1; animation: search-busy 1.1s ease-in-out infinite; }
@keyframes search-busy { from { background-position: -60% 0; } to { background-position: 160% 0; } }
@media (prefers-reduced-motion: reduce) { .search-field.busy::after { animation-duration: 2.4s; } }
.search-go {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px; background: transparent; color: var(--text-dim);
}
.search-go:hover { border: none; background: var(--bg-panel); color: var(--accent-2); }
.search-go svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search-drop {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25;
  overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.search-drop.open { display: block; animation: menu-in .12s ease-out; }
.search-drop .search-result-item { margin-bottom: 4px; background: var(--bg-panel-2); }
.search-drop-info { padding: 4px 6px 8px; font-size: 12px; color: var(--text-dim); }
/* louvor que sai (posto na lista, ou tirado dela): desliza pro lado, apaga e fecha o espaço, sem tranco */
.search-result-item.leaving, .setlist-song.leaving {
  pointer-events: none;
  transition: height .28s ease, margin .28s ease, padding .28s ease, border-width .28s ease, opacity .2s ease, transform .22s ease;
}
/* louvor que acabou de entrar na lista: aparece deslizando, com um destaque que some */
.setlist-song.just-added { animation: song-in .5s ease-out; }
@keyframes song-in {
  0% { opacity: 0; transform: translateY(-6px); background: color-mix(in srgb, var(--accent-2) 22%, var(--bg-panel)); }
  40% { opacity: 1; transform: none; background: color-mix(in srgb, var(--accent-2) 22%, var(--bg-panel)); }
  100% { background: var(--bg-panel); }
}
@media (prefers-reduced-motion: reduce) {
  .search-result-item.leaving, .setlist-song.leaving { transition-duration: .01s; }
  .setlist-song.just-added { animation: none; }
}
/* os ícones do Google e do YouTube ficam sobre o nome nas linhas que têm botões à direita */
.hover-in-info .info, .home-row { position: relative; }
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px;
  background: var(--bg-panel);
}
.search-result-item .info { flex: 1; min-width: 0; }
.search-result-item .title { font-weight: 600; }
.search-result-item .subtitle { font-size: 12px; color: var(--text-dim); }
.search-result-item .add-btn { flex-shrink: 0; }

/* flex: 1 ocupa a altura toda da tela: com lista curta (ou vazia), o quadro do resultado da busca era cortado
   no fim do conteúdo, porque a página tinha só a altura do que estava nela */
#setlist-view { padding: 20px; max-width: 720px; margin: 0 auto; width: 100%; overflow-y: auto; flex: 1; min-height: 0; }
#setlist-view h2 { margin-top: 0; margin-bottom: 0; }
.setlist-description { margin-bottom: 14px; }
.setlist-description-text {
  margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.5; white-space: pre-wrap;
  cursor: pointer; border-radius: 6px; padding: 2px 4px; margin-left: -4px;
}
.setlist-description-text:hover { background: var(--bg-panel-2); color: var(--text); }
.setlist-description-add {
  background: none; border: 1px dashed var(--border); color: var(--text-dim); font-size: 13px;
  padding: 4px 10px; border-radius: 6px;
}
.setlist-description-add:hover { color: var(--text); border-color: var(--accent-2); }
.setlist-description-edit {
  width: 100%; box-sizing: border-box; min-height: 60px; resize: vertical; font: inherit; font-size: 14px;
  padding: 8px 10px; border-radius: 6px; background: var(--bg-panel-2); border: 1px solid var(--accent-2); color: var(--text);
}
.setlist-song {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px;
  background: var(--bg-panel);
}
/* número da posição: etiqueta do mesmo tamanho em todas as linhas, número no meio */
.setlist-song .num {
  flex: none; box-sizing: border-box; min-width: 30px; height: 30px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--bg-panel-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; line-height: 1; color: var(--text-dim); font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.setlist-song .num:hover, .setlist-song .num:focus { color: var(--text); border-color: var(--accent-2); outline: none; }
/* lista padrão: número e descrição só aparecem, sem editar */
.setlist-song .num.readonly, .setlist-song .num.readonly:hover { cursor: default; color: var(--text-dim); border-color: var(--border); }
.setlist-description-text.readonly, .setlist-description-text.readonly:hover { cursor: default; background: none; color: var(--text-dim); }
/* editando: o mesmo tamanho da etiqueta (a largura vem do JS), sem as setinhas de campo numérico */
.setlist-song .num-edit {
  flex: none; box-sizing: border-box; width: 30px; min-width: 30px; height: 30px; padding: 0 5px; margin: 0;
  border-radius: 6px; background: var(--bg-panel-2); border: 1px solid var(--accent-2);
  font-size: 13px; font-weight: 600; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums;
  text-align: center;
}
.setlist-song .info { flex: 1; min-width: 0; }
.setlist-song .title { font-weight: 600; }
.setlist-song .subtitle { font-size: 12px; color: var(--text-dim); }

.toast {
  position: absolute; top: 12px; left: 50%; z-index: 50;
  transform: translateX(-50%) translateY(-8px);
  background: var(--ok); color: #06240f; font-weight: 600; font-size: 13px;
  padding: 9px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bottom { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(8px); }
.toast.bottom.show { transform: translateX(-50%) translateY(0); }

dialog {
  background: var(--bg-panel); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; width: min(360px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0,0,0,.5); }

.cifra-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 12px 0 4px; }
.cifra-head label { margin: 0; }
/* só aparecem no celular */
.seg, .phone-only, #drawer-backdrop, .float-ctl { display: none; }
.seg { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; background: transparent; color: var(--text-dim); padding: 6px 14px; font-size: 14px; }
.seg button.active { background: var(--bg-panel); color: var(--text); font-weight: 600; box-shadow: none; }
.setlist-toolbar h2 { flex: 1; min-width: 0; }
.float-ctl {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  align-items: center; gap: 4px; padding: 4px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.float-ctl button {
  width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.float-ctl button svg { width: 18px; height: 18px; }
.float-ctl .float-play { background: var(--accent); color: var(--on-accent); }

/* ---------- tablet e celular: a barra lateral vira gaveta, aberta pelo ☰ ----------
   (a segunda condição pega o celular deitado: largo, mas baixo e de toque) */
@media (max-width: 900px), (max-height: 500px) and (pointer: coarse) {
  #sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 80; width: min(320px, 86vw);
    transform: translateX(-100%); visibility: hidden; box-shadow: 0 0 30px rgba(0,0,0,.4);
    transition: transform .25s ease, visibility 0s linear .25s;
  }
  #body-wrap.sidebar-hidden #sidebar { display: flex; }
  #body-wrap.drawer-open #sidebar { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; }
  #drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 79; background: rgba(0,0,0,.45);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  #body-wrap.drawer-open #drawer-backdrop { opacity: 1; pointer-events: auto; }
  .list-item { padding: 12px 10px; }
  #song-search { font-size: 16px; }
  /* tela estreita: 3 ou 4 colunas ficariam apertadas demais */
  #body-wrap .chord-sheet-wrap.columns .chord-sheet,
  #view-song:fullscreen .chord-sheet-wrap.columns .chord-sheet { column-count: 2; }
}

/* ---------- celular (em pé ou deitado) ---------- */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  header { padding: 8px 12px; gap: 6px; flex-wrap: nowrap; }
  header h1 { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  header .spacer, #folder-status, #btn-export, #btn-import { display: none; }
  #btn-sidebar-toggle, #btn-theme, #btn-settings {
    width: 40px; height: 40px; padding: 0; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
  }

  input, textarea, select, .home-inner input { font-size: 16px; } /* abaixo de 16px o iPhone dá zoom ao tocar no campo */

  .home { padding: 16px 16px 32px; }

  /* música: cabeçalho e barra rolam junto com a cifra, pra sobrar tela pra ler */
  #view-song { overflow-y: auto; overscroll-behavior-y: contain; }
  .song-scroll { flex: none; overflow: visible; padding: 12px 16px 96px; }
  /* título na largura toda; embaixo, a linha de ícones e a de fonte/tom/rolagem */
  .song-header { padding: 10px 16px 12px; gap: 10px 6px; justify-content: flex-start; }
  .song-header-left { flex: 1 1 100%; }
  .song-header h2 { font-size: 19px; }
  .song-header .artist { font-size: 13px; }
  .song-header-right { display: contents; }
  .tb-part { display: flex; align-items: center; gap: 6px; }
  .tb-view { order: 1; }
  .tb-actions { order: 2; }
  .tb-controls { order: 3; flex: 1 1 100%; justify-content: space-between; flex-wrap: wrap; gap: 8px 4px; }
  #btn-columns, #btn-delete-song-2 { display: none; } /* colunas não cabem; excluir fica no editor */
  .tb-btn { width: 36px; height: 36px; }
  .tb-group { height: 36px; }
  /* medidas pra fonte, tom e rolagem (▶ − 4 +) caberem numa linha só a partir de 360px de largura */
  .tb-group .tb-btn { width: 28px; height: 32px; }
  .tb-symbol { width: 14px; }
  .tb-value { min-width: 24px; }
  .tb-select {
    width: 36px; max-width: 36px; height: 36px; padding: 0; color: transparent;
    background: var(--bg-panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0ab' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='4' y1='6' x2='15' y2='6'/%3E%3Cline x1='4' y1='12' x2='15' y2='12'/%3E%3Cline x1='4' y1='18' x2='11' y2='18'/%3E%3Cline x1='18' y1='14' x2='18' y2='22'/%3E%3Cline x1='14' y1='18' x2='22' y2='18'/%3E%3C/svg%3E") no-repeat center / 18px;
  }
  .tb-select option { color: var(--text); background: var(--bg-panel); }
  .presentation-nav { padding: 8px 12px; gap: 8px; }
  .presentation-nav .lbl, .presentation-nav .spacer { display: none; }
  .presentation-nav .pos { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .float-ctl.show { display: flex; }

  /* tela cheia no celular é pra tocar: uma linha só, presa no topo, com o nome (passando se não couber),
     a rolagem e o botão de sair. Sem artista/ano, fonte, tom e os outros ícones. A apresentação da lista fica igual. */
  #view-song.is-fullscreen .song-header {
    position: sticky; top: 0; z-index: 5; flex-wrap: nowrap; align-items: center; padding: 6px 12px; gap: 8px;
  }
  #view-song.is-fullscreen .song-header-left { flex: 1 1 auto; }
  #view-song.is-fullscreen .song-header h2 { font-size: 17px; }
  #view-song.is-fullscreen .song-header .artist,
  #view-song.is-fullscreen .tb-view,
  #view-song.is-fullscreen .tb-controls > .tb-group:not(#scroll-group),
  #view-song.is-fullscreen .tb-actions > :not(#btn-fullscreen) { display: none; }
  #view-song.is-fullscreen .tb-controls { flex: 0 0 auto; order: 2; }
  #view-song.is-fullscreen .tb-actions { order: 3; }

  /* editor: texto e prévia um de cada vez, alternando pelo botão */
  .editor { padding: 12px 16px 0; }
  .editor .row2 { flex-wrap: wrap; gap: 10px 12px; }
  .editor .row2 > div, .editor .row2 > .f-grow, .editor .title-row > .f-version { flex: 1 1 140px; }
  .editor .title-row > .f-grow { flex-basis: 100%; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .seg { display: inline-flex; }
  .editor-body { flex: none; flex-direction: column; height: 70vh; height: 70dvh; min-height: 0; }
  .editor-col { min-height: 0; } /* sem isso a prévia cresce do tamanho da cifra e não rola */
  .editor-body[data-mode="text"] .preview-col, .editor-body[data-mode="preview"] .text-col { display: none; }
  .editor-col textarea { min-height: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
  .editor-preview::after { height: 30vh; }
  .editor .actions { margin-top: 8px; padding: 10px 0 12px; }

  #setlist-view { padding: 16px; }
  .setlist-toolbar { flex-wrap: wrap; }
  .setlist-toolbar h2 { flex-basis: 100%; }
  .setlist-song button.icon { min-width: 36px; height: 36px; }
  .btn-present { width: 100%; padding: 12px; }

  .sheet-head { padding: 10px 16px; }
  .sheet-body { padding: 0 16px 32px; gap: 16px; }
  /* prévia presa no topo: dá pra ver a fonte mudar enquanto rola a lista de fontes */
  .sheet-preview {
    position: sticky; top: 0; z-index: 2; max-height: 34vh; overflow-y: auto;
    margin: 0 -16px; padding: 12px 16px; border-width: 0 0 1px; border-radius: 0;
  }
  .font-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone-only { display: block; }
  .sheet-actions { display: flex; gap: 8px; }
}

/* tela de toque não tem teclado: a dica de atalhos some */
@media (hover: none) and (pointer: coarse) {
  .home-hint { display: none; }
}

/* barra de rolagem própria só com mouse; no toque fica a do sistema, que não ocupa espaço */
@media (hover: hover) and (pointer: fine) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
}

/* online: tela de entrar */
#login-overlay { position: fixed; inset: 0; z-index: 10000; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 16px; }
#login-overlay[hidden] { display: none; }
#login-form { width: 100%; max-width: 360px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 28px; display: flex; flex-direction: column; }
.login-title { font-size: 22px; font-weight: 700; }
.login-sub { font-size: 13px; color: var(--text-dim); margin: 4px 0 24px; }
#login-form label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
#login-form input { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 11px 12px; font-size: 15px; margin-bottom: 14px; outline: none; }
#login-form input:focus { border-color: var(--accent-2); }
#login-btn { padding: 12px; font-size: 15px; margin-top: 4px; }
.song-loading { color: var(--text-dim); padding: 24px 4px; }
#song-list .list-item, #setlist-list .list-item { content-visibility: auto; contain-intrinsic-size: auto 48px; }
.login-erro { min-height: 20px; margin-top: 12px; font-size: 13px; color: var(--danger); text-align: center; }
/* online: pasta, exportar e importar não servem (importar e exportar listas vão pra aba do usuário) */
.online #btn-folder, .online #btn-folder-reload, .online #folder-status, .online #btn-export, .online #btn-import, .online #sec-backup { display: none !important; }
