:root {
  --top-h: 102px;
  --bg: #faf7f2;
  --panel: #ffffff;
  --ink: #2a2522;
  --muted: #8a7f76;
  --line: #e9e2d8;
  --accent: #b5562b;
  --accent-soft: #f6e6dc;
  --chord: #b5562b;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171412; --panel: #201c19; --ink: #ece5dc; --muted: #9b9087; --line: #352f2a;
    --accent: #e98a5b; --accent-soft: #3a2a21; --chord: #f0a27a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171412; --panel: #201c19; --ink: #ece5dc; --muted: #9b9087; --line: #352f2a;
  --accent: #e98a5b; --accent-soft: #3a2a21; --chord: #f0a27a; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }

/* Cabecera */
.top {
  position: sticky; top: 0; z-index: 10; height: 56px;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: .2px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand strong { color: var(--accent); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.icon-btn, .pill {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px;
  height: 34px; min-width: 34px; padding: 0 12px; cursor: pointer; font-size: 14px;
}
.pill { font-weight: 600; font-size: 13px; letter-spacing: .3px; }
.icon-btn:hover, .pill:hover { border-color: var(--accent); }

/* Barra de categorías deslizable */
.chipbar {
  position: sticky; top: 56px; z-index: 9; height: 46px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.chipbar .chips {
  display: flex; flex-wrap: nowrap; gap: 8px; height: 100%; align-items: center;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 16px;
  padding: 0 16px; margin: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chipbar .chips::-webkit-scrollbar { display: none; }
.chipbar .chip { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; padding: 6px 14px; font-size: 13.5px; background: var(--panel); }
.chipbar .chip.on { background: var(--accent); color: #fff; }

/* Layout */
.layout { display: grid; grid-template-columns: 320px 1fr; min-height: calc(100vh - var(--top-h)); }
.sidebar {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
  border-right: 1px solid var(--line); background: var(--panel); padding: 14px 10px 30px;
}
.search-wrap { margin-bottom: 8px; }
.search-wrap input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); outline: none;
}
.search-wrap input:focus { border-color: var(--accent); }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 4px 10px; font-size: 12.5px; cursor: pointer;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.song-list { list-style: none; margin: 0; padding: 0; }
.song-list a {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: baseline;
  padding: 8px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px;
}
.song-list a:hover { background: var(--accent-soft); }
.song-list a.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.song-list .code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.song-list .k { font-family: var(--mono); font-size: 11.5px; color: var(--chord); }
.song-list .empty { color: var(--muted); padding: 12px; font-size: 14px; }

/* Contenido */
.content { padding: 28px 40px 80px; max-width: 980px; min-width: 0; }
.welcome h1 { font-family: var(--serif); font-size: 40px; margin: 30px 0 10px; font-weight: 500; }
.welcome p { max-width: 560px; line-height: 1.6; }
.muted { color: var(--muted); }

.song-head .code { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.song-head h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; margin: 4px 0 8px; line-height: 1.15; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }


.sheet {
  font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  font-size: 16px; line-height: 1.45; white-space: pre; overflow-x: auto;
  margin: 22px 0 0; padding: 4px 0 10px; tab-size: 4;
}
.sheet.mono { font-family: var(--mono); }
.sheet .ch { color: var(--chord); font-weight: 600; }
.sheet .lbl { color: var(--muted); font-style: italic; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); }
.pager a { color: var(--accent); text-decoration: none; font-size: 14px; max-width: 48%; }

.only-mobile { display: none; }

/* Móvil */
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .brand { font-size: 18px; white-space: nowrap; }
  .sidebar { position: static; height: auto; border-right: 0; }
  body.reading .sidebar { display: none; }
  body:not(.reading) .content { display: none; }
  .content { padding: 16px 14px 60px; }
  .only-mobile { display: inline-block; }
  .song-head h1 { font-size: 26px; }
}

/* Impresión */
@media print {
  .top, .chipbar, .sidebar, .toolbar, .pager { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  .sheet .ch { color: #000; }
}

/* En directo */
.live-btn { display: inline-flex; align-items: center; gap: 7px; }
.live-btn .dot, .live-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.live-btn.on { border-color: var(--accent); color: var(--accent); }
.live-btn.on .dot, .live-bar .dot { background: #d93a2b; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.live-panel {
  position: fixed; top: 62px; right: 12px; z-index: 30; width: min(340px, calc(100vw - 24px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.45);
}
.live-panel h3 { margin: 0 0 4px; font-family: var(--serif); font-weight: 500; font-size: 20px; }
.live-panel .small { font-size: 13px; line-height: 1.45; margin: 0 0 12px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.seg button { border: 0; background: var(--bg); padding: 9px 4px; cursor: pointer; font-size: 13.5px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; }
.field { display: grid; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.field input, .field select { height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 0 10px; font-family: var(--sans); font-weight: 400; color: var(--ink); font-size: 14px; }
.live-status { font-size: 13.5px; margin: 10px 0 0; }
.live-flash { font-size: 13px; color: var(--accent); margin: 8px 0 0; }
.live-bar {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
  max-width: calc(100vw - 24px); white-space: nowrap;
}
.live-bar #liveBarText { cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.live-bar button { border: 0; border-radius: 999px; background: var(--accent); color: #fff; padding: 6px 12px; cursor: pointer; font-size: 13px; }
body.live-on .content { padding-bottom: 110px; }
@media (max-width: 820px) {
  .live-btn .lbl { display: none; }
  .live-btn { padding: 0; width: 34px; justify-content: center; }
  .top { gap: 8px; padding: 0 10px; }
  .top .pill#notationBtn { padding: 0 10px; font-size: 12px; }
}
/* Emitiendo: sin zoom ni desplazamiento horizontal */
html.emitting, body.emitting { overflow-x: clip; max-width: 100%; touch-action: pan-y; overscroll-behavior-x: none; }
body.emitting .sheet { overflow-x: hidden; }
body.emitting .chipbar .chips { touch-action: pan-x pan-y; }
@media print { .live-btn, .live-panel, .live-bar { display: none !important; } }

/* Variantes de tono */
.variants { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; }
.var-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.toggle { font-size: 13.5px; display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* Barra de controles vertical (arriba a la derecha) */
.toolbar {
  position: fixed; z-index: 15; top: calc(var(--top-h) + 12px); right: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 10px 28px -16px rgba(0,0,0,.45);
  transition: opacity .6s ease;
}
.toolbar.idle { opacity: .5; }
.toolbar.idle:hover, .toolbar:focus-within { opacity: 1; }
.tb {
  position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); cursor: pointer; font-size: 20px; font-weight: 600; line-height: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0;
}
.tb sup { font-size: 11px; margin-left: 1px; }
.tb.small { font-size: 10.5px; font-weight: 600; line-height: 1.15; }
.tb:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.tb:disabled { opacity: .35; cursor: default; }
.tb[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tb.key { height: 52px; border-color: var(--accent); background: var(--accent-soft); overflow: hidden; }
.key-name { font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--chord); }
.key-off { font-family: var(--mono); font-size: 10px; color: var(--muted); min-height: 11px; margin-top: 2px; }
.tb.key select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; font-size: 16px; }
.tb-sep { width: 24px; height: 1px; background: var(--line); margin: 2px 0; }
.content { padding-right: 96px; }
@media (max-width: 820px) {
  .toolbar { right: 8px; top: calc(var(--top-h) + 8px); padding: 4px; gap: 4px; border-radius: 14px; }
  .tb { width: 40px; height: 40px; font-size: 18px; }
  .tb.key { height: 48px; }
  .content { padding-left: 14px; padding-right: 62px; }
}
@media print { .content { padding-right: 0 !important; } }

/* Engranaje para contraer / expandir */
.tb-items { display: flex; flex-direction: column; align-items: center; gap: inherit; }
.toolbar.collapsed .tb-items { display: none; }
.tb.gear { color: var(--muted); }
.tb.gear svg { transition: transform .35s ease; }
.toolbar:not(.collapsed) .tb.gear { color: var(--accent); }
.toolbar:not(.collapsed) .tb.gear svg { transform: rotate(90deg); }
body.tb-collapsed .content { padding-right: 40px; }
@media (max-width: 820px) { body.tb-collapsed .content { padding-right: 14px; } body.tb-collapsed .song-head { padding-right: 48px; } }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 13px; text-decoration: underline; padding: 0; margin: -2px 0 10px; }

/* Párrafos seleccionables */
.sheet { white-space: normal; }
.sheet .para {
  font: inherit; white-space: pre; margin: 0 0 6px -12px; padding: 8px 12px; border-radius: 12px;
  border-left: 3px solid transparent; cursor: pointer; transition: background .25s, border-color .25s;
  width: max-content; min-width: calc(100% + 12px); outline: none;
}
.sheet .para:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.sheet .para.sel { background: var(--accent-soft); border-left-color: var(--accent); }
.sheet .para:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
body.emitting .sheet .para { width: auto; }

/* Barra de estado reducida al punto (lateral derecho) */
.live-bar { transition: left .35s ease, right .35s ease, transform .35s ease, padding .35s ease, width .35s ease, background .35s; }
.live-bar.mini {
  left: auto; right: 12px; transform: none; width: 40px; height: 40px; padding: 0; justify-content: center; gap: 0;
  background: var(--panel); border: 1px solid var(--line); cursor: pointer;
}
.live-bar.mini #liveBarText, .live-bar.mini button { display: none; }
.live-bar.mini .dot { width: 12px; height: 12px; }
/* Espacio al final para poder centrar los últimos párrafos */
.sheet { padding-bottom: 45vh; }

/* ---------- Modo Pantalla (proyección) ---------- */
.tb.screen-btn { height: 52px; gap: 2px; font-size: 9.5px; }
body.screen-mode { overflow: hidden; }
.screen { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; user-select: none; -webkit-user-select: none; }
.scr-stage { position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.scr-text {
  max-width: 100%; max-height: 100%; text-align: center; white-space: pre-line; line-height: 1.22;
  overflow-wrap: break-word; text-wrap: balance; color: #fff; letter-spacing: .01em;
}
.scr-text.show { animation: scrIn .35s ease; }
@keyframes scrIn { from { opacity: 0; } to { opacity: 1; } }
.scr-guide { position: absolute; border: 2px dashed rgba(255,255,255,.45); border-radius: 6px; opacity: 0; transition: opacity .4s; pointer-events: none; }
.scr-guide.on { opacity: 1; }
.scr-ui {
  position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 14px; z-index: 2;
  display: grid; gap: 8px; padding: 10px 12px; border-radius: 16px; max-width: calc(100vw - 20px);
  background: rgba(30,30,30,.92); border: 1px solid rgba(255,255,255,.12); color: #eee;
  font-family: var(--sans); font-size: 13px; transition: opacity .6s;
}
.screen.idle .scr-ui { opacity: .3; }
.screen.idle .scr-ui:hover { opacity: 1; }
.scr-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center; }
.sg { display: inline-flex; align-items: center; gap: 5px; }
.sl { color: #aaa; font-size: 12px; }
.sv { min-width: 34px; text-align: center; font-family: var(--mono); font-size: 12px; color: #fff; }
.sb {
  height: 32px; min-width: 32px; padding: 0 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); color: #fff; font-size: 14px;
}
.sb:hover { background: rgba(255,255,255,.16); }
.sb.accent { background: var(--accent); border-color: var(--accent); }
.sb[aria-pressed="true"] { background: #fff; color: #000; }
.scr-ui select { height: 32px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18); background: #222; color: #fff; padding: 0 8px; font-size: 14px; font-family: var(--sans); font-weight: 400; }
/* Pantalla completa / modo limpio: solo la letra */
.screen.clean .scr-ui, .screen.clean .scr-guide { display: none; }
.screen.clean { cursor: none; }
body.screen-clean .live-bar, body.screen-clean .live-panel { display: none !important; }
body.screen-mode .live-bar { z-index: 70; }
body.screen-mode .live-panel { z-index: 80; }
@media (max-width: 820px) {
  .scr-ui { bottom: 8px; padding: 8px; gap: 6px; font-size: 12px; }
  .scr-row.margins .sl:first-child { flex-basis: 100%; text-align: center; }
  .sb { height: 30px; min-width: 30px; padding: 0 8px; }
}

/* ---------- Aviso del directo: aro rojo sin relleno cuando no se sigue al emisor ---------- */
.live-bar.off .dot { background: transparent !important; border: 2px solid #e0352b; animation: none; }
.live-bar.mini.off .dot { width: 18px; height: 18px; }
.live-bar.mini.off { border-color: #e0352b55; }

.scr-row.cfg { display: none; }
.screen.cfg-open .scr-row.cfg { display: flex; }
#scrCfg[aria-expanded="true"] { background: #fff; color: #000; }
@media (max-width: 520px) { .scr-ui .sb .txt { display: none; } .scr-ui { bottom: 6px; } }
/* En modo Pantalla el aviso del directo va arriba para no tapar los controles */
body.screen-mode .live-bar { top: calc(12px + env(safe-area-inset-top)); bottom: auto; background: rgba(40,40,40,.92); color: #fff; border: 1px solid rgba(255,255,255,.15); }
body.screen-mode .live-bar.mini { top: 12px; background: rgba(40,40,40,.92); }

/* ---------- Título con botón de editar ---------- */
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin: 4px 0 8px; }
.edit-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--accent); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.edit-btn:hover { border-color: var(--accent); }
.tag.edited { background: transparent; border: 1px dashed var(--accent); }

/* ---------- Editor ---------- */
body.editing { overflow: hidden; }
.editor { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ed-card {
  width: min(1180px, 100%); height: min(860px, 100%); display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); color: var(--ink); border-radius: 18px; padding: 16px 18px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6);
}
.ed-top { display: flex; align-items: center; justify-content: space-between; }
.ed-top h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 22px; }
.ed-top h2 .code { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-left: 6px; }
.ed-card .field { margin: 0; }
.ed-help { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.ed-help b { color: var(--ink); font-weight: 600; }
.ed-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#edText {
  width: 100%; height: 100%; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  background: var(--bg); color: var(--ink); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 15px; line-height: 1.45;
  white-space: pre; overflow: auto; outline: none; tab-size: 4;
}
#edText:focus { border-color: var(--accent); }
.ed-prev-wrap { min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 8px 20px; background: var(--bg); }
.ed-prev-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 4px; }
.ed-prev { margin: 0; padding: 0 !important; font-size: 14px; }
.ed-prev .para { cursor: default; position: relative; border-left-color: var(--line); margin-bottom: 8px; }
.ed-prev .para:hover { background: transparent; }
.ed-n { position: absolute; left: -16px; top: 8px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.ed-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-foot.small { font-size: 12.5px; }
.ed-foot .link-btn { margin: 0; }
.ed-spacer { flex: 1; }
.pill.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 820px) {
  .editor { padding: 0; }
  .ed-card { border-radius: 0; height: 100%; padding: 12px; }
  .ed-main { grid-template-columns: 1fr; grid-template-rows: 1fr 0.8fr; }
  #edText { font-size: 14px; }
}
@media print { .edit-btn, .editor { display: none !important; } }

/* ---------- Colecciones ---------- */
.chipbar .chip.custom { border-style: dashed; }
.chipbar .chip.add { color: var(--accent); border-color: var(--accent); background: transparent; }
.tag-btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; font-size: 12px; }
.tag-btn:hover { border-color: var(--accent); color: var(--accent); }
.coll-dlg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.coll-card {
  width: min(440px, 100%); max-height: min(720px, 100%); display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); color: var(--ink); border-radius: 18px; padding: 16px 18px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6);
}
.coll-sub { margin: 0; font-size: 13.5px; line-height: 1.45; }
.coll-list { list-style: none; margin: 0; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.coll-list li { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.coll-list li:last-child { border-bottom: 0; }
.coll-item { flex: 1; display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; font-size: 15px; }
.coll-item input { width: 18px; height: 18px; accent-color: var(--accent); }
.coll-name { flex: 1; }
.coll-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.coll-del { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px 12px; font-size: 13px; }
.coll-del:hover, .coll-del.armed { color: #d93a2b; }
.coll-new { display: flex; gap: 8px; }
.coll-new input { flex: 1; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 0 10px; font-size: 14px; }
.coll-new input:focus { outline: none; border-color: var(--accent); }
.coll-msg { margin: 0; min-height: 1em; font-size: 13px; color: var(--accent); }
.coll-msg.bad { color: #d93a2b; }
.small-note { font-size: 12px; }
@media print { .tag-btn, .coll-dlg { display: none !important; } }

/* ---------- Editor visual de acordes por sílaba ---------- */
.ed-tabs { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.ed-tab { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13.5px; }
.ed-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill:disabled { opacity: .4; cursor: default; }
.ed-vis { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 17px; }
.cv-para { padding: 6px 0; }
.cv-row { display: flex; align-items: flex-end; gap: 6px; }
.cv-split, .cv-split-ph { flex: 0 0 26px; width: 26px; height: 26px; margin-bottom: 2px; }
.cv-split { border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; opacity: .45; }
.cv-row:hover .cv-split, .cv-split:focus { opacity: 1; }
.cv-split:hover { color: var(--accent); border-color: var(--accent); }
.cv-line { display: flex; flex-wrap: wrap; align-items: flex-end; row-gap: 4px; padding: 2px 0; }
.cv-syl { display: inline-flex; flex-direction: column; cursor: pointer; border-radius: 5px; padding: 0; outline: none; }
.cv-syl + .cv-syl:not(.tail) { margin-left: 1px; }
.cv-syl.we { margin-right: .32em; }
.cv-syl:hover, .cv-syl:focus-visible { background: var(--accent-soft); }
.cv-ch { min-height: 1.25em; font-size: .78em; font-weight: 700; color: var(--chord); white-space: nowrap; line-height: 1.25; }
.cv-ch b.note { color: var(--muted); font-weight: 500; }
.cv-tx { white-space: pre; line-height: 1.3; border-bottom: 2px solid transparent; }
.cv-syl.has .cv-tx { border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.cv-syl.tail .cv-tx { color: var(--muted); font-size: .8em; padding: 0 4px; }
.cv-chordsonly { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.cv-chip { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 3px 9px; cursor: pointer; font-weight: 700; color: var(--chord); font-size: 14px; }
.cv-chip.note { color: var(--muted); font-weight: 500; }
.cv-chip.add { color: var(--muted); border-style: dashed; }
.cv-join-wrap { display: flex; justify-content: center; margin: 2px 0 6px; border-top: 1px dashed var(--line); }
.cv-join { margin-top: -12px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.cv-join:hover { color: var(--accent); border-color: var(--accent); }

.cv-menu { position: fixed; z-index: 95; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 50px -18px rgba(0,0,0,.55); padding: 10px 12px; display: grid; gap: 8px; font-size: 14px; }
.cv-menu.sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto !important; border-radius: 16px 16px 0 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.cv-mh { display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.cv-x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; }
.cv-cur { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); }
.cv-cur b { color: var(--chord); }
.cv-rm { margin-left: auto; border: 1px solid #d93a2b66; color: #d93a2b; background: transparent; border-radius: 8px; padding: 3px 10px; cursor: pointer; }
.cv-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.cv-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.cv-grid button { min-width: 40px; height: 34px; padding: 0 8px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.cv-grid.used button { color: var(--chord); }
.cv-grid button:hover { border-color: var(--accent); }
.cv-grid button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cv-bass label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cv-bass select { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.cv-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cv-prev { color: var(--chord); font-size: 16px; min-width: 40px; text-align: right; }
.cv-addchk { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
@media (max-width: 820px) { .ed-vis { font-size: 16px; padding: 10px; } }

/* ---------- Listas de reproducción ---------- */
.lists-head { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 2px 4px 6px; }
.lists { display: grid; gap: 6px; margin-bottom: 12px; }
.list-item {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; text-align: left;
  border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 8px 10px; cursor: pointer; color: var(--ink);
}
.list-item:hover { border-color: var(--accent); }
.list-item.on { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.list-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--panel); color: var(--accent); font-size: 15px; border: 1px solid var(--line); }
.list-item.on .list-ico { background: var(--accent); color: #fff; border-color: var(--accent); }
.list-txt { display: grid; min-width: 0; }
.list-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-n { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- Comentario de la canción ---------- */
.song-note {
  display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 10px 14px;
  border-radius: 12px; background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); cursor: text; max-width: 720px;
}
.song-note .note-ico { font-size: 15px; line-height: 1.5; }
.song-note .note-txt { white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.song-note.editing { display: grid; gap: 8px; cursor: default; }
.song-note textarea {
  width: 100%; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 10px; font: inherit; font-size: 14.5px; resize: vertical; min-height: 64px;
}
.song-note textarea:focus { outline: none; border-color: var(--accent); }
.note-actions { display: flex; align-items: center; gap: 8px; }
.note-actions .link-btn { margin: 0; }
@media print { #noteBtn { display: none !important; } }

/* ---------- Ajustes: zoom desactivado, receptor sin controles de tono, cabecera ---------- */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.receiving .key-ctl, body.receiving .variants { display: none !important; }
body.receiving .toolbar .tb-sep:first-of-type { display: none; }
#notationBtn { font-weight: 400; letter-spacing: .3px; }
#notationBtn b { font-weight: 800; color: var(--accent); }
.screen-top { display: inline-grid; place-items: center; padding: 0; width: 34px; }
@media (max-width: 820px) { .top-actions { gap: 6px; } .top .icon-btn { min-width: 32px; width: 32px; padding: 0; } }

/* ---------- Cancionero compartido (Drive) ---------- */
.cloud-card { max-width: 460px; }
.cloud-status { margin: 4px 0 8px; font-weight: 600; }
.cloud-status.good { color: #2e7d32; }
.cloud-status.bad { color: #c62828; }
.cloud-form { display: grid; gap: 8px; margin: 10px 0; }
.cloud-form .field input { width: 100%; }
.cloud-editor { margin: 10px 0; }
.cloud-editor p { margin: 0 0 8px; }
.cloud-log { margin: 8px 0; font-size: 13px; }
.cloud-log ul { list-style: none; padding: 0; margin: 6px 0 0; max-height: 220px; overflow: auto; }
.cloud-log li { padding: 3px 0; border-bottom: 1px solid var(--line, #0001); }
body:not(.can-edit) #editBtn, body:not(.can-edit) #noteBtn, body:not(.can-edit) #collBtn, body:not(.can-edit) .chip.add { display: none !important; }
.lists-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.editors-btn { margin: 0; font-size: 12px; text-transform: none; letter-spacing: 0; }
.seg.seg4 { grid-template-columns: repeat(4, 1fr); }
.seg.seg4 button { font-size: 12.5px; padding: 9px 2px; }
