/* musica.css — app Música. Mismo lenguaje visual que Fotos/Glovo/Gadis (ver /claude/notas/SPA_KIT.md):
   variables de tema, transición de tema 0.9s SOLO mientras cambia, barra flotante con píldora, modales propios. */
:root {
    --bg: #0c0e13; --surface: #12151c; --card: #1b1f27; --card-hi: #262b36; --outline: #4b5262;
    --text: #e6e1e5; --sub: #aab0bd; --accent: #19b394; --accent-text: #04201a;
    --nav-bg: #1b1f27; --nav-border: rgba(255,255,255,.10);
    --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
    --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}
[data-theme="light"] {
    --bg: #f6f5f3; --surface: #fff; --card: #fff; --card-hi: #eeecea; --outline: #b9b5bd;
    --text: #1d1b20; --sub: #5b5761; --accent: #0e9a7e; --accent-text: #fff;
    --nav-bg: #fff; --nav-border: rgba(0,0,0,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text);
    font-family: Roboto, system-ui, sans-serif; -webkit-user-select: none; user-select: none; overflow: hidden; }
html.tema-cambiando *, html.tema-cambiando *::before, html.tema-cambiando *::after {
    transition: background-color .9s ease, color .9s ease, border-color .9s ease, fill .9s ease, box-shadow .9s ease !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 24px; height: 24px; fill: currentColor; display: block; }
.hide { display: none !important; }

#top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center;
    padding: calc(var(--sat) + 10px) 16px 8px; background: var(--bg); }
#topTitle { font-size: 22px; font-weight: 600; flex: 1; letter-spacing: .2px; }
.ib { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text);
    position: relative; overflow: hidden; flex: none; }
.ib.big { width: 48px; height: 48px; background: var(--accent); color: var(--accent-text); }
.ib.lg { width: 56px; height: 56px; }
.ib.xl { width: 72px; height: 72px; background: var(--accent); color: var(--accent-text); }
.ib.xl svg { width: 36px; height: 36px; }
.ib.on { color: var(--accent); }
.ib:active { background: rgba(127,127,127,.22); }
.ib.big:active, .ib.xl:active { filter: brightness(.9); }

#view { position: fixed; top: calc(var(--sat) + 62px); bottom: 0; left: 0; right: 0; overflow-y: auto;
    padding: 4px 14px calc(150px + var(--sab)); -webkit-overflow-scrolling: touch; }
.sec { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--sub); margin: 18px 4px 8px; }
.card { background: var(--card); border-radius: 18px; padding: 16px; }
.stat { color: var(--sub); font-size: 14px; margin-top: 4px; }
.btn { background: var(--accent); color: var(--accent-text); border-radius: 22px; padding: 11px 20px; font-weight: 600; }
.btn.sec2 { background: var(--card-hi); color: var(--text); }
.btn:active { filter: brightness(.9); }
.btns { display: flex; flex-wrap: wrap; margin: 12px 0 2px; }
.btns > * { margin: 0 10px 10px 0; }
.chips { display: flex; flex-wrap: wrap; }
.chips > * { margin: 0 8px 8px 0; }
.chip { background: var(--card); border-radius: 16px; padding: 10px 14px; font-size: 14px; }
.chip small { color: var(--sub); margin-left: 6px; }
.chip:active { background: var(--card-hi); }

.row { display: flex; align-items: center; padding: 8px 4px; border-radius: 14px; min-height: 60px; }
.row:active { background: var(--card-hi); }
.row.cur .t1 { color: var(--accent); }
.row .mt { flex: 1; min-width: 0; }
.t1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t2 { font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.dur { font-size: 12px; color: var(--sub); }
.cv { width: 48px; height: 48px; border-radius: 10px; background: var(--card-hi); flex: none; position: relative; overflow: hidden;
    display: grid; place-items: center; color: var(--sub); }
.cv svg { width: 26px; height: 26px; opacity: .7; }
.cv img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.gi .cv { width: 100%; height: 0; padding-bottom: 100%; border-radius: 14px; }
.gi .cv svg { width: 40px; height: 40px; position: absolute; top: 50%; left: 50%; margin: -20px 0 0 -20px; }
.gi .t1 { margin-top: 6px; font-size: 14px; }
.crumb { display: flex; align-items: center; margin: 4px 0 6px; }
.crumb > * + * { margin-left: 4px; }
.crumb .t1 { font-size: 18px; font-weight: 600; }
.subtabs { display: flex; background: var(--card); border-radius: 22px; padding: 4px; margin: 4px 0 10px; }
.subtabs button + button { margin-left: 6px; }
.subtabs button { flex: 1; padding: 9px 4px; border-radius: 18px; font-size: 14px; color: var(--sub); }
.subtabs button.act { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.search { display: flex; align-items: center; background: var(--card); border-radius: 26px; padding: 0 16px; height: 50px; margin: 4px 0 8px; }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 16px;
    -webkit-user-select: text; user-select: text; min-width: 0; }
.empty { text-align: center; color: var(--sub); padding: 40px 10px; }

/* mini reproductor y barra de pestañas flotantes */
#mini { position: fixed; left: 12px; right: 12px; bottom: calc(86px + var(--sab)); z-index: 30; height: 64px;
    background: var(--card-hi); border: 1px solid var(--nav-border); border-radius: 20px; display: flex; align-items: center;
    padding: 0 6px 0 8px; overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,.28); }
.mini-in { flex: 1; min-width: 0; display: flex; align-items: center; height: 100%; }
.mini-in > * + * { margin-left: 10px; }
.mini-in .cv { width: 44px; height: 44px; }
#miniBar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(127,127,127,.25); }
#miniFill { display: block; height: 100%; width: 0; background: var(--accent); }
#nav { position: fixed; left: 12px; right: 12px; bottom: calc(14px + var(--sab)); z-index: 30; height: 64px; display: flex;
    background: var(--nav-bg); border: 1px solid var(--nav-border); border-radius: 24px; padding: 6px;
    box-shadow: 0 4px 18px rgba(0,0,0,.28); }
#navPill { position: absolute; top: 6px; bottom: 6px; left: 0; width: 0; border-radius: 18px; background: var(--accent);
    transition: transform .28s cubic-bezier(.3,.9,.3,1), width .28s cubic-bezier(.3,.9,.3,1); }
.ni { flex: 1; position: relative; z-index: 1; display: grid; place-items: center; color: var(--sub); border-radius: 18px; }
.ni.act { color: var(--accent-text); }

/* pantalla de reproducción */
#np { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform .32s cubic-bezier(.3,.9,.3,1); padding-top: var(--sat); }
#np.open { transform: translateY(0); }
.np-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; }
.np-lbl { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--sub); }
.np-body { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px 26px calc(24px + var(--sab));
    justify-content: space-between; min-height: 0; }
.np-cv { width: 70vmin; height: 70vmin; max-width: 44vh; max-height: 44vh; border-radius: 24px; margin-top: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.np-cv svg { width: 25%; height: 25%; }
.np-info { width: 100%; text-align: left; }
.np-info .t1 { font-size: 22px; font-weight: 600; }
.np-info .t2 { font-size: 16px; margin-top: 4px; }
.np-seek { width: 100%; }
.tm { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); margin-top: 2px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: none; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: var(--outline); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent); margin-top: -6.5px; }
.np-ctl { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 420px; }

/* modal propio, toast */
#mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 80; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center;
    padding: 12px calc(12px) calc(12px + var(--sab)); }
#modal { width: 100%; max-width: 480px; background: var(--card); border-radius: 24px; padding: 20px; max-height: 80vh; overflow-y: auto; }
#modal h3 { font-size: 18px; margin-bottom: 8px; }
#modal p { color: var(--sub); font-size: 14px; margin-bottom: 12px; }
#modal input { width: 100%; background: var(--card-hi); border: 0; outline: 0; border-radius: 14px; color: var(--text); font: inherit;
    padding: 14px; -webkit-user-select: text; user-select: text; margin-bottom: 8px; }
#modal .acts { display: flex; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
#modal .acts > * { margin: 0 0 0 10px; }
.mi { display: flex; align-items: center; padding: 14px 6px; border-radius: 12px; font-size: 16px; }
.mi:active { background: var(--card-hi); }
#toast { position: fixed; left: 50%; bottom: calc(168px + var(--sab)); transform: translateX(-50%) translateY(20px); z-index: 90;
    background: var(--card-hi); color: var(--text); padding: 10px 18px; border-radius: 20px; font-size: 14px; opacity: 0;
    transition: opacity .25s, transform .25s; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* separaciones que antes daba gap en flex */
.row > * + * { margin-left: 12px; }
.mi > * + * { margin-left: 12px; }
.search > * + * { margin-left: 8px; }
.stat + .btns { margin-top: 10px; }

/* radio del coche / pantallas apaisadas anchas: reproductor a dos columnas y controles grandes */
@media (orientation: landscape) and (min-width: 700px) {
    #view { padding-left: 24px; padding-right: 24px; }
    .row { min-height: 72px; }
    .t1 { font-size: 18px; }
    .t2 { font-size: 14px; }
    .cv { width: 56px; height: 56px; }
    .ib { width: 52px; height: 52px; }
    #nav { height: 72px; }
    #mini { height: 72px; bottom: calc(96px + var(--sab)); }
    .np-body { padding-top: 0; padding-bottom: 10px; }
    .np-cv { width: 36vh; height: 36vh; max-width: 36vh; max-height: 36vh; margin: 0; }
    .np-info .t1 { font-size: 20px; }
    .np-seek, .np-info { max-width: 720px; }
}
body.car .row { min-height: 80px; }

/* progreso de descargas al dispositivo */
#dlpill { position: fixed; right: 16px; bottom: calc(160px + var(--sab)); z-index: 35; background: var(--accent); color: var(--accent-text);
    border-radius: 20px; padding: 8px 8px 8px 16px; font-size: 13px; font-weight: 600; display: flex; align-items: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.3); }
#dlpill button { margin-left: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.15); color: inherit; }
