:root {
  --bg: #f4f5f7;
  --surface: #fff;
  --surface-raised: #fff;
  --surface-soft: #e9ebef;
  --ink: #14161a;
  --muted: #68707d;
  --line: #dfe2e7;
  --accent: #16856c;
  --accent-strong: #0f6f59;
  --accent-soft: #dff4ec;
  --danger: #b33a2b;
  --shadow: 0 16px 40px rgba(24, 28, 35, .1);
  --sidebar: 216px;
  --player: 88px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #090a0c;
  --surface: #15171b;
  --surface-raised: #1b1e23;
  --surface-soft: #24272d;
  --ink: #f4f6f8;
  --muted: #9aa1ac;
  --line: #2b2e34;
  --accent: #67d9b8;
  --accent-strong: #83e5c7;
  --accent-soft: #183b32;
  --danger: #ff8575;
  --shadow: 0 18px 48px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-width: 320px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; text-decoration: none; }
img { display: block; }
.muted { color: var(--muted); }
.eyebrow, .section-kicker { margin: 0 0 7px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); padding-bottom: var(--player); }
.is-locked { filter: blur(8px); pointer-events: none; }
.sidebar { position: fixed; inset: 0 auto var(--player) 0; z-index: 20; width: var(--sidebar); padding: 22px 14px 16px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 96%, transparent); display: flex; flex-direction: column; }
.brand { min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 0 10px 18px; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--accent); color: #07110e; font-size: 22px; font-weight: 900; }
.brand-mark.small { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
nav { display: grid; gap: 4px; }
nav button, .quiet { min-height: 46px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 12px; padding: 0 12px; text-align: left; font-weight: 650; }
nav button span { width: 21px; text-align: center; font-size: 19px; }
nav button:hover, nav button.active, .quiet:hover { background: var(--surface); color: var(--ink); }
nav button.active { box-shadow: inset 3px 0 0 var(--accent); color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.main { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; height: 68px; padding: 11px 28px; display: flex; align-items: center; gap: 16px; justify-content: space-between; background: color-mix(in srgb, var(--bg) 91%, transparent); backdrop-filter: blur(18px); }
.global-search { width: min(620px, 62vw); height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); }
.global-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; }
.global-search kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 10px; }
.status-button { min-height: 40px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 0 13px; font-size: 12px; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.status-button.dirty .status-dot { background: #e7a329; }
.view { width: 100%; max-width: 1580px; margin: 0 auto; padding: 24px 28px 48px; }
.dashboard-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 8px 0 18px; border-bottom: 1px solid var(--line); }
.dashboard-head h1, .page-head h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.03; letter-spacing: -.045em; }
.dashboard-head p:last-child, .page-head p { margin: 8px 0 0; color: var(--muted); }
.dashboard-actions, .hero-actions { display: flex; align-items: center; gap: 9px; }
.section { margin-top: 34px; }
.first-section { margin-top: 26px; }
.section-title { min-height: 36px; display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-title h2 { margin: 0; font-size: 23px; line-height: 1.1; letter-spacing: -.025em; }
.section-title .muted { font-size: 13px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.quick-card { min-width: 0; min-height: 76px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: grid; grid-template-columns: 54px minmax(0, 1fr) 18px; align-items: center; gap: 12px; padding: 10px; text-align: left; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.quick-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--surface-raised); }
.quick-art { width: 54px; aspect-ratio: 1; border-radius: 9px; display: grid; place-items: center; color: #111; font-size: 20px; font-weight: 900; }
.quick-copy { min-width: 0; }
.quick-copy strong, .quick-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-copy strong { font-size: 14px; }
.quick-copy small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.quick-arrow { color: var(--muted); font-size: 24px; }
.platforms, .chips { display: flex; gap: 8px; overflow-x: auto; padding: 1px 1px 10px; scrollbar-width: none; }
.platforms::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.primary, .secondary, .danger, .chip { min-height: 44px; border-radius: 10px; padding: 0 16px; border: 0; font-weight: 750; }
.primary { background: var(--accent); color: #07110e; }
.primary:hover { background: var(--accent-strong); }
.secondary { border: 1px solid var(--line); background: var(--surface); }
.secondary:hover { border-color: var(--muted); }
.danger { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }
.chip { min-height: 38px; flex: none; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.full { width: 100%; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 22px 14px; }
.featured-grid { margin-top: 8px; }
.playlist-card { min-width: 0; border: 0; border-radius: 12px; background: transparent; padding: 8px; text-align: left; transition: background .16s ease, transform .16s ease; }
.playlist-card:hover { background: var(--surface); transform: translateY(-2px); }
.playlist-cover { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 9px; background: linear-gradient(145deg, var(--surface-soft), color-mix(in srgb, var(--accent) 20%, var(--surface-soft))); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); display: grid; place-items: center; }
.playlist-cover img, .cover img { width: 100%; height: 100%; object-fit: cover; }
.playlist-cover .play-fab { position: absolute; right: 9px; bottom: 9px; opacity: 0; transform: translateY(5px); transition: .16s ease; }
.playlist-card:hover .play-fab, .playlist-card:focus-within .play-fab { opacity: 1; transform: none; }
.playlist-card h3 { margin: 10px 2px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.playlist-card p { margin: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.play-fab, .play-button { border: 0; border-radius: 50%; background: var(--accent); color: #07110e; display: grid; place-items: center; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent); }
.play-fab { width: 40px; height: 40px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 6px 0 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.song-row { min-height: 62px; display: grid; grid-template-columns: 38px minmax(190px, 1.2fr) minmax(120px, .7fr) minmax(100px, .55fr) 154px; align-items: center; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.song-row:last-child { border-bottom: 0; }
.song-row:hover { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.song-index { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.song-main { min-width: 0; display: flex; align-items: center; gap: 11px; }
.cover { flex: none; overflow: hidden; background: var(--surface-soft); display: grid; place-items: center; }
.cover.row { width: 44px; height: 44px; border-radius: 7px; }
.cover.mini { width: 52px; height: 52px; border-radius: 8px; }
.song-copy, .track-copy { min-width: 0; }
.song-copy strong, .song-copy span, .track-copy strong, .track-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-copy span, .song-album, .song-source, .track-copy span { color: var(--muted); font-size: 12px; }
.song-actions { display: flex; justify-content: end; gap: 2px; }
.icon-btn { width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-soft); }
.search-controls { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px auto; gap: 10px; margin-bottom: 16px; }
.field, .select { height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 13px; outline: 0; }
.field:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.playlist-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; }
.playlist-aside { position: sticky; top: 86px; align-self: start; }
.playlist-aside .playlist-cover { margin-bottom: 16px; }
.playlist-aside h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.08; letter-spacing: -.03em; }
.playlist-aside p { color: var(--muted); font-size: 13px; }
.source-list { display: grid; gap: 9px; }
.source-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.source-icon { width: 44px; height: 44px; border-radius: 9px; background: var(--surface-soft); display: grid; place-items: center; font-weight: 850; }
.source-card h3 { margin: 0 0 3px; font-size: 15px; }
.source-card p { margin: 0; color: var(--muted); font-size: 12px; }
.switch { width: 44px; height: 26px; padding: 3px; border: 0; border-radius: 13px; background: var(--line); }
.switch::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .16s ease; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }
.notice { margin-bottom: 16px; padding: 13px 15px; border: 1px solid color-mix(in srgb, #d99435 45%, var(--line)); border-radius: 10px; background: color-mix(in srgb, #d99435 11%, var(--surface)); color: var(--ink); font-size: 13px; }
.player { position: fixed; inset: auto 0 0; z-index: 40; height: var(--player); display: grid; grid-template-columns: minmax(220px, 1fr) minmax(390px, 1.2fr) minmax(180px, 1fr); align-items: center; gap: 18px; padding: 10px 20px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(20px); }
.now-playing { min-width: 0; display: flex; align-items: center; gap: 11px; }
.track-copy span { margin-top: 3px; }
.transport { min-width: 0; }
.transport-buttons { display: flex; align-items: center; justify-content: center; gap: 5px; }
.play-button { width: 46px; height: 46px; font-size: 16px; }
.timeline { display: grid; grid-template-columns: 38px minmax(100px, 1fr) 38px; align-items: center; gap: 8px; margin-top: 2px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--accent); }
.player-tools { display: flex; align-items: center; justify-content: end; gap: 7px; }
.player-tools input { width: 92px; }
.queue-panel { position: fixed; inset: 0 0 var(--player) auto; z-index: 35; width: min(390px, 94vw); padding: 24px; border-left: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); transform: translateX(102%); transition: transform .2s ease; }
.queue-panel.open { transform: none; }
.panel-head { display: flex; align-items: start; justify-content: space-between; }
.panel-head h2 { margin: 0; font-size: 25px; }
.queue-list { height: calc(100% - 120px); overflow: auto; margin: 18px 0; }
.queue-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: 9px; }
.queue-item.active { background: var(--accent-soft); }
.queue-item small { display: block; color: var(--muted); }
.login-shell { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 72% 20%, #265c50 0, #11181a 38%, #08090b 76%); }
.login-shell.hidden { display: none; }
.login-card { width: min(470px, 100%); padding: 36px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 18px; background: rgba(18, 21, 24, .9); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); color: #f5f7f8; backdrop-filter: blur(18px); }
.login-card h1 { margin: 24px 0 12px; font-size: clamp(38px, 8vw, 56px); line-height: .98; letter-spacing: -.055em; }
.login-card label { display: block; margin: 23px 0 7px; font-size: 13px; font-weight: 700; }
.input-row { display: flex; gap: 8px; }
.input-row input { min-width: 0; flex: 1; padding: 12px; border: 1px solid #3d434b; border-radius: 10px; background: #111418; color: #fff; }
.form-error { min-height: 18px; color: #ff9a8c; font-size: 12px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(0, 0, 0, .65); }
.modal { width: min(560px, 100%); max-height: 88vh; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 8px; font-size: 24px; }
.modal-actions { display: flex; justify-content: end; gap: 8px; margin-top: 20px; }
.form-stack { display: grid; gap: 12px; }
.form-stack label { font-size: 12px; font-weight: 750; }
.form-stack input, .form-stack textarea, .form-stack select { width: 100%; margin-top: 5px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.form-stack textarea { min-height: 170px; resize: vertical; font: 12px/1.5 ui-monospace, monospace; }
.empty { padding: 46px 22px; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 19px; }
.loading { height: 150px; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.toast-root { position: fixed; right: 18px; bottom: calc(var(--player) + 16px); z-index: 120; display: grid; gap: 8px; }
.toast { max-width: min(420px, calc(100vw - 32px)); padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: #9d3628; color: #fff; }
.mobile-only { display: none; }
:where(button, input, select, textarea, a):focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, #fff); outline-offset: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (max-width: 1100px) {
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
  .player { grid-template-columns: minmax(210px, 1fr) minmax(350px, 1.3fr) auto; }
  .player-tools input { display: none; }
}
@media (max-width: 760px) {
  :root { --player: 78px; }
  .app-shell { display: block; }
  .sidebar { inset: 0 auto 0 0; width: min(286px, 86vw); transform: translateX(-103%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .main { width: 100%; }
  .topbar { height: 64px; padding: 9px 12px; gap: 8px; }
  .mobile-only { display: grid; flex: none; }
  .global-search { width: auto; flex: 1; height: 44px; }
  .global-search kbd, .status-button { display: none; }
  .view { padding: 18px 14px 34px; }
  .dashboard-head, .page-head { align-items: start; flex-direction: column; gap: 16px; }
  .dashboard-head { padding-top: 0; }
  .dashboard-head h1, .page-head h1 { font-size: 34px; }
  .dashboard-actions { width: 100%; }
  .dashboard-actions button { flex: 1; }
  .section { margin-top: 28px; }
  .quick-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-card { grid-template-columns: 46px minmax(0, 1fr); min-height: 66px; padding: 8px; }
  .quick-art { width: 46px; }
  .quick-arrow { display: none; }
  .section-title { align-items: start; }
  .section-title .muted { display: none; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 8px; }
  .playlist-card { padding: 5px; }
  .playlist-cover .play-fab { opacity: 1; transform: none; }
  .search-controls { grid-template-columns: 1fr 1fr; }
  .search-controls .field { grid-column: 1 / -1; }
  .playlist-layout { grid-template-columns: 1fr; }
  .playlist-aside { position: static; display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 14px; }
  .playlist-aside .playlist-cover { margin: 0; }
  .song-row { grid-template-columns: 30px minmax(0, 1fr) 132px; padding: 7px 8px; }
  .song-album, .song-source { display: none; }
  .song-actions { gap: 0; }
  .song-actions .optional { display: none; }
  .source-card { grid-template-columns: 44px minmax(0, 1fr); }
  .source-card .song-actions { grid-column: 1 / -1; justify-content: start; }
  .player { height: var(--player); grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .cover.mini { width: 46px; height: 46px; }
  .transport { display: contents; }
  .transport-buttons { justify-content: end; }
  .transport-buttons #shuffle, .transport-buttons #repeat { display: none; }
  .timeline, .player-tools { display: none; }
  .play-button { width: 46px; height: 46px; }
  #previous, #next { width: 42px; height: 42px; }
  #player-like { display: none; }
  .queue-panel { bottom: var(--player); }
  .toast-root { right: 12px; bottom: calc(var(--player) + 12px); }
}
@media (max-width: 460px) {
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: 62px; }
  .search-controls { grid-template-columns: 1fr; }
  .search-controls > * { grid-column: auto !important; }
  .playlist-aside { grid-template-columns: 96px minmax(0, 1fr); }
  .song-row { grid-template-columns: 26px minmax(0, 1fr) 88px; }
  .song-actions .icon-btn { width: 42px; }
  .now-playing { gap: 8px; }
  .track-copy span { display: none; }
  .login-card { padding: 26px; }
  .input-row { flex-direction: column; }
}
