/* MUSIRIVA — biblioteca profesional, sin afectar Estudio Agentes.
   Las acciones, audio, créditos y almacenamiento conservan sus manejadores. */

/* La tarjeta Canciones recientes es redundante solo en móvil. NO ocultarla
   cuando el controlador muestra Mi biblioteca dentro del mismo panel. */
@media(max-width:860px){
  html body.musiriva-branded #songResultCard:not(:has(#myLibrarySection.eco-library-view[style*="display: block"])){
    display:none!important;
    height:0!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
  }
  html body.musiriva-branded main.grid{
    gap:0!important;
    padding-bottom:20px!important;
  }
  html body.musiriva-branded #songResultCard:has(#myLibrarySection.eco-library-view[style*="display: block"]){
    display:block!important;
    margin-top:0!important;
    padding:15px!important;
    min-height:0!important;
  }
}

/* Biblioteca: tarjetas y portadas, herencia MUSIRIVA (nunca verde). */
html body.musiriva-branded #songLibrary .library-item{
  position:relative!important;
  overflow:visible!important;
  min-width:0!important;
  border:1px solid #67407f!important;
  border-radius:16px!important;
  background:linear-gradient(135deg,#291536,#1c0f2d)!important;
  box-shadow:inset 0 1px #fff1!important;
}
html body.musiriva-branded #songLibrary .library-title{
  color:#faf0ff!important;
  font-size:clamp(14px,2.5vw,17px)!important;
  line-height:1.3!important;
  overflow-wrap:anywhere!important;
  max-width:100%!important;
}
html body.musiriva-branded #songLibrary .library-meta{
  color:#c9b5d9!important;
  line-height:1.4!important;
  margin-top:5px!important;
}
html body.musiriva-branded #songLibrary .library-item img[alt="Portada"]{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  border-radius:10px!important;
}
html body.musiriva-branded #songLibrary .library-item audio{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:37px!important;
  accent-color:#ba62ec!important;
  color-scheme:dark;
}
html body.musiriva-branded #songLibrary [data-more]{
  background:#321944!important;
  border:1px solid #9d58c5!important;
  color:#f0c5ff!important;
  border-radius:11px!important;
  width:35px!important;
  height:35px!important;
  font-size:22px!important;
  box-shadow:none!important;
}
html body.musiriva-branded #songLibrary [data-more]:hover,
html body.musiriva-branded #songLibrary [data-more]:focus-visible{
  outline:2px solid #f0acf8!important;
  outline-offset:1px!important;
  background:#54256e!important;
  color:white!important;
}

/* Menú del botón ⋮: posición adaptada por JS, scroll solo en el menú. */
html body.musiriva-branded #songLibrary [data-menu]{
  box-sizing:border-box!important;
  position:fixed!important;
  z-index:640!important;
  top:var(--musiriva-menu-top,100px)!important;
  left:var(--musiriva-menu-left,12px)!important;
  right:auto!important;
  bottom:auto!important;
  width:min(264px,calc(100vw - 24px))!important;
  min-width:0!important;
  max-width:calc(100vw - 24px)!important;
  max-height:min(342px,calc(100dvh - 155px))!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  padding:7px!important;
  margin:0!important;
  border:1px solid #a763ca!important;
  border-radius:15px!important;
  background:linear-gradient(155deg,#30183f,#21102e)!important;
  box-shadow:0 20px 46px #050010c9,0 0 0 1px #ffffff0d!important;
  scrollbar-width:thin;
  scrollbar-color:#9462ab #241430;
}
html body.musiriva-branded #songLibrary [data-menu] button{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:37px!important;
  margin:2px 0!important;
  padding:7px 9px!important;
  gap:9px!important;
  border:1px solid transparent!important;
  border-radius:9px!important;
  background:transparent!important;
  color:#f8edff!important;
  font-family:inherit!important;
  font-size:13px!important;
  font-weight:650!important;
  line-height:1.32!important;
  text-align:left!important;
  white-space:normal!important;
  transition:background-color .13s,border-color .13s!important;
}
html body.musiriva-branded #songLibrary [data-menu] button:hover,
html body.musiriva-branded #songLibrary [data-menu] button:focus-visible{
  border-color:#9156b4!important;
  background:#49235c!important;
  color:#fff!important;
  outline:0!important;
}
html body.musiriva-branded #songLibrary [data-menu] button .musiriva-menu-icon{
  display:inline-grid!important;
  flex:0 0 19px!important;
  width:19px!important;
  height:19px!important;
  place-items:center!important;
  font-size:16px!important;
  line-height:1!important;
  text-align:center!important;
}
html body.musiriva-branded #songLibrary [data-menu] button .musiriva-menu-label{
  display:block!important;
  flex:1!important;
  min-width:0!important;
}
html body.musiriva-branded #songLibrary [data-menu] [data-del]{
  margin-top:5px!important;
  background:#41212e!important;
  border-color:#7d3b55!important;
  color:#ffb6bc!important;
}
html body.musiriva-branded #songLibrary [data-menu] [data-del]:hover,
html body.musiriva-branded #songLibrary [data-menu] [data-del]:focus-visible{
  background:#552332!important;
  border-color:#c95b72!important;
  color:#fff1f1!important;
}

/* Master Pro, video y separar pistas: solamente fuera de la interfaz móvil. */
@media(max-width:860px){
  html body.musiriva-branded #songLibrary [data-menu] [data-master-pro],
  html body.musiriva-branded #songLibrary [data-menu] [data-video],
  html body.musiriva-branded #songLibrary [data-menu] [data-stems]{
    display:none!important;
  }
  html body.musiriva-branded #songLibrary [data-menu]{
    width:min(260px,calc(100vw - 20px))!important;
    max-width:calc(100vw - 20px)!important;
    max-height:min(324px,calc(100dvh - 160px))!important;
  }
  html body.musiriva-branded #songLibrary .library-item{
    margin-top:10px!important;
    padding-bottom:12px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  html body.musiriva-branded #songLibrary [data-menu] button{transition:none!important}
}