/* Moozic — design system.
   Neutral, quiet chrome; colour comes from the music (--glow / --np-glow are set from album art).
   Every token is defined once with light-dark(); no inline styles anywhere (the CSP forbids them). */

:root {
  color-scheme: dark light;
  --bg: light-dark(#f6f5fa, #0a0a10);
  --bg-2: light-dark(#eeedf6, #0e0e16);
  --surface: light-dark(#ffffff, #14141d);
  --surface-2: light-dark(#f1f0f8, #1b1b26);
  --surface-3: light-dark(#e6e4f2, #252533);
  --line: light-dark(rgb(24 20 60 / .09), rgb(255 255 255 / .07));
  --line-2: light-dark(rgb(24 20 60 / .17), rgb(255 255 255 / .13));
  --text: light-dark(#16151f, #f3f2f8);
  --text-2: light-dark(#3d3b50, #c4c2d4);
  --muted: light-dark(#6b6980, #8c8aa0);
  --faint: light-dark(#a3a1b5, #5b596e);
  --accent: light-dark(#6a4dff, #8f7cff);
  --accent-2: light-dark(#d1409a, #ff7ac1);
  --accent-soft: light-dark(rgb(106 77 255 / .11), rgb(143 124 255 / .16));
  --grad: linear-gradient(135deg, #7c5cff 0%, #b566ff 55%, #ff6fb5 100%);
  --ok: light-dark(#0e9f62, #46d68f);
  --warn: light-dark(#b16d0a, #f6b845);
  --bad: light-dark(#d1304a, #ff6b7d);
  --ok-soft: light-dark(rgb(14 159 98 / .12), rgb(70 214 143 / .14));
  --warn-soft: light-dark(rgb(177 109 10 / .12), rgb(246 184 69 / .14));
  --bad-soft: light-dark(rgb(209 48 74 / .11), rgb(255 107 125 / .14));
  --shadow: light-dark(0 12px 32px -12px rgb(30 20 80 / .28), 0 14px 36px -12px rgb(0 0 0 / .7));
  --shadow-sm: light-dark(0 2px 8px rgb(30 20 80 / .12), 0 2px 10px rgb(0 0 0 / .45));
  --glass: light-dark(rgb(246 245 250 / .78), rgb(10 10 16 / .74));
  --glow: 143 124 255;      /* rgb triplet; view ambient colour */
  --np-glow: 143 124 255;   /* rgb triplet; now-playing colour */
  --glow-a: .26;
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --nav-w: 248px; --player-h: 92px; --topbar-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --glow-a: .17; } }
:root[data-theme="light"] { --glow-a: .17; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); overflow: hidden;
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
h1, h2, h3, p { margin: 0; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ---------- icons ---------- */
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.filled { fill: currentColor; stroke-width: 1.6; }

/* ---------- shell ---------- */
#app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; height: 100vh; height: 100dvh; }
#nav { grid-area: 1 / 1; background: var(--bg-2); border-right: 1px solid var(--line); padding: 18px 12px 12px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
#main { grid-area: 1 / 2; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#player { grid-area: 2 / 1 / 3 / 3; }

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; font-size: 20px; font-weight: 750; letter-spacing: -.03em; color: var(--text); }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 4px 14px -4px rgb(124 92 255 / .6); }
.brand:hover { color: var(--text); }
.nav-title { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); padding: 18px 12px 6px; }
#nav a.nav, #nav button.nav {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--muted);
  font-weight: 550; background: none; border: 0; text-align: left; width: 100%; transition: background .15s, color .15s;
}
#nav a.nav .ic, #nav button.nav .ic { font-size: 19px; }
#nav a.nav:hover, #nav button.nav:hover { background: var(--surface-2); color: var(--text); }
#nav a.nav.active { background: var(--accent-soft); color: var(--text); }
#nav a.nav.active .ic { color: var(--accent); }
#nav .spacer { flex: 1; min-height: 12px; }
#nav .nav-foot { padding: 12px 12px 4px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; color: var(--faint); font-size: 12px; }
#nav .nav-foot a { color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
#nav .nav-foot a:hover { color: var(--accent); }
#nav button.nav.nav-more { display: none; }

#topbar { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 clamp(16px, 3vw, 40px); }
.searchbox { position: relative; flex: 1; max-width: 540px; }
.searchbox .ic { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); font-size: 17px; pointer-events: none; }
.searchbox input[type=search] { width: 100%; height: 42px; padding: 0 44px 0 42px; border-radius: 999px; background: var(--surface-2); border: 1px solid transparent; }
.searchbox input[type=search]:hover { border-color: var(--line-2); }
.searchbox input[type=search]:focus { border-color: var(--accent); }
.searchbox kbd { position: absolute; right: 12px; top: 50%; translate: 0 -50%; font: 11px ui-monospace, Menlo, monospace; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; pointer-events: none; }
.searchbox input:focus + kbd { display: none; }
#topbar .grow { flex: 1; }
.scan-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.spin { animation: spin 1s linear infinite; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex: none; text-transform: uppercase; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18); }
button.avatar:hover { filter: brightness(1.1); }

#view {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scroll-behavior: smooth;
  background: radial-gradient(ellipse 85% 380px at 22% 0, rgb(var(--glow) / var(--glow-a)), transparent 78%) no-repeat local;
}
.page { padding: 4px clamp(16px, 3vw, 40px) 56px; max-width: 1480px; margin: 0 auto; animation: rise .35s var(--ease) both; }
#view:focus { outline: none; }

/* ---------- typography & layout helpers ---------- */
h1, .h1 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 780; letter-spacing: -.035em; line-height: 1.1; }
h2, .h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.eyebrow { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.col { display: grid; gap: 12px; align-content: start; }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 0 22px; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 62ch; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head a { color: var(--muted); font-size: 13px; font-weight: 600; } .section-head a:hover { color: var(--accent); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; white-space: nowrap; color: var(--text);
  transition: background .15s, border-color .15s, transform .1s, filter .15s;
}
.btn .ic { font-size: 17px; }
.btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); border-color: var(--line-2); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -8px rgb(140 90 255 / .8); }
.btn.primary:hover:not(:disabled) { background: var(--grad); color: #fff; filter: brightness(1.1); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.sm .ic { font-size: 15px; }
.btn.icon { width: 38px; padding: 0; } .btn.icon.sm { width: 30px; }
.btn.round { border-radius: 999px; }
.btn.big { height: 46px; padding: 0 22px; border-radius: 999px; font-size: 15px; }
.fab { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: 0 10px 26px -8px rgb(140 90 255 / .9); transition: transform .15s var(--ease), filter .15s; }
.fab:hover { transform: scale(1.06); filter: brightness(1.1); } .fab:active { transform: scale(.97); }

input[type=text], input[type=search], input[type=password], input[type=number], input[type=email], select, textarea {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; height: 38px; padding: 0 12px; min-width: 0; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; }
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--line-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c8aa0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.row input[type=text], .row input[type=password], .toolbar input[type=text] { min-width: 210px; }
.field { display: grid; gap: 6px; } .field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; cursor: pointer; user-select: none; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 600; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* range sliders (seek + volume): --p is the filled fraction, set from JS */
input[type=range].rng { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; --p: 0%; --fill: var(--text); margin: 0; }
input[type=range].rng:hover, input[type=range].rng:focus-visible { --fill: var(--accent); }
.rng::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(to right, var(--fill) var(--p), var(--surface-3) var(--p)); }
.rng::-moz-range-track { height: 4px; border-radius: 99px; background: var(--surface-3); }
.rng::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--fill); }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .5); opacity: 0; transition: opacity .15s; }
.rng::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; opacity: 0; transition: opacity .15s; }
.rng:hover::-webkit-slider-thumb, .rng:focus-visible::-webkit-slider-thumb, .sheet .rng::-webkit-slider-thumb { opacity: 1; }
.rng:hover::-moz-range-thumb, .rng:focus-visible::-moz-range-thumb, .sheet .rng::-moz-range-thumb { opacity: 1; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-head:last-child { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat b { display: block; font-size: 26px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.warn b { color: var(--warn); } .stat.ok b { color: var(--ok); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.notice { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--warn-soft); color: var(--text); border: 1px solid transparent; }
.notice .ic { color: var(--warn); font-size: 20px; }
.notice.accent { background: var(--accent-soft); } .notice.accent .ic { color: var(--accent); }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 56px 24px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--muted); }
.empty .ic-wrap { width: 60px; height: 60px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 26px; color: var(--muted); margin-bottom: 6px; }
.empty h3 { color: var(--text); font-size: 17px; } .empty p { max-width: 46ch; } .empty .row { justify-content: center; margin-top: 10px; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 90px; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s var(--ease); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-weight: 600; transition: .15s; }
.chip:hover { border-color: var(--line-2); background: var(--surface-2); color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip b { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; } .chip.active b { color: var(--accent); }

/* ---------- artwork ---------- */
.art { position: relative; aspect-ratio: 1; background: var(--surface-2); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); isolation: isolate; }
.art .art-ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgb(255 255 255 / .55); font-size: 34px; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.art.loaded img { opacity: 1; }
.art.loaded .art-ph { display: none; }
.art.round { border-radius: 50%; }
.art .initials { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 750; font-size: 34px; letter-spacing: -.02em; text-shadow: 0 2px 10px rgb(0 0 0 / .25); }
.thumb { width: 42px; height: 42px; border-radius: 8px; box-shadow: none; flex: none; }
.thumb .art-ph { font-size: 18px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 26px 20px; }
.tile { position: relative; min-width: 0; }
.tile .art { transition: transform .25s var(--ease), box-shadow .25s; }
.tile:hover .art { transform: translateY(-4px); box-shadow: var(--shadow); }
.tile .cover-link { display: block; }
.tile .media { position: relative; }
.tile .play { position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; font-size: 18px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .25s var(--ease), filter .15s; }
.tile:hover .play, .tile:focus-within .play { opacity: 1; transform: translateY(-4px); }
.tile .play:hover { transform: translateY(-4px) scale(1.06); }
.tile .t { margin-top: 12px; font-weight: 650; letter-spacing: -.01em; } .tile .t a:hover { color: var(--text); text-decoration: underline; }
.tile .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tile .s a:hover { color: var(--text); }
.tile.artist { text-align: center; } .tile.artist .art { border-radius: 50%; }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(158px, 178px); gap: 20px; overflow-x: auto; padding: 4px 4px 18px; margin: -4px -4px 0; scroll-snap-type: x proximity; }
.shelf > * { scroll-snap-align: start; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.quick a { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px 0 0; height: 64px; overflow: hidden; font-weight: 650; transition: background .15s, border-color .15s; }
.quick a:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.quick .art { height: 64px; width: 64px; border-radius: 0; box-shadow: none; flex: none; } .quick .art .art-ph { font-size: 22px; }
.quick .s { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }

/* ---------- hero (album / artist / playlist) ---------- */
.hero { display: flex; gap: clamp(20px, 3vw, 36px); align-items: flex-end; padding: 22px 0 26px; flex-wrap: wrap; }
.hero .art { width: clamp(150px, 22vw, 232px); flex: none; border-radius: 14px; box-shadow: 0 18px 40px -20px rgb(0 0 0 / .7); }
.hero .art.round { border-radius: 50%; }
.hero .info { min-width: 0; flex: 1 1 320px; display: grid; gap: 10px; }
.hero h1 { font-size: clamp(30px, 5.2vw, 60px); letter-spacing: -.04em; overflow-wrap: anywhere; }
.hero .meta { color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.hero .meta a { font-weight: 650; } .hero .meta a:hover { text-decoration: underline; color: var(--text); }
.hero .meta .sep { color: var(--faint); }
.hero .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- track table ---------- */
table.tracks { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.tracks th { position: sticky; top: 0; z-index: 2; text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 10px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tracks td { padding: 6px 10px; height: 56px; vertical-align: middle; }
.tracks tr.compact td { height: 48px; }
.tracks tbody tr { transition: background .12s; }
.tracks tbody tr:hover td, .tracks tbody tr:focus-within td { background: var(--surface-2); }
.tracks tbody tr:hover td:first-child { border-radius: 10px 0 0 10px; } .tracks tbody tr:hover td:last-child { border-radius: 0 10px 10px 0; }
.c-num { width: 52px; text-align: center !important; padding-left: 4px !important; padding-right: 4px !important; }
.c-album { width: 26%; } .c-heart { width: 46px; } .c-time { width: 70px; text-align: right !important; } .c-act { width: 52px; text-align: right !important; }
.c-issue { width: 32%; } .c-artist { width: 22%; } .c-fix { width: 92px; text-align: right !important; } .c-move { width: 84px; text-align: right !important; }
.tracks td.c-num { color: var(--muted); font-variant-numeric: tabular-nums; position: relative; }
.tracks .rowplay { position: absolute; inset: 0; margin: auto; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--text); display: none; place-items: center; font-size: 16px; }
.tracks tr:hover .rowplay, .tracks .rowplay:focus-visible { display: grid; }
.tracks tr:hover .n, .tracks tr:hover .eq { visibility: hidden; }
.tracks .tcell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tracks .tcell > div { min-width: 0; }
.tracks .t { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tracks .t > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks .s { color: var(--muted); font-size: 12.5px; }
.tracks .s a:hover, .tracks td a:hover { color: var(--text); text-decoration: underline; }
.tracks td.c-album, .tracks td.c-artist { color: var(--muted); }
.tracks tr.playing .t, .tracks tr.playing .n { color: var(--accent); }
.tracks .time { color: var(--muted); font-variant-numeric: tabular-nums; }
.eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; height: 100%; background: var(--accent); border-radius: 2px; animation: eq .9s ease-in-out infinite alternate; transform-origin: bottom; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
tr.playing .eq { display: inline-flex; } tr.playing .n { display: none; }
body.is-paused .eq i { animation-play-state: paused; }
.heart { background: none; border: 0; color: var(--muted); font-size: 18px; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; transition: color .15s, transform .15s var(--ease); }
.heart:hover { color: var(--text); transform: scale(1.12); }
.heart.on { color: var(--accent-2); } .heart.on .ic { fill: currentColor; }
@media (hover: hover) { .tracks .heart:not(.on) { opacity: 0; } .tracks tr:hover .heart, .tracks .heart:focus-visible { opacity: 1; } }
.list { display: grid; gap: 2px; }
.list > .item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 10px; }
.list > .item:hover { background: var(--surface-2); }
.list.bordered > .item { border-bottom: 1px solid var(--line); border-radius: 0; } .list.bordered > .item:last-child { border-bottom: 0; }

/* ---------- player bar ---------- */
#player {
  position: relative; z-index: 20; height: var(--player-h); display: grid; grid-template-columns: minmax(200px, 1fr) minmax(340px, 640px) minmax(200px, 1fr); align-items: center; gap: 24px; padding: 0 22px;
  background: linear-gradient(90deg, rgb(var(--np-glow) / .2), transparent 45%), var(--bg-2); border-top: 1px solid var(--line);
  transition: background .6s;
}
#player .np { display: flex; align-items: center; gap: 14px; min-width: 0; }
#player .np .art { width: 58px; height: 58px; border-radius: 10px; flex: none; cursor: pointer; }
#player .np .art.empty-cover { background: var(--surface-2); box-shadow: none; }
#player .meta { min-width: 0; }
#player .meta .tt { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player .meta .tt a:hover { text-decoration: underline; color: var(--text); }
#player .meta .a { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player .meta .a a:hover { text-decoration: underline; color: var(--text); }
.ctl { display: grid; gap: 4px; justify-items: center; min-width: 0; }
.btns { display: flex; align-items: center; gap: 8px; }
.cb { width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--text-2); display: grid; place-items: center; font-size: 18px; position: relative; transition: color .15s, transform .12s, background .15s; }
.cb:hover { color: var(--text); transform: scale(1.08); } .cb:active { transform: scale(.94); }
.cb.on { color: var(--accent); } .btns .cb.on::after { content: ""; position: absolute; bottom: 3px; left: 50%; translate: -50% 0; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.btns .cb.play { width: 44px; height: 44px; background: var(--text); color: var(--bg); font-size: 19px; } .btns .cb.play:hover { color: var(--bg); transform: scale(1.07); }
.cb .one { position: absolute; right: 5px; top: 5px; font-size: 9px; font-weight: 800; line-height: 1; }
.seekrow { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seekrow span { width: 40px; } .seekrow span:first-child { text-align: right; }
#player .right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
#player .right .cb { width: 34px; height: 34px; }
#player .right .cb:hover { background: var(--surface-2); transform: none; }
.volrow { display: flex; align-items: center; gap: 6px; }
#player .volrow .rng { width: 100px; }
#player .np-cover { flex: none; display: flex; }
.mini-progress { display: none; }
.q-badge { position: relative; }

/* ---------- now playing sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; overflow: auto; overscroll-behavior: contain; background: linear-gradient(180deg, rgb(var(--np-glow) / .6) 0%, var(--bg) 78%), var(--bg); animation: sheetIn .38s var(--ease) both; }
.sheet.closing { animation: sheetOut .25s ease-in both; }
.sheet-inner { max-width: 1120px; margin: 0 auto; padding: 18px clamp(18px, 4vw, 44px) 40px; min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); gap: clamp(28px, 5vw, 72px); align-content: start; }
.sheet-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.sheet-top .btn { font-size: 20px; }
.sheet-main { display: grid; gap: 22px; align-content: start; justify-items: center; }
.sheet .art-slot { width: 100%; display: flex; justify-content: center; }
.sheet .cover-big { width: min(100%, 440px, 46vh); border-radius: 16px; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .75); }
.sheet .titles { width: 100%; max-width: 440px; display: flex; align-items: center; gap: 12px; }
.sheet .titles .h { min-width: 0; flex: 1; }
.sheet .titles .h1x { font-size: 24px; font-weight: 750; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet .titles .h2x { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sheet .titles a:hover { text-decoration: underline; color: var(--text); }
.sheet .seekrow, .sheet .btns { width: 100%; max-width: 440px; } .sheet .btns { justify-content: space-between; }
.sheet .volrow { width: 100%; max-width: 440px; color: var(--muted); }
.sheet-queue { min-width: 0; display: grid; gap: 12px; align-content: start; }
.sheet-queue .q-list { display: grid; gap: 2px; }
.q-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.q-item:hover { background: rgb(255 255 255 / .06); }
.q-item.playing { background: var(--accent-soft); }
.q-item .art { width: 42px; height: 42px; border-radius: 6px; box-shadow: none; flex: none; } .q-item .art .art-ph { font-size: 16px; }
.q-item .q-t { min-width: 0; flex: 1; } .q-item .q-t b { display: block; font-weight: 600; } .q-item .q-t span { color: var(--muted); font-size: 12.5px; display: block; }
.q-item.playing .q-t b { color: var(--accent); }
.q-item .x { opacity: 0; } .q-item:hover .x, .q-item .x:focus-visible { opacity: 1; }

/* ---------- overlays ---------- */
#overlay:empty { display: none; }
#overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgb(6 6 12 / .62); backdrop-filter: blur(6px); animation: fade .2s both; }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; width: min(760px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .28s var(--ease) both; }
.modal.narrow { width: min(460px, 100%); } .modal.wide { width: min(980px, 100%); }
.modal > header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal > header strong { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.modal .body { padding: 20px 22px; overflow: auto; }
.modal > footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.menu { position: fixed; z-index: 90; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; min-width: 220px; box-shadow: var(--shadow); animation: pop .16s var(--ease) both; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 0 12px; height: 38px; border-radius: 9px; font-weight: 550; color: var(--text-2); }
.menu button .ic { font-size: 17px; color: var(--muted); }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); color: var(--text); outline: none; }
.menu button.danger, .menu button.danger .ic { color: var(--bad); }
.menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu .who { padding: 8px 12px 6px; } .menu .who b { display: block; } .menu .who span { color: var(--muted); font-size: 12.5px; }
#toasts { position: fixed; left: 50%; translate: -50% 0; bottom: calc(var(--player-h) + 18px); display: grid; gap: 10px; z-index: 100; justify-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); animation: toastIn .3s var(--ease) both; }
.toast .ic { font-size: 19px; color: var(--accent); flex: none; } .toast.bad .ic { color: var(--bad); } .toast.ok .ic { color: var(--ok); }

/* ---------- cards & rows for the manage views ---------- */
.diff { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); gap: 6px 14px; font-size: 13px; align-items: baseline; }
.diff .f { color: var(--muted); font-weight: 600; }
.diff .from, .diff .to { padding: 2px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.diff .from { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.diff .from.empty-v { background: var(--surface-2); color: var(--faint); text-decoration: none; font-style: italic; }
.diff .to { background: var(--ok-soft); color: var(--ok); }
.cand { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 14px 16px; }
.cand + .cand { margin-top: 10px; } .cand.best { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); }
.score { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12px; color: var(--muted); }
.score .bar { width: 44px; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .score .bar i { display: block; height: 100%; background: var(--grad); }
.path { font: 12px ui-monospace, Menlo, monospace; color: var(--muted); overflow-wrap: anywhere; }
.issue-row td { height: 64px; }
.folder { margin-top: 16px; } .folder .fh { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.folder .fh .ic { color: var(--muted); font-size: 17px; }
.folder .fh .p { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.files { width: 100%; border-collapse: collapse; }
.files td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: middle; } .files tr:hover td { background: var(--surface-2); }
.dl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 230px) auto; gap: 16px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); }
.dl-row:first-child { border-top: 0; }
.dl-row .st { display: grid; gap: 6px; }
pre.token { background: var(--surface-2); padding: 14px; border-radius: var(--r); overflow: auto; user-select: all; white-space: pre-wrap; word-break: break-all; border: 1px dashed var(--line-2); }
.kbd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 24px; }
.kbd-list div { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-2); }
kbd { font: 12px ui-monospace, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; color: var(--text); }
.tl { position: relative; display: grid; gap: 2px; }

/* ---------- loading ---------- */
.skeleton-wrap { padding: 4px clamp(16px, 3vw, 40px) 40px; max-width: 1480px; margin: 0 auto; animation: fade .3s .12s both; }
.sk { background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px; }
.sk.h1 { height: 38px; width: min(320px, 60%); margin: 22px 0 26px; } .sk.line { height: 14px; margin-top: 8px; } .sk.row { height: 52px; margin-bottom: 8px; }
.sk-tile .sk.sq { aspect-ratio: 1; border-radius: var(--r); }
.sk-tile .sk.line { width: 70%; } .sk-tile .sk.line + .sk.line { width: 45%; }

/* ---------- keyframes ---------- */
@keyframes spin { to { rotate: 360deg; } }
@keyframes rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; scale: .96; translate: 0 8px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes toastIn { from { opacity: 0; translate: 0 14px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes sheetIn { from { translate: 0 100%; } to { translate: 0 0; } }
@keyframes sheetOut { to { translate: 0 100%; } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- narrow: tab bar + mini player ---------- */
@media (max-width: 900px) {
  :root { --topbar-h: 60px; --player-h: 68px; }
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; }
  #main { grid-area: 1 / 1; }
  #player { grid-area: 2 / 1; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 0 12px 0 10px; border-top: 0; margin: 0 8px 6px; border-radius: 16px; height: var(--player-h);
    background: linear-gradient(90deg, rgb(var(--np-glow) / .35), transparent 80%), var(--surface-2); box-shadow: var(--shadow-sm); overflow: hidden; }
  #player .np { cursor: pointer; } #player .np .art { width: 46px; height: 46px; border-radius: 8px; }
  #player .ctl { display: block; } #player .seekrow, #player .btns .cb:not(.play):not(.next) { display: none; }
  #player .btns .cb.play { width: 40px; height: 40px; } #player .btns .cb.next { color: var(--text); }
  #player .right { display: none; }
  .mini-progress { display: block; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: rgb(255 255 255 / .12); border-radius: 2px; }
  .mini-progress i { display: block; height: 100%; width: 0; background: var(--text); border-radius: 2px; }
  #nav { grid-area: 3 / 1; flex-direction: row; align-items: stretch; justify-content: space-around; gap: 0; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); overflow: hidden; background: var(--glass); backdrop-filter: blur(14px); }
  #nav .brand, #nav .nav-title, #nav .spacer, #nav .nav-foot, #nav a.nav.secondary { display: none; }
  #nav a.nav, #nav button.nav, #nav .nav-more { flex: 1; flex-direction: column; justify-content: center; height: 54px; gap: 3px; padding: 0 2px; font-size: 10.5px; text-align: center; width: auto; border-radius: 12px; }
  #nav a.nav .ic, #nav button.nav .ic { font-size: 22px; }
  #nav button.nav.nav-more { display: flex; }
  #nav a.nav.active { background: none; color: var(--accent); }
  #topbar { padding: 0 14px; gap: 10px; }
  .searchbox kbd { display: none; }
  .page { padding: 0 16px 32px; }
  .hide-sm { display: none !important; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 14px; }
  .shelf { grid-auto-columns: 140px; gap: 14px; }
  .tracks td { height: 58px; }
  .tracks .heart:not(.on) { opacity: 1; }
  .c-num { width: 40px; }
  #toasts { bottom: calc(var(--player-h) + 76px); }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero .info { flex: none; width: 100%; }
  #topbar > .grow { display: none; }
  .hero .art { width: min(72vw, 260px); align-self: center; }
  .sheet-inner { grid-template-columns: minmax(0, 1fr); }
  .modal { max-height: 92vh; }
  #overlay { align-items: end; padding: 0; } .modal { border-radius: 22px 22px 0 0; width: 100% !important; animation-name: sheetIn; }
  .dl-row { grid-template-columns: minmax(0, 1fr) auto; } .dl-row .st { grid-column: 1 / -1; grid-row: 2; }
  .diff { grid-template-columns: 76px minmax(0, 1fr); } .diff .to { grid-column: 2; }
}
@media (max-width: 900px) and (hover: none) { .tile .play { opacity: 1; transform: none; width: 38px; height: 38px; } }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; }
@media (max-width: 900px) { .editor { grid-template-columns: minmax(0, 1fr); } }
