:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #13121d;
  --sidebar: #191824;
  --panel: #211f30;
  --panel-hover: #302d44;
  --line: #353247;
  --text: #f7f5ff;
  --muted: #b8b4cb;
  --accent: #baf57c;
  --ink: #17210e;
  --error: #ffadb6;
  --player: 88px;
  --nav: 0px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3.55rem); line-height: 1.06; letter-spacing: -.055em; overflow-wrap: anywhere; }
h2 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.025em; }
p { line-height: 1.6; }
small, .muted { color: var(--muted); }
svg { display: block; width: 22px; height: 22px; flex: none; }
.brand, .mobile-brand { display: flex; align-items: center; gap: 11px; font-weight: 780; letter-spacing: -.04em; }
.brand { font-size: 1.34rem; }
.brand img, .mobile-brand img { width: 35px; height: 35px; border-radius: 10px; }
.login-screen {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 16% 15%, #39305e, transparent 60%), var(--bg);
}
.login-card {
  width: min(100%, 440px); padding: clamp(22px, 5vw, 38px); border-radius: 25px;
  border: 1px solid var(--line); background: #191824; box-shadow: 0 26px 86px #0006;
}
.login-card h1 { margin: 26px 0 12px; font-size: 2.1rem; }
.login-card p { color: var(--muted); }
.login-card form, .field-stack { display: grid; gap: 9px; margin-top: 22px; }
label { font-size: .88rem; font-weight: 650; color: var(--muted); }
input:not([type=range]), select {
  width: 100%; min-height: 45px; padding: 10px 13px; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  font-size: 16px;
}
.login-card .primary { margin-top: 13px; }
.primary, .secondary, .quiet, .chip, .status, .icon-button, .round {
  min-height: 40px; border: 0; border-radius: 100px; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; padding: 8px 16px; font-weight: 720; white-space: nowrap;
}
.primary { background: var(--accent); color: var(--ink); }
.primary:hover, .round:hover { background: #d4ffa9; }
.secondary, .chip, .status { background: var(--panel); border: 1px solid var(--line); }
.secondary:hover, .chip:hover, .status:hover, .icon-button:hover, .quiet:hover { background: var(--panel-hover); }
.quiet, .icon-button { background: transparent; }
.icon-button { min-width: 40px; width: 40px; padding: 0; color: var(--muted); }
.icon-button.active { color: var(--accent); }
.icon-button.active .filled { fill: currentColor; }
.icon-button svg, .secondary svg, .primary svg { width: 19px; height: 19px; }
.round { min-width: 41px; padding: 0; color: var(--ink); background: var(--accent); }
.round svg { width: 19px; height: 19px; }
.error { color: var(--error) !important; }
.error:empty { display: none; }

#app { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  height: calc(100dvh - var(--player)); position: sticky; top: 0; padding: 26px 15px 20px;
  background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column;
}
.sidebar .brand { padding: 0 9px; }
.side-label { font-size: .65rem; font-weight: 750; color: var(--muted); letter-spacing: .13em; margin: 35px 10px 12px; }
#sidebar-nav { display: grid; gap: 5px; }
.nav-button { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; text-align: left; font-weight: 650; }
.nav-button[aria-current=page] { background: #34304a; color: var(--text); }
.nav-button[aria-current=page] svg { color: var(--accent); }
.nav-button:hover { background: var(--panel-hover); }
.side-foot { margin: auto 10px 0; color: var(--muted); font-size: .78rem; display: flex; align-items: center; gap: 8px; }
.signal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; flex: none; }
.status.disconnected .signal-dot { background: #ffc986; }
.workspace { min-width: 0; background: radial-gradient(ellipse at 75% 0%, #262039 0%, transparent 56%); }
.topbar {
  position: sticky; top: 0; z-index: 2; min-height: 62px; padding: 10px clamp(16px, 3vw, 38px);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #13121de8; backdrop-filter: blur(12px); border-bottom: 1px solid #fff0;
}
.topbar-left { display: flex; gap: 8px; align-items: center; }
#breadcrumb { color: var(--muted); font-size: .87rem; font-weight: 650; }
.status { font-size: .78rem; padding: 6px 12px; min-height: 34px; }
.mobile-brand, .mobile-nav { display: none; }
#content { max-width: 1440px; margin: auto; padding: 17px clamp(16px, 3vw, 38px) calc(var(--player) + 28px); outline: none; }
.hero {
  min-height: 225px; position: relative; overflow: hidden; display: grid; align-content: center;
  gap: 12px; padding: clamp(23px, 4.5vw, 50px); border: 1px solid #8e84b157; border-radius: 24px;
  background: radial-gradient(ellipse at 83% 5%, #65549b, transparent 60%), linear-gradient(120deg, #262439 5%, #3b315d 92%);
}
.hero > :not(.disc-art) { position: relative; z-index: 1; max-width: 560px; }
.hero h1 { max-width: 560px; }
.hero p { color: #e5dff6; max-width: 43ch; }
.kicker { color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.disc-art {
  width: clamp(230px, 34vw, 480px); aspect-ratio: 1; border-radius: 100%; position: absolute;
  top: 50%; right: -3%; transform: translateY(-48%) rotate(-23deg); opacity: .54;
  background: radial-gradient(circle, #baf57c 0 5%, #685aa4 5.4% 10%, #ad9fdd 10.3% 11%, #332c52 11.5% 24%, transparent 24.5%),
              repeating-radial-gradient(circle, #9e90ca 0px 1px, #433665 2px 12px);
  border: 1px solid #aa98e2;
  box-shadow: 0 25px 80px #1a132bbd;
}
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.page-heading { margin: 9px 0 16px; }
.page-heading p { margin-top: 8px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
.card {
  min-width: 0; border: 1px solid var(--line); border-radius: 15px; padding: 10px;
  text-align: left; background: var(--panel); display: grid; gap: 4px; position: relative;
}
.card:hover { background: var(--panel-hover); }
.card strong, .card small, .track-copy strong, .track-copy small, .playing-caption strong, .playing-caption small {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block;
}
.card .art { margin-bottom: 4px; width: 100%; }
.art {
  width: 44px; aspect-ratio: 1; position: relative; display: grid; flex: none; place-items: center;
  overflow: hidden; border-radius: 8px; background: linear-gradient(145deg, #675390, #272039);
}
.art .cover-fallback { color: #fff9; width: 35%; height: 35%; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art.tone-1 { background: linear-gradient(145deg, #4f866e, #143638); }
.art.tone-2 { background: linear-gradient(145deg, #a05f70, #492541); }
.art.tone-3 { background: linear-gradient(145deg, #ad7a56, #503052); }
.art.tone-4 { background: linear-gradient(145deg, #5378aa, #252e5b); }
.empty { color: var(--muted); padding: 21px; background: #232133; border: 1px dashed var(--line); border-radius: 13px; }
.tabs, .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tabs { margin: 17px 0 16px; }
.chip[aria-pressed=true] { background: var(--accent); color: var(--ink); border-color: transparent; }
.search-box { display: flex; gap: 8px; max-width: 680px; }
.search-box input { background: var(--panel); }
.catalog-list { display: grid; gap: 6px; margin-top: 12px; }
.catalog-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 44px; padding: 8px 12px; text-align: left; overflow-wrap: anywhere;
  color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
}
.catalog-row:hover { background: var(--panel-hover); }
.catalog-row small { color: var(--muted); }
.review-list { display: grid; gap: 14px; margin-top: 14px; }
.review-card { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.review-card h2 { font-size: 1.05rem; overflow-wrap: anywhere; }
.review-card .actions { margin-top: 12px; }
.review-card .actions button { min-height: 44px; }
.review-audio { display: block; width: 100%; margin-top: 14px; }
.detail { display: flex; align-items: end; gap: 21px; margin: 5px 0 19px; }
.detail > .art { width: clamp(88px, 21vw, 196px); border-radius: 13px; }
.detail h1 { margin: 5px 0 9px; }
.detail p { color: var(--muted); }
.track-list { display: grid; margin-top: 10px; }
.track-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 5px;
  align-items: center; padding: 5px 5px 5px 0; border-bottom: 1px solid #ffffff13; border-radius: 8px;
}
.track-row:hover { background: #ffffff08; }
.track-row.now .track-copy strong { color: var(--accent); }
.track-link, .playing-link {
  padding: 0; color: var(--text); text-align: left; background: transparent; border: 0; min-width: 0;
  display: flex; align-items: center; gap: 11px;
}
.track-link { padding: 5px 0 5px 6px; }
.track-copy, .playing-caption { min-width: 0; }
.track-copy small, .playing-caption small { font-size: .8rem; }
.length { color: var(--muted); font-size: .77rem; font-variant-numeric: tabular-nums; }
.player {
  position: fixed; z-index: 4; bottom: 0; left: 0; right: 0; height: var(--player);
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.3fr) minmax(100px, 1fr);
  align-items: center; gap: 14px; padding: 8px clamp(15px, 3vw, 32px);
  background: #1a1926; border-top: 1px solid var(--line);
}
.playing-info { min-width: 0; display: flex; align-items: center; gap: 6px; }
.playing-link { overflow: hidden; }
.playing-link .art { width: 49px; }
.transport-buttons, .progress { display: flex; align-items: center; justify-content: center; gap: 9px; }
.progress { margin-top: 2px; }
.progress span { min-width: 34px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .7rem; }
.progress span:last-child { text-align: right; }
.progress input { width: 100%; accent-color: var(--accent); cursor: pointer; }
.extras { display: flex; justify-content: end; }
dialog {
  width: min(480px, calc(100% - 26px)); max-height: min(78dvh, 720px); padding: 19px;
  border-radius: 21px; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 18px 64px #0009;
}
dialog::backdrop { background: #080710b3; backdrop-filter: blur(5px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dialog-header h2 { overflow-wrap: anywhere; }
.dialog-choices { display: grid; gap: 6px; margin: 12px 0; }
.dialog-choices button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; }
.dialog-choices button:hover { background: var(--panel-hover); }
.dialog-meta { margin-top: 10px; color: var(--muted); font-size: .86rem; }
.queue-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; border-bottom: 1px solid var(--line); padding: 5px 0; }
.queue-actions { display: flex; }
.now-art { display: grid; place-items: center; padding: 3px 0 14px; }
.now-art .art { width: min(55vw, 245px); border-radius: 15px; }
.now-meta { text-align: center; }
.now-controls { margin: 12px 0; justify-content: center; }
#toast {
  position: fixed; z-index: 5; bottom: calc(var(--player) + var(--nav) + 13px);
  right: 15px; max-width: min(365px, calc(100% - 30px)); padding: 12px 15px;
  border: 1px solid #8b829f; border-radius: 12px; background: #302b45; color: var(--text);
  box-shadow: 0 8px 30px #0007; font-size: .88rem;
}
@media (max-width: 720px) {
  :root { --player: 62px; --nav: calc(60px + env(safe-area-inset-bottom)); }
  #app { display: block; }
  .sidebar, #breadcrumb, .desktop-control, .extras { display: none; }
  .mobile-brand { display: flex; }
  .mobile-brand img { width: 29px; height: 29px; border-radius: 7px; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed;
    left: 0; right: 0; bottom: 0; z-index: 4; height: var(--nav); padding-bottom: env(safe-area-inset-bottom);
    background: #181724; border-top: 1px solid var(--line);
  }
  .mobile-nav .nav-button { flex-direction: column; justify-content: center; align-items: center; gap: 4px; font-size: .7rem; padding: 4px 0; border-radius: 0; }
  .mobile-nav .nav-button[aria-current=page] { background: transparent; }
  .mobile-nav svg { width: 21px; height: 21px; }
  .player { bottom: var(--nav); grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 7px 12px; }
  .playing-link .art { width: 39px; }
  .transport-buttons { gap: 3px; }
  .transport .progress { position: absolute; top: -5px; left: 1px; right: 1px; margin: 0; }
  .transport .progress span { display: none; }
  .transport .progress input { height: 8px; margin: 0; }
  #content { padding-bottom: calc(var(--player) + var(--nav) + 21px); }
  .cards { grid-template-columns: repeat(auto-fill, minmax(121px, 1fr)); gap: 9px; }
  .hero { min-height: 210px; border-radius: 17px; }
  .disc-art { right: -29%; opacity: .38; }
  .detail { align-items: center; gap: 12px; }
  .detail h1 { font-size: 1.75rem; }
  .track-row { gap: 2px; }
}
