/* Panel de música — design system (contrato: mockups/panel-v1.html, variante A) */

@font-face {
    font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url(fonts/inter-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: Inter; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url(fonts/inter-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============ Tokens ============ */
:root {
    --bg: #0B0D14;
    --s1: #11141D;
    --s2: #171B27;
    --s3: #1F2433;
    --line: rgba(255,255,255,.06);
    --line-2: rgba(255,255,255,.11);
    --text: #ECEEF5;
    --muted: #8B91A7;
    --faint: #5C6279;
    --accent: #7C5CFF;
    --accent-hi: #9580FF;
    --accent-soft: rgba(124,92,255,.14);
    --accent-glow: rgba(124,92,255,.35);
    --danger: #FF5C7A;
    --danger-soft: rgba(255,92,122,.12);
    --ok: #3DD68C;
    --warn: #FFB454;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 8px 24px rgba(0,0,0,.35);
    --shadow-3: 0 20px 48px rgba(0,0,0,.5);
    --ease: cubic-bezier(.2,.7,.2,1);
    --bar-h: 84px;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
    background: var(--bg); color: var(--text);
    font: 14px/1.45 Inter, system-ui, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
code { background: var(--s3); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-glow); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--s3); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #2B3145; background-clip: content-box; border: 2px solid transparent; }

/* ============ Login ============ */
.view-login { height: 100dvh; display: grid; place-items: center; padding: 16px; overflow: auto; }
.login-card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 40px 36px; max-width: 400px; text-align: center; }
.login-card .brand-mark { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 20px; }
.login-card .brand-mark svg { width: 28px; height: 28px; }
.login-card h1 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 8px; }
.login-card p { color: var(--muted); margin-bottom: 24px; }
.login-card .btn { height: 44px; padding: 0 22px; border-radius: 22px; font-size: 14px; }

/* ============ Estructura ============ */
.app {
    height: 100dvh;
    display: grid;
    grid-template-columns: 248px minmax(0,1fr) 320px;
    grid-template-rows: minmax(0,1fr) auto;
    grid-template-areas: "side main ctx" "bar bar bar";
}
.sidebar { grid-area: side; background: var(--s1); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.main { grid-area: main; min-height: 0; overflow-y: auto; }
.ctx { grid-area: ctx; background: var(--s1); border-left: 1px solid var(--line); overflow-y: auto; padding: 20px; }
.playerbar { grid-area: bar; }
.mnav { display: none; }
.main-inner { max-width: 920px; margin: 0 auto; padding: 20px 28px 40px; }

/* ============ Sidebar ============ */
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 14px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 4px 14px var(--accent-glow); flex: none; }
.brand-mark svg { width: 16px; height: 16px; color: #fff; }
.guild {
    position: relative; margin: 0 12px 14px; padding: 8px 10px; display: flex; align-items: center; gap: 10px;
    background: var(--s2); border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color .15s, background .15s;
}
.guild:hover { border-color: var(--line-2); background: var(--s3); }
.guild:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.guild select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; appearance: none; }
.guild select option { background: var(--s2); color: var(--text); }
.guild-ico { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg,#2a3352,#3d2f6b); display: grid; place-items: center; font-weight: 700; font-size: 12px; overflow: hidden; flex: none; }
.guild-ico img { width: 100%; height: 100%; object-fit: cover; }
.guild-txt { flex: 1; min-width: 0; }
.guild-txt small { display: block; color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.guild-txt span { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild > svg { color: var(--faint); }
.nav { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--muted); font-weight: 500;
    width: 100%; text-align: left; position: relative; transition: color .15s, background .15s;
}
.nav-item:hover { color: var(--text); background: var(--s2); }
.nav-item.active { color: var(--text); background: var(--accent-soft); }
.nav-item.active svg { color: var(--accent-hi); }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11px; font-weight: 600; font-style: normal; padding: 1px 7px; border-radius: 20px; background: var(--s3); color: var(--muted); }
.nav-item.only-narrow { display: none; }
.side-label { padding: 20px 20px 8px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; justify-content: space-between; }
.side-label button { color: var(--muted); padding: 2px; border-radius: 6px; display: grid; }
.side-label button:hover { color: var(--text); background: var(--s3); }
.side-pls { flex: 1; overflow-y: auto; padding: 0 10px; min-height: 0; }
.side-pls-empty { padding: 4px 10px; font-size: 12.5px; color: var(--faint); }
.side-pl { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r-sm); width: 100%; text-align: left; color: var(--muted); transition: color .15s, background .15s; }
.side-pl:hover { background: var(--s2); color: var(--text); }
.side-pl.active { color: var(--text); background: var(--s2); }
.side-pl .mosaic { width: 34px; height: 34px; border-radius: 7px; }
.side-pl div { min-width: 0; }
.side-pl b { display: block; font-weight: 500; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-pl small { color: var(--faint); font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.badge { font-size: 10px; font-weight: 600; font-style: normal; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-hi); margin-left: auto; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#7C5CFF,#3DD6C6); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.userchip span { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); transition: color .15s, background .15s, transform .1s; flex: none; }
.iconbtn:hover { color: var(--text); background: var(--s3); }
.iconbtn:active { transform: scale(.94); }
.iconbtn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.iconbtn:disabled, .btn:disabled, .playbtn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ============ Cabecera móvil ============ */
.mhead { display: none; align-items: center; gap: 10px; padding-bottom: 12px; }

/* ============ Buscador ============ */
.search { position: sticky; top: 0; z-index: 20; padding: 0 0 16px; margin-top: -4px; background: linear-gradient(var(--bg) 78%, transparent); }
.search-wrap { position: relative; }
.search-box {
    display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 16px; background: var(--s2); border: 1px solid var(--line);
    border-radius: 24px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-box:hover { border-color: var(--line-2); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--s1); }
.search-box > svg { color: var(--muted); }
.search-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 15px; }
.search-box input::placeholder { color: var(--faint); }
.kbd { font-size: 11px; color: var(--faint); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
.results {
    position: absolute; left: 0; right: 0; top: 54px; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r-lg);
    box-shadow: var(--shadow-3); padding: 8px; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .16s, transform .16s var(--ease);
    max-height: min(70vh, 560px); overflow-y: auto;
}
.search.open .results { opacity: 1; transform: none; pointer-events: auto; }
.results h4 { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 6px; font-weight: 600; }
.res { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; }
.res:hover, .res.kb { background: var(--s3); }
.res.busy { opacity: .5; pointer-events: none; }
.res .cover { width: 64px; height: 36px; border-radius: 6px; }
.res-main { flex: 1; min-width: 0; }
.res-main b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-main small { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res .dur { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.res-note { padding: 10px; color: var(--muted); font-size: 13px; }
.results-foot { border-top: 1px solid var(--line); margin-top: 6px; padding: 10px 10px 4px; font-size: 12px; color: var(--faint); display: flex; gap: 14px; flex-wrap: wrap; }
.res-skel { display: flex; gap: 12px; padding: 7px 10px; align-items: center; }

/* ============ Botones ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 18px; font-weight: 600; font-size: 13px;
    background: var(--s3); color: var(--text); border: 1px solid var(--line); transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; white-space: nowrap; position: relative;
}
.btn:hover { background: #283046; border-color: var(--line-2); }
.btn:active { transform: scale(.97); }
.btn svg.i { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: var(--accent-hi); box-shadow: 0 4px 16px var(--accent-glow); }
.btn.ghost { background: none; border-color: var(--line-2); }
.btn.ghost:hover { background: var(--s2); }
/* Jerarquía de color: primary (sólido) = la acción principal de la vista · soft = añadir / guardar ·
   danger = destructivo · ghost = navegación y secundarios neutros */
.btn.soft { background: var(--accent-soft); border-color: rgba(124,92,255,.45); color: var(--accent-hi); }
.btn.soft:hover { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 4px 16px var(--accent-glow); }
.btn.danger { background: var(--danger-soft); border-color: rgba(255,92,122,.3); color: var(--danger); }
.btn.danger:hover { background: var(--danger); border-color: transparent; color: #fff; }
.btn.discord { background: #5865F2; border-color: transparent; color: #fff; }
.btn.discord:hover { background: #6E7AF5; }
.btn.discord svg { width: 20px; height: 20px; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn.loading, .iconbtn.loading { pointer-events: none; color: transparent !important; }
.btn.loading > *, .iconbtn.loading > * { visibility: hidden; }
.btn.loading::after, .iconbtn.loading::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.iconbtn.loading { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Portadas ============ */
.cover { position: relative; overflow: hidden; background: linear-gradient(135deg,#252B40,#1A1630); display: grid; place-items: center; flex: none; }
.cover > svg { width: 38%; height: 38%; color: rgba(255,255,255,.18); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; overflow: hidden; background: var(--s3); flex: none; }
.mosaic .cover { width: 100%; height: 100%; border-radius: 0; }
.mosaic.single { display: block; }

/* ============ Reproductor (hero) ============ */
.hero {
    position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--s1); border: 1px solid var(--line);
    box-shadow: var(--shadow-2); padding: 24px; display: flex; gap: 24px; margin-bottom: 28px; min-height: 226px;
}
.hero-tint { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(60px) saturate(1.4); opacity: .22; transition: opacity .6s; pointer-events: none; }
.hero-tint::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--s1) 85%); }
.hero > * { position: relative; }
.hero > .hero-tint { position: absolute; }
.hero .cover { width: 176px; height: 176px; border-radius: var(--r-md); box-shadow: var(--shadow-3); transition: transform .5s var(--ease), filter .5s; }
body[data-state="paused"] .hero .cover { transform: scale(.96); filter: saturate(.7); }
.hero-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.np-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-hi); }
body[data-state="paused"] .np-label { color: var(--muted); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; height: 100%; background: currentColor; border-radius: 2px; transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.35s; } .eq i:nth-child(3) { animation-delay: -.6s; } .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%,100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
body[data-state="paused"] .eq i { animation-play-state: paused; }
.np-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.np-title[href]:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.np-artist { color: var(--muted); font-size: 15px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip svg.i { width: 12px; height: 12px; }
.chip.fx { background: var(--accent-soft); border-color: transparent; color: var(--accent-hi); }
.progress-row { margin-top: auto; padding-top: 16px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.track { flex: 1; height: 5px; border-radius: 5px; background: rgba(255,255,255,.09); overflow: hidden; }
.track i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--accent); transition: width 1s linear; }
.track.jump i { transition: none; }
/* Barra arrastrable (seek): zona de clic ampliada + tirador; solo activa si se conoce la duración */
.track.js-seek { position: relative; overflow: visible; outline: none; touch-action: none; }
.track.js-seek.seekable { cursor: pointer; }
.track.js-seek.seekable::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; bottom: -9px; }
.track.js-seek::after { content: ""; position: absolute; top: 50%; left: var(--p, 0%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s var(--ease), left 1s linear; pointer-events: none; }
.track.js-seek.seekable:hover::after, .track.js-seek.seekable:focus-visible::after, .track.js-seek.scrubbing::after, .track.js-seek.seeking::after { opacity: 1; transform: scale(1); }
.track.js-seek.seekable:hover i, .track.js-seek.scrubbing i { background: var(--accent-hi); }
.track.js-seek.seekable:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.track.js-seek.scrubbing i, .track.js-seek.jump::after, .track.js-seek.scrubbing::after { transition: none; }
/* Corte de audio mientras el bot salta: el tirador se vuelve un spinner */
.track.js-seek.seeking { pointer-events: none; }
.track.js-seek.seeking i { opacity: .55; }
.track.js-seek.seeking::after { background: transparent; box-shadow: none; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; box-sizing: border-box; animation: spin .7s linear infinite; transition: none; }
body[data-state="paused"] .track i { background: var(--muted); }
.controls { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.controls .spacer { flex: 1; }
.vol { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.vol.loading { opacity: .55; pointer-events: none; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 96px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--text) var(--v,66.6%), rgba(255,255,255,.12) var(--v,66.6%)); cursor: pointer; }
input[type=range]:hover { background: linear-gradient(90deg, var(--accent-hi) var(--v,66.6%), rgba(255,255,255,.12) var(--v,66.6%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
input[type=range]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.playbtn { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px var(--accent-glow); transition: transform .12s var(--ease), background .15s, box-shadow .15s; flex: none; }
.playbtn:hover { background: var(--accent-hi); transform: scale(1.05); }
.playbtn:active { transform: scale(.95); }
.playbtn svg { width: 20px; height: 20px; }
.playbtn .ic-play { margin-left: 3px; }
body[data-state="playing"] .ic-play, body:not([data-state="playing"]) .ic-pause { display: none; }
.ctrl { width: 40px; height: 40px; border-radius: 50%; }
.ctrl svg.i { width: 19px; height: 19px; }

/* Estados: vacío y carga */
.hero-empty, .hero-skel { display: none; }
body[data-state="empty"] .hero { align-items: center; justify-content: center; text-align: center; }
body[data-state="empty"] .hero > :not(.hero-empty), body[data-state="loading"] .hero > :not(.hero-skel) { display: none; }
body[data-state="empty"] .hero-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero-empty .orb { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-hi); display: grid; place-items: center; margin-bottom: 8px; }
.hero-empty .orb svg { width: 28px; height: 28px; }
.hero-empty h2 { font-size: 20px; letter-spacing: -.01em; }
.hero-empty p { color: var(--muted); max-width: 380px; margin-bottom: 10px; }
body[data-state="loading"] .hero-skel { display: flex; gap: 24px; width: 100%; }
.hero-skel-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.sk { background: linear-gradient(90deg, var(--s2) 25%, var(--s3) 50%, var(--s2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============ Secciones / listas ============ */
.sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.sec-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.sec-head .meta { color: var(--muted); font-size: 13px; }
.rows { display: flex; flex-direction: column; gap: 2px; }
.row {
    display: grid; grid-template-columns: 22px 26px 44px minmax(0,1fr) 120px 52px auto; align-items: center; gap: 12px;
    padding: 7px 10px 7px 4px; border-radius: var(--r-sm); transition: background .12s; position: relative;
}
.row.nogrip { grid-template-columns: 26px 44px minmax(0,1fr) 120px 52px auto; padding-left: 10px; }
.row.file { grid-template-columns: 44px minmax(0,1fr) auto; padding-left: 10px; }
.row:hover { background: var(--s2); }
.row .grip { color: var(--faint); opacity: 0; cursor: grab; display: grid; place-items: center; height: 32px; transition: opacity .12s; }
.row:hover .grip { opacity: 1; }
.row .grip:active { cursor: grabbing; }
.row .idx { color: var(--faint); font-variant-numeric: tabular-nums; text-align: center; font-size: 13px; }
.row .cover { width: 44px; height: 44px; border-radius: 7px; }
.row .t { min-width: 0; }
.row .t b, .row .t a { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t a:hover { text-decoration: underline; text-underline-offset: 3px; }
.row .t small { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t small .m-dur { display: none; }
.row .by { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.row .by span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .by .avatar { width: 18px; height: 18px; font-size: 9px; }
.row .dur { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.row .acts { display: flex; gap: 6px; justify-content: flex-end; }
/* Acciones de fila: siempre a la vista, cada una con su color (pastilla). Vale para cola, playlists,
   historial, Drive y resultados del buscador. */
.row .acts .iconbtn, .res .iconbtn { border-radius: 9px; background: rgba(255,255,255,.05); color: var(--text); }
.row .acts .iconbtn:hover, .res .iconbtn:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.row .acts .iconbtn.add { background: var(--accent-soft); color: var(--accent-hi); }
.row .acts .iconbtn.add:hover { background: var(--accent); color: #fff; box-shadow: 0 4px 14px var(--accent-glow); }
.row .acts .iconbtn.danger { background: var(--danger-soft); color: var(--danger); }
.row .acts .iconbtn.danger:hover { background: var(--danger); color: #fff; }
.row .acts .touch-only { display: none; }
.row.dragging { opacity: .35; }
.row.drop-before::before, .row.drop-after::after { content: ""; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 8px var(--accent-glow); }
.row.drop-before::before { top: -2px; } .row.drop-after::after { bottom: -2px; }
.row.enter { animation: rowin .35s var(--ease); }
@keyframes rowin { from { opacity: 0; transform: translateY(8px); background: var(--accent-soft); } }
.empty-note { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 28px; text-align: center; color: var(--muted); }
body[data-state="loading"] #queue-rows, body[data-state="loading"] #queue-empty { display: none; }
body:not([data-state="loading"]) #queue-skel { display: none; }
#queue-skel .sk { height: 58px; margin-bottom: 4px; }

/* ============ Vistas ============ */
.view { display: none; animation: viewin .25s var(--ease); }
@keyframes viewin { from { opacity: 0; transform: translateY(6px); } }
body[data-view="queue"] #view-queue, body[data-view="playlist"] #view-playlist, body[data-view="playlists"] #view-playlists,
body[data-view="drive"] #view-drive, body[data-view="filters"] #view-filters, body[data-view="system"] #view-system,
body[data-view="activity"] #view-activity { display: block; }

/* ---------- Actividad: historial y estadísticas ---------- */
/* Cabecera: título + pestañas; en Estadísticas, UNA fila de filtro que gobierna todo lo de debajo */
.act-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.act-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--s2); border: 1px solid var(--line); border-radius: 10px; }
.seg button { padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); transition: color .15s, background .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--s3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.act-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.act-filter .meta { color: var(--muted); font-size: 12.5px; }
#view-activity[data-tab="history"] .act-stats, #view-activity[data-tab="stats"] .act-history { display: none; }
/* Al recargar se conserva lo pintado, atenuado (sin esqueletos ni saltos) */
.act-body.loading { opacity: .45; transition: opacity .15s; pointer-events: none; }
.only-mobile { display: none; }
.push-right { margin-left: auto; }

.day { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin: 18px 0 4px 10px; }
.day:first-child { margin-top: 4px; }
.row.hist { grid-template-columns: 44px 44px minmax(0,1fr) 120px 52px auto; padding-left: 10px; }
.row.hist .when { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.row.hist.skipped .t b, .row.hist.skipped .cover { opacity: .6; }
.row.hist .t b { display: flex; align-items: center; gap: 6px; }
.row.hist .t b span:first-child { overflow: hidden; text-overflow: ellipsis; }
.tagmini { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 0 6px; border-radius: 5px; background: rgba(255,255,255,.06); color: var(--muted); flex: none; }
.row.hist .m-when { display: none; }
.more { display: flex; justify-content: center; margin-top: 14px; }
.act-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 56px 16px; color: var(--muted); }
.act-empty .orb { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-hi); display: grid; place-items: center; margin-bottom: 6px; }
.act-empty .orb svg { width: 24px; height: 24px; }
.act-empty b { color: var(--text); font-size: 16px; }
.act-empty p { max-width: 400px; font-size: 13.5px; }

/* Cifras: figuras proporcionales (las tabulares se reservan para columnas que se alinean) */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; min-width: 0; }
.tile small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.tile b span { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; letter-spacing: 0; }

/* Tops: una serie = un color; el valor va en tinta de texto, nunca en el color del dato */
.card h3 .tools { margin-left: auto; display: flex; gap: 2px; }
.card h3 .tools .iconbtn { width: 28px; height: 28px; }
.card h3 .tools .iconbtn svg { width: 15px; height: 15px; color: currentColor; }
.card h3 .tools .iconbtn.on { color: var(--accent-hi); background: var(--accent-soft); }
.top { display: grid; grid-template-columns: 18px 36px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 7px 0; }
.top .rk { color: var(--faint); font-size: 12.5px; text-align: center; font-variant-numeric: tabular-nums; }
.top .cover, .top .avatar { width: 36px; height: 36px; border-radius: 6px; font-size: 12px; }
.top .avatar { border-radius: 50%; }
.top .tt { min-width: 0; }
.top .tt b { display: block; font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .tt small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .hbar { height: 4px; margin-top: 5px; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 2px; }
.top .val { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.top .val small { display: block; color: var(--muted); font-size: 11.5px; }
.top-empty { color: var(--muted); font-size: 13px; padding: 8px 0; }

/* Columnas SVG a mano: marcas finas, rejilla de pelo continua, punta redondeada y base recta */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.chart .tick { fill: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .col { fill: var(--accent); transition: fill .12s; }
.chart .hit { fill: transparent; outline: none; }
.chart g.band:hover .col, .chart .hit:focus + .col { fill: var(--accent-hi); }
.chart .peak { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.tip { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); margin-top: -8px; padding: 6px 10px; border-radius: 8px; background: #000d; border: 1px solid var(--line-2); box-shadow: var(--shadow-3); white-space: nowrap; font-size: 12px; color: var(--muted); opacity: 0; transition: opacity .1s; }
.tip.on { opacity: 1; }
.tip b { display: block; color: var(--text); font-size: 13.5px; font-weight: 600; }
.datatable { width: 100%; border-collapse: collapse; font-size: 12.5px; max-height: 190px; display: block; overflow: auto; }
.datatable thead, .datatable tbody { display: table; width: 100%; table-layout: fixed; }
.datatable th, .datatable td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.datatable th { color: var(--faint); font-weight: 600; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
.datatable td:last-child, .datatable th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.pl-hero { display: flex; gap: 22px; align-items: flex-end; margin-bottom: 24px; }
.pl-hero .mosaic { width: 148px; height: 148px; border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.pl-hero > div:last-child { min-width: 0; }
.pl-hero small { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.pl-hero h1 { font-size: 34px; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 6px; overflow-wrap: anywhere; }
.pl-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; margin-top: 14px; }
.field { flex: 1; min-width: 0; height: 38px; padding: 0 14px; border-radius: 19px; background: var(--s2); border: 1px solid var(--line); outline: 0; transition: border-color .15s, box-shadow .15s; }
.field:hover { border-color: var(--line-2); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field::placeholder { color: var(--faint); }
.field.wide { width: 100%; }
select.field, textarea.field { border-radius: var(--r-sm); }
select.field option { background: var(--s2); }
textarea.field { height: auto; padding: 10px 14px; width: 100%; resize: vertical; font: 12px/1.5 ui-monospace, Consolas, monospace; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 16px; }
.pl-card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; text-align: left; transition: transform .2s var(--ease), border-color .15s, background .15s; min-width: 0; }
.pl-card:hover { transform: translateY(-3px); border-color: var(--line-2); background: var(--s2); }
.pl-card .mosaic { width: 100%; aspect-ratio: 1; border-radius: var(--r-sm); margin-bottom: 10px; }
.pl-card b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ Filtros ============ */
/* Un solo componente (.fxp) pintado en dos sitios, como hoy .js-fx-grid: panel derecho (320 px) y vista «Filtros» */
.fxp { display: flex; flex-direction: column; gap: 18px; }
.fxp-status { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.fxp-status .chip { flex: none; }
.fxp-status .btn { margin-left: auto; }
.fxp-status .chip.busy { color: var(--warn); background: rgba(255,180,84,.1); border-color: transparent; }
.fxp-status .chip.busy::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: fxspin .7s linear infinite; }
@keyframes fxspin { to { transform: rotate(360deg); } }
.fxp.busy .fxp-block { opacity: .6; pointer-events: none; transition: opacity .15s; }

.fxp-block > h4 { font-size: 12.5px; font-weight: 600; color: var(--text); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.fxp-block > h4 small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
.fxp-block > h4 .lnk { margin-left: auto; color: var(--accent-hi); font-size: 12px; font-weight: 500; padding: 2px 6px; border-radius: 6px; }
.fxp-block > h4 .lnk:hover { background: var(--accent-soft); }
.fxp-block > h4 .lnk[disabled] { opacity: .4; pointer-events: none; }

/* Presets: desplegable + guardar */
.fxp-preset { display: flex; gap: 8px; position: relative; }
.fxp-preset .sel { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border-radius: 10px; background: var(--s2); border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 13px; text-align: left; }
.fxp-preset .sel:hover { border-color: var(--line-2); }
.fxp-preset .sel span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fxp-preset .sel svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.fxp-preset .btn { height: 36px; flex: none; }
.fxp-preset .pop { top: 42px; max-height: 380px; }
.fxp-preset .pop .grp-l { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.fxp-preset .pop .it { display: flex; align-items: center; gap: 4px; }
.fxp-preset .pop .it > button:first-child { flex: 1; min-width: 0; }
.fxp-preset .pop .it b { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fxp-preset .pop .it small { color: var(--muted); font-size: 11.5px; margin-left: auto; flex: none; }
.fxp-preset .pop .it .iconbtn { width: 28px; height: 28px; display: grid; padding: 0; }
.fxp-preset .pop .it.on b { color: var(--accent-hi); }
.fxp-save { display: none; gap: 8px; margin-top: 8px; }
.fxp-save.open { display: flex; }
.fxp-save .field { height: 32px; border-radius: 10px; font-size: 13px; }

/* Velocidad y tono: exclusivo */
.fxp .seg { display: flex; }
.fxp .seg button { flex: 1; padding: 6px 4px; white-space: nowrap; }
.fxp .seg button.on { background: var(--accent-soft); color: var(--accent-hi); box-shadow: inset 0 0 0 1px var(--accent); }
.fxp-slide { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 11.5px; color: var(--faint); }
.fxp-slide input[type=range] { flex: 1; width: auto; min-width: 0; }
.fxp-slide.off { display: none; }

/* Extras combinables: interruptor + deslizador al activarse */
.fxp-extra { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--s2); padding: 9px 12px; transition: border-color .15s, background .15s; }
.fxp-extra + .fxp-extra { margin-top: 6px; }
.fxp-extra.on { border-color: rgba(124,92,255,.5); background: var(--accent-soft); }
.fxp-extra .xhead { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.fxp-extra .em { font-size: 17px; width: 22px; text-align: center; flex: none; }
.fxp-extra .tt { flex: 1; min-width: 0; }
.fxp-extra .tt b { display: block; font-size: 13px; font-weight: 600; }
.fxp-extra .tt small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fxp-extra .val { font-size: 12px; color: var(--accent-hi); font-variant-numeric: tabular-nums; flex: none; }
.fxp-extra:not(.on) .val, .fxp-extra:not(.on) .fxp-slide { display: none; }
.sw { width: 32px; height: 18px; border-radius: 9px; background: rgba(255,255,255,.14); position: relative; flex: none; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .15s var(--ease); }
.on > .xhead .sw { background: var(--accent); }
.on > .xhead .sw::after { transform: translateX(14px); }

/* EQ de 10 bandas: deslizadores verticales, relleno desde 0 dB */
.eq10 { display: grid; grid-template-columns: repeat(10, minmax(0,1fr)); gap: 0; padding: 12px 6px 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--s2); position: relative; }
.eq10::before { content: ""; position: absolute; left: 8px; right: 8px; top: calc(12px + 16px + 60px); border-top: 1px dashed rgba(255,255,255,.1); pointer-events: none; }
.eq10 .band { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.eq10 .band output { height: 12px; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.eq10 .band.set output { color: var(--accent-hi); }
.eq10 .band label { font-size: 10px; color: var(--faint); }
.eq10 input[type=range] { writing-mode: vertical-lr; direction: rtl; width: 4px; height: 120px;
    background: linear-gradient(to top, rgba(255,255,255,.12) var(--lo,50%), var(--accent) var(--lo,50%), var(--accent) var(--hi,50%), rgba(255,255,255,.12) var(--hi,50%)); }
.eq10 input[type=range]:hover { background: linear-gradient(to top, rgba(255,255,255,.12) var(--lo,50%), var(--accent-hi) var(--lo,50%), var(--accent-hi) var(--hi,50%), rgba(255,255,255,.12) var(--hi,50%)); }
.fxp-foot { color: var(--faint); font-size: 11.5px; line-height: 1.4; }

/* Vista «Filtros» (tablet y móvil): el mismo componente en dos columnas */
#view-filters .fxp { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px 24px; align-items: start; }
#view-filters .fxp-status, #view-filters .fxp-foot { grid-column: 1 / -1; }
#view-filters .fxp-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ctx .fxp-col { display: contents; }
#view-filters .eq10 input[type=range] { height: 150px; }
#view-filters .eq10::before { top: calc(12px + 16px + 75px); }
@media (max-width: 767px) { #view-filters .fxp { grid-template-columns: minmax(0,1fr); } }
@media (pointer: coarse) { .eq10 input[type=range]::-webkit-slider-thumb { width: 18px; height: 18px; } .fxp-slide input[type=range]::-webkit-slider-thumb { width: 18px; height: 18px; } }

/* ============ Modo Radio ============ */
/* Interruptor de la radio, en la cabecera de «A continuación» (la radio va de lo que sonará después) */
.radio-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--s2); color: var(--muted); font-size: 13px; font-weight: 500; transition: border-color .15s, background .15s, color .15s; }
.radio-toggle:hover { border-color: var(--line-2); color: var(--text); }
.radio-toggle svg.i { width: 15px; height: 15px; }
.radio-toggle.on { border-color: rgba(124,92,255,.5); background: var(--accent-soft); color: var(--accent-hi); }
.radio-toggle .sw { width: 28px; height: 16px; border-radius: 8px; background: rgba(255,255,255,.14); position: relative; flex: none; transition: background .15s; }
.radio-toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); }
.radio-toggle.on .sw { background: var(--accent); }
.radio-toggle.on .sw::after { transform: translateX(12px); }

/* Una línea de estado bajo la cabecera: qué va a hacer la radio (o por qué no hace nada) */
.radio-strip { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 0 0 10px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.radio-strip svg.i { width: 15px; height: 15px; color: var(--accent-hi); flex: none; }
.radio-strip b { color: var(--text); font-weight: 500; }
.radio-strip.warn { background: rgba(255,180,84,.1); }
.radio-strip.warn svg.i { color: var(--warn); }
.radio-strip .spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--accent-hi); border-top-color: transparent; animation: rspin .7s linear infinite; flex: none; }
@keyframes rspin { to { transform: rotate(360deg); } }

/* Canción puesta por la radio: en la columna «pedida por» sale la radio en vez de una persona */
.row .by.radio { color: var(--accent-hi); }
.row .by.radio svg.i { width: 15px; height: 15px; flex: none; }
.chip.radio { color: var(--accent-hi); }
.row .t small .m-radio { display: none; color: var(--accent-hi); }


/* ============ Panel de contexto ============ */
.ctx h3 { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.ctx section ~ section { margin-top: 28px; }
.kv { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv.last { border-bottom: 0; }
.kv svg { color: var(--faint); width: 15px; height: 15px; }
.kv span { color: var(--muted); white-space: nowrap; }
.kv b { margin-left: auto; font-weight: 500; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.kv a { color: var(--accent-hi); margin-left: auto; }
.kv a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ctx-empty { color: var(--muted); font-size: 13px; }
body:not([data-state="playing"]):not([data-state="paused"]) .ctx-details { display: none; }
body[data-state="playing"] .ctx-empty, body[data-state="paused"] .ctx-empty { display: none; }
.pop-wrap { position: relative; margin-top: 12px; }
.pop { position: absolute; left: 0; right: 0; top: 42px; z-index: 5; background: var(--s3); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 6px; display: none; max-height: 260px; overflow-y: auto; }
.pop.open { display: block; animation: viewin .15s var(--ease); }
.pop button { display: flex; width: 100%; padding: 8px 10px; border-radius: 6px; text-align: left; gap: 8px; align-items: center; }
.pop button:hover { background: rgba(255,255,255,.06); }
.pop p { padding: 8px 10px; color: var(--muted); font-size: 13px; }

/* ============ Sistema y ajustes ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); gap: 16px; }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.card h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.card h3 svg { color: var(--accent-hi); }
.card > p { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.meter { margin-bottom: 14px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.meter-top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.meter .track i { transition: width .6s var(--ease); }
.meter.warn .track i { background: var(--warn); }
.stat-row { display: flex; gap: 10px; margin-top: 4px; }
.stat { flex: 1; background: var(--s2); border-radius: var(--r-sm); padding: 10px 12px; }
.stat small { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; display: block; }
.stat b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.status-line { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--s2); border-radius: var(--r-sm); font-size: 13px; margin-bottom: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(61,214,140,.18); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(255,180,84,.18); }
.dot.down { background: var(--danger); box-shadow: 0 0 0 3px rgba(255,92,122,.18); }

/* Punto de estado del bot: insignia sobre el icono de la marca (sidebar, carril <1200 y cabecera móvil) */
.brand-mark { position: relative; }
.bot-dot { position: absolute; right: -4px; bottom: -4px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--s1); background: var(--faint); }
.bot-dot.ok { background: var(--ok); }
.bot-dot.warn { background: var(--warn); animation: botpulse 1.4s ease-in-out infinite; }
.bot-dot.down { background: var(--danger); }
@keyframes botpulse { 50% { opacity: .35; } }

/* Tarjetas «Estado del bot» y «Errores recientes» */
.card.wide { grid-column: 1 / -1; }
.card p .strong { color: var(--text); font-weight: 500; }
.card .kv b { max-width: 70%; }
.card .kv b small { color: var(--muted); font-weight: 400; font-size: inherit; }
.card h3 .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px; background: var(--s3); color: var(--muted); }
.err { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 2px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.err:first-child { border-top: 0; padding-top: 4px; }
.err time { color: var(--faint); font-size: 12px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.err .what { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.err .tag { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 1px 7px; border-radius: 5px; background: var(--danger-soft); color: var(--danger); flex: none; }
.err .song { grid-column: 2; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.err .act { grid-column: 2; margin-top: 6px; }
.err details { grid-column: 2; margin-top: 4px; }
.err summary { font-size: 12px; color: var(--muted); cursor: pointer; width: fit-content; }
.err summary:hover { color: var(--text); }
.err pre { margin-top: 6px; padding: 10px 12px; background: var(--s2); border-radius: var(--r-sm); font-size: 11.5px; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }
.err-empty { display: flex; align-items: center; gap: 10px; padding: 14px 12px; background: var(--s2); border-radius: var(--r-sm); font-size: 13px; color: var(--muted); }
.err-empty svg { color: var(--ok); width: 16px; height: 16px; }

/* Cola recuperada tras un reinicio: en pausa y sin conectar */
body[data-restored="1"] .np-label { color: var(--warn); }
body[data-restored="1"] .np-label .eq { display: none; }
.chip.warn { background: rgba(255,180,84,.1); border-color: transparent; color: var(--warn); }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 0; }
details summary:hover { color: var(--text); }
details[open] summary { margin-bottom: 8px; }
.card .hint { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.card input[type=file] { margin-bottom: 8px; font-size: 12px; max-width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
label.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.session-row { display: flex; align-items: center; gap: 12px; }
.session-row .avatar { width: 40px; height: 40px; font-size: 14px; }
.session-row b { display: block; }
.session-row .btn { margin-left: auto; }

/* ============ Barra de reproducción ============ */
.playerbar {
    height: var(--bar-h); background: var(--s2); border-top: 1px solid var(--line-2); display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr);
    align-items: center; gap: 20px; padding: 0 20px; position: relative; box-shadow: 0 -8px 30px rgba(0,0,0,.35);
    transition: margin-bottom .3s var(--ease), opacity .2s;
}
body.bar-hidden .playerbar { margin-bottom: calc(var(--bar-h) * -1); opacity: 0; pointer-events: none; }
.pb-song { display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; }
.pb-song .cover { width: 52px; height: 52px; border-radius: 8px; }
.pb-song .tx { min-width: 0; }
.pb-song b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-song small { color: var(--muted); display: flex; gap: 6px; align-items: center; min-width: 0; }
.pb-song small span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-song .eq { height: 9px; color: var(--accent-hi); flex: none; }
body:not([data-state="playing"]):not([data-state="paused"]) .pb-song .eq { display: none; }
.pb-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pb-ctrls { display: flex; align-items: center; gap: 10px; }
.pb-ctrls .playbtn { width: 38px; height: 38px; box-shadow: none; }
.pb-ctrls .playbtn svg { width: 15px; height: 15px; }
.pb-prog { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.pb-line { display: none; }

/* ============ Toasts ============ */
#toasts { position: fixed; right: 20px; bottom: 104px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { display: flex; align-items: center; gap: 12px; background: var(--s3); border: 1px solid var(--line-2); border-left: 3px solid var(--ok); border-radius: var(--r-sm); padding: 11px 14px; box-shadow: var(--shadow-3); font-size: 13px; max-width: 380px; animation: toastin .3s var(--ease); }
.toast.error { border-left-color: var(--danger); }
.toast button { color: var(--accent-hi); font-weight: 600; white-space: nowrap; padding: 2px 6px; border-radius: 6px; }
.toast button:hover { background: var(--accent-soft); }
@keyframes toastin { from { opacity: 0; transform: translateX(20px); } }

/* ============ Punteros táctiles: sin drag & drop nativo ============ */
@media (pointer: coarse) {
    .row .grip { display: none; }
    .row { grid-template-columns: 26px 44px minmax(0,1fr) 120px 52px auto; padding-left: 10px; }
    .row .acts .touch-only { display: grid; }
}

/* ============ Tablet ============ */
@media (max-width: 1199px) {
    .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .app { grid-template-columns: 72px minmax(0,1fr); grid-template-areas: "side main" "bar bar"; }
    .ctx { display: none; }
    .brand span, .sidebar .guild-txt, .sidebar .guild > svg, .nav-item span, .nav-item .count, .side-label, .side-pls, .sidebar .badge, .userchip span { display: none; }
    .brand { justify-content: center; padding: 18px 0 14px; }
    .sidebar .guild { justify-content: center; margin: 0 auto 14px; width: 48px; padding: 8px; }
    .nav-item { justify-content: center; padding: 12px; }
    .nav-item.only-narrow { display: flex; }
    .side-foot { margin-top: auto; align-items: center; }
    .userchip { flex-direction: column; padding: 8px 0; }
    .main-inner { padding: 20px 24px 40px; }
}

/* ============ Móvil ============ */
@media (max-width: 767px) {
    :root { --bar-h: 62px; }
    .app { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto auto; grid-template-areas: "main" "bar" "mnav"; }
    .sidebar { display: none; }
    .mhead { display: flex; }
    .mhead .guild { margin: 0; flex: 1; padding: 6px 8px; min-width: 0; }
    .main-inner { padding: 12px 16px 28px; }
    .mnav { grid-area: mnav; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--s1); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
    .mnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 10.5px; color: var(--faint); font-weight: 500; border-radius: 8px; }
    .mnav button.active { color: var(--accent-hi); }
    .mnav svg.i { width: 20px; height: 20px; }
    .hero { flex-direction: column; align-items: center; text-align: center; padding: 20px 16px; gap: 16px; }
    .hero .cover { width: min(240px, 62vw); height: min(240px, 62vw); }
    .hero-body { width: 100%; align-items: center; }
    .np-title { font-size: 21px; }
    .np-artist { max-width: 100%; }
    .np-chips { justify-content: center; }
    .progress-row, .controls { width: 100%; }
    .controls { justify-content: center; }
    .controls .spacer, .vol { display: none; }
    .err { grid-template-columns: 1fr; }
    .only-mobile { display: inline-flex; }
    .sec-head .radio-toggle { order: 3; }
    .row .t small .m-radio { display: inline; }   /* en móvil no hay columna «pedida por»: la marca va en el subtítulo */
    .row.hist { grid-template-columns: 44px minmax(0,1fr) auto; }
    .row.hist .when { display: none; }
    .row.hist .m-when { display: inline; }
    .tile b { font-size: 20px; }
    .err .song, .err .act, .err details { grid-column: 1; }
    .hero .playbtn { width: 60px; height: 60px; }
    .hero-skel { flex-direction: column; align-items: center; }
    .hero-skel-body { width: 100%; }
    .row, .row.nogrip { grid-template-columns: 44px minmax(0,1fr) auto; gap: 10px; padding: 7px 4px; }
    .row .idx, .row .by, .row .dur, .row .grip { display: none; }
    .row .t small .m-dur { display: inline; }
    .row .acts .desk-only { display: none; }
    .playerbar { grid-template-columns: minmax(0,1fr) auto; padding: 0 12px; gap: 8px; }
    .pb-song .cover { width: 42px; height: 42px; }
    .pb-prog, .pb-right, .pb-ctrls .stopbtn { display: none; }
    .pb-line { display: block; position: absolute; left: 0; right: 0; top: -1px; height: 2px; border-radius: 0; }
    .pl-hero { flex-direction: column; align-items: flex-start; }
    .pl-hero h1 { font-size: 26px; }
    .kbd, .results-foot { display: none; }
    #toasts { left: 12px; right: 12px; bottom: 140px; }
    .toast { max-width: none; }
    .cards { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
