/* ========== Tokens ========== */
:root {
  --bg: #f4f2ee; --surface: #ffffff; --surface-2: #f1eee8; --surface-3: #e8e4dc;
  --fg: #1b1a17; --muted: #6d675e; --line: #e6e1d8;
  --accent: #f26b1d; --accent-strong: #d9560c; --accent-soft: #fdeadd; --on-accent: #fff;
  --chord: #e8590c; --chorus-bg: #fff7f0;
  --ok: #24804c; --ok-soft: #e1f3e8; --warn: #9a6200; --warn-soft: #fbf0d6; --idle-soft: #eeebe5;
  --danger: #c0392b;
  --radius: 18px; --radius-md: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(30 20 10 / .04), 0 8px 24px rgb(30 20 10 / .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f; --surface: #181818; --surface-2: #212121; --surface-3: #2b2b2b;
    --fg: #f1efea; --muted: #a09a90; --line: #2a2a2a;
    --accent: #ff7a2e; --accent-strong: #ff8f4f; --accent-soft: #3a2114; --on-accent: #fff;
    --chord: #ff8a3d; --chorus-bg: #1d1712;
    --ok: #5fd08e; --ok-soft: #143222; --warn: #f2c94c; --warn-soft: #2e2611; --idle-soft: #262626;
    --shadow: 0 1px 2px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0f; --surface: #181818; --surface-2: #212121; --surface-3: #2b2b2b;
  --fg: #f1efea; --muted: #a09a90; --line: #2a2a2a;
  --accent: #ff7a2e; --accent-strong: #ff8f4f; --accent-soft: #3a2114; --on-accent: #fff;
  --chord: #ff8a3d; --chorus-bg: #1d1712;
  --ok: #5fd08e; --ok-soft: #143222; --warn: #f2c94c; --warn-soft: #2e2611; --idle-soft: #262626;
  --shadow: 0 1px 2px rgb(0 0 0 / .5);
  color-scheme: dark;
}

/* ========== Base ========== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; } /* sem zoom no toque duplo; pinça continua */
button, a, select, label, .tool, .mobile-bar { touch-action: manipulation; }
/* iPhone dá zoom ao focar campo com fonte < 16px: no celular os campos ficam com 16px. */
@media (max-width: 900px) { input, select, textarea, .tool-ctrl select { font-size: 16px !important; } }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, select, input, textarea { font: inherit; color: inherit; }
.i { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
small .i, .chip .i { width: 14px; height: 14px; vertical-align: -2px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 14px; min-width: 44px; min-height: 44px; cursor: pointer; text-decoration: none; font-weight: 500;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
button:hover, .btn:hover { background: var(--surface-2); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: default; }
button.primary, .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--accent-strong); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); }
button.round { border-radius: 99px; }
button[aria-pressed="true"]:not(.tool) { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px 96px; }
.muted { color: var(--muted); }
.err { color: var(--danger); }
.spacer { flex: 1; }

/* ========== Topo ========== */
header.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); min-height: 60px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line);
}
header.top h1 { font-size: 1rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; font-size: 1.05rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; object-fit: cover; display: block;
  box-shadow: 0 4px 12px rgb(0 0 0 / .25);
}

/* ========== Repertório ========== */
.hero {
  position: relative; overflow: hidden; margin: 20px 0 18px; padding: 28px 24px 22px; border-radius: var(--radius); color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #ff9a52 0%, transparent 50%), linear-gradient(135deg, #f26b1d, #c2410c 55%, #7c2d12);
  box-shadow: 0 12px 32px rgb(194 65 12 / .25);
}
.hero::after { /* notas decorativas */
  content: "♪ ♫"; position: absolute; right: 18px; top: 6px; font-size: 5rem; opacity: .12; letter-spacing: -.1em; pointer-events: none;
}
.hero .eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.hero h2 { margin: 6px 0 4px; font-size: clamp(1.6rem, 5.5vw, 2.4rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; }
.hero .date { margin: 0; opacity: .92; text-transform: capitalize; }
.hero .date .i { width: 16px; height: 16px; vertical-align: -3px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.stat { background: rgb(255 255 255 / .14); border-radius: 12px; padding: 10px 12px; }
.stat strong { display: block; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: .75rem; opacity: .9; }
@media (max-width: 480px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.progress { height: 6px; border-radius: 99px; background: rgb(255 255 255 / .22); margin-top: 16px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: #fff; border-radius: inherit; transition: width .6s ease; }

.search { position: relative; margin: 0 0 10px; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding: 13px 14px 13px 44px; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow); }
.filters { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.filters button { flex: none; min-height: 36px; padding: 4px 14px; border-radius: 99px; font-size: .85rem; }

.list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.list > li { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.list > li:has(a.card):hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-1px); }
.list a.card, .list .row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-decoration: none; }
.list .n {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; font-size: .9rem;
}
.list .info { flex: 1; min-width: 0; }
.list strong { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list small { color: var(--muted); display: flex; flex-wrap: wrap; min-width: 0; gap: 2px 12px; margin-top: 2px; font-size: .82rem; }
.list small span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.list .empty { border: 0; background: none; box-shadow: none; }
.key-chip { font-weight: 700; color: var(--accent); }
.vs-badge { color: var(--accent); display: grid; place-items: center; }
.chev { color: var(--muted); display: grid; place-items: center; }
@media (max-width: 480px) { .list .chev { display: none; } }
.st { font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; letter-spacing: .01em; }
.st-a_cifrar { background: var(--idle-soft); color: var(--muted); }
.st-cifrada { background: var(--warn-soft); color: var(--warn); }
.st-revisada { background: var(--ok-soft); color: var(--ok); }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }
.empty .i { width: 40px; height: 40px; opacity: .5; }

/* ========== Cifra: layout ========== */
.layout {
  max-width: 1280px; margin: 0 auto; padding: 20px 16px 120px;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start;
}
.sidebar { position: sticky; top: 80px; display: grid; gap: 12px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
.sheet-handle { display: none; }
.iconbar { display: flex; gap: 8px; }
.iconbar button, .iconbar .btn { flex: 1; border-radius: 99px; min-height: 46px; }

.tool-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.tool {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 12px 6px 16px;
  background: none; border: 0; border-radius: 0; text-align: left; font-weight: 500;
}
.tool + .tool { border-top: 1px solid var(--line); }
button.tool:hover { background: var(--surface-2); }
.tool > .i { color: var(--muted); }
.tool-name { flex: 1; font-size: .95rem; margin: 0; color: var(--fg); font-weight: 500; }
.tool-ctrl { display: flex; align-items: center; gap: 2px; }
.tool-ctrl button { min-width: 36px; min-height: 36px; padding: 0; border: 0; background: transparent; border-radius: 99px; color: var(--muted); }
.tool-ctrl button:hover { background: var(--surface-2); color: var(--fg); }
.tool-ctrl button.round { background: var(--accent); color: #fff; margin-left: 4px; }
.tool-ctrl .i { width: 18px; height: 18px; }
.tool-ctrl select {
  width: auto; min-height: 36px; padding: 4px 8px; border: 0; border-radius: 9px; background: var(--surface-2);
  color: var(--accent); font-weight: 700; font-size: .9rem; cursor: pointer;
}
.tool-ctrl select:disabled { color: var(--muted); }
.value { min-width: 4.5ch; text-align: center; font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); }
.switch { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .2s; }
.tool[aria-pressed="true"] .switch { background: var(--accent); }
.tool[aria-pressed="true"] .switch::after { transform: translateX(16px); }

/* ========== Cifra: cartão principal ========== */
.song-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px clamp(16px, 3vw, 36px) 32px; box-shadow: var(--shadow); min-width: 0; }
.song-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.song-head h1 { margin: 0; font-size: clamp(1.6rem, 4.5vw, 2.3rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 800; }
.artist { margin: 4px 0 0; color: var(--accent); font-weight: 700; font-size: 1.15rem; }
.media-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: none;
  width: 92px; height: 72px; border-radius: var(--radius-md); text-decoration: none; font-size: .78rem; font-weight: 600;
  background: linear-gradient(140deg, #3b2418, #1d1410); color: #fff; border: 1px solid var(--line);
}
.media-btn:hover { filter: brightness(1.15); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--surface-2); font-size: .82rem; font-weight: 500; }
.chip b { color: var(--accent); }
.chip.st { padding: 5px 12px; font-size: .78rem; }
.note { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); font-size: .92rem; }
.note .i { width: 18px; height: 18px; margin-top: 1px; color: var(--warn); }
.note.info { background: var(--surface-2); }
.note.info .i { color: var(--accent); }
.note + .note { margin-top: 6px; }

.vs-card { display: flex; align-items: center; gap: 14px; margin: 16px 0 0; padding: 12px 16px; background: var(--surface-2); border-radius: var(--radius-md); }
.vs-play { width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; border: 0; display: grid; place-items: center; }
.vs-play:hover { background: var(--accent-strong); }
.vs-play .i { width: 24px; height: 24px; }
.vs-body { flex: 1; min-width: 0; }
.vs-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.vs-card .label { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.vs-time { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Barra de arrastar grande, boa pro toque no celular. */
.vs-seek { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0; padding: 0; }
.vs-seek::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: var(--surface-3); }
.vs-seek::-moz-range-track { height: 6px; border-radius: 99px; background: var(--surface-3); }
.vs-seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / .3); margin-top: -8px; }
.vs-seek::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
.vs-seek:disabled { opacity: .5; }

.tabs { display: inline-flex; gap: 4px; margin: 22px 0 0; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.tabs button { min-height: 38px; padding: 6px 18px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

.diagram-strip { display: flex; gap: 8px; overflow-x: auto; margin: 16px 0 0; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.chord-card { flex: none; margin: 0; padding: 8px 6px 4px; border-radius: 12px; background: var(--surface-2); text-align: center; scroll-snap-align: start; min-width: 84px; }
.chord-card figcaption { font: 700 .9rem var(--mono); color: var(--chord); margin-bottom: 2px; }
.diagram-btn { display: block; margin: 0 auto; padding: 0; min-width: 0; min-height: 0; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.diagram-btn:hover:not(:disabled) { background: var(--surface-3); }
.diagram-btn:disabled { opacity: 1; cursor: default; }
.variant-nav { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 2px; font: 600 .7rem var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.variant-nav button { min-width: 26px; min-height: 26px; padding: 0; border: 0; background: none; color: var(--muted); border-radius: 99px; }
.variant-nav button:hover { background: var(--surface-3); color: var(--fg); }
.variant-nav .i { width: 14px; height: 14px; }
.diagram { display: block; margin: 0 auto; overflow: visible; }
.diagram line { stroke: var(--muted); stroke-width: 1; }
.diagram .nut { fill: var(--fg); }
.diagram .dot { fill: var(--fg); }
.diagram .open { fill: none; stroke: var(--fg); stroke-width: 1.2; }
.diagram text { fill: var(--muted); font: 10px var(--font); }
.no-diagram { display: grid; place-items: center; height: 86px; color: var(--muted); }

.key-line { margin: 18px 0 0; font-size: .95rem; }
.key-line b { color: var(--accent); }

/* ========== Cifra: folha ========== */
.sheet { font: var(--fs)/1.38 var(--mono); margin-top: 18px; }
.sheet.columns { columns: 2 320px; column-gap: 48px; column-rule: 1px solid var(--line); }
.sec { margin: 0 0 1.4em; break-inside: avoid; }
.sec h3 { margin: 0 0 .45em; font: 700 .85em var(--mono); color: var(--fg); }
.sec h3::before { content: "["; color: var(--muted); }
.sec h3::after { content: "]"; color: var(--muted); }
.sec.chorus { background: var(--chorus-bg); border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; padding: .7em .9em; }
.ln { display: flex; flex-wrap: wrap; align-items: flex-end; }
.sg { display: inline-flex; flex-direction: column; }
.ch { color: var(--chord); font-weight: 700; padding-right: .5ch; white-space: pre; }
.ch:empty::before { content: "\00a0"; }
.ly { white-space: pre-wrap; }
.ly:empty::before { content: "\00a0"; } /* acorde no fim da linha, sem letra embaixo: mantém a altura e não desce */
.blank { height: .8em; }
.cmt { font: italic .85em var(--font); color: var(--muted); margin: .3em 0; }
.no-chords .ch { display: none; }
/* Tablatura: bloco monoespaçado, rola na horizontal no celular em vez de quebrar. */
.tab { margin: .2em 0 1.1em; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font: .8em/1.4 var(--mono); white-space: pre; overflow-x: auto; -webkit-overflow-scrolling: touch; color: var(--fg); }
.no-chords .tab { display: none; } /* no modo "só letra", esconde a tablatura */
.sheet.columns .tab { break-inside: avoid; }
/* Modo "Editar acordes": cada acorde vira um alvo de toque. */
.sheet.editing .ch[data-i] { cursor: pointer; outline: 1.5px dashed color-mix(in srgb, var(--chord) 55%, transparent); outline-offset: 1px; border-radius: 4px; margin-right: .3ch; padding-right: 0; }
.sheet.editing .ch[data-i]:hover { background: var(--accent-soft); }
.sheet.editing::before { content: "Modo edição: toque num acorde para trocar ou apagar."; display: block; margin-bottom: 12px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font: 600 .85rem var(--font); }

nav.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 40px; }
nav.pn a { display: block; padding: 14px 16px; text-decoration: none; background: var(--surface-2); border-radius: var(--radius-md); font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav.pn a:hover { background: var(--surface-3); }
nav.pn small { display: flex; align-items: center; gap: 2px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
nav.pn a.next { grid-column: 2; text-align: right; }
nav.pn a.next small { justify-content: flex-end; }

.mobile-bar, .backdrop { display: none; }

/* ========== Celular: ferramentas viram gaveta + barra rápida ========== */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 12px 10px 120px; }
  .song-card { padding: 20px 16px 28px; border-radius: var(--radius-md); }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 50; max-height: 82vh; padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
    background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgb(0 0 0 / .25);
    transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  }
  body.tools-open .sidebar { transform: none; }
  .sheet-handle { display: flex; align-items: center; justify-content: space-between; font-weight: 700; padding: 4px 4px 0 8px; }
  .backdrop { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .4); opacity: 0; pointer-events: none; transition: opacity .2s; display: block; }
  body.tools-open .backdrop { opacity: 1; pointer-events: auto; }
  /* Barra fixa embaixo: ocupa a largura da tela (com margem) e nunca passa dela. */
  .mobile-bar {
    position: fixed; z-index: 35; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    max-width: 420px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px; border-radius: 99px;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line); box-shadow: 0 8px 30px rgb(0 0 0 / .18);
  }
  .mobile-bar button { border: 0; background: transparent; border-radius: 99px; min-width: 40px; min-height: 40px; padding: 0; }
  .mobile-bar button.primary { background: var(--accent); color: #fff; width: 48px; height: 48px; flex: none; }
  .speed-group { display: flex; align-items: center; background: var(--surface-2); border-radius: 99px; flex: none; }
  .mobile-speed { display: flex; align-items: center; gap: 3px; min-width: 5ch; justify-content: center; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; font-size: .95rem; }
  .mobile-speed .i { width: 15px; height: 15px; }
  .mobile-bar #tools-open { gap: 6px; padding: 0 12px; font-size: .88rem; flex: none; }
  @media (max-width: 360px) { .tools-label { display: none; } .mobile-bar #tools-open { padding: 0; } }
  .media-btn { width: 72px; height: 60px; }
}

/* Modo palco (tela cheia): só a cifra. */
:fullscreen .sidebar { display: none; }
:fullscreen .layout { grid-template-columns: 1fr; max-width: none; }
:fullscreen .song-card { border: 0; box-shadow: none; }

/* ========== Admin ========== */
.whoami { display: flex; align-items: center; gap: 2px; min-width: 0; }
.whoami-email { font-size: .8rem; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami-email::before { content: "● "; }
a.whoami-email { text-decoration: none; }
a.whoami-email:hover { filter: brightness(.95); }
@media (max-width: 640px) { .whoami-email { max-width: 14ch; font-size: .72rem; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.admin-badge { font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.head-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.head-title h1 { font-size: 1rem; margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved { font-size: .8rem; color: var(--ok); white-space: nowrap; }
.saved.dirty { color: var(--warn); }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .saved { display: none; }
  header.top { gap: 4px; padding-left: 12px; padding-right: 12px; }
  header.top .brand > span { display: none; } /* celular: só o logo, libera espaço no topo */
  header.top .btn, header.top button, .whoami, .admin-badge { flex: none; }
  .whoami-email { max-width: 11ch; }
  .list a.card, .list .row { gap: 9px; padding: 11px 12px; }
  .list .st { font-size: .64rem; padding: 3px 8px; }
  /* Edição no celular: campos menores pra rolar menos. */
  .admin-edit .head-title h1 { font-size: 1rem; }
  .admin-edit textarea { min-height: 260px; }
  .admin-edit .preview { height: auto; min-height: 160px; max-height: 50vh; }
}

/* Menu de ações do admin (abre pelos 3 risquinhos). */
.menu {
  position: fixed; top: 58px; right: 12px; z-index: 40; width: min(260px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgb(0 0 0 / .22); padding: 6px; display: grid; gap: 2px;
}
.menu-email { padding: 8px 12px 10px; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; color: var(--fg); }
.menu-item:hover { background: var(--surface-2); }
.menu-item .i { color: var(--muted); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .i { color: var(--danger); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 24px 0 16px; }
.page-head h1 { margin: 0; font-size: clamp(1.4rem, 4vw, 1.9rem); letter-spacing: -.03em; font-weight: 800; }
.page-head p { margin: 4px 0 0; }
.toast { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.toast.err { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.toast:empty { display: none; }
.list .row .info { text-decoration: none; }
.move { display: flex; flex-direction: column; }
.move button { min-width: 34px; min-height: 26px; padding: 0; border-radius: 8px; }
.move .i { width: 18px; height: 18px; }

.admin-wrap { max-width: 1320px; padding-top: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; margin: 0 0 16px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.panel-head > .i { color: var(--accent); }
.panel-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
details > summary.panel-head { cursor: pointer; list-style: none; margin: 0; }
details > summary.panel-head::-webkit-details-marker { display: none; }
details > summary.panel-head::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details:not([open]) > summary.panel-head::after { transform: rotate(-90deg); }

label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }
input, select, textarea { width: 100%; padding: 11px 12px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s, background .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--line); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { display: block; margin-top: 4px; font-size: .74rem; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.fields .span-2 { grid-column: span 2; }
@media (max-width: 900px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } .fields .span-2 { grid-column: auto; } }

.dropzone {
  display: flex; align-items: center; gap: 14px; margin: 10px 0 0; padding: 16px; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius-md); color: var(--fg); font-size: .95rem; transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone > .i { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.dropzone strong { display: block; }
.dropzone small { color: var(--muted); font-weight: 500; }
#vs-file:focus-visible + .vs-current, .dropzone:has(+ #vs-file:focus-visible) { outline: 2px solid var(--accent); }
.vs-current { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: .9rem; }
.vs-current:has(#vs-name:empty) { display: none; }
button.danger { color: var(--danger); }
.panel .vs { margin-top: 8px; }

.steps { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 4px; color: var(--muted); font-size: .85rem; }
.steps b { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 4px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .72rem; }
kbd { font: 600 .75rem var(--mono); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
textarea { font: 14px/1.5 var(--mono); min-height: 65vh; resize: vertical; }
.preview { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; overflow: auto; height: 65vh; min-height: 300px; background: var(--surface); --fs: 15px; }
.preview.sheet { margin-top: 0; }
.preview:empty::before { content: "A prévia aparece aqui quando você colar a cifra."; color: var(--muted); font: .9rem var(--font); }
.revs { margin-top: 12px; }
.revs > li { box-shadow: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; }

/* ========== Impressão: só a cifra ========== */
@media print {
  header.top, .sidebar, .mobile-bar, .backdrop, .vs-card, .tabs, nav.pn, .media { display: none !important; }
  body { background: #fff; color: #000; }
  .layout { display: block; padding: 0; }
  .song-card { border: 0; box-shadow: none; padding: 0; }
  .sheet { --fs: 12pt; }
  .ch, .artist, .key-line b, .chord-card figcaption { color: #000; }
  .sec.chorus { background: none; }
  .chord-card { background: none; border: 1px solid #ccc; }
}
