/* ============================================================
   Cancionero oviedo_church — hoja de estilos
   Paleta del logo: blanco hueso y negro, rojo litúrgico de acento.
   ============================================================ */

:root {
  --bg: #EFECE4;
  --surface: #F8F6F1;
  --surface-2: #E4E0D5;
  --ink: #0C0B0A;
  --ink-soft: #57534B;
  --ink-faint: #8A857A;
  --rule: #D5D0C3;
  --accent: #A82A1A;
  --accent-soft: rgba(168, 42, 26, .10);

  --fresh: #A82A1A;
  --warm: #B8862B;
  --cold: #4F7A63;
  --never: #B4AEA1;

  --f-display: "Unbounded", "Trebuchet MS", sans-serif;
  --f-body: "Source Serif 4", Georgia, serif;
  --f-mono: "JetBrains Mono", Consolas, monospace;

  --r: 4px;
  --tap: 46px;
  --head: 57px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark;
    --bg: #100F0E; --surface: #1A1917; --surface-2: #24221F;
    --ink: #EFECE4; --ink-soft: #ADA79B; --ink-faint: #7C766B;
    --rule: #302D28; --accent: #E4705A; --accent-soft: rgba(228,112,90,.13);
    --fresh: #E4705A; --warm: #D6A94E; --cold: #7FB79A; --never: #5C574F;
  }
}
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #100F0E; --surface: #1A1917; --surface-2: #24221F;
  --ink: #EFECE4; --ink-soft: #ADA79B; --ink-faint: #7C766B;
  --rule: #302D28; --accent: #E4705A; --accent-soft: rgba(228,112,90,.13);
  --fresh: #E4705A; --warm: #D6A94E; --cold: #7FB79A; --never: #5C574F;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ cabecera */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.topbar-in {
  max-width: 1180px; margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand svg { width: 34px; height: 34px; color: var(--ink); flex: none; }
.brand b {
  font-family: var(--f-display); font-weight: 900; font-size: 17px;
  letter-spacing: -.02em; text-transform: uppercase;
}
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 9px 14px; border-radius: var(--r); font-size: 15px;
  color: var(--ink-soft); white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--ink); color: var(--bg); }
.nav a.dim { opacity: .45; cursor: default; }
.nav a.dim:hover { background: none; }

.iconbtn {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: var(--r); cursor: pointer; font-size: 16px;
}
.iconbtn:hover { background: var(--surface-2); }
.langpick {
  height: 40px; padding: 0 10px; border: 1px solid var(--rule);
  background: var(--surface); border-radius: var(--r); cursor: pointer;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 18px 90px; }

/* --------------------------------------------------- búsqueda y filtros */
.searchrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1 1 320px; }
.search input {
  width: 100%; height: var(--tap); padding: 0 40px 0 44px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
}
.search .mag { position: absolute; left: 15px; top: 11px; color: var(--ink-faint); }
.search .x {
  position: absolute; right: 8px; top: 8px; width: 30px; height: 30px;
  border: 0; background: none; cursor: pointer; color: var(--ink-faint); border-radius: var(--r);
}
.search .x:hover { background: var(--surface-2); }

.seg { display: flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.seg button {
  height: var(--tap); padding: 0 16px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink-soft); font-size: 15px;
}
.seg button + button { border-left: 1px solid var(--rule); }
.seg button.on { background: var(--ink); color: var(--bg); }

.btn {
  height: var(--tap); padding: 0 18px; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  border-radius: var(--r); font-size: 15px;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn:hover { opacity: .88; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { background: var(--surface-2); opacity: 1; }
.btn.danger { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.tag {
  padding: 6px 13px; border: 1px solid var(--rule); border-radius: 999px;
  font-size: 14px; color: var(--ink-soft); background: var(--surface); cursor: pointer;
}
.tag:hover { background: var(--surface-2); }
.tag.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag .n { color: var(--ink-faint); font-size: 12px; margin-left: 5px; }
.tag.on .n { color: rgba(255,255,255,.75); }

.legend {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  margin: 18px 0 8px; font-size: 13px; color: var(--ink-faint);
}
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.d-fresh { background: var(--fresh); } .d-warm { background: var(--warm); }
.d-cold { background: var(--cold); }
.d-never { background: var(--never); box-shadow: inset 0 0 0 1px var(--rule); }

.count { font-size: 13px; color: var(--ink-faint); margin: 4px 0 8px; font-family: var(--f-mono); }

/* ----------------------------------------------------- lista de canciones */
.list { border-top: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: 54px 1fr auto auto auto;
  align-items: center; gap: 14px;
  padding: 12px 10px; border-bottom: 1px solid var(--rule); cursor: pointer;
}
.row:hover { background: var(--surface); }
.num { font-family: var(--f-mono); font-size: 14px; color: var(--ink-faint); text-align: right; }
.tt { min-width: 0; }
.tt b {
  display: block; font-family: var(--f-display); font-weight: 700; font-size: 17px;
  letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tt small { color: var(--ink-faint); font-size: 13px; }
.langs { display: flex; gap: 4px; }
.lg {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em;
  padding: 3px 6px; border: 1px solid var(--rule); border-radius: 3px;
  color: var(--ink-faint); font-style: normal;
}
.lg.main { border-color: var(--ink); color: var(--ink); }
.key {
  font-family: var(--f-mono); font-weight: 700; font-size: 15px; color: var(--accent);
  min-width: 46px; text-align: center;
}
.last {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--ink-soft); min-width: 128px; justify-content: flex-end;
}
.empty { padding: 60px 10px; text-align: center; color: var(--ink-faint); }
.empty b { display: block; font-family: var(--f-display); font-size: 19px; color: var(--ink); margin-bottom: 8px; }

/* --------------------------------------------------------- ficha canción */
.songhead { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.songhead h1 {
  font-family: var(--f-display); font-weight: 900; font-size: clamp(26px, 4.2vw, 42px);
  letter-spacing: -.035em; line-height: 1.05; margin: 0 0 8px;
}
.meta { color: var(--ink-faint); font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; margin: 0; }
.meta b { color: var(--ink-soft); font-weight: 600; }
.spacer { flex: 1; }

.langtabs { display: flex; margin: 20px 0 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.langtabs button {
  background: none; border: 0; cursor: pointer; padding: 11px 18px;
  font-size: 16px; color: var(--ink-faint);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.langtabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

.ctrl {
  position: sticky; top: var(--head); z-index: 30;
  background: var(--bg); border-bottom: 1px solid var(--rule);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 11px 0; margin-bottom: 6px;
}
.grp {
  display: flex; align-items: center; border: 1px solid var(--rule);
  border-radius: var(--r); background: var(--surface); overflow: hidden;
}
.grp > * { border: 0; background: none; }
.grp button { width: 42px; height: 42px; cursor: pointer; font-size: 18px; }
.grp button:hover { background: var(--surface-2); }
.grp .val {
  min-width: 60px; text-align: center; font-family: var(--f-mono);
  font-weight: 700; color: var(--accent); font-size: 17px;
  border-left: 1px solid var(--rule); border-right: 1px solid var(--rule);
  height: 42px; line-height: 42px;
}
.grp .lbl { padding: 0 12px; font-size: 13px; color: var(--ink-faint); white-space: nowrap; }
.grp select { height: 42px; padding: 0 8px; cursor: pointer; }
.ctrl .more { display: none; }        /* solo hace falta en pantallas estrechas */
/* En pantalla ancha el selector de tono va pegado a los botones − y +, y su
   etiqueta sobra: la de al lado ya dice «Tono». */
.ctrl .grp.keypick .lbl { display: none; }
.ctrl .grp.keypick { margin-left: -6px; }

/* --- La letra con los acordes.
   Cada trozo es una columna: acorde arriba, sílaba debajo. El acorde queda
   anclado a SU sílaba a cualquier tamaño de letra. --- */
.sheet { font-size: var(--lyr, 19px); max-width: 820px; }
.sec { margin: 24px 0 0; }
.sec > h4 {
  font-family: var(--f-display); font-size: 12px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint);
  margin: 0 0 10px; display: flex; align-items: center; gap: 12px;
}
.sec > h4::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.sec.chorus { padding-left: 16px; border-left: 2px solid var(--accent); }
.line { display: flex; flex-wrap: wrap; align-items: flex-end; margin-bottom: 3px; }
.line.blank { height: .7em; }
.line .cmt { color: var(--ink-faint); font-style: italic; font-size: .9em; }
.ck { display: inline-flex; flex-direction: column; }
.ck > i {
  font-family: var(--f-mono); font-style: normal; font-weight: 700;
  font-size: .72em; line-height: 1.35; color: var(--accent);
  white-space: pre; letter-spacing: -.01em;
}
.ck > i em { font-style: normal; color: var(--ink-faint); font-weight: 400; font-size: .86em; }
.ck > s { text-decoration: none; white-space: pre-wrap; }
.sheet.bold .ck > s { font-weight: 600; }

.cols { display: flex; gap: 32px; align-items: flex-start; }
.sidecar {
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: var(--r); padding: 16px 18px; font-size: 14px; color: var(--ink-soft);
  width: 290px; flex: none;
}
.sidecar h5 {
  font-family: var(--f-display); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 8px;
}
.sidecar section + section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.sidecar p { margin: 0 0 8px; }
.sidecar .k { font-family: var(--f-mono); color: var(--accent); font-weight: 700; }
.sidecar ul { margin: 0; padding-left: 1.1em; }
.sidecar li { margin-bottom: 4px; }

/* -------------------------------------------------------------- editor */
.edgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); font-family: var(--f-display); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r);
}
.field textarea {
  font-family: var(--f-mono); font-size: 14px; line-height: 1.7;
  min-height: 340px; resize: vertical; white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
.fieldrow { display: flex; gap: 12px; flex-wrap: wrap; }
.fieldrow .field { flex: 1 1 130px; }
.hint { font-size: 13px; color: var(--ink-faint); margin: 6px 0 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.previewbox {
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); padding: 18px; min-height: 340px;
}
.previewbox .sheet { font-size: 17px; }

/* ---------------------------------------------------------- quién soy */
.who {
  display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-soft);
  padding-left: 12px; border-left: 1px solid var(--rule); flex: none;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-family: var(--f-display);
  font-size: 11px; font-weight: 700; flex: none;
}
.link {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--never); box-shadow: inset 0 0 0 1px var(--rule);
}
.link.on { background: var(--cold); box-shadow: none; }
.pending {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--warm); color: #fff; font-family: var(--f-mono);
  font-size: 12px; display: grid; place-items: center; cursor: pointer;
}
.whoname { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ calendario */
.calmonth {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; margin-top: 18px;
}
.calhead {
  padding: 9px 10px; font-family: var(--f-display); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  background: var(--surface-2); border-bottom: 1px solid var(--rule);
}
.calday {
  position: relative; min-height: 104px; padding: 6px 7px 26px;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.calday:nth-child(7n + 7) { border-right: 0; }
.calday.out { background: var(--surface); }
.calday.out .n { opacity: .35; }
.calday.today { box-shadow: inset 0 0 0 2px var(--accent); }
.calday .n { font-family: var(--f-mono); font-size: 13px; color: var(--ink-faint); }
.calday .addday {
  position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink-faint);
  border-radius: var(--r); cursor: pointer; opacity: 0; font-size: 13px; line-height: 1;
}
.calday:hover .addday { opacity: 1; }

.ev {
  display: block; margin-top: 5px; padding: 5px 7px; border-radius: 3px;
  background: var(--surface-2); border-left: 3px solid var(--ink-faint);
  font-size: 13px; line-height: 1.3;
}
.ev:hover { background: var(--accent-soft); }
.ev b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev small { color: var(--ink-faint); font-size: 11px; font-family: var(--f-mono); }
.ev.k-sunday { border-left-color: var(--accent); }
.ev.k-youth  { border-left-color: var(--warm); }
.ev.k-prayer { border-left-color: var(--cold); }

.calweek { margin-top: 18px; border-top: 1px solid var(--rule); }
.weekrow {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center;
  padding: 12px 10px; border-bottom: 1px solid var(--rule);
}
.weekrow.today { background: var(--accent-soft); }
.weekrow .wd b { font-family: var(--f-display); font-size: 13px; letter-spacing: .1em;
                 text-transform: uppercase; display: block; }
.weekrow .wd span { color: var(--ink-faint); font-size: 13px; }
.weekrow .wev { display: flex; gap: 10px; flex-wrap: wrap; }
.weekrow .wev .ev { margin: 0; min-width: 190px; }

/* ------------------------------------------------------ filas de usuario */
.userrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 10px; border-bottom: 1px solid var(--rule);
}
.userrow:hover { background: var(--surface); }
.userrow .tt { flex: 1 1 190px; min-width: 0; }
.userrow .tt b { font-family: var(--f-display); font-size: 16px; }
.userrow .tt small { display: block; color: var(--ink-faint); font-size: 13px; }

/* --------------------------------------------------------------- set list */
.setlist { border-top: 1px solid var(--rule); }
.setrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 10px; border-bottom: 1px solid var(--rule); background: var(--bg);
}
.setrow:hover { background: var(--surface); }
.setrow.dragging { opacity: .4; }
.setrow.over { box-shadow: inset 0 2px 0 var(--accent); }
.setrow[draggable="true"] { cursor: grab; }
.setrow .pos {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); border-radius: 50%;
  font-family: var(--f-mono); font-size: 13px; font-weight: 700;
}
.setrow .tt { flex: 1 1 220px; min-width: 0; }
.setrow .tt b { font-family: var(--f-display); font-size: 16px; letter-spacing: -.01em; }
.setrow .iconbtn { width: 34px; height: 34px; font-size: 14px; }

.picker { display: flex; flex-direction: column; margin-top: 8px; }
.pickitem {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 10px 12px; border: 1px solid var(--rule); border-top: 0;
  background: var(--surface); cursor: pointer; text-align: left;
}
.pickitem:first-child { border-top: 1px solid var(--rule); }
.pickitem:hover { background: var(--accent-soft); }
.pickitem b { font-family: var(--f-display); font-size: 15px; font-weight: 700; }
.pickitem span { color: var(--ink-faint); font-family: var(--f-mono); font-size: 12px; }

.livebar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin: 0 0 14px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: var(--r); font-size: 15px;
}
.livebar span { flex: 1; }

.dropzone {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 22px; border: 2px dashed var(--rule); border-radius: var(--r);
  background: var(--surface); max-width: 620px;
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.busy { opacity: .5; pointer-events: none; }
.dropzone b { font-family: var(--f-display); font-size: 16px; }
.dropzone .hint { margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 22px; border-radius: var(--r);
  font-size: 15px; z-index: 90; box-shadow: 0 6px 30px rgba(0,0,0,.25);
}
.toast.err { background: var(--accent); color: #fff; }

/* ------------------------------------------------------- modo escenario */
body.stage-on { overflow: hidden; }
body.stage-on .topbar { display: none; }
body.stage-on .wrap { max-width: none; padding: 0; }

/* En el escenario manda el contraste: negro puro y letra hueso, se lea con
   la luz que se lea. No depende del tema elegido. */
.stage {
  position: fixed; inset: 0; z-index: 60;
  background: #080807; color: #F4F1E9;
  display: flex; flex-direction: column;
}
.stage-page {
  flex: 1; overflow-y: auto; padding: 30px 34px 120px;
  scrollbar-width: none;
}
.stage-page::-webkit-scrollbar { display: none; }
.stage-title {
  font-family: var(--f-display); font-weight: 900; letter-spacing: -.03em;
  font-size: clamp(22px, 3vw, 34px); margin-bottom: 22px; color: #F4F1E9;
}
.stage-sheet { max-width: none; column-gap: 46px; }
.stage-sheet .sec > h4 { color: #8A857A; }
.stage-sheet .sec > h4::after { background: #2A2724; }
.stage-sheet .sec.chorus { border-left-color: #E4705A; }
.stage-sheet .ck > i { color: #FF8A6B; }        /* acordes bien separados de la letra */
.stage-sheet .ck > i em { color: #7C766B; }
.stage-sheet .sec { break-inside: avoid-column; }

.stage-bar {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center;
  background: rgba(20, 19, 17, .94); border: 1px solid #322E29; border-radius: 8px;
  padding: 7px 10px; max-width: calc(100% - 24px);
  transition: opacity .35s; box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.stage-bar.away { opacity: 0; pointer-events: none; }
.stage-bar button {
  min-width: 44px; height: 44px; padding: 0 10px; cursor: pointer;
  background: none; border: 0; color: #F4F1E9; font-size: 17px; border-radius: 5px;
}
.stage-bar button:hover { background: #2A2724; }
.stage-bar b {
  font-family: var(--f-mono); color: #FF8A6B; font-size: 17px;
  min-width: 46px; text-align: center;
}
.stage-bar .sep { width: 1px; height: 26px; background: #322E29; margin: 0 6px; }
.stage-count { font-family: var(--f-mono); font-size: 13px; color: #8A857A; min-width: 54px;
               text-align: center; }
.stage-hint {
  position: absolute; left: 0; right: 0; top: 12px; text-align: center;
  font-size: 12px; color: #6B665C; transition: opacity .35s; pointer-events: none;
}
.stage-hint.away { opacity: 0; }

@media (max-width: 700px) {
  .stage-page { padding: 20px 16px 120px; }
  .stage-bar { gap: 2px; padding: 6px; bottom: 12px; }
  .stage-bar button { min-width: 38px; height: 40px; padding: 0 6px; font-size: 15px; }
  .stage-hint { display: none; }
}

/* -------------------------------------------------------------- móvil */
@media (max-width: 900px) {
  .cols { flex-direction: column; }
  .sidecar { width: 100%; }
  .edgrid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  /* En el móvil no caben cabecera y navegación completas. Se quedan los
     enlaces que funcionan; los de las fases siguientes se esconden hasta
     que existan (entonces pasarán a una barra inferior). */
  .nav a.dim { display: none; }
  .nav a { padding: 9px 10px; font-size: 14px; }
  .brand b { display: none; }
  .topbar-in { gap: 10px; padding: 10px 14px; }
  .row { grid-template-columns: 44px 1fr auto; gap: 10px; }
  .row .langs, .row .last { display: none; }
  .wrap { padding: 18px 14px 80px; }
  /* --- la barra de la canción, compacta ---
     En el móvil ocupaba media pantalla antes de llegar a la letra. Se queda a
     la vista lo que se toca cantando (el tono) y lo demás se despliega con
     el botón «⋯»: la cejilla, la notación y el tamaño se eligen una vez, no
     en mitad de un culto. */
  .ctrl { gap: 6px; padding: 8px 0; }
  .ctrl .grp .lbl { display: none; }
  .ctrl .grp button { width: 40px; height: 40px; font-size: 16px; }
  .ctrl .grp .val { min-width: 44px; height: 40px; line-height: 40px; font-size: 15px; }
  .ctrl .grp select { height: 40px; padding: 0 4px; font-size: 14px; }
  .ctrl .btn { height: 40px; padding: 0 12px; font-size: 15px; }
  .ctrl .btn .txt { display: none; }          /* solo el icono */
  .ctrl .spacer { display: none; }
  .ctrl .more { display: grid; width: 40px; height: 40px; }
  .ctrl .grp.extra { display: none; }
  .ctrl.open .grp.extra { display: flex; }
  .ctrl.open .btn .txt { display: inline; }   /* desplegada, con sus nombres */

  /* --- cabecera de la canción: cuanto más baja, más letra se ve ---
     Se queda el título y el número. El autor, las etiquetas y el tono de la
     iglesia se consultan en la ficha con calma, no de pie y cantando; el tono
     que importa está en grande en la barra, justo debajo. */
  .songhead { gap: 8px; }
  .songhead h1 { font-size: 22px; line-height: 1.15; margin: 0 0 4px; }
  .meta { font-size: 13px; gap: 10px; }
  .meta .m-author, .meta .m-key, .meta .m-tags { display: none; }
  .langtabs { margin-top: 12px; }
  .langtabs button { padding: 8px 14px; font-size: 15px; }

  /* En el móvil la cabecera no da para todo. Arriba se queda la identidad y
     los ajustes; la navegación baja al pie, al alcance del pulgar, que es
     como se usa de pie y con una mano. */
  .whoname { display: none; }
  .who { padding-left: 8px; border-left: 0; }

  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0;
    background: var(--bg); border-top: 1px solid var(--rule);
    display: flex; gap: 0;
    padding: 0 4px env(safe-area-inset-bottom, 0px);
  }
  .nav a {
    flex: 1; text-align: center; padding: 13px 4px; font-size: 12px;
    border-radius: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .nav a.on {
    background: none; color: var(--accent); font-weight: 600;
    box-shadow: inset 0 -3px 0 var(--accent);
  }
  .wrap { padding-bottom: 96px; }

  /* el mes entero no cabe: se ven los días con contenido, sin cuadrícula */
  .calmonth { grid-template-columns: repeat(7, 1fr); }
  .calday { min-height: 62px; padding: 4px 4px 4px; font-size: 12px; }
  .calday .addday { display: none; }
  .ev b { font-size: 11px; }
  .ev small { display: none; }
  .weekrow { grid-template-columns: 84px 1fr; gap: 10px; }
  .weekrow .wev .ev { min-width: 0; }
}

/* ------------------------------------------------------- vista de impresión */
.printbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0 0 16px; border-bottom: 1px solid var(--rule); margin-bottom: 22px;
}
.printbar .lbl { font-size: 13px; color: var(--ink-faint); }
.printbar .hint { font-size: 13px; color: var(--ink-faint); max-width: 320px; }

.printdoc { max-width: 900px; }
.printhead {
  font-family: var(--f-display); font-weight: 900; font-size: 24px;
  letter-spacing: -.03em; margin: 0 0 24px;
}
.printsong { margin-bottom: 34px; }
.printtitle {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin-bottom: 12px;
}
.printtitle b { font-family: var(--f-display); font-weight: 700; font-size: 19px; }
.printtitle span { color: var(--ink-faint); font-size: 13px; }
.printlangs { display: grid; gap: 26px; align-items: start; }
.printlang {
  font-family: var(--f-display); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px;
}
.printsheet { font-size: var(--print-size, 12pt); max-width: none; }
.printdoc.no-chords .ck > i { display: none; }
.printdoc.no-chords .line { margin-bottom: 1px; }

/* ------------------------------------------------------------ impresión */
@media print {
  .topbar, .ctrl, .langtabs, .sidecar, .legend, .searchrow, .tags,
  .toast, .printbar, .livebar, .nav, .stage-bar, .stage-hint { display: none !important; }

  body { background: #fff; color: #000; font-size: 12pt; }
  .wrap { max-width: none; padding: 0; }
  .sheet { font-size: 12pt; max-width: none; }
  .ck > i { color: #000; font-weight: 700; }
  .ck > i em { color: #555; }
  .sec { break-inside: avoid; }          /* una estrofa no se parte entre páginas */
  .songhead h1 { font-size: 20pt; }
  .printsheet { font-size: var(--print-size, 12pt); }
  .printsong { margin-bottom: 0; }
  .printsong.breakafter { break-after: page; }
  .printtitle { border-bottom: 1px solid #000; }
  .sec.chorus { border-left: 2px solid #000; }
  a { text-decoration: none; color: #000; }

  @page { margin: 14mm 12mm; }
}
