/* MUSIC PAGE (music.js): full-window Spotify-style layout.
   Columns: site icon rail | library sidebar | main view | lyrics panel (while a song is loaded).
   The player bar runs along the bottom. The site dock is hidden on this page on wide screens
   because the icon rail on the left does the same job. */

#page-music { --ym-accent: #a855f7; --ym-accent-2: #c084fc; --ym-ink: var(--bright-text); --ym-dim: color-mix(in srgb, var(--bright-text) 58%, transparent); --ym-faint: color-mix(in srgb, var(--bright-text) 10%, transparent); --ym-panel: color-mix(in srgb, var(--bg-2) 82%, transparent); }
#page-music.active { position: fixed; inset: 0; z-index: 5; animation: none; background: color-mix(in srgb, var(--bg) 70%, transparent); }
body.yy-music .yy-dock-host { display: none; }
body.yy-music { overflow: hidden; }

.ym-app { position: relative; height: 100%; display: grid; grid-template-columns: 64px 270px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 86px; grid-template-areas: "rail side main" "player player player"; color: var(--ym-ink); font-family: 'Poppins', sans-serif; }
.ym-app.lyrics-open { grid-template-columns: 64px 270px minmax(0, 1fr) 360px; grid-template-areas: "rail side main lyrics" "player player player player"; }
.ym-app button { font-family: inherit; }
.ym-app img { -webkit-user-drag: none; }

/* Site navigation rail */
.ym-rail { grid-area: rail; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0 12px; }
.ym-rail-spacer { flex: 1; }
.ym-rail-btn { width: 40px; height: 40px; display: grid; place-items: center; border: none; border-radius: 12px; background: none; color: var(--ym-dim); cursor: pointer; transition: background .15s, color .15s; }
.ym-rail-btn svg { width: 20px; height: 20px; }
.ym-rail-btn:hover { background: var(--ym-faint); color: var(--ym-ink); }
.ym-rail-btn.active { background: color-mix(in srgb, var(--ym-accent) 22%, transparent); color: var(--ym-accent-2); border-radius: 50%; }

/* Library sidebar */
.ym-side { grid-area: side; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px 12px 6px; min-height: 0; }
.ym-brand { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.5px; padding: 0 10px 10px; }
.ym-search { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 999px; background: var(--ym-faint); color: var(--ym-dim); margin-bottom: 8px; }
.ym-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.ym-search input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--ym-ink); font: inherit; font-size: 0.84rem; }
.ym-search input::-webkit-search-cancel-button { filter: invert(0.6); }
.ym-search:focus-within { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ym-accent) 70%, transparent); }
.ym-nav { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: none; border-radius: 12px; background: none; color: var(--ym-dim); font-size: 0.88rem; font-weight: 600; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.ym-nav svg { width: 18px; height: 18px; }
.ym-nav:hover { color: var(--ym-ink); background: color-mix(in srgb, var(--bright-text) 5%, transparent); }
.ym-nav.active { color: var(--ym-ink); background: var(--ym-faint); }
.ym-lib-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 10px 6px 14px; font-size: 0.86rem; font-weight: 700; }
.ym-create { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; color: var(--ym-dim); font-size: 0.8rem; font-weight: 600; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.ym-create svg { width: 14px; height: 14px; }
.ym-create:hover { color: var(--ym-ink); background: var(--ym-faint); }
.ym-create-form { display: flex; gap: 6px; padding: 4px 6px 8px 10px; }
.ym-create-form input { flex: 1; min-width: 0; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--ym-faint); background: color-mix(in srgb, var(--bg) 60%, transparent); color: var(--ym-ink); font: inherit; font-size: 0.8rem; outline: none; }
.ym-create-form button { border: none; border-radius: 999px; padding: 0 14px; background: var(--ym-accent); color: #fff; font-weight: 600; font-size: 0.78rem; cursor: pointer; }
.ym-lib-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ym-lib-item { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border: none; border-radius: 10px; background: none; color: var(--ym-ink); cursor: pointer; text-align: left; transition: background .15s; }
.ym-lib-item:hover { background: color-mix(in srgb, var(--bright-text) 5%, transparent); }
.ym-lib-item.active { background: var(--ym-faint); }
.ym-lib-item b { display: block; font-size: 0.84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-lib-item small { display: block; font-size: 0.72rem; color: var(--ym-dim); }
.ym-lib-item > span:last-child { min-width: 0; }
.ym-lib-art { width: 42px; height: 42px; flex-shrink: 0; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--ym-faint); color: var(--ym-dim); }
.ym-lib-art img { width: 100%; height: 100%; object-fit: cover; }
.ym-lib-art svg { width: 18px; height: 18px; }
.ym-liked-art { background: linear-gradient(135deg, #4c1d95, #8b5cf6 55%, #c4b5fd); color: #fff; }

/* Main view */
.ym-main { grid-area: main; min-width: 0; min-height: 0; overflow-y: auto; padding: 12px 28px 28px; scrollbar-width: thin; }
.ym-main::-webkit-scrollbar, .ym-lib-list::-webkit-scrollbar, .ym-lyrics-body::-webkit-scrollbar { width: 6px; }
.ym-main::-webkit-scrollbar-thumb, .ym-lib-list::-webkit-scrollbar-thumb, .ym-lyrics-body::-webkit-scrollbar-thumb { background: var(--ym-faint); border-radius: 6px; }
.ym-topbar { display: flex; align-items: center; gap: 8px; min-height: 8px; }
.ym-topbar .ym-search { flex: 1; margin: 0; }
.ym-only-sm { display: none !important; }
.ym-icon-btn { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border: none; border-radius: 50%; background: none; color: var(--ym-dim); cursor: pointer; transition: color .15s, background .15s, transform .15s; padding: 0; position: relative; }
.ym-icon-btn svg { width: 18px; height: 18px; }
.ym-icon-btn:hover { color: var(--ym-ink); background: var(--ym-faint); }
.ym-icon-btn.on { color: var(--ym-accent-2); }
.ym-icon-btn.on::after { content: ''; position: absolute; bottom: 1px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.ym-icon-btn.one::before { content: '1'; position: absolute; top: 3px; right: 3px; font-size: 0.55rem; font-weight: 800; }
.ym-like.on { color: var(--ym-accent-2); }
.ym-like.on::after { display: none; }

.ym-chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 4px; scrollbar-width: none; }
.ym-chips::-webkit-scrollbar { display: none; }
.ym-chip { flex-shrink: 0; padding: 7px 16px; border-radius: 999px; border: none; background: var(--ym-faint); color: var(--ym-ink); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: background .15s; }
.ym-chip:hover { background: color-mix(in srgb, var(--bright-text) 16%, transparent); }
.ym-chip.active { background: var(--ym-accent); color: #fff; }

.ym-row { margin-top: 26px; }
.ym-row-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.ym-row-head h2, .ym-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.3px; margin: 0; color: var(--ym-ink); }
.ym-title { margin: 18px 0 16px; }
.ym-sub-title { font-size: 0.95rem; font-weight: 700; margin: 18px 0 8px; color: var(--ym-dim); }
.ym-link { border: none; background: none; color: var(--ym-dim); font-size: 0.8rem; font-weight: 700; cursor: pointer; padding: 0; }
.ym-link:hover { color: var(--ym-ink); text-decoration: underline; }
.ym-row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: 172px; gap: 8px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.ym-row-scroll::-webkit-scrollbar { height: 6px; }
.ym-row-scroll::-webkit-scrollbar-thumb { background: var(--ym-faint); border-radius: 6px; }
.ym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }

.ym-card { scroll-snap-align: start; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .2s; border: 1.5px solid transparent; outline: none; min-width: 0; }
.ym-card:hover, .ym-card:focus-visible { background: color-mix(in srgb, var(--bright-text) 6%, transparent); }
.ym-card.playing { border-color: color-mix(in srgb, var(--bright-text) 55%, transparent); background: color-mix(in srgb, var(--bright-text) 5%, transparent); }
.ym-card-art { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--ym-faint); box-shadow: 0 8px 24px rgba(0,0,0,0.45); display: grid; place-items: center; }
.ym-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ym-card-art > svg { width: 40%; height: 40%; color: #fff; }
.ym-ph svg { width: 36px; height: 36px; color: var(--ym-dim); }
.ym-card-play { position: absolute; right: 8px; bottom: 8px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--ym-accent); color: #fff; box-shadow: 0 8px 18px rgba(0,0,0,0.45); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.ym-card-play svg { width: 18px; height: 18px; }
.ym-card:hover .ym-card-play, .ym-card:focus-visible .ym-card-play, .ym-card.playing .ym-card-play { opacity: 1; transform: translateY(0); }
.ym-card-title { margin-top: 10px; font-size: 0.84rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ym-card-sub { margin-top: 3px; font-size: 0.74rem; color: var(--ym-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-artist .ym-card-art { border-radius: 50%; }
.ym-artist { text-align: center; }
.ym-e { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 5px; border-radius: 3px; background: color-mix(in srgb, var(--bright-text) 55%, transparent); color: var(--bg); font-size: 0.6rem; font-style: normal; font-weight: 800; vertical-align: 1px; }

/* Album / artist / playlist header */
.ym-head { display: flex; align-items: flex-end; gap: 24px; margin: 18px 0 22px; }
.ym-head-art { width: 200px; height: 200px; flex-shrink: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,0.55); background: linear-gradient(135deg, #4c1d95, #8b5cf6 55%, #c4b5fd); display: grid; place-items: center; }
.ym-head-art.round { border-radius: 50%; }
.ym-head-art img { width: 100%; height: 100%; object-fit: cover; }
.ym-head-art span svg { width: 70px; height: 70px; color: #fff; }
.ym-head-info { min-width: 0; }
.ym-head-info small { font-size: 0.76rem; font-weight: 600; color: var(--ym-dim); }
.ym-head-info h1 { margin: 4px 0 6px; font-size: clamp(1.8rem, 4vw, 3.4rem); font-weight: 800; letter-spacing: -1.5px; line-height: 1.05; overflow-wrap: anywhere; }
.ym-head-info p { margin: 0; font-size: 0.84rem; color: var(--ym-dim); }
.ym-head-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.ym-head-tools { display: flex; gap: 8px; margin: -8px 0 14px; }
.ym-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--bright-text) 22%, transparent); background: none; color: var(--ym-ink); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.ym-pill svg { width: 15px; height: 15px; }
.ym-pill:hover { border-color: var(--ym-ink); }
.ym-pill.danger { color: #ff7b7b; border-color: rgba(255,123,123,0.4); }

/* Track list */
.ym-tracks { display: flex; flex-direction: column; }
.ym-track { display: grid; grid-template-columns: 30px 42px minmax(0, 1.4fr) minmax(0, 1fr) 34px 52px 34px; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 8px; cursor: pointer; outline: none; }
.ym-track:hover, .ym-track:focus-visible { background: color-mix(in srgb, var(--bright-text) 6%, transparent); }
.ym-track.playing b { color: var(--ym-accent-2); }
.ym-track-n { text-align: center; font-size: 0.82rem; color: var(--ym-dim); font-variant-numeric: tabular-nums; }
.ym-track img { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; background: var(--ym-faint); }
.ym-track-main { min-width: 0; display: flex; flex-direction: column; }
.ym-track-main b, .ym-track-main span, .ym-track-album { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-track-main b { font-size: 0.86rem; font-weight: 600; }
.ym-track-main span, .ym-track-album, .ym-track-dur { font-size: 0.76rem; color: var(--ym-dim); }
.ym-track-dur { text-align: right; font-variant-numeric: tabular-nums; }
.ym-track .ym-icon-btn { opacity: 0; }
.ym-track:hover .ym-icon-btn, .ym-track:focus-within .ym-icon-btn, .ym-track .ym-like.on { opacity: 1; }
.ym-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.ym-eq i { width: 3px; background: var(--ym-accent-2); border-radius: 1px; animation: ymEq 0.9s ease-in-out infinite; }
.ym-eq i:nth-child(2) { animation-delay: -0.3s; }
.ym-eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes ymEq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

.ym-empty { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 60px 20px; color: var(--ym-dim); font-size: 0.88rem; text-align: center; }
.ym-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ym-faint); border-top-color: var(--ym-accent-2); animation: ymSpin 0.8s linear infinite; flex-shrink: 0; }
@keyframes ymSpin { to { transform: rotate(360deg); } }

/* Lyrics panel */
.ym-lyrics { grid-area: lyrics; position: relative; margin: 12px 12px 10px 0; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; background: #2a1d3d; box-shadow: 0 18px 44px rgba(0,0,0,0.5); animation: ymSlide .3s ease; }
.ym-lyrics[hidden] { display: none; }
@keyframes ymSlide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.ym-lyrics-bg, .ym-full-bg { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(60px) saturate(1.6) brightness(0.75); transform: scale(1.2); z-index: 0; transition: background-image .6s; }
.ym-lyrics-bg::after, .ym-full-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.45)); }
.ym-lyrics-head, .ym-full-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 14px 12px 10px 16px; color: #fff; }
.ym-lyrics-head img, .ym-full-top img { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.ym-ly-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ym-ly-meta b { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-ly-meta span { font-size: 0.76rem; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-lyrics .ym-icon-btn, .ym-full .ym-icon-btn { color: rgba(255,255,255,0.75); }
.ym-lyrics .ym-icon-btn:hover, .ym-full .ym-icon-btn:hover { color: #fff; background: rgba(255,255,255,0.14); }
.ym-lyrics-body { position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 40vh; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 40px, #000 calc(100% - 60px), transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 40px, #000 calc(100% - 60px), transparent 100%); }
.ym-ly-line { margin: 0 0 14px; font-size: 1.05rem; font-weight: 700; line-height: 1.35; color: rgba(255,255,255,0.45); cursor: pointer; transition: color .3s, transform .3s, opacity .3s; transform-origin: left center; }
.ym-ly-line:hover { color: rgba(255,255,255,0.8); }
.ym-ly-line.past { color: rgba(255,255,255,0.7); }
.ym-ly-line.active { color: #fff; transform: scale(1.03); text-shadow: 0 2px 14px rgba(0,0,0,0.25); }
.ym-ly-line.static { cursor: default; color: rgba(255,255,255,0.85); font-size: 0.98rem; margin-bottom: 8px; }
.ym-ly-empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 10px; color: rgba(255,255,255,0.75); font-size: 0.9rem; text-align: center; }
.ym-ly-note { font-size: 0.74rem; color: rgba(255,255,255,0.7); margin-bottom: 14px; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,0.22); }

/* Player bar */
.ym-player { grid-area: player; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 10px 22px 8px; border-top: 1px solid var(--ym-faint); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.ym-progress { position: absolute; left: 0; right: 0; top: -5px; height: 10px; cursor: pointer; outline: none; touch-action: none; }
.ym-progress::before { content: ''; position: absolute; left: 0; right: 0; top: 4px; height: 2.5px; background: var(--ym-faint); }
.ym-progress i { position: absolute; left: 0; top: 4px; height: 2.5px; width: 0; background: linear-gradient(90deg, var(--ym-accent), var(--ym-accent-2)); border-radius: 0 2px 2px 0; }
.ym-progress i::after { content: ''; position: absolute; right: -6px; top: -4.5px; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ym-accent) 40%, transparent); opacity: 0; transition: opacity .15s; }
.ym-progress:hover::before, .ym-progress:hover i, .ym-progress:focus-visible i { height: 4px; top: 3px; }
.ym-progress:hover i::after, .ym-progress:focus-visible i::after { opacity: 1; }
.ym-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ym-now img { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.ym-now-meta { min-width: 0; display: flex; flex-direction: column; }
.ym-now-meta b { font-size: 0.86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-now-meta span { font-size: 0.74rem; color: var(--ym-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-controls { display: flex; align-items: center; gap: 8px; }
.ym-play { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border: none; border-radius: 50%; background: var(--ym-accent); color: #fff; cursor: pointer; box-shadow: 0 6px 20px color-mix(in srgb, var(--ym-accent) 45%, transparent); transition: transform .15s, background .15s; padding: 0; }
.ym-play svg { width: 20px; height: 20px; }
.ym-play:hover { transform: scale(1.06); background: var(--ym-accent-2); }
.ym-play.big { width: 54px; height: 54px; }
.ym-play.big svg { width: 24px; height: 24px; }
.ym-extra { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.ym-time { font-size: 0.72rem; color: var(--ym-dim); font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: 6px; }
.ym-badge { font-size: 0.64rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ym-accent) 25%, transparent); color: var(--ym-accent-2); margin-right: 4px; white-space: nowrap; }
.ym-volume { -webkit-appearance: none; appearance: none; width: 100px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--ym-ink) var(--v, 80%), var(--ym-faint) var(--v, 80%)); outline: none; cursor: pointer; }
.ym-volume::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: none; }
.ym-volume::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: none; }
.ym-volume:hover { background: linear-gradient(90deg, var(--ym-accent-2) var(--v, 80%), var(--ym-faint) var(--v, 80%)); }

/* Full screen lyrics */
.ym-full { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; overflow: hidden; background: #1b1326; color: #fff; font-family: 'Poppins', sans-serif; animation: ymFade .3s ease; }
@keyframes ymFade { from { opacity: 0; } to { opacity: 1; } }
.ym-full-bg { inset: -120px; filter: blur(90px) saturate(1.7) brightness(0.7); }
.ym-full-top { padding: 18px 22px; }
.ym-full-body { position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 820px; margin: 0 auto; padding: 30vh 28px 40vh; text-align: center; scrollbar-width: none; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 78%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 78%, transparent 100%); }
.ym-full-body::-webkit-scrollbar { display: none; }
.ym-full-body .ym-ly-line { font-size: clamp(1.4rem, 3.2vw, 2.3rem); margin-bottom: 22px; transform-origin: center; letter-spacing: -0.4px; }
.ym-full-body .ym-ly-line.static { font-size: clamp(1.1rem, 2.4vw, 1.6rem); margin-bottom: 12px; }
.ym-full-body .ym-ly-note { display: inline-block; }
.ym-full-bottom { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 20px 26px; }
.ym-full-progress { display: flex; align-items: center; gap: 14px; width: min(560px, 100%); }
.ym-full-progress .ym-progress { position: relative; top: 0; flex: 1; }
.ym-full-progress .ym-progress::before { background: rgba(255,255,255,0.25); }
.ym-full-progress .ym-progress i { background: #fff; }
.ym-full-progress .ym-time { color: rgba(255,255,255,0.75); }
.ym-full-controls { padding: 6px 10px; border-radius: 999px; background: rgba(0,0,0,0.25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ym-full-controls .ym-play { background: #fff; color: #111; box-shadow: none; }
body.ym-full-open { overflow: hidden; }

/* Song menu + toast */
.ym-menu { position: fixed; z-index: 80; min-width: 210px; max-height: 60vh; overflow-y: auto; padding: 6px; border-radius: 12px; background: var(--bg-3); border: 1px solid color-mix(in srgb, var(--bright-text) 12%, transparent); box-shadow: 0 14px 40px rgba(0,0,0,0.5); display: flex; flex-direction: column; font-family: 'Poppins', sans-serif; }
.ym-menu button { display: flex; align-items: center; gap: 8px; border: none; background: none; color: var(--bright-text); font: inherit; font-size: 0.82rem; text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.ym-menu button svg { width: 14px; height: 14px; }
.ym-menu button:hover { background: color-mix(in srgb, var(--bright-text) 8%, transparent); }
.ym-menu button.danger { color: #ff6b6b; }
.ym-menu-sep { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: color-mix(in srgb, var(--bright-text) 45%, transparent); padding: 10px 12px 4px; border-top: 1px solid color-mix(in srgb, var(--bright-text) 8%, transparent); margin-top: 4px; }
.ym-toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 90; padding: 10px 18px; border-radius: 10px; background: #fff; color: #111; font-family: 'Poppins', sans-serif; font-size: 0.84rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }

/* The YouTube player that plays full songs stays out of sight. */
.ym-yt-host { position: fixed; left: -10000px; top: 0; width: 200px; height: 200px; opacity: 0; pointer-events: none; overflow: hidden; }

/* Light theme */
html[data-theme="light"] #page-music { --ym-accent: #7c3aed; --ym-accent-2: #7c3aed; }
html[data-theme="light"] .ym-card-art { box-shadow: 0 6px 18px rgba(0,0,0,0.15); }
html[data-theme="light"] .ym-search input::-webkit-search-cancel-button { filter: none; }

/* Medium screens: narrower library and lyrics */
@media (max-width: 1180px) {
    .ym-app { grid-template-columns: 64px 220px minmax(0, 1fr); }
    .ym-app.lyrics-open { grid-template-columns: 64px 220px minmax(0, 1fr) 300px; }
}
@media (max-width: 980px) {
    .ym-app, .ym-app.lyrics-open { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "rail main" "player player"; }
    .ym-side { position: absolute; z-index: 20; top: 0; bottom: 86px; left: 64px; width: 270px; background: var(--bg-2); border-right: 1px solid var(--ym-faint); transform: translateX(-120%); transition: transform .25s ease; padding-left: 14px; }
    .ym-app.side-open .ym-side { transform: none; }
    .ym-app.side-open .ym-scrim { display: block; }
    .ym-scrim { display: none; position: absolute; z-index: 15; inset: 0 0 86px 64px; background: rgba(0,0,0,0.45); }
    .ym-only-sm { display: flex !important; }
    .ym-topbar { padding: 4px 0 8px; }
    .ym-lyrics { position: absolute; z-index: 18; right: 12px; top: 0; bottom: 86px; width: min(360px, calc(100% - 100px)); }
}
/* Phones: the site dock comes back (the icon rail is hidden) and the player sits above it. */
@media (max-width: 640px) {
    body.yy-music .yy-dock-host { display: block; }
    #page-music.active { bottom: var(--dock-space); }
    .ym-app, .ym-app.lyrics-open { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "player"; grid-template-rows: minmax(0, 1fr) 74px; }
    .ym-rail { display: none; }
    .ym-side { left: 0; bottom: 74px; width: min(300px, 85vw); }
    .ym-scrim { inset: 0 0 74px 0; }
    .ym-main { padding: 10px 14px 20px; }
    .ym-lyrics { left: 8px; right: 8px; width: auto; bottom: 74px; margin: 8px 0; }
    .ym-player { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 12px; gap: 8px; }
    .ym-player { grid-template-columns: minmax(0, 1fr) auto auto; }
    .ym-extra > :not(#ymLyricsBtn):not(#ymPreviewBadge) { display: none; }
    .ym-controls .ym-icon-btn#ymShuffle, .ym-controls .ym-icon-btn#ymRepeat { display: none; }
    .ym-now img { width: 42px; height: 42px; }
    .ym-hide-sm { display: none !important; }
    .ym-track { grid-template-columns: 26px 40px minmax(0, 1fr) 34px 34px; gap: 8px; padding: 6px 4px; }
    .ym-track .ym-icon-btn { opacity: 1; }
    .ym-row-scroll { grid-auto-columns: 140px; }
    .ym-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .ym-head { flex-direction: column; align-items: flex-start; gap: 14px; }
    .ym-head-art { width: 150px; height: 150px; }
    .ym-full-body { padding: 24vh 18px 36vh; }
    .ym-toast { bottom: calc(var(--dock-space) + 84px); }
}
