:root {
  --tinta: #1c1a2e;
  --panel: #15142a;
  --panel-2: #1f1d3a;
  --acento: #e0a96d;
  --acento-2: #c97b4a;
  --texto-claro: #ece9f6;
  --texto-tenue: #a19dbb;
  --papel: #fffdf8;
  --fondo: #ece6da;
  --radio: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--tinta);
  background: radial-gradient(circle at 70% 20%, #f6f1e7, var(--fondo) 60%);
}
button { font: inherit; cursor: pointer; border: 0; }

/* ---------- Chat ---------- */
#chat {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel), #100f20);
  color: var(--texto-claro);
  box-shadow: 4px 0 30px #0003;
  z-index: 1;
}
.marca { display: flex; align-items: center; gap: 14px; padding: 22px 22px 18px; border-bottom: 1px solid #ffffff12; }
.logo {
  width: 48px; height: 48px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 30px; color: var(--panel);
  background: linear-gradient(135deg, var(--acento), var(--acento-2));
  border-radius: 14px;
  box-shadow: 0 6px 18px #e0a96d40;
}
.marca h1 { margin: 0; font-family: "Playfair Display", serif; font-size: 22px; letter-spacing: .3px; }
.marca p { margin: 3px 0 0; font-size: 13px; color: var(--texto-tenue); }

#mensajes { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
#mensajes::-webkit-scrollbar { width: 8px; }
#mensajes::-webkit-scrollbar-thumb { background: #ffffff1a; border-radius: 4px; }

.msg { display: flex; gap: 10px; align-items: flex-end; animation: aparecer .25s ease-out; }
.msg.usuario { justify-content: flex-end; }
.avatar {
  width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 50%; font-size: 17px; color: var(--panel);
  background: linear-gradient(135deg, var(--acento), var(--acento-2));
}
.burbuja { padding: 11px 14px; border-radius: 16px; line-height: 1.5; font-size: 14.5px; white-space: pre-wrap; max-width: 86%; }
.asistente .burbuja { background: var(--panel-2); border-bottom-left-radius: 4px; }
.usuario .burbuja { background: linear-gradient(135deg, var(--acento), var(--acento-2)); color: #1b1408; border-bottom-right-radius: 4px; font-weight: 500; }
.error .burbuja { background: #4a1f2a; color: #ffd6dc; }

.estado .burbuja { font-style: italic; color: var(--texto-tenue); }
.escribiendo .burbuja { display: flex; gap: 5px; padding: 15px 16px; }
.escribiendo .burbuja span { width: 7px; height: 7px; border-radius: 50%; background: var(--texto-tenue); animation: rebote 1.2s infinite; }
.escribiendo .burbuja span:nth-child(2) { animation-delay: .15s; }
.escribiendo .burbuja span:nth-child(3) { animation-delay: .3s; }

#sugerencias { display: flex; flex-direction: column; gap: 8px; margin-left: 40px; }
.sugerencia {
  text-align: left; padding: 10px 13px; border-radius: 12px; font-size: 13.5px;
  color: var(--texto-claro); background: transparent; border: 1px solid #ffffff22;
  transition: background .15s, border-color .15s, transform .15s;
}
.sugerencia:hover { background: #ffffff0d; border-color: var(--acento); transform: translateX(3px); }

#formulario {
  display: flex; align-items: flex-end; gap: 10px; margin: 14px 16px 18px; padding: 8px 8px 8px 16px;
  background: var(--panel-2); border: 1px solid #ffffff1a; border-radius: 18px;
  transition: border-color .15s;
}
#formulario:focus-within { border-color: var(--acento); }
#entrada {
  flex: 1; resize: none; max-height: 160px; padding: 8px 0; font: inherit; font-size: 14.5px;
  color: var(--texto-claro); background: transparent; border: 0; outline: none;
}
#entrada::placeholder { color: var(--texto-tenue); }
#enviar {
  width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px;
  color: #1b1408; background: linear-gradient(135deg, var(--acento), var(--acento-2));
  transition: transform .15s, opacity .15s;
}
#enviar:hover:not(:disabled) { transform: scale(1.06); }
#enviar:disabled { opacity: .4; cursor: default; }

/* ---------- Partitura ---------- */
main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 16px 20px 20px; }

#barra {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 20px; margin-bottom: 14px;
  background: #fffdf8cc; backdrop-filter: blur(10px);
  border: 1px solid #00000012; border-radius: 999px; box-shadow: 0 4px 20px #0000000d;
}
#titulo-partitura { font-family: "Playfair Display", serif; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acciones { display: flex; gap: 6px; }
.accion { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--tinta); background: #0000000a; transition: background .15s; }
.accion:hover:not(:disabled) { background: #e0a96d40; }
.accion:disabled { opacity: .35; cursor: default; }
.icono {
  width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icono.flecha { width: 14px; height: 14px; margin-left: -2px; opacity: .6; }
.grupo-acciones { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: #0000000a; }
.grupo-acciones .accion { background: transparent; }
.grupo-acciones .accion.activo { background: var(--acento); }
.accion.principal:not(:disabled) {
  color: #1b1408; font-weight: 600; background: linear-gradient(135deg, var(--acento), var(--acento-2));
  box-shadow: 0 2px 10px #c97b4a40;
}
.accion.principal:hover:not(:disabled) { filter: brightness(1.06); }

.desplegable { position: relative; }
.menu-desplegable {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; min-width: 270px; padding: 6px;
  background: #fff; border: 1px solid #00000014; border-radius: 14px; box-shadow: 0 12px 40px #1c1a2e2e;
}
.menu-desplegable[hidden] { display: none; }
.menu-desplegable button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px;
  font-size: 14px; color: var(--tinta); background: transparent; text-align: left;
}
.menu-desplegable button:hover { background: #e0a96d2e; }
.menu-desplegable button .icono { color: var(--acento-2); }
.menu-desplegable #ver-codigo { border-top: 1px solid #0000000f; border-radius: 0 0 9px 9px; padding-top: 11px; }

/* ---------- Versiones ---------- */
#lista-versiones { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
#lista-versiones li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #0000000d; }
#lista-versiones li:last-child { border-bottom: 0; }
#lista-versiones li.vacia { color: #8b8170; font-size: 14px; }
.etiqueta-version { display: block; font-size: 14px; font-weight: 500; }
.fecha-version { display: block; font-size: 12.5px; color: #8b8170; }
#lista-versiones button { flex-shrink: 0; padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--tinta); background: #e0a96d40; }
#lista-versiones button:hover:not(:disabled) { background: #e0a96d80; }
#lista-versiones button:disabled { opacity: .6; cursor: default; }

/* ---------- Compartir ---------- */
#dialogo-compartir {
  width: min(480px, calc(100vw - 24px)); padding: 22px 24px; border: 0; border-radius: 18px;
  color: var(--tinta); background: var(--papel); box-shadow: 0 30px 80px #0000004d;
}
#dialogo-compartir::backdrop { background: #15142a99; backdrop-filter: blur(3px); }
.cabecera-dialogo { display: flex; align-items: center; justify-content: space-between; }
.cabecera-dialogo h2 { margin: 0; font-family: "Playfair Display", serif; font-size: 22px; }
.boton-icono { display: grid; place-items: center; padding: 6px; border-radius: 8px; color: #6b6253; background: transparent; }
.boton-icono:hover { background: #0000000d; }
.texto-dialogo { margin: 8px 0 16px; font-size: 14px; line-height: 1.5; color: #6b6253; }
.campo-enlace {
  display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 12px;
  border: 1px solid #00000018; border-radius: 12px; background: #fff;
}
.campo-enlace > .icono { color: #a39a8a; }
#enlace-compartido { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 14px; color: var(--tinta); background: transparent; }
.boton-dialogo {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; font-size: 14px;
  font-weight: 600; color: #1b1408; background: linear-gradient(135deg, var(--acento), var(--acento-2)); text-decoration: none;
}
.boton-dialogo.whatsapp { color: #fff; background: #25d366; }
.compartir-qr { display: flex; align-items: center; gap: 18px; margin-top: 18px; }
.compartir-qr p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #6b6253; }
#codigo-qr { flex: 0 0 132px; height: 132px; padding: 6px; border-radius: 12px; background: #fff; border: 1px solid #0000000f; }
#codigo-qr svg { display: block; width: 100%; height: 100%; }
.enlace-peligro { margin-top: 18px; padding: 0; font-size: 13.5px; color: #b3423a; background: none; text-decoration: underline; }

#hoja {
  /* Crece con la partitura (no encoge): con overflow hidden, si encogiera, cortaría las últimas líneas. */
  flex: 1 0 auto; max-width: 1600px; width: 100%; margin: 0 auto;
  background: var(--papel); border-radius: 6px;
  box-shadow: 0 1px 2px #0000000f, 0 12px 40px #3b2a1426;
  overflow: hidden;
}
#reproductor:not(:empty) { border-bottom: 1px solid #0000000d; }
#reproductor .abcjs-inline-audio { background: var(--tinta); border-radius: 0; padding: 8px 14px; height: auto; }
#reproductor .abcjs-inline-audio .abcjs-btn { background: transparent; }
#reproductor .abcjs-inline-audio .abcjs-midi-progress-background { background: #ffffff2a; }
#reproductor .abcjs-inline-audio .abcjs-midi-progress-indicator { background: var(--acento); }
#partitura { padding: 20px 28px; min-height: 420px; }
#partitura .abcjs-note_selected { fill: var(--acento-2); }

.vacio { height: 100%; min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #8b8170; }
.vacio-icono { font-size: 64px; color: var(--acento); opacity: .8; animation: flotar 3s ease-in-out infinite; }
.vacio h2 { margin: 12px 0 6px; font-family: "Playfair Display", serif; color: var(--tinta); }
.vacio p { margin: 0; }

#codigo {
  display: block; width: 100%; min-height: 260px; margin: 0; padding: 20px 28px; resize: vertical;
  font: 13px/1.5 ui-monospace, "JetBrains Mono", monospace; color: var(--tinta);
  background: #f4efe5; border: 0; border-top: 1px solid #0000000d; outline: none;
}
#codigo[hidden] { display: none; }


/* ---------- Acceso ---------- */
#acceso {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto;
  display: flex; align-items: center; justify-content: center; gap: clamp(32px, 6vw, 96px);
  padding: 40px clamp(20px, 5vw, 80px);
  background: radial-gradient(circle at 30% 20%, #2a2650, var(--panel) 55%, #0b0a17);
}
.presentacion { flex: 1; max-width: 620px; color: var(--texto-claro); animation: aparecer .5s ease-out; }
.marca-presentacion { display: flex; align-items: center; gap: 12px; font-family: "Playfair Display", serif; font-size: 20px; font-weight: 600; }
.marca-presentacion .logo { width: 40px; height: 40px; font-size: 24px; }
.presentacion h2 { margin: 34px 0 16px; font-family: "Playfair Display", serif; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.12; font-weight: 700; }
.presentacion h2 em { font-style: italic; color: var(--acento); }
.subtitulo { margin: 0 0 28px; font-size: 16.5px; line-height: 1.6; color: var(--texto-tenue); }
.ventajas { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
.ventajas li { display: flex; gap: 12px; font-size: 14px; line-height: 1.45; color: var(--texto-tenue); }
.ventajas strong { display: block; margin-bottom: 2px; color: var(--texto-claro); font-weight: 600; }
.ventajas .icono { width: 20px; height: 20px; margin-top: 2px; color: var(--acento); }
.muestra {
  padding: 14px 18px 6px; border-radius: 10px; background: var(--papel); color: var(--tinta);
  box-shadow: 0 20px 50px #0007; transform: rotate(-1deg);
}
.muestra:empty { display: none; }
#acceso[hidden] { display: none; }
.tarjeta-acceso {
  width: min(400px, 92vw); padding: 36px 32px 28px; text-align: center; color: var(--texto-claro);
  background: #ffffff0a; border: 1px solid #ffffff1a; border-radius: 22px;
  box-shadow: 0 30px 80px #0008; backdrop-filter: blur(12px); animation: aparecer .4s ease-out;
}
.logo.grande { width: 72px; height: 72px; margin: 0 auto 14px; font-size: 46px; border-radius: 20px; }
.tarjeta-acceso h1 { margin: 0; font-family: "Playfair Display", serif; font-size: 28px; }
.lema { margin: 6px 0 26px; color: var(--texto-tenue); font-size: 14px; }
.boton-google, .boton-principal {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; border-radius: 12px; font-weight: 600; font-size: 15px; transition: transform .15s, filter .15s;
}
.boton-google { background: #fff; color: #222; }
.boton-principal { background: linear-gradient(135deg, var(--acento), var(--acento-2)); color: #1b1408; }
.boton-google:hover, .boton-principal:hover { transform: translateY(-1px); filter: brightness(1.05); }
.separador { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--texto-tenue); font-size: 12.5px; }
.separador::before, .separador::after { content: ""; flex: 1; height: 1px; background: #ffffff1f; }
#form-acceso { display: flex; flex-direction: column; gap: 10px; }
#form-acceso input {
  padding: 12px 14px; border-radius: 12px; font: inherit; font-size: 14.5px; color: var(--texto-claro);
  background: #ffffff0d; border: 1px solid #ffffff22; outline: none;
}
#form-acceso input:focus { border-color: var(--acento); }
.cambiar-modo { margin: 16px 0 0; font-size: 13.5px; color: var(--texto-tenue); }
.cambiar-modo a { color: var(--acento); }
.texto-verificar { margin: 0 0 18px; font-size: 14.5px; line-height: 1.55; color: var(--texto-tenue); }
.texto-verificar strong { color: var(--texto-claro); }
#ya-verificado { width: 100%; }
.aviso-acceso { margin: 14px 0 0; padding: 10px; border-radius: 10px; background: #1f3a2c; color: #cdf3dc; font-size: 13.5px; }
#cuota { margin: 0 16px -4px; font-size: 12px; color: var(--texto-tenue); text-align: right; }
#cuota.agotandose { color: #ffb08a; }
.error-acceso { margin: 14px 0 0; padding: 10px; border-radius: 10px; background: #4a1f2a; color: #ffd6dc; font-size: 13.5px; }

/* ---------- Menú y biblioteca ---------- */
.menu { display: flex; gap: 6px; padding: 10px 16px; border-bottom: 1px solid #ffffff12; }
.menu-boton {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 6px; border-radius: 10px; font-size: 13px; color: var(--texto-claro);
  background: #ffffff0a; transition: background .15s;
}
.menu-boton:hover, .menu-boton.activo { background: #ffffff1a; }
#ir-panel { flex: 0 0 auto; padding: 8px 12px; color: var(--texto-tenue); text-decoration: none; }
#ir-panel[hidden] { display: none; }
#salir { flex: 0 0 auto; padding: 8px 12px; color: var(--texto-tenue); }
#biblioteca { max-height: 45%; overflow-y: auto; border-bottom: 1px solid #ffffff12; background: #0000002a; }
#lista-partituras { list-style: none; margin: 0; padding: 8px; }
#lista-partituras li {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  transition: background .15s;
}
#lista-partituras li:hover, #lista-partituras li.actual { background: #ffffff12; }
#lista-partituras .nombre { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
#lista-partituras .fecha { font-size: 12px; color: var(--texto-tenue); }
#lista-partituras .borrar { padding: 2px 6px; border-radius: 6px; color: var(--texto-tenue); background: transparent; opacity: 0; }
#lista-partituras li:hover .borrar { opacity: 1; }
#lista-partituras .borrar:hover { color: #ff9aa8; background: #ffffff12; }
#lista-partituras .vacia { cursor: default; color: var(--texto-tenue); font-size: 13.5px; }

/* ---------- Adjuntar partitura ---------- */
#adjuntar {
  width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px;
  color: var(--texto-tenue); background: transparent; transition: color .15s, background .15s;
}
#adjuntar:hover { color: var(--acento); background: #ffffff0d; }
#formulario { padding-left: 8px; }
#adjunto-elegido {
  display: flex; align-items: center; gap: 8px; margin: 0 16px -6px; padding: 8px 10px 8px 12px;
  font-size: 13.5px; color: var(--texto-claro); background: #e0a96d22; border: 1px solid #e0a96d55;
  border-radius: 12px;
}
#adjunto-elegido[hidden] { display: none; }
#nombre-adjunto { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#quitar-adjunto { padding: 2px 6px; border-radius: 6px; color: var(--texto-tenue); background: transparent; }
#quitar-adjunto:hover { color: #ff9aa8; background: #ffffff12; }
#chat.arrastrando { box-shadow: inset 0 0 0 3px var(--acento); }

/* ---------- Paneles: transponer y partes ---------- */
.panel { padding: 12px 16px; background: #fffdf8f2; border-bottom: 1px solid #0000000f; }
.panel[hidden] { display: none; }
.titulo-panel { margin: 0 0 8px; font-weight: 600; font-size: 14px; }
.nota-panel { font-weight: 400; color: #8b8170; font-size: 12.5px; }
.fila-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13.5px; }
.panel .grupo { display: flex; gap: 2px; padding: 3px; background: #0000000a; border-radius: 12px; }
.panel .grupo button { min-width: 44px; height: 34px; padding: 0 8px; border-radius: 9px; font-size: 14px; font-weight: 600; background: transparent; color: var(--tinta); }
.panel .grupo button:hover { background: #e0a96d55; }
.panel select { margin-left: 6px; padding: 6px 8px; border-radius: 9px; border: 1px solid #0000001f; font: inherit; background: #fff; }
#desplazamiento { color: #8b8170; }
#lista-partes { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#lista-partes li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #0000000a; font-size: 14px; }
#lista-partes .nombre-parte { flex: 1; min-width: 120px; font-weight: 600; }
#lista-partes select { margin: 0; }
.boton-panel, #lista-partes button { padding: 7px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--tinta); background: #e0a96d40; }
.boton-panel:hover, #lista-partes button:hover { background: #e0a96d80; }

/* ---------- Editor de notas ---------- */
.accion.destacada:not(:disabled) { background: #e0a96d33; }
.accion.activo { background: var(--acento); color: #1b1408; }
#herramientas {
  position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 14px; background: #fffdf8f2; backdrop-filter: blur(6px); border-bottom: 1px solid #0000000f;
}
#herramientas[hidden] { display: none; }
#ayuda-edicion { flex-basis: 100%; margin: 0; font-size: 13px; color: #8b8170; }
#herramientas .grupo { display: flex; gap: 2px; padding: 3px; background: #0000000a; border-radius: 12px; }
#herramientas button {
  min-width: 38px; height: 36px; padding: 0 8px; border-radius: 9px; font-size: 19px; line-height: 1;
  color: var(--tinta); background: transparent; transition: background .12s;
}
#herramientas button:hover:not(:disabled) { background: #e0a96d55; }
#herramientas button:disabled { opacity: .3; cursor: default; }
#estado-guardado { margin-left: auto; font-size: 12.5px; color: #8b8170; }
body.editando #partitura .abcjs-note, body.editando #partitura .abcjs-rest { cursor: pointer; }
body.editando #partitura .abcjs-note:hover, body.editando #partitura .abcjs-rest:hover { fill: var(--acento-2); }

@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } }
@keyframes rebote { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes flotar { 50% { transform: translateY(-8px); } }

/* ---------- Móvil: una vista cada vez (Chat / Partitura) con pestañas abajo ---------- */
#pestanas { display: none; }

@media (max-width: 900px) {
  html, body { height: 100dvh; }
  body { flex-direction: column; overflow: hidden; }
  #chat, main { width: 100%; flex: 1; min-height: 0; }
  body:not(.vista-partitura) main { display: none; }
  body.vista-partitura #chat { display: none; }

  .marca { padding: 14px 16px 12px; }
  .logo { width: 40px; height: 40px; font-size: 24px; border-radius: 12px; }
  .marca h1 { font-size: 19px; }
  .menu { padding: 8px 12px; }
  #mensajes { padding: 14px 12px; }
  .burbuja { max-width: 90%; font-size: 15px; }
  /* En el móvil, el formulario va justo después del titular y las ventajas debajo. */
  #acceso { flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 0; padding: 28px 18px 40px; }
  .presentacion { display: contents; }
  .marca-presentacion { order: 1; }
  .presentacion h2 { order: 2; margin-top: 22px; }
  .subtitulo { order: 3; }
  .tarjeta-acceso { order: 4; width: 100%; margin-bottom: 32px; }
  .ventajas { order: 5; }
  .tarjeta-acceso .logo.grande, .tarjeta-acceso h1, .tarjeta-acceso .lema { display: none; }
  .ventajas { grid-template-columns: 1fr; gap: 14px; }
  .muestra { display: none !important; }
  #sugerencias { margin-left: 0; }
  #formulario { margin: 10px 12px; }
  #entrada { font-size: 16px; } /* evita que iOS haga zoom al escribir */

  main { padding: 10px 10px 0; }
  #barra { border-radius: 16px; padding: 8px 8px 8px 14px; margin-bottom: 10px; }
  #titulo-partitura { font-size: 16px; }
  .accion { padding: 8px 10px; }
  .accion span, .accion .flecha { display: none; }
  .grupo-acciones { background: transparent; padding: 0; }
  .compartir-qr { flex-direction: column; text-align: center; }
  #hoja { border-radius: 10px; }
  #partitura { padding: 12px 6px; min-height: 0; }
  .vacio { min-height: 50vh; padding: 0 20px; }

  #pestanas {
    display: flex; flex-shrink: 0; gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: var(--panel); border-top: 1px solid #ffffff14;
  }
  .pestana {
    flex: 1; position: relative; padding: 10px; border-radius: 12px; font-size: 14px; font-weight: 600;
    color: var(--texto-tenue); background: transparent;
  }
  .pestana.activa { color: var(--panel); background: linear-gradient(135deg, var(--acento), var(--acento-2)); }
  .pestana .aviso {
    position: absolute; top: 6px; right: calc(50% - 52px); width: 9px; height: 9px; border-radius: 50%;
    background: #ff6b81; box-shadow: 0 0 0 2px var(--panel);
  }
}

@media print {
  #chat, #barra, #reproductor, #codigo, #pestanas, #herramientas, .panel, #dialogo-compartir { display: none !important; }
  main { display: block !important; }
  body { background: #fff; display: block; }
  main { padding: 0; overflow: visible; }
  #hoja { box-shadow: none; }
  #partitura { padding: 0; }
}
