/* Zuujis Player. Dark by default, light when the device is (or the desktop says so); violet, pink and amber for what's yours. */
:root {
  --bg: #0d0b14;
  --side: #110e1a;
  --panel: #16121f;
  --raised: #1f1a2b;
  --hover: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .08);
  --text: #f5f2fb;
  --muted: #aaa2bd;
  --faint: rgba(245, 242, 251, .42);
  --a: #8b5cf6;
  --b: #ec4899;
  --c: #f59e0b;
  --up: #34d399;
  --down: #fb923c;
  --accent: #c084fc;
  --grad: linear-gradient(120deg, var(--a), var(--b) 60%, var(--c));
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --radius: 14px;
  --bar: 88px;
  --side-w: 236px;
  --now-w: 384px;
  color-scheme: dark;
}
/* Light on a light device, unless the desktop's window says dark (theme.js); `.light` when it says light. */
@media (prefers-color-scheme: light) {
  :root:not(.dark) {
    --bg: #f8f6fc;
    --side: #f0ecf7;
    --panel: #ffffff;
    --raised: #f3effa;
    --hover: rgba(40, 20, 80, .06);
    --line: rgba(40, 20, 80, .1);
    --text: #1b1528;
    --muted: #645b78;
    --faint: rgba(27, 21, 40, .45);
    --accent: #7c3aed;
    --shadow: 0 18px 50px rgba(60, 30, 110, .18);
    color-scheme: light;
  }
}
:root.light {
  --bg: #f8f6fc;
  --side: #f0ecf7;
  --panel: #ffffff;
  --raised: #f3effa;
  --hover: rgba(40, 20, 80, .06);
  --line: rgba(40, 20, 80, .1);
  --text: #1b1528;
  --muted: #645b78;
  --faint: rgba(27, 21, 40, .45);
  --accent: #7c3aed;
  --shadow: 0 18px 50px rgba(60, 30, 110, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----- The frame ----- */
.app {
  display: grid;
  height: 100dvh;
  grid-template-columns: var(--side-w) minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) var(--bar);
  grid-template-areas: "side main now" "bar bar bar";
}
.side { grid-area: side; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px 14px; overflow-y: auto; }
.main { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.now { grid-area: now; width: var(--now-w); background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.bar { grid-area: bar; }
.tabs { display: none; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 17px; letter-spacing: -.01em; padding: 2px 8px 18px; }
.brand img { border-radius: 9px; box-shadow: 0 6px 18px rgba(139, 92, 246, .35); }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.navhead { margin: 14px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.nav button, .moreitem {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; text-align: left; color: var(--muted); font-weight: 500; text-decoration: none;
}
.nav button:hover { background: var(--hover); color: var(--text); }
.nav button.on { background: var(--raised); color: var(--text); }
.nav button.on svg { color: var(--accent); }
.sidefoot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.storage { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--faint); padding: 0 6px; }
select {
  appearance: none; background: var(--raised) url("chevron.svg") no-repeat right 8px center / 16px;
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 30px 7px 10px; font-size: 13px; max-width: 100%;
}
.radio { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.radio:hover { color: var(--text); background: var(--hover); }
.radio small { margin-left: auto; opacity: .6; }
.acct { display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.acct .primary { flex: 1; justify-content: center; }
.who { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; flex: 1; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.whoname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 500; }
.signout { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--faint); font-size: 12px; padding: 4px; }
.linkbtn:hover { color: var(--text); }

/* ----- The top of the library ----- */
.top { display: flex; align-items: center; gap: 12px; padding: 16px 28px 10px; min-height: 66px; }
.search { flex: 0 1 380px; display: flex; align-items: center; gap: 8px; background: var(--raised); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; height: 40px; color: var(--faint); }
.search:focus-within { border-color: var(--accent); color: var(--text); }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; height: 100%; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.status { flex: 1; margin: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; color: var(--muted); flex: none; }
.iconbtn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.iconbtn.toggle.on { color: var(--accent); }
.iconbtn.toggle.one { position: relative; }
.iconbtn.toggle.one::after { content: "1"; position: absolute; right: 6px; bottom: 6px; font-size: 9px; font-weight: 800; color: var(--accent); }
.iconbtn.on { color: var(--accent); }
#rescan.spin svg { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.view { flex: 1; overflow-y: auto; padding: 4px 28px 40px; scroll-behavior: auto; overscroll-behavior: contain; }
.view:focus { outline: 0; }
.pagehead { margin: 6px 0 18px; }
.pagehead h1 { font-size: 30px; line-height: 1.15; margin: 0; letter-spacing: -.02em; }
.sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
h2.section { font-size: 19px; margin: 30px 0 12px; letter-spacing: -.01em; }

/* ----- Buttons ----- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 18px; }
.primary, .secondary {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; text-decoration: none; border: 0; white-space: nowrap;
}
.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(236, 72, 153, .28); }
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.secondary { background: var(--raised); border: 1px solid var(--line); color: var(--text); }
.secondary:hover:not(:disabled) { background: var(--hover); }
.secondary.danger { color: #f87171; }
.secondary.small { height: 32px; padding: 0 12px; font-size: 13px; }
.primary svg, .secondary svg { width: 18px; height: 18px; }

/* ----- Pictures ----- */
.art {
  --h: 280;
  position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 1; border-radius: 12px;
  background:
    radial-gradient(120% 90% at 15% 10%, hsl(calc(var(--h) + 30) 85% 62% / .9), transparent 60%),
    linear-gradient(140deg, hsl(var(--h) 70% 42%), hsl(calc(var(--h) + 45) 75% 30%));
  color: rgba(255, 255, 255, .92); flex: none;
}
.art .ini { font-weight: 800; letter-spacing: -.02em; font-size: clamp(16px, 2.2vw, 34px); text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.art.pic { background: #000; }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; } }
.art.round { border-radius: 50%; }
.art.small { width: 40px; border-radius: 8px; }
.art.small .ini { font-size: 13px; }
.art.big { width: clamp(150px, 22vw, 232px); box-shadow: var(--shadow); }
.art.big .ini { font-size: 52px; }

/* ----- Grids of albums and artists ----- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }
.tile { display: flex; flex-direction: column; gap: 3px; background: none; border: 0; padding: 0; text-align: left; min-width: 0; content-visibility: auto; contain-intrinsic-size: 168px 230px; }
.tile .art { width: 100%; margin-bottom: 7px; transition: transform .18s ease, box-shadow .18s ease; box-shadow: 0 8px 22px rgba(0, 0, 0, .22); }
.tile:hover .art { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile .t1 { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .t2 { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.round { align-items: center; text-align: center; }
.tile.round .t1, .tile.round .t2 { max-width: 100%; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.chip {
  --h: 280;
  display: flex; flex-direction: column; justify-content: flex-end; height: 92px; padding: 14px; border: 0; border-radius: var(--radius); text-align: left; color: #fff;
  background: linear-gradient(140deg, hsl(var(--h) 70% 45%), hsl(calc(var(--h) + 50) 75% 32%));
  transition: transform .15s ease;
}
.chip:hover { transform: translateY(-2px); }
.chip .t1 { font-weight: 700; font-size: 16px; }
.chip .t2 { opacity: .8; font-size: 12px; }

/* ----- An album or artist ----- */
.hero { display: flex; align-items: flex-end; gap: 28px; margin: 10px 0 22px; }
.heromiddle { min-width: 0; }
.hero h1 { font-size: clamp(26px, 3.6vw, 44px); line-height: 1.08; margin: 4px 0 6px; letter-spacing: -.025em; }
.kind { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.by { background: none; border: 0; padding: 0; font-weight: 600; color: var(--text); }
.by:hover { text-decoration: underline; }
.hero .actions { margin-bottom: 0; }

/* ----- Song lists ----- */
.songs { position: relative; }
.songs.windowed .song { position: absolute; left: 0; right: 0; }
.song { display: flex; align-items: center; height: 56px; border-radius: 10px; padding-right: 4px; }
.song:hover { background: var(--hover); }
.songmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0 0 0 8px; height: 100%; text-align: left; }
.lead { width: 40px; display: grid; place-items: center; position: relative; flex: none; }
.num { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 14px; }
.eqbars { display: none; }
.song.on .t1 { color: var(--accent); }
.song.on .num { display: none; }
.song.on .eqbars {
  display: block; width: 14px; height: 14px;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 3px 60% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 50% 100% / 3px 100% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 3px 40% no-repeat;
}
.song.on .lead .art + .eqbars { position: absolute; inset: 0; margin: auto; background-color: rgba(0, 0, 0, .45); border-radius: 8px; width: 40px; height: 40px; background-size: 3px 40%, 3px 60%, 3px 30%; background-position: 13px 70%, 19px 70%, 25px 70%; }
.txt { display: flex; flex-direction: column; min-width: 0; }
.t1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .t1 { font-weight: 500; }
.t2 { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.end { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; padding: 0 6px; }
.savedmark { width: 16px; height: 16px; color: var(--up); }
.rowmore { width: 34px; height: 34px; opacity: 0; }
.song:hover .rowmore, .rowmore:focus-visible { opacity: 1; }
@media (hover: none) { .rowmore { opacity: .7; } }
.menu {
  position: fixed; z-index: 50; min-width: 210px; padding: 6px; background: var(--raised); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: pop .12s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
.menu button { background: none; border: 0; border-radius: 8px; padding: 9px 12px; text-align: left; font-size: 14px; }
.menu button:hover:not(:disabled) { background: var(--hover); }

/* ----- Cards for what isn't there yet ----- */
.card { max-width: 560px; margin: 8vh auto 0; text-align: center; padding: 36px 30px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.card h2 { margin: 14px 0 8px; font-size: 23px; letter-spacing: -.015em; }
.card p { color: var(--muted); margin: 0 auto; max-width: 440px; }
.card .actions { justify-content: center; margin-bottom: 0; }
.cardicon { width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 12px 30px rgba(236, 72, 153, .3); }
.cardicon svg { width: 30px; height: 30px; }
.card.welcome { max-width: 640px; padding: 48px 36px; }
.card.welcome h2 { font-size: 32px; }
.card.busy .cardicon svg { animation: spin 2s linear infinite; }

/* ----- The player bar ----- */
.bar {
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(300px, 640px) minmax(180px, 1fr); align-items: center; gap: 18px;
  padding: 0 20px; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  z-index: 20;
}
.barnow { display: flex; align-items: center; gap: 12px; min-width: 0; background: none; border: 0; text-align: left; padding: 6px; border-radius: 12px; }
.barnow:hover { background: var(--hover); }
.barnow .art { width: 56px; border-radius: 9px; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.barnow .art .ini { font-size: 17px; }
.meta { display: flex; flex-direction: column; min-width: 0; }
.meta b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barmid { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.buttons { display: flex; align-items: center; justify-content: center; gap: 10px; }
.playbtn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); display: grid; place-items: center; transition: transform .12s ease; }
.playbtn:hover:not(:disabled) { transform: scale(1.06); }
.playbtn svg { width: 22px; height: 22px; }
.playbtn.big { width: 64px; height: 64px; background: var(--grad); color: #fff; box-shadow: 0 10px 28px rgba(236, 72, 153, .35); }
.playbtn.big svg { width: 28px; height: 28px; }
.playbtn.loading { animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
.seek { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.seek span { width: 40px; text-align: center; }
.barend { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.volume { display: flex; align-items: center; gap: 6px; color: var(--muted); width: 150px; }
.volume svg { width: 20px; height: 20px; }
.bar.idle .barnow .meta span { color: var(--faint); }

/* Sliders: a thin track filled up to where it is. */
input[type="range"] { -webkit-appearance: none; appearance: none; background: none; flex: 1; min-width: 0; height: 18px; margin: 0; cursor: pointer; }
input[type="range"]:disabled { cursor: default; opacity: .5; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--text) var(--p, 0%), color-mix(in srgb, var(--text) 22%, transparent) var(--p, 0%) var(--b, 0%), var(--line) var(--b, 0%));
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--text); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border-radius: 50%; background: var(--text); opacity: 0; transition: opacity .12s; }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--text); }
input[type="range"]:hover::-webkit-slider-thumb, input[type="range"]:focus-visible::-webkit-slider-thumb { opacity: 1; }
#volume { --p: var(--v, 80%); }
#volume::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--text) var(--v, 80%), var(--line) var(--v, 80%)); }

/* ----- Now playing ----- */
.nowhead { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.nowhead .spacer { width: 38px; }
.nowhead span:first-of-type { flex: 1; text-align: center; }
.nowbody { flex: 1; overflow-y: auto; padding: 8px 22px 30px; display: flex; flex-direction: column; gap: 18px; }
.nowart { width: 100%; max-width: 340px; margin: 4px auto 0; border-radius: 18px; box-shadow: var(--shadow); }
.nowart .ini { font-size: 64px; }
.nowmeta { text-align: center; }
.nowmeta h2 { margin: 0; font-size: 21px; letter-spacing: -.015em; line-height: 1.25; }
.nowmeta p { margin: 4px 0 0; color: var(--muted); }
.nowctl { gap: 18px; }
.eq, .queue, .lyrics { background: var(--raised); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
/* The preset list takes what room is left, and its own row when the panel is too narrow (it never spills out). */
.eqhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.eqhead h3, .queue h3, .lyrics h3 { margin: 0; font-size: 15px; }
.eqhead h3 { flex: 0 0 auto; margin-right: auto; }
.eqhead select { flex: 1 1 110px; min-width: 0; max-width: 100%; }
.eqgraph { margin: 10px -4px 6px; height: 170px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 60%, transparent); }
.eqgraph canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: ns-resize; }
.now.eqoff .eqgraph { opacity: .7; }
.preamp { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.preamp output { width: 54px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.preamp input { --p: 50%; }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.queue ol { list-style: none; margin: 8px -8px 0; padding: 0; }
.qitem { width: 100%; display: flex; flex-direction: column; background: none; border: 0; text-align: left; padding: 7px 8px; border-radius: 9px; }
.qitem:hover { background: var(--hover); }
.queue .empty { color: var(--faint); font-size: 13px; padding: 4px 8px; }

/* ----- More (phones) ----- */
.morelist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.moreitem { color: var(--text); background: var(--panel); border: 1px solid var(--line); padding: 14px 16px; font-size: 16px; }
.more .storage { padding: 0 0 18px; }

/* ----- Favourite, sleep timer, limiter ----- */
.nowmeta { display: flex; align-items: center; gap: 8px; text-align: left; }
.nowmeta > div { flex: 1; min-width: 0; }
.fav.on { color: var(--b); }
.fav.on svg path { fill: currentColor; }
.sleep { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.sleep svg { width: 18px; height: 18px; }
.sleep select { padding: 4px 26px 4px 8px; font-size: 12px; background-position: right 6px center; }
.sleepnote { margin: -10px 0 0; text-align: center; font-size: 13px; color: var(--accent); }
.limit { font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 6px; color: var(--faint); border: 1px solid var(--line); transition: color .1s, border-color .1s; }
.limit.on { color: var(--c); border-color: var(--c); }

/* ----- Lyrics ----- */
.lyhead { display: flex; align-items: center; gap: 8px; }
.lyhead h3 { flex: none; }
.lysource { flex: 1; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lyoffset { display: flex; align-items: center; gap: 2px; font-size: 12px; }
.lyoffset output { min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.iconbtn.small { width: 30px; height: 30px; font-size: 17px; font-weight: 700; }
.iconbtn.small svg { width: 18px; height: 18px; }
.lybody { margin-top: 8px; }
.lylines { max-height: 300px; overflow-y: auto; scroll-behavior: smooth; padding: 4px 0; mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); }
.lyline { display: block; width: 100%; margin: 0; padding: 4px 2px; font-size: 15px; line-height: 1.45; text-align: left; color: var(--muted); background: none; border: 0; border-radius: 8px; white-space: pre-wrap; }
.lylines.synced .lyline { color: var(--faint); font-weight: 600; font-size: 16px; transition: color .2s, transform .2s; transform-origin: left center; }
.lylines.synced .lyline:hover { color: var(--muted); }
.lylines.synced .lyline.on { color: var(--text); transform: scale(1.04); }
.lyempty p { margin: 4px 0; color: var(--muted); font-size: 14px; }
.lyempty .actions { margin: 10px 0 0; }
.primary.small { height: 32px; padding: 0 14px; font-size: 13px; }
.lypaste textarea, .newlist input {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; color: var(--text); font: inherit; font-size: 14px;
}
.lypaste textarea { resize: vertical; min-height: 140px; }
.lypaste .actions { margin: 10px 0 0; }

/* ----- Playlists ----- */
.menu.picker { width: 280px; max-height: 60vh; overflow-y: auto; }
.menuhead { margin: 4px 10px 8px; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu button small { display: block; font-size: 11px; color: var(--faint); }
.newlist { display: flex; gap: 6px; padding: 0 4px 6px; }
.newlist.wide { max-width: 520px; padding: 0; margin: 6px 0 20px; gap: 10px; }
.newlist.wide input { height: 40px; }
.hint { color: var(--muted); font-size: 14px; }
.moreitem small { margin-left: auto; font-size: 12px; color: var(--faint); }

/* ----- Asked once: covers and lyrics online ----- */
.ask { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(8, 6, 14, .6); backdrop-filter: blur(6px); animation: pop .15s ease; }
.askbox { width: min(520px, 100%); max-height: 100%; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 28px 26px 22px; text-align: center; }
.askbox h2 { margin: 12px 0 8px; font-size: 22px; letter-spacing: -.015em; }
.askbox p { margin: 0 0 10px; color: var(--muted); }
.askbox p.small { font-size: 12.5px; color: var(--faint); }
.askopts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.askopt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); text-align: left; height: auto; white-space: normal; box-shadow: none; }
.askopt:hover { background: var(--hover); }
.askopt.primary { border: 0; background: var(--grad); color: #fff; }
.askopt .t1 { font-weight: 700; font-size: 14px; }
.askopt .t2 { font-size: 12px; opacity: .8; }
@media (max-width: 499px) { .askopts { grid-template-columns: 1fr; } }

/* ----- Settings ----- */
.settings { max-width: 760px; }
.setgroup { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 4px 20px 14px; margin-bottom: 18px; }
.setgroup h2.section { margin: 16px 0 6px; font-size: 16px; }
.setrow { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.setgroup h2 + .setrow, .presets .setrow:first-child { border-top: 0; }
.settext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.settext .t1, .setrow > .t1 { font-weight: 600; }
.setrow > .t1 { flex: 1; }
.settext .t2 { font-size: 13px; color: var(--muted); }
.rowbtns { display: flex; gap: 6px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); flex: none; }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--grad); color: #fff; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 8px 0; font-size: 14px; }
.keys dt { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.keys dd { margin: 0; color: var(--muted); }
@media (max-width: 699px) {
  .setrow { flex-wrap: wrap; }
  .setgroup { padding: 4px 14px 12px; }
}

/* ----- Middle widths: Now playing floats over the library ----- */
@media (max-width: 1199px) {
  .app { grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-areas: "side main" "bar bar"; }
  .now { position: fixed; top: 0; right: 0; bottom: var(--bar); z-index: 30; box-shadow: var(--shadow); animation: slide .2s ease; }
  @keyframes slide { from { transform: translateX(30px); opacity: 0; } }
}
@media (max-width: 959px) {
  :root { --side-w: 76px; }
  .side { padding: 16px 10px; align-items: center; }
  .brand span, .navhead, .nav button span, .radio span, .radio small, .whoname, .storage, .signout { display: none; }
  .brand { padding: 2px 0 14px; }
  .nav button { justify-content: center; padding: 11px; }
  .radio { justify-content: center; border: 0; }
  .acct { flex-direction: column; padding: 0; }
  .acct .primary { padding: 0 10px; font-size: 12px; }
  .bar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .barmid .seek { display: none; }
  .volume { width: 110px; }
}

/* ----- Phones: tabs along the bottom, the player above them, Now playing over everything ----- */
@media (max-width: 699px) {
  :root { --bar: 66px; }
  body { font-size: 16px; }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas: "main" "bar" "tabs";
  }
  .side { display: none; }
  .top { padding: calc(10px + env(safe-area-inset-top)) 16px 8px; min-height: 0; flex-wrap: wrap; }
  .search { flex: 1 1 auto; }
  .status { flex-basis: 100%; order: 3; text-align: left; }
  .status:empty { display: none; }
  .view { padding: 2px 16px 24px; }
  .pagehead h1 { font-size: 26px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .art.big { width: min(62vw, 240px); align-self: center; }
  .bar { margin: 0 8px 6px; border: 1px solid var(--line); border-radius: 16px; height: var(--bar); padding: 0 8px; grid-template-columns: minmax(0, 1fr) auto; box-shadow: var(--shadow); }
  .barnow .art { width: 46px; }
  .barmid .buttons .toggle, .barmid .buttons [aria-label="Previous"], .barend { display: none; }
  .barmid .buttons { gap: 2px; }
  .playbtn { width: 40px; height: 40px; }
  .tabs {
    grid-area: tabs; display: flex; justify-content: space-around; padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--side) 92%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line);
  }
  .tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 6px 0; font-size: 11px; color: var(--faint); }
  .tabs button.on { color: var(--accent); }
  .now { position: fixed; inset: 0; width: auto; z-index: 40; border: 0; animation: rise .22s ease; padding-top: env(safe-area-inset-top); }
  @keyframes rise { from { transform: translateY(40px); opacity: 0; } }
  .nowart { max-width: min(78vw, 360px); }
  .song { height: 60px; }
  .card { margin-top: 4vh; padding: 28px 20px; }
  .card.welcome h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ----- Video: the stage above the library, kept while browsing ----- */
.stage { flex: none; margin: 0 28px 10px; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.stage video { display: block; width: 100%; max-height: min(56vh, 640px); background: #000; }
.stagebar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; background: var(--panel); }
.stagetitle { flex: 1; min-width: 0; margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stagebar select { padding: 4px 26px 4px 8px; font-size: 12px; background-position: right 6px center; }
.videofolder { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sharedowner { margin: 22px 0 4px; font-size: 15px; font-weight: 700; }
.sharedfolder { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; min-width: 0; }
.sharedfolder h3 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 13px; font-weight: 600; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sharedfolder button { flex: 0 0 auto; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.videorow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-align: left; font: inherit; cursor: pointer; min-width: 0; }
.videorow:hover { background: var(--hover); }
.videorow.on { border-color: var(--accent); }
.videorow svg { width: 28px; height: 28px; flex: none; color: var(--accent); }
.videorow span { min-width: 0; display: flex; flex-direction: column; }
.videorow b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.videorow small { color: var(--muted); }
@media (max-width: 899px) {
  .stage { margin: 0 16px 8px; }
  .stagebar select[data-speed] { max-width: 76px; }
}
