/* ---------- fontes (auto-hospedadas) ----------
   Antes vinham do Google Fonts por CDN: dependência de rede na primeira
   abertura (quebra o "offline de verdade" de quem instala e cai sem sinal)
   e mais um terceiro na cadeia de suprimentos. Os .woff2 agora moram em
   vendor/fonts/ e entram no precache do service worker.
   São as mesmas famílias e os mesmos arquivos que o Google servia (subconjunto
   latin, o suficiente pra português), licença SIL Open Font License 1.1.
   Espelham a saída de fonts.googleapis.com/css2 para as mesmas famílias. */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(../vendor/fonts/instrument-sans-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(../vendor/fonts/instrument-sans-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(../vendor/fonts/instrument-sans-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../vendor/fonts/instrument-serif-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../vendor/fonts/jetbrains-mono-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../vendor/fonts/jetbrains-mono-latin.woff2) format('woff2');
}

/* ---------- tokens ---------- */
:root {
  --ground: #f2f4f3;
  --panel: #fff;
  --panel-2: #e8ecea;
  --rail: #eaeeec;
  --ink: #171b1a;
  --ink-2: #5b6664;
  --line: #d2d9d6;
  --chord: #96650a;
  --chord-bg: rgba(150, 101, 10, 0.09);
  --glass-bg: rgba(150, 101, 10, 0.07);
  --glass-edge: rgba(150, 101, 10, 0.16);
  --mark: #0e5c63;
  --danger: #a3372b;
  --danger-vivid: #e02424;
  --warn: #8a5a00;
  --block: #7c3aed;
  --block-glow: rgba(124, 58, 237, 0.3);
  --shadow: 0 1px 2px rgba(23, 27, 26, 0.07), 0 8px 24px -12px rgba(23, 27, 26, 0.18);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #101413;
    --panel: #181d1c;
    --panel-2: #222927;
    --rail: #141918;
    --ink: #e9edeb;
    --ink-2: #93a09d;
    --line: #2c3432;
    --chord: #f0b429;
    --chord-bg: rgba(240, 180, 41, 0.12);
    --glass-bg: rgba(240, 180, 41, 0.09);
    --glass-edge: rgba(240, 180, 41, 0.18);
    --mark: #45b8ae;
    --danger: #e8705f;
    --danger-vivid: #ff5c5c;
    --warn: #e0a64b;
    --block: #b57bff;
    --block-glow: rgba(181, 123, 255, 0.55);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme='dark'] {
  --ground: #101413;
  --panel: #181d1c;
  --panel-2: #222927;
  --rail: #141918;
  --ink: #e9edeb;
  --ink-2: #93a09d;
  --line: #2c3432;
  --chord: #f0b429;
    --chord-bg: rgba(240, 180, 41, 0.12);
    --glass-bg: rgba(240, 180, 41, 0.09);
    --glass-edge: rgba(240, 180, 41, 0.18);
    --mark: #45b8ae;
  --danger: #e8705f;
  --danger-vivid: #ff5c5c;
  --warn: #e0a64b;
  --block: #b57bff;
  --block-glow: rgba(181, 123, 255, 0.55);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
/* overscroll-behavior no <html> é o que de fato importa: no modo de
   renderização padrão é ele (não o <body>) o "scrolling element" do
   documento, e é contra ele que o Chrome/Android decide iniciar o
   pull-to-refresh. Ter isso só no body não bloqueia o gesto. */
html, body { height: 100%; overscroll-behavior-y: none; }
body {
  margin: 0;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.5 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; }
[hidden] { display: none !important; }

.wordmark {
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(20px, 4.6vw, 27px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

button {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  min-height: 42px;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover { border-color: var(--ink-2); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--mark);
  outline-offset: 2px;
}
button.primary {
  background: var(--chord-bg);
  border-color: var(--chord);
  color: var(--chord);
  font-weight: 600;
}
button.danger { color: var(--danger); }
button.ghost { background: transparent; }
button.big { min-height: 48px; padding: 12px 18px; font-size: 15px; }

button:disabled { opacity: 0.45; cursor: default; }
.icon-btn { min-width: 42px; padding: 9px; }

input[type='text'], input[type='search'], input[type='url'], textarea, select {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  min-height: 42px;
  width: 100%;
}
textarea {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
  resize: vertical;
}
.muted { color: var(--ink-2); font-size: 13px; }
.muted.small { font-size: 12px; }
.err { color: var(--danger); font-size: 13px; margin: 0 0 6px; }

.backup-status { font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.backup-status.ok { color: var(--mark); }
.backup-status.warn { color: var(--danger); }

/* ---------- boot ---------- */
.boot { height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.boot-card { max-width: 46ch; text-align: center; }
.boot-msg { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }
.boot-problems {
  margin: 18px 0 0;
  padding: 14px 16px 14px 34px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--danger);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
}
.boot-problems li + li { margin-top: 8px; }

/* ---------- casca ---------- */
.app { height: 100%; display: grid; grid-template-columns: 264px 1fr; min-height: 0; }
.main { display: grid; grid-template-rows: auto 1fr; min-height: 0; min-width: 0; }
/* overscroll-behavior no body não basta: no Android/Chrome, quem dispara o
   "puxar para atualizar" é o próprio container que rola. Sem isso aqui, um
   PWA instalado recarrega sozinho ao arrastar para baixo no topo da lista
   (o iPhone não tem esse gesto, por isso o problema só aparece no Android). */
.main-body { overflow-y: auto; overscroll-behavior-y: contain; min-height: 0; padding: 22px 20px 48px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar-mark { flex: 1 1 auto; min-width: 0; }

.sidebar {
  background: var(--rail);
  border-right: 1px solid var(--line);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  min-height: 0;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px 12px;
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  margin: 18px 8px 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.nav-label:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.nav-item {
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
  width: 100%;
  padding: 11px 10px;
  font-size: 14.5px;
  border-radius: 8px;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--panel-2); border-color: transparent; }
.nav-item[aria-current='page'] {
  background: var(--chord-bg);
  color: var(--chord);
  font-weight: 600;
}
.nav-ico {
  flex: 0 0 auto;
  width: 22px;
  text-align: center;
  font-size: 15px;
  opacity: 0.9;
  transition: transform 0.15s ease;
}
.nav-item:hover .nav-ico { transform: translateX(1px); }
@media (prefers-reduced-motion: reduce) {
  .nav-item, .nav-ico { transition: none; }
}
.sidebar-foot {
  margin: auto 8px 4px;
  padding-top: 14px;
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  border: 0;
}
.menu-only { display: none; }

/* estreito: sidebar vira gaveta */
@media (max-width: 899px) {
  .app { grid-template-columns: 1fr; }
  .menu-only { display: inline-flex; }
  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(290px, 84vw);
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }
  .app.menu-open .sidebar { transform: translateX(0); }
  .main-body { padding: 18px 16px 44px; }
  .topbar { padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* ---------- telas ---------- */
.screen-head {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.screen-title {
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  flex: 0 1 auto;
  min-width: 0;
}
.screen-sub {
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  flex: 1 1 auto;
}
/* Fica na linha do nome do Set List, empurrado para a direita pelo subtítulo. */
.add-songs {
  flex: 0 0 auto;
  background: var(--chord-bg);
  border-color: var(--chord);
  font-size: 15px;
  gap: 0;
}
.block-title {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 600;
}

/* ---------- cards de set list ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 108px;
  display: flex;
  align-items: flex-start;
}
.card:hover { border-color: var(--chord); }
.card-open {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  text-align: left;
  background: none;
  border: none;
  padding: 16px;
  border-radius: 12px;
}
.card-open:hover { border-color: transparent; }
.card-acts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 10px 10px 0;
  flex: 0 0 auto;
}
.card-acts button { min-width: 40px; padding: 8px; font-size: 14px; }
.card-name {
  display: block;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.card-meta {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.card-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.flag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--warn);
  white-space: nowrap;
}
.flag.ok { color: var(--mark); }

.empty-state {
  max-width: 46ch;
  margin: 40px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-lead {
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
}
.empty-sub { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }

/* ---------- lista de músicas ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar input[type='search'] { flex: 1 1 auto; }
.toolbar select { width: auto; flex: 0 0 auto; }
.toolbar .chk { margin-top: 0; flex: 0 0 auto; white-space: nowrap; }

/* Toggle de verdade (trilha + bolinha), não a caixinha nativa do navegador. */
.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  transition: background 0.15s, border-color 0.15s;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-2);
  transition: transform 0.15s, background 0.15s;
}
.switch input:checked ~ .switch-track { background: var(--chord-bg); border-color: var(--chord); }
.switch input:checked ~ .switch-track .switch-thumb { transform: translateX(16px); background: var(--chord); }
.switch input:focus-visible ~ .switch-track { outline: 2px solid var(--mark); outline-offset: 2px; }

.songs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.song {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.song.dragging { opacity: 0.4; }
.song.drop-target { border-color: var(--chord); }

/*
 * Card do bloco: UM contorno neon envolvendo o cabeçalho e as músicas dele,
 * em vez de cada linha desenhar seu próprio pedaço da borda — é isso que
 * evita o brilho "cortando" em cada linha (parecendo uma tabela). As linhas
 * lá dentro perdem a borda própria; um traço fino e neutro só separa uma da
 * outra.
 */
.block-wrap {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  border: 1px solid var(--block);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--block-glow), 0 0 14px -2px var(--block-glow);
  overflow: hidden;
}
.block-wrap .song { margin-bottom: 0; border: none; border-radius: 0; }
.block-wrap .song + .song { border-top: 1px solid var(--line); }
.grip {
  flex: 0 0 auto;
  cursor: grab;
  color: var(--ink-2);
  padding: 4px 2px;
  font-size: 14px;
  display: none;
}
.song-open {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  background: none;
  border: none;
  padding: 4px 0;
  display: block;
}
.song-title {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/*
 * O subtítulo carrega o que decide o show — tom, "tom do show", "sem áudio".
 * Truncar isso em tela estreita esconderia exatamente o que importa, então
 * ele quebra em mais linhas. Só o título trunca.
 */
.song-sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.song-sub .tag { font-family: 'JetBrains Mono', monospace; color: var(--chord); font-weight: 700; }
.song-sub .miss { color: var(--warn); }
.song-sub .own-key { color: var(--mark); }
.song-sub .yt-tag { color: var(--danger-vivid); font-weight: 600; }
.song-sub .local-tag { color: var(--chord); font-weight: 600; }
.song-sub .sync-tag { color: var(--mark); font-weight: 600; }
.song-acts { display: flex; gap: 5px; flex: 0 0 auto; }
.song-acts button { min-width: 44px; padding: 9px 10px; font-size: 17px; }
.song-menu-btn { font-size: 20px; letter-spacing: 1px; color: var(--ink-2); }

/* Ícones desenhados das ações de bloco, no mesmo peso dos emoji ao lado. */
.edit-song,
.del-song { display: inline-flex; align-items: center; justify-content: center; }
.edit-song .ico-edit,
.del-song .ico-bin { width: 22px; height: 22px; }
.song-acts .edit-song { color: var(--chord); }
.song-acts .del-song { color: var(--danger-vivid); }

/* Menu "⋮" da música: nome por extenso em vez de ícone sozinho — no toque
   não existe hover pra revelar o title de um botão. */
.song-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 14px;
}
.song-menu-item svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--mark); }
.song-menu-item.danger, .song-menu-item.danger svg { color: var(--danger-vivid); }
.song-menu-item[disabled] { opacity: 0.45; }

/* Ações dos cards de Set List, no tamanho menor do card. */
.card-acts .rename-list,
.card-acts .del-list { display: inline-flex; align-items: center; justify-content: center; }
.card-acts .rename-list .ico-edit,
.card-acts .del-list .ico-bin { width: 18px; height: 18px; }
.card-acts .rename-list { color: var(--chord); }
.card-acts .del-list { color: var(--danger-vivid); }
.pos {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-2);
  min-width: 2.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Cabeçalho de bloco: mesma linha .song, mas lê como divisor de seção. */
.block-title { flex: 1 1 auto; min-width: 0; padding: 4px 0; }
.block-name { display: block; font-size: 13.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.block-count { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-2); }
.empty {
  margin: 20px auto;
  max-width: 46ch;
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
}

.setlist-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  justify-content: center;
}
.btn-show {
  min-height: 62px;
  font-size: 18px;
  padding: 16px 36px;
  min-width: min(340px, 100%);
  letter-spacing: 0.01em;
}

/* ---------- contagem de entrada ---------- */
/*
 * Entrada e saída usam a mesma curva, que desacelera no fim: é o que faz a
 * cifra "emergir" em vez de aparecer de estalo. O desfoque na saída é o
 * detalhe que mais suaviza — sem ele o corte aparece mesmo com fade longo.
 */
.countin {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: var(--ground);
  opacity: 0;
  transition: opacity 0.26s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.countin.on { opacity: 1; }
.countin.out {
  opacity: 0;
  transform: scale(1.06);
  filter: blur(6px);
  transition:
    opacity 0.42s cubic-bezier(0.2, 0.7, 0.3, 1),
    transform 0.42s cubic-bezier(0.2, 0.7, 0.3, 1),
    filter 0.42s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.countin-stack {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition:
    opacity 0.3s cubic-bezier(0.2, 0.7, 0.3, 1),
    transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.countin.on .countin-stack { opacity: 1; transform: none; }

/* Refletor: pulsa a cada tempo e abre no "BORA!". */
.countin-glow {
  grid-area: 1 / 1;
  width: min(520px, 90vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--chord-bg) 0%, transparent 68%);
  opacity: 0;
  pointer-events: none;
}
.countin-glow.pulse { animation: glowPulse 0.42s ease-out; }
.countin-glow.flare { animation: glowFlare 0.7s ease-out; }
@keyframes glowPulse {
  0% { opacity: 0.9; transform: scale(0.82); }
  100% { opacity: 0; transform: scale(1.12); }
}
@keyframes glowFlare {
  0% { opacity: 1; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.6); }
}

.countin-set {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.countin-num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  color: var(--chord);
  font-size: clamp(64px, 18vw, 140px);
  line-height: 1;
  min-height: 1em;
  font-variant-numeric: tabular-nums;
}
.countin-num.shout {
  font-size: clamp(40px, 11vw, 88px);
  letter-spacing: 0.02em;
}
.countin-num.pop { animation: numPop 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes numPop {
  0% { opacity: 0; transform: translateY(12px) scale(0.72); }
  55% { opacity: 1; transform: translateY(0) scale(1.06); }
  100% { opacity: 1; transform: none; }
}

.countin-beats { display: flex; gap: 10px; margin-top: 4px; }
.countin-beats span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--line);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.countin-beats span.lit { background: var(--chord); border-color: var(--chord); }
.countin-hint { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); }

/* arrastar só onde há mouse */
@media (pointer: fine) {
  .grip { display: block; }
}

/* ---------- diálogos ---------- */
/*
 * Centralização declarada explicitamente, sem depender só do UA stylesheet
 * do <dialog>. Em navegadores/WebViews que suportam o elemento mas não
 * aplicam seu CSS nativo por completo, um showModal() sem isso deixa o
 * diálogo preso no fluxo normal da página — solto, sem backdrop, encostado
 * onde a marcação dele está no HTML, em vez de centralizado por cima de tudo.
 */
.dlg {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(640px, calc(100vw - 32px));
  max-height: min(86vh, 860px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  padding: 20px;
  box-shadow: var(--shadow);
}
/* Fecha explicitamente, com mais peso que .dlg-tall (display:flex) abaixo,
   em vez de confiar só no UA stylesheet do <dialog> pra escondê-lo. */
.dlg:not([open]) { display: none; }
.dlg-sm { width: min(420px, calc(100vw - 32px)); }

/*
 * Diálogo alto: cabeçalho e rodapé fixos, só o miolo rola. É o que mantém a
 * busca sempre visível enquanto se inclui uma música atrás da outra.
 */
.dlg-tall {
  display: flex;
  flex-direction: column;
  height: min(86vh, 720px);
  padding-bottom: 14px;
}
.dlg-tall[open] { display: flex; }
.dlg-head { flex: 0 0 auto; }
.dlg-head h2 { margin-bottom: 4px; }
.dlg-head .muted { margin: 0 0 12px; }
.dlg-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  margin-top: 12px;
  padding-right: 2px;
}
.dlg-tall .dlg-actions { flex: 0 0 auto; margin-top: 12px; }
.dlg::backdrop { background: rgba(0, 0, 0, 0.55); }
.dlg h2 {
  margin: 0 0 14px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 22px;
}
.confirm-body { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.confirm-body b { color: var(--ink); }

.dlg-progress #restoreProgressPct { margin: 10px 0 0; text-align: right; }
.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--mark);
  border-radius: inherit;
  transition: width 0.15s ease-out;
}
#importProgressWrap { margin: 12px 0 6px; }
.dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  flex-wrap: wrap;
}
.fld { display: block; margin-bottom: 12px; }
.fld > span {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.fld-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}
.fld-head > span {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
button.small { min-height: 34px; padding: 7px 10px; font-size: 13px; }
/* Realce do alvo enquanto um arquivo é arrastado por cima. */
textarea.dropping { border-color: var(--chord); background: var(--chord-bg); }

.fld-row { display: flex; gap: 12px; flex-wrap: wrap; }
.fld-row .fld { flex: 1 1 200px; margin-bottom: 12px; }

/* Correção dos tempos do karaokê (na edição da música). */
.times-bar { display: flex; align-items: center; gap: 8px; margin: 6px 0 8px; }
.times-bar .time { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-2); }
.times-hint { font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.times-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.times-list li {
  display: flex;
  gap: 10px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.times-list li:last-child { border-bottom: 0; }
.times-list li .t { flex: 0 0 auto; min-width: 44px; font-family: 'JetBrains Mono', monospace; color: var(--ink-2); }
.times-list li:hover { background: var(--panel-2); }
.times-list li.now { background: var(--glass-bg); color: var(--mark); font-weight: 600; }
.times-list li.now .t { color: var(--mark); }

/* Mini-player do YouTube no editor de tempos. */
.times-yt { width: min(360px, 100%); margin: 6px auto 8px; border-radius: 10px; overflow: hidden; background: #000; }
.times-yt iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
/* "Ocultar vídeo": sai da tela mas continua tocando (só o áudio importa). */
.times-yt.offscreen { position: fixed; left: -10000px; top: 0; width: 320px; height: 180px; }

/* Busca de tempos no LRCLIB. */
.fld-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lrc-list { list-style: none; margin: 12px 0 0; padding: 0; }
.lrc-item { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.lrc-item:last-child { border-bottom: 0; }
.lrc-item b { font-size: 14px; font-weight: 600; }
.lrc-item small { font-size: 12px; color: var(--ink-2); }
.lrc-item .tag { font-size: 11px; color: var(--chord); }
.lrc-item.off { opacity: 0.5; cursor: default; }
.lrc-item:not(.off):hover { background: var(--panel-2); }

/* Diálogo do link do YouTube: subtítulo com o nome da música. */
#youtubeSub { margin: -6px 0 14px; }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: block;
  text-align: left;
  padding: 14px;
  border-radius: 10px;
  background: var(--panel-2);
  line-height: 1.45;
}
.choice strong { display: block; font-size: 15px; margin-bottom: 3px; }
.choice span { display: block; font-size: 13px; color: var(--ink-2); }

.import-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.import-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 11px;
  background: var(--panel-2);
  border-radius: 8px;
  font-size: 13.5px;
}
.import-list .kind {
  flex: 0 0 auto;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.import-list .k-pair { color: var(--mark); }
.import-list .k-chart { color: var(--chord); }
.import-list .k-audio { color: var(--ink-2); }
.import-list .nm { min-width: 0; overflow-wrap: anywhere; }
.import-list .to { margin-left: auto; flex: 0 0 auto; color: var(--mark); font-size: 12px; }

.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.chk input { accent-color: var(--mark); }

/*
 * Fileira de selects com rótulo — sem isso, um <select> sozinho mostrando só
 * o valor atual ("Título") não diz pra que serve até a pessoa clicar nele.
 */
.filters-row { display: flex; flex-wrap: wrap; gap: 14px 20px; margin: 12px 0; }
.fld-inline { display: flex; align-items: center; gap: 8px; }
.fld-inline > span {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.fld-inline select { min-width: 160px; min-height: 38px; padding: 6px 10px; }

/* Filtro por status como abas/pílulas — um estado de cada vez, não uma
   pilha de caixinhas soltas sem relação visual entre si. */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.seg-btn {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
}
.seg-btn[aria-pressed='true'] {
  background: var(--chord-bg);
  border-color: var(--chord);
  color: var(--chord);
  font-weight: 600;
}

/* ---------- armazenamento, backup e desempenho ---------- */
.section-title {
  margin: 28px 0 12px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 19px;
}
.stat-cards { margin-bottom: 4px; }
.stat-card {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  gap: 4px;
}
.stat-value {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 32px;
  line-height: 1.1;
}
.stat-label { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.stat-ring { flex-direction: row; align-items: center; gap: 14px; }
.ring {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: conic-gradient(var(--chord) var(--pct, 0deg), var(--panel-2) 0deg);
}
.ring::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--panel);
}
.ring-num {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.perf-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px 28px;
}
.perf-gauge { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gauge-svg { width: 100%; max-width: 200px; }
.gauge-label { margin: -14px 0 0; font-weight: 700; font-size: 14px; }
.gauge-label.tone-good { color: var(--mark); }
.gauge-label.tone-ok { color: var(--chord); }
.gauge-label.tone-bad { color: var(--danger); }
.perf-meters { display: flex; flex-direction: column; gap: 10px; grid-column: 2; }
.meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.meter-head b { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter-track {
  height: 6px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--mark);
}
.perf-support {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.chip {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip-ok { color: var(--mark); border-color: var(--mark); }
.chip-bad { color: var(--danger); border-color: var(--danger); }

@media (max-width: 620px) {
  .perf-panel { grid-template-columns: 1fr; }
  .perf-meters, .perf-support { grid-column: 1; }
}

.action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.action-card {
  min-height: 76px;
  height: auto;
  justify-content: flex-start;
  text-align: left;
  padding: 16px;
  gap: 12px;
}
.action-ico { font-size: 22px; flex: 0 0 auto; }
.action-text { display: flex; flex-direction: column; gap: 3px; white-space: normal; }
.action-text small { font-weight: 400; color: var(--ink-2); font-size: 12px; line-height: 1.35; }
.action-card.primary .action-text small { color: var(--chord); opacity: 0.85; }

/* ---------- início (dashboard) ---------- */
@keyframes dash-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 20px;
  margin-bottom: 16px;
  border-radius: 16px;
  border: 1px solid var(--glass-edge);
  background: linear-gradient(135deg, var(--glass-bg), var(--chord-bg) 55%, transparent);
  animation: dash-in 0.4s ease both;
}
.dash-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--chord);
}
.dash-title {
  margin: 0 0 6px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(21px, 4vw, 27px);
}
.dash-sub { margin: 0; color: var(--ink-2); font-size: 14px; }

.dash-backup-card { width: 100%; margin-bottom: 8px; animation: dash-in 0.4s ease both; animation-delay: 0.05s; }
.dash-backup-card .action-ico { color: var(--mark); }
.dash-backup-card.warn .action-ico { color: var(--danger); }
.dash-backup-card.warn .action-text b { color: var(--danger); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.feature-card:hover { border-color: var(--mark); transform: translateY(-2px); box-shadow: var(--shadow); }
.feature-ico { font-size: 19px; }
.feature-card b { font-size: 14px; }
.feature-card span { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }

.notes-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.notes-list li::marker { color: var(--mark); }

.roadmap-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.roadmap-chips .chip { transition: transform 0.15s ease, border-color 0.15s ease; }
.roadmap-chips .chip:hover { border-color: var(--mark); color: var(--mark); transform: translateY(-1px); }

/* Entrada suave e escalonada dos itens do painel — sutil de propósito. */
.stagger > * { animation: dash-in 0.4s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .dash-hero, .dash-backup-card, .stagger > * { animation: none; }
}

/* ---------- palco ---------- */
.view { height: 100%; display: grid; grid-template-rows: auto 1fr auto; min-height: 0; }
/* O vídeo do YouTube ocupa a MESMA área da cifra: escolhendo vê-lo, a cifra
   some e o player se adapta à tela; voltando, o player some e a cifra volta.
   Nada de miniplayer fixo roubando altura da cifra. */
.view.stage {
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    'top'
    'chart'
    'transport';
}
.view.stage > .bar { grid-area: top; }
.view.stage > .yt-wrap { grid-area: chart; }
.view.stage > .chart-scroll { grid-area: chart; }
.view.stage > .transport { grid-area: transport; }

.yt-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 8px 12px;
  background: var(--ground);
}
.yt-player {
  width: 100%;
  height: 100%;
  max-width: 1280px;
  max-height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}
/* !important vence o tamanho inline que o IFrame API põe no iframe, para o
   vídeo acompanhar a tela em qualquer tamanho. */
.yt-player iframe { display: block; width: 100% !important; height: 100% !important; border: 0; }
/* Modo cifra: o player sai da tela mas continua tocando (só o áudio importa). */
.yt-wrap.offscreen {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 320px;
  height: 180px;
  z-index: -1;
}

.bar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/*
 * Cabeçalho em até 3 fileiras (min-width:0 em cada nível flex/grid da
 * cadeia — .bar é item de grid de .view.stage, .bar-row-id é item do
 * flex-column .bar; sem isso em toda a cadeia, o padrão min-width:auto de
 * item flex/grid deixa o texto empurrar os ancestrais a crescer, e o "…"
 * abaixo nunca chega a ser aplicado — só pareceria "cortado" pelo overflow
 * do próprio aparelho):
 *   1) voltar + título/artista (uma linha, corta com "…") + relógio do show
 *      + afinador, os dois últimos redondos, como no resto do app.
 *   2) selo do bloco/próxima música (só aparece dentro de um Set List),
 *      numa linha só sua — texto pode ser longo, e dividir espaço com os
 *      botões abaixo reduzia ele a "BLOCO…" cedo demais.
 *   3) tom + BPM + tamanho da letra + autoplay, sem rótulos "TOM"/"LETRA"
 *      acima dos botões (os ícones já bastam); quebra linha (flex-wrap) se
 *      não couber tudo numa fileira só, em vez de estourar a largura.
 */
.bar { min-width: 0; }
.bar-row-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-row-tools { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.bar-id { flex: 1 1 auto; min-width: 0; }
.bar-id .wordmark {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Botões redondos no palco (voltar, relógio do show, afinador). */
.icon-btn.round { border-radius: 50%; }
/*
 * Selo do bloco atual: fora da linha de texto e fora da fileira de botões,
 * de propósito — hoje a única pista de que um bloco acabou é a música ter
 * parado sozinha, então isso precisa ser visto de relance, não lido no meio
 * de outras informações nem truncado cedo por dividir espaço com botões.
 */
.block-badge {
  display: block;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--block);
  border: 1px solid var(--block);
  border-radius: 999px;
  box-shadow: 0 0 8px -1px var(--block-glow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Cronômetro do show: um círculo igual ao afinador, ao lado do nome. */
.show-clock {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--mark);
  border: 1px solid var(--mark);
  border-radius: 50%;
  white-space: nowrap;
}
.bar-sub {
  margin: 2px 0 0;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.field > span {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.key {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: 17px;
  color: var(--chord);
  background: var(--chord-bg);
  border: 1px solid var(--chord);
  min-width: 64px;
}
/* Compacto só no cabeçalho: ícones bastam, sem rótulo acima dos botões. */
.bar-row-tools .field button:not(.key) { min-height: 34px; padding: 6px 10px; }
.bar-row-tools .key { min-width: 52px; font-size: 15px; }
/* Autoplay junto de tom/letra no cabeçalho — mesma altura dos botões vizinhos. */
/* Mesmo tamanho do relógio do show, ao lado. Ativo fica verde (--mark),
   como qualquer indicador de estado "ligado" no resto do app (backup em
   dia, tom do show) — o âmbar já é o tom/letra, ao lado. */
.autoplay-btn {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
}
#btnAutoplay[aria-pressed='true'] {
  background: var(--mark);
  border-color: var(--mark);
  color: #f7f8f7;
}
:root[data-theme='dark'] #btnAutoplay[aria-pressed='true'] { color: #101413; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) #btnAutoplay[aria-pressed='true'] { color: #101413; }
}
.capo { margin: 0; font-size: 11.5px; color: var(--mark); line-height: 1.3; }

.chart-scroll {
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior-y: contain;
  min-height: 0;
  padding: 22px 16px 45vh;
  -webkit-overflow-scrolling: touch;
}

.diagrams {
  max-width: 62ch;
  margin: 2.6em auto 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.diagrams h2 {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 600;
  font-family: inherit;
}
.diagrams .note { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.dia-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.dia { width: 80px; text-align: center; }
.dia b {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--chord);
  margin-bottom: 3px;
}
.dia svg { display: block; width: 100%; max-width: 100%; height: auto; }

.transport {
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 8px 16px;
}
/*
 * Pé do palco: barra de posição em cima, depois o bloco de transporte
 * (anterior/play/próxima juntos, como em qualquer player) e por último as
 * ferramentas secundárias (vídeo, marcar início, velocidade), compactas.
 */
.transport-normal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.transport-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.transport-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.transport-tools .field { flex: 1 1 120px; min-width: 120px; }
.transport-cluster { display: flex; align-items: center; gap: 10px; }
.transport-cluster .nav-song { flex: 1 1 0; min-height: 38px; }
/* Pé compacto: botões ~40% mais baixos que o padrão (42px → 26px). */
.transport button:not(.play) { min-height: 26px; padding: 4px 12px; }
.transport input[type='range'] { height: 22px; }
/* Redondo e no mesmo estilo "tom suave" do resto do app (fundo + borda +
   ícone na cor de destaque), em vez de um retângulo sólido isolado. */
.play {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  min-height: 0;
  border-radius: 50%;
  background: var(--chord-bg);
  border: 1px solid var(--chord);
  color: var(--chord);
  font-size: 20px;
}
.seekwrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
input[type='range'] { flex: 1; min-width: 70px; accent-color: var(--chord); height: 26px; width: auto; }
.transport .field input[type='range'] { max-width: 110px; }
.time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hint { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.hint b { color: var(--ink); font-weight: 600; }

.nav-song.toggle[aria-pressed='true'] {
  background: var(--chord-bg);
  border-color: var(--chord);
  color: var(--chord);
  font-weight: 600;
}

@media (max-width: 520px) {
  .transport-tools .field { flex: 1 1 100%; }
}

/* ---------- aviso flutuante ---------- */
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(520px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  background: var(--panel);
  border: 1px solid var(--chord);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.toast-msg { flex: 1 1 auto; font-size: 14px; }
.toast-action {
  flex: 0 0 auto;
  background: var(--chord-bg);
  border-color: var(--chord);
  color: var(--chord);
  font-weight: 600;
}
.toast-close { flex: 0 0 auto; background: transparent; border-color: transparent; }

/* ---------- cifra ---------- */
.sheet {
  max-width: 62ch;
  margin: 0 auto;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs, 19px);
  line-height: 1.62;
  white-space: pre;
}
.sheet .sec {
  display: block;
  margin: 1.9em 0 0.5em;
  color: var(--mark);
  font-weight: 700;
  font-size: 0.72em;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: pre-wrap;
}
/* Acordes na linha da seção nunca entram no uppercase: "Bm" não é "BM". */
.sheet .sec .ch { font-size: 1.34em; letter-spacing: 0; text-transform: none; }
.sheet .ch { color: var(--chord); font-weight: 700; }
.sheet .lyr {
  display: block;
  border-radius: 8px;
  transition: color 0.45s ease, background-color 0.45s ease, box-shadow 0.45s ease;
}
.sheet .crd { display: block; color: var(--chord); font-weight: 700; min-height: 1em; }
.sheet .gap { display: block; height: 0.62em; }

/* Karaokê: a frase atual, num destaque tipo "vidro" (js/perf da calibração em stage.js). */
.sheet .lyr.now {
  color: var(--mark);
  background: var(--glass-bg);
  box-shadow:
    0 0 0 5px var(--glass-bg),
    0 8px 18px -14px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px var(--glass-edge);
  backdrop-filter: blur(5px) saturate(1.15);
  -webkit-backdrop-filter: blur(5px) saturate(1.15);
}
/* ---------- afinador ---------- */
/*
 * Skin própria, escura, independente do tema claro/escuro do app — igual a
 * um instrumento físico, não uma tela do aplicativo. Por isso as cores aqui
 * são fixas, não var(--...).
 */
.dlg-tuner {
  width: min(300px, calc(100vw - 32px));
  background: linear-gradient(180deg, #17181a 0%, #101112 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e9edeb;
  padding: 4px 22px 20px;
  border-radius: 22px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.65);
}
.dlg-tuner::backdrop { background: rgba(0, 0, 0, 0.55); }
/* Alça de arrastar: tira o "margin: auto" que centraliza o diálogo assim
   que a pessoa toca, pra ele poder ser movido pra qualquer lugar da tela —
   útil pra tirar o afinador de cima da cifra ou dos botões do palco. */
.tuner-drag {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 24px;
  margin: 0 -22px 4px;
  cursor: grab;
  touch-action: none;
}
.tuner-drag span {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #333, #4a4a4a, #333);
}
.tuner-drag:active { cursor: grabbing; }
.tuner-x {
  position: absolute;
  top: 10px;
  right: 12px;
  color: #7d8280;
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}
.tuner-note { text-align: center; padding: 22px 0 4px; position: relative; }
.tuner-note::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}
.tuner-note span {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 52px;
  line-height: 1;
  color: #f3c968;
  text-shadow: 0 0 24px rgba(243, 201, 104, 0.25);
}
.tuner-note.good span { color: #54e0a0; text-shadow: 0 0 26px rgba(84, 224, 160, 0.4); }
.tuner-note .tuner-oct { font-size: 22px; opacity: 0.75; vertical-align: 8px; margin-left: 2px; }
.tuner-cents-line {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #6f7573;
  text-transform: uppercase;
  margin: 10px 0 0;
  min-height: 13px;
}
.tuner-note.good .tuner-cents-line { color: #4ec98f; }
.tuner-freqrow { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0 22px; }
.tuner-freqbtn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #232527, #191a1c);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 2px 4px rgba(0, 0, 0, 0.4);
  color: #c7cac9;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.tuner-freqpill {
  background: linear-gradient(180deg, #1d1e20, #151618);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: #dcdedd;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.tuner-labels { display: flex; justify-content: space-between; padding: 0 2px; margin-bottom: 6px; }
.tuner-labels span { font-size: 9.5px; color: #565b59; font-variant-numeric: tabular-nums; }
.tuner-labels span.zero { color: #e9edeb; font-weight: 700; font-size: 11px; }
.tuner-meter {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 14px 10px 10px;
}
.tuner-bars { display: flex; align-items: flex-end; justify-content: space-between; height: 40px; }
.tuner-bars i {
  width: 4px;
  border-radius: 2px 2px 0 0;
  background: #2e3130;
  height: 20px;
  display: block;
}
.tuner-bars i.tick { height: 28px; }
.tuner-bars i.zero { height: 38px; background: #eef0ee; box-shadow: 0 0 8px rgba(255, 255, 255, 0.5); }
.tuner-bars i.good { background: #3fe89d; box-shadow: 0 0 10px rgba(63, 232, 157, 0.65); }
.tuner-bars i.mid { background: #f0ab48; box-shadow: 0 0 8px rgba(240, 171, 72, 0.4); }
.tuner-bars i.bad { background: #e35b4c; box-shadow: 0 0 8px rgba(227, 91, 76, 0.35); }
.tuner-status { text-align: center; font-size: 11px; color: #666b69; margin: 14px 0 0; min-height: 14px; }
