:root {
  color-scheme: dark;
  --bg: #101015;
  --sidebar-bg: #121217;
  --surface: #191920;
  --surface-hover: #23222b;
  --line: #292832;
  --text: #f6f3fc;
  --muted: #aaa6b7;
  --dim: #898597;
  --accent: #c6adff;
  --accent-bright: #d5c3ff;
  --accent-bg: #2a2039;
  --good: #a9e3c1;
  --nav-width: 216px;
  --dock-height: 91px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
#audio-background { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.workspace { position: relative; z-index: 1; }
.topbar-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.page-more { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.page-more p, .history-clock { color: var(--muted); font-size: 12px; }
.search-pagination-panel { margin-top: 14px; }
.search-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.search-pagination .secondary-button { min-width: 32px; min-height: 34px; padding: 0 7px; }
.search-pagination button[aria-current="page"] { opacity: 1; background: var(--accent-bg); color: var(--accent-bright); border-color: var(--accent); }
.pagination-gap { color: var(--muted); padding: 0 3px; }
.history-period, .setting-field { display: block; margin-top: 16px; color: var(--muted); }
.history-period select, .setting-field select, .history-dates input {
  margin-left: 8px; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  font: inherit; padding: 6px; border-radius: 7px;
}
.history-dates { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 9px; color: var(--muted); }
.setting-field select, .setting-field input { display: block; width: 100%; margin: 8px 0 12px; }
.history-day { font-size: 14px; color: var(--accent-bright); margin: 17px 0 7px; }
.history-entry { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 6px; }
.audio-loading { position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--accent-bg); overflow: hidden; }
.audio-loading span { display: block; height: 100%; width: var(--buffer-percent, 26%); background: var(--accent); }
.audio-loading:not([aria-valuenow]) span { animation: audio-buffer 1.15s ease-in-out infinite alternate; }
@keyframes audio-buffer { from { transform: translateX(-100%); } to { transform: translateX(385%); } }
@media (prefers-reduced-motion: reduce) { .audio-loading:not([aria-valuenow]) span { animation: none; } }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; color: inherit; background: none; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; opacity: .44; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { width: 20px; height: 20px; vertical-align: middle; flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
input[type="range"] { accent-color: var(--accent); width: 100%; height: 4px; cursor: pointer; }
input[type="range"]:disabled { cursor: default; }

.sidebar {
  position: fixed; inset: 0 auto var(--dock-height) 0; z-index: 3;
  width: var(--nav-width); padding: 28px 17px 20px;
  display: flex; flex-direction: column;
  background: var(--sidebar-bg); border-right: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; width: fit-content;
  padding: 0 10px; font-size: 26px; font-weight: 800; line-height: 1;
  letter-spacing: -.085em;
}
.brand-mark {
  width: 33px; height: 33px; display: grid; place-items: center;
  border-radius: 10px; background: var(--accent); color: #181121;
  box-shadow: 0 6px 24px #b891ff1f;
}
.brand-mark svg { width: 22px; height: 22px; stroke-width: 2.15; }
.brand-period { color: var(--accent); }
.nav { margin-top: 40px; display: grid; gap: 5px; }
.nav-link {
  width: 100%; min-height: 44px; padding: 0 12px; border-radius: 9px;
  display: flex; align-items: center; gap: 11px; text-align: left;
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active { color: var(--accent-bright); background: var(--accent-bg); }
.nav-link svg { width: 18px; height: 18px; }
.nav-label { margin: 24px 12px 6px; color: var(--dim); font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.nav-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.sidebar-footer {
  margin-top: auto; padding: 15px 11px 2px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: flex-start;
}
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 12px; font-weight: 680; }
.sidebar-footer small { margin-top: 4px; color: var(--dim); font-size: 11px; }
.version-dot { width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px #b891ff72; }

.workspace { margin-left: var(--nav-width); padding-bottom: var(--dock-height); }
.topbar, main { width: min(100%, 1320px); margin-inline: auto; padding-inline: 34px; }
.topbar { height: 76px; display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.mobile-brand { display: none; }
.search-box {
  width: min(100%, 450px); height: 42px; padding: 0 12px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted);
}
.search-box:focus-within { border-color: #9375bf; }
.search-box svg { width: 17px; height: 17px; }
.search-box input {
  flex: 1; min-width: 0; height: 100%; padding: 0; color: var(--text);
  outline: 0; border: 0; background: transparent; font-size: 14px;
}
.search-box input::placeholder { color: var(--muted); }
kbd { width: 23px; height: 22px; display: grid; place-items: center; border: 1px solid #393743; border-radius: 5px; font: 12px system-ui, sans-serif; color: var(--muted); }
.profile-button {
  display: flex; align-items: center; gap: 9px; min-height: 40px; max-width: 190px; padding: 3px 8px 3px 4px;
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface); font-size: 13px; font-weight: 650;
}
.profile-button:hover { background: var(--surface-hover); }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; background: #342647; border-radius: 50%; color: var(--accent-bright); }
.avatar svg, .profile-chevron svg { width: 15px; height: 15px; }
.profile-chevron { color: var(--dim); }
#profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.profile-banner {
  position: relative; isolation: isolate; display: flex; align-items: end; justify-content: space-between;
  min-height: 270px; overflow: hidden; gap: 16px; padding: 26px;
  border: 1px solid #40314f; border-radius: 17px;
  background: #191321 url("/hero.webp") right center / cover;
}
.profile-banner::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg, #130f1bec, #17102055 65%), linear-gradient(0deg, #15101be8, transparent 80%);
}
.profile-cover { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-identity { display: flex; align-items: end; gap: 18px; min-width: 0; }
.profile-avatar {
  width: 85px; height: 85px; flex: 0 0 85px; position: relative; overflow: hidden;
  display: grid; place-items: center; border-radius: 22px; color: #21122b;
  border: 1px solid #f1e2ff; background: linear-gradient(135deg, #dac0ff, #a694f9);
  font-size: 44px; font-weight: 760;
}
.profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-person { min-width: 0; }
.profile-person h1 { font-size: clamp(25px, 4vw, 43px); line-height: 1.12; overflow-wrap: anywhere; }
.profile-person p { color: #e2d7ed; overflow-wrap: anywhere; }
#profile-handle { font-size: 12px; margin-bottom: 5px; }
#profile-bio { white-space: pre-wrap; font-size: 13px; margin-top: 7px; max-width: 570px; }
.profile-banner .secondary-button { flex-shrink: 0; white-space: nowrap; }
.profile-section-heading {
  min-width: 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  margin: 24px 0 12px; gap: 8px;
}
.profile-section-heading h2, .profile-panel h2 { font-size: 19px; }
.profile-period { color: var(--muted); font-size: 12px; }
.profile-period select {
  color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 7px; margin-left: 5px; padding: 6px; font: inherit;
}
.profile-stats, .profile-grid { display: grid; gap: 12px; }
.profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.profile-grid { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); align-items: start; }
.profile-stats > div, .profile-panel {
  background-color: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0;
}
.profile-stats span { color: var(--muted); font-size: 13px; }
.profile-stats strong { display: block; margin-top: 5px; color: var(--accent-bright); font-size: 27px; }
.profile-panel > h2 { margin-bottom: 10px; }
.profile-panel .profile-section-heading { margin: 0 0 10px; }
.profile-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center;
  gap: 5px; min-height: 36px; border-bottom: 1px solid var(--line);
}
.profile-row:last-child { border-bottom: 0; }
.profile-row .track-row { border-bottom: 0; }
.profile-artist { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.profile-caption { color: var(--muted); white-space: nowrap; font-size: 12px; }
.profile-toggle { color: var(--text); font-size: 14px; }
.profile-toggle input { accent-color: var(--accent); }
.profile-logout { margin-top: 16px; }
#profile-editor { max-width: min(520px,calc(100vw - 24px)); }
#profile-editor textarea, #profile-editor input {
  display: block; width: 100%; margin-top: 6px; padding: 8px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--bg); color: var(--text); font: inherit;
}
#profile-editor textarea { resize: vertical; }
#profile-editor-fields { display: grid; gap: 12px; min-inline-size: 0; padding: 0; margin: 0; border: 0; }
.profile-editor-images { display: grid; gap: 14px; }
.profile-image-editor { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.profile-image-actions { display: flex; flex-wrap: wrap; gap: 4px 9px; }
.editor-preview { display: block; width: 100%; aspect-ratio: 3 / 1; margin-top: 9px; object-fit: cover; border-radius: 7px; }
.editor-preview.square { width: 77px; aspect-ratio: 1; }
.profile-crop { margin-top: 10px; }
.crop-frames { display: grid; grid-template-columns: minmax(0,3fr) minmax(0,1fr); gap: 10px; align-items: start; }
.crop-avatar .crop-frames { grid-template-columns: minmax(0,160px) 64px; }
.crop-frames figure { min-width: 0; margin: 0; }
.crop-frames canvas { display: block; width: 100%; height: auto; border-radius: 7px; }
.crop-frames figcaption { margin-top: 5px; color: var(--muted); font-size: 11px; }
.crop-canvas { touch-action: none; cursor: grab; outline: 1px solid var(--accent); }
.crop-canvas:active { cursor: grabbing; }
.crop-avatar .crop-secondary-canvas { border-radius: 50%; }
.crop-controls { display: grid; gap: 4px; margin: 10px 0 5px; }
#profile-editor .crop-controls input { min-height: 20px; margin: 0; padding: 0; }
.profile-transfer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 8px; align-items: center; }
.profile-transfer p { grid-column: 1 / -1; }
.profile-transfer progress { width: 100%; accent-color: var(--accent); }
.profile-transfer span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.profile-save-notice {
  margin-top: 12px; padding: 9px 12px; color: var(--good);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
}

main { padding-top: 2px; padding-bottom: 32px; }
.hero {
  min-height: 274px; display: flex; align-items: center; overflow: hidden;
  border: 1px solid #40314f; border-radius: 17px;
  background: linear-gradient(90deg, #161220 0%, #161220ee 25%, #16122077 49%, transparent 74%),
              url("/hero.webp") 68% 51% / cover, radial-gradient(ellipse at 79% 45%, #7f53aa, #23182e 60%, #17121e 85%);
}
.hero-content { padding: 25px 35px 28px; position: relative; }
.hero h1 {
  font-size: clamp(36px, 4.15vw, 61px); font-weight: 800;
  line-height: .99; letter-spacing: -.064em;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { margin-top: 15px; color: #e0d7eb; font-size: 14px; line-height: 1.5; }
.primary-button, .secondary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 15px; border-radius: 8px;
  font-size: 13px; font-weight: 750; white-space: nowrap;
}
.primary-button { background: var(--accent); color: #1d122a; }
.primary-button:hover { background: #decfff; }
.secondary-button { background: var(--surface-hover); color: var(--text); border: 1px solid var(--line); }
.secondary-button:hover { background: var(--accent-bg); }
.primary-button svg, .secondary-button svg { width: 16px; height: 16px; }
.hero .primary-button { margin-top: 19px; }

.section { margin-top: 24px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.section-heading h2 { font-size: 21px; letter-spacing: -.035em; font-weight: 760; }
.section-heading p { color: var(--dim); font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 11px; }
.discovery-card {
  position: relative; overflow: hidden; min-height: 94px; padding: 12px 38px 12px 13px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 3px; isolation: isolate;
  text-align: left; border: 1px solid #ffffff12; border-radius: 10px; background-color: #2a213b;
  background-position: 55% 49%; background-size: cover;
}
.discovery-card::before { position: absolute; inset: 0; content: ""; z-index: -1; background: linear-gradient(90deg, #14101de8, #14101d7a 65%, #14101d33); }
.discovery-card:hover { border-color: #c6adff80; }
.discovery-card strong, .discovery-card small { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discovery-card strong { font-size: 14px; font-weight: 730; letter-spacing: -.025em; }
.discovery-card small { color: #e4daef; font-size: 11px; }
.card-arrow { position: absolute; right: 10px; bottom: 12px; width: 26px; height: 26px; border-radius: 50%; background: #14101d9c; display: grid; place-items: center; }
.card-arrow svg { width: 14px; height: 14px; }
.art-purple { background-image: url("/art-purple.webp"); background-color: #4a2c68; }
.art-blue { background-image: url("/art-blue.webp"); background-color: #223958; }
.art-orange { background-image: url("/art-orange.webp"); background-color: #69402c; }
.art-green { background-image: url("/art-green.webp"); background-color: #1d473f; }
.art-pink { background-image: url("/art-pink.webp"); background-color: #622f50; }
.art-gray { background-image: url("/art-gray.webp"); background-color: #3e3e53; }

.track-list { display: grid; }
.track-row {
  min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto 45px auto;
  align-items: center; gap: 10px; padding: 5px 8px 5px 4px;
  min-height: 57px; border-bottom: 1px solid #ffffff0c; border-radius: 6px;
}
.track-row:hover, .track-row.is-current { background: #ffffff07; }
.track-row.is-current .track-title { color: var(--accent-bright); }
.track-button { padding: 0; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; }
.track-button:hover .track-title { color: var(--accent-bright); }
.track-button > div { min-width: 0; }
.cover {
  position: relative; overflow: hidden; width: 39px; height: 39px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 7px; background-size: cover; background-position: center;
  background-color: #2a213b;
}
.cover > img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.cover > svg { width: 18px; height: 18px; color: #eee3ff; }
.cover .cover-play { visibility: hidden; position: absolute; inset: 0; display: grid; place-items: center; background: #100a1ab3; color: white; }
.track-button:hover .cover-play, .track-button:focus-visible .cover-play, .is-current .cover-play { visibility: visible; }
.cover-play svg { width: 17px; height: 17px; fill: currentColor; }
.track-title, .track-artist { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-title { font-size: 13px; font-weight: 700; line-height: 1.4; }
.track-artist { margin-top: 2px; color: var(--muted); font-size: 12px; }
.track-duration { text-align: right; margin-right: 4px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.status-pill {
  width: fit-content; display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px;
  border-radius: 5px; background: #24232e; color: var(--muted); font-size: 10px; white-space: nowrap;
}
.status-pill svg { width: 12px; height: 12px; }
.status-pill.ready { color: var(--good); background: #202f2a; }
.status-pill.error { color: #ffb5c1; background: #3a222d; }
.status-pill.pending { color: var(--accent-bright); background: var(--accent-bg); }
.status-cell { min-width: 0; text-align: right; }
.icon-button {
  display: inline-grid; place-items: center; width: 33px; height: 33px;
  padding: 0; border-radius: 7px; color: var(--muted); flex: 0 0 auto;
}
.icon-button svg { width: 18px; height: 18px; }
.icon-button:is(:hover, :focus-visible):not(:disabled) { background: var(--surface-hover); color: var(--text); }
.icon-button[aria-pressed="true"], .icon-button[aria-expanded="true"] { color: var(--accent-bright); }
.icon-button[data-action="favorite"][aria-pressed="true"] svg { fill: currentColor; }
.icon-button.invisible { visibility: hidden; pointer-events: none; }

.page-heading { margin: 23px 0 23px; }
.page-heading h1 { font-size: 39px; line-height: 1.1; letter-spacing: -.055em; font-weight: 800; overflow-wrap: anywhere; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.search-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; align-items: start; }
.search-group, .empty-state { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.search-group h2 { margin-bottom: 9px; font-size: 16px; }
.group-note { color: var(--muted); font-size: 13px; padding: 11px 0 4px; line-height: 1.5; }
.empty-state { padding: 26px 21px; }
.empty-state h2 { font-size: 18px; margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.empty-state button { margin-top: 13px; }
.search-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; margin-bottom: 14px; }
.search-filter label { font-size: 13px; color: var(--text); display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }
.search-filter input { accent-color: var(--accent); }
.mobile-tabs { display: none; }

.player {
  position: fixed; inset: auto 0 0; z-index: 6; height: var(--dock-height);
  padding: 9px 24px; border-top: 1px solid #33313b; background: #16161df7;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 1.55fr) minmax(0, 1fr); align-items: center; gap: 18px;
}
.now-playing { display: flex; min-width: 0; align-items: center; gap: 10px; }
.now-playing > div { min-width: 0; }
.now-playing .cover { width: 46px; height: 46px; }
.now-playing strong, .now-playing small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing strong { font-size: 13px; }
.now-playing small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.playback { display: grid; gap: 7px; align-items: center; }
.transport { display: flex; align-items: center; justify-content: center; gap: 10px; }
.transport [data-action="previous"] svg, .transport [data-action="next"] svg { width: 17px; height: 17px; }
.play-button {
  width: 38px; height: 38px; padding: 0; display: grid; place-items: center;
  color: #1c1427; background: var(--accent); border-radius: 50%;
}
.play-button:hover { background: var(--accent-bright); }
.play-button svg { width: 20px; height: 20px; fill: currentColor; }
.timeline { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.timeline span { min-width: 29px; text-align: center; }
.timeline input { flex: 1; min-width: 0; }
.utility { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.utility input { max-width: 85px; min-width: 22px; }
.queue-button { margin-left: 6px; }
.queue-panel {
  position: fixed; z-index: 7; right: 17px; bottom: calc(var(--dock-height) + 12px); width: min(410px, calc(100vw - 34px));
  border: 1px solid #474154; border-radius: 12px; background: #201e28; box-shadow: 0 14px 60px #0008; padding: 10px;
  max-height: min(520px, 62vh); overflow: auto;
}
.queue-panel header, dialog header { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.queue-panel h2 { font-size: 18px; margin-left: 5px; }
.queue-panel .track-row { grid-template-columns: minmax(0,1fr) 40px; gap: 5px; }
.queue-panel .status-cell, .queue-panel .row-action { display: none; }

dialog {
  width: min(410px, calc(100vw - 28px)); padding: 19px; color: var(--text);
  border: 1px solid #514760; border-radius: 15px; background: #201e28;
}
dialog::backdrop { background: #08070cca; }
dialog h2 { font-size: 22px; letter-spacing: -.035em; }
dialog label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
dialog input {
  min-height: 40px; padding: 0 9px; color: var(--text); background: var(--bg); border: 1px solid #403a48; border-radius: 7px;
}
dialog form, #profile-menu { display: grid; gap: 12px; margin-top: 13px; }
dialog p { color: var(--muted); font-size: 13px; line-height: 1.5; }
dialog .form-error { color: #ffb6c2; }
.text-button { color: var(--accent-bright); padding: 4px; font-size: 13px; }
.text-button:hover { text-decoration: underline; }
.toast {
  position: fixed; max-width: min(400px, calc(100vw - 28px)); min-width: 120px;
  bottom: calc(var(--dock-height) + 13px); left: calc(50% + var(--nav-width) / 2);
  z-index: 10; transform: translateX(-50%); padding: 10px 13px; border-radius: 9px;
  background: #2d2738; border: 1px solid #50465f; font-size: 13px; box-shadow: 0 8px 30px #0006;
}

@media (min-width: 1200px) {
  .topbar, main { padding-inline: 38px; }
  .hero { min-height: 283px; }
  .hero-content { padding-inline: 39px; }
}
@media (max-width: 1030px) {
  :root { --nav-width: 181px; }
  .topbar, main { padding-inline: 22px; }
  .search-layout .status-pill { display: none; }
  .search-layout .track-row { gap: 3px; grid-template-columns: minmax(0,1fr) 0 33px auto; }
}
@media (max-width: 760px) {
  :root { --nav-width: 0px; --mobile-nav: calc(52px + env(safe-area-inset-bottom)); --dock-height: calc(116px + env(safe-area-inset-bottom)); }
  .sidebar { inset: auto 0 0; width: auto; height: var(--mobile-nav); padding: 3px 7px calc(4px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); z-index: 8; }
  .sidebar .brand, .sidebar-footer, .nav-label, .nav-count { display: none; }
  .nav { margin: 0; grid-template-columns: repeat(5,minmax(0,1fr)); }
  .nav-link { min-height: 43px; justify-content: center; padding: 0 4px; border-radius: 10px; }
  .nav-link > span:not([data-icon]) { display: none; }
  .nav-link svg { width: 22px; height: 22px; }
  .topbar, main { padding-inline: 13px; }
  .topbar { height: 62px; gap: 8px; }
  .mobile-brand { display: flex; padding: 0; }
  .search-box { flex: 1; min-width: 0; height: 38px; }
  .search-box kbd, .profile-chevron { display: none; }
  .profile-button { min-height: 35px; padding: 2px 7px 2px 3px; max-width: 104px; }
  .avatar { width: 26px; height: 26px; }
  .hero { min-height: 221px; background-position: center, 64% center; }
  .hero-content { padding: 18px; }
  .hero p { font-size: 13px; max-width: 245px; }
  .desktop-break { display: none; }
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .discovery-card { min-height: 73px; }
  .section { margin-top: 19px; }
  .section-heading h2 { font-size: 19px; }
  .section-heading p { font-size: 11px; }
  .page-heading h1 { font-size: 34px; }
  .search-layout { grid-template-columns: minmax(0,1fr); }
  .search-layout .search-group.inactive-tab { display: none; }
  .search-layout .status-pill { display: inline-flex; }
  .mobile-tabs { display: flex; gap: 5px; }
  .mobile-tabs button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
  .mobile-tabs button[aria-pressed="true"] { color: var(--accent-bright); background: var(--accent-bg); }
  .player { bottom: var(--mobile-nav); height: 64px; grid-template-columns: minmax(0,1fr) auto auto; gap: 7px; padding: 4px 8px 8px; }
  .now-playing { gap: 6px; }
  .now-playing .cover { width: 34px; height: 34px; }
  .now-playing strong { font-size: 12px; }
  .now-playing small { font-size: 11px; }
  .dock-favorite, .transport-extra, .utility input, .utility #mute { display: none; }
  .transport { gap: 3px; }
  .player .icon-button { width: 25px; }
  .play-button { width: 33px; height: 33px; }
  .timeline { position: absolute; bottom: 2px; left: 5px; right: 5px; }
  .timeline > span { display: none; }
  .timeline input { margin: 0; }
  .queue-button { margin: 0; }
  .profile-banner { min-height: 217px; align-items: start; justify-content: end; flex-direction: column; padding: 14px; gap: 11px; }
  .profile-avatar { width: 60px; height: 60px; flex-basis: 60px; border-radius: 14px; font-size: 32px; }
  .profile-identity { gap: 10px; }
  .profile-grid { grid-template-columns: minmax(0,1fr); }
  .profile-stats > div, .profile-panel { padding: 9px; }
  .profile-stats span { font-size: 11px; }
}
@media (max-width: 365px) {
  .profile-button > #profile-name { display: none; }
  .status-pill { font-size: 9px; padding-inline: 4px; }
  .status-pill svg { display: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.title-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.title-filter input, .admin-filter input, .admin-filter select {
  min-width: 0; min-height: 39px; padding: 6px 10px; background: var(--surface);
  color: var(--text); border: 1px solid var(--line); border-radius: 8px;
}
.title-filter input { flex: 1 1 210px; max-width: 370px; }
.track-actions { display: flex; align-items: center; gap: 1px; }
.track-artist { display: flex; align-items: center; gap: 4px; overflow: visible; }
.track-artist-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.artist-badge { flex: 0 0 auto; color: var(--accent-bright); }
.artist-badge svg { width: 14px; height: 14px; }
.now-open { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; text-align: left; padding: 0; }
.now-copy { display: block; min-width: 0; }
.now-open:hover .now-copy strong { color: var(--accent-bright); }
[data-action="repeat"][data-mode="one"] { position: relative; }
[data-action="repeat"][data-mode="one"]::after {
  content: "1"; position: absolute; top: 1px; right: 3px; border-radius: 5px; min-width: 10px;
  padding: 1px; background: var(--accent); color: var(--bg); font-size: 9px; line-height: 1;
}
#full-player {
  inset: 0; margin: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; padding: 0;
  border: 0; border-radius: 0; background: radial-gradient(ellipse at 32% 6%, #332345, #15131c 60%);
  overflow: auto;
}
#full-player .full-header {
  position: sticky; top: 0; z-index: 2; padding: 12px max(20px, calc((100vw - 1030px) / 2));
  background: #18141fe8; border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.full-player-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: clamp(21px, 5vw, 64px);
  width: min(calc(100% - 40px), 960px); margin: clamp(20px, 6vh, 70px) auto 50px;
}
#full-art .cover { width: 100%; height: auto; aspect-ratio: 1; border-radius: 22px; box-shadow: 0 18px 55px #0007; }
.full-player-info { display: grid; gap: 18px; }
#full-title { color: var(--text); font-size: clamp(23px, 5vw, 44px); line-height: 1.12; overflow-wrap: anywhere; }
#full-artist { margin-top: 7px; font-size: 16px; overflow-wrap: anywhere; }
.full-timeline input { padding: 0; min-height: 24px; border: 0; background: transparent; }
.full-timeline > div { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; }
.full-transport .play-button { width: 53px; height: 53px; }
.full-transport { gap: clamp(8px, 3vw, 22px); }
.split-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.full-actions { justify-content: center; }
#repeat-label { margin: 0; text-align: center; }
.full-lyrics { grid-column: 1 / -1; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #ffffff06; scroll-margin-top: 70px; }
.full-lyrics h3 { font-size: 20px; }
#caption-now { min-height: 1.4em; font-size: 18px; margin: 6px 0; color: var(--accent-bright); white-space: pre-line; }
#caption-lines { display: grid; gap: 3px; max-height: 250px; overflow: auto; }
.caption-line { text-align: left; padding: 6px 9px; border-radius: 8px; white-space: pre-line; overflow-wrap: anywhere; color: var(--muted); }
.caption-line:hover, .caption-line[aria-current] { background: var(--accent-bg); color: var(--accent-bright); }
.collection-heading, .collection-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.collection-heading .primary-button, .collection-toolbar .split-actions { margin-left: auto; }
.collection-toolbar { margin: 16px 0 9px; }
.collection-toolbar h2 { overflow-wrap: anywhere; }
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr)); gap: 12px; }
.playlist-card { display: grid; text-align: left; gap: 6px; padding: 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.playlist-card:hover { border-color: var(--accent); }
.playlist-card strong { overflow-wrap: anywhere; }
.playlist-card small, .admin-row small { color: var(--muted); }
.playlist-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; color: var(--accent-bright); background: var(--accent-bg); }
.collection-options { display: grid; gap: 7px; margin-top: 10px; }
.collection-options button { overflow-wrap: anywhere; }
#collection-dialog-body, #admin-detail-body { margin-top: 12px; }
#admin-shortcut { margin-bottom: 12px; }
#admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 16px; }
.admin-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; margin-top: 16px; }
.admin-filter label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; }
.admin-filter label:first-child { flex: 1 1 190px; }
.admin-filter select { min-width: 115px; }
.admin-filter input[type="date"] { width: 135px; }
.admin-list { display: grid; gap: 7px; }
.admin-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding: 7px 0; }
.admin-row-info { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.admin-avatar { display: grid; place-items: center; position: relative; width: 40px; height: 40px; border-radius: 9px; background: var(--accent-bg); color: var(--accent-bright); overflow: hidden; }
.admin-avatar img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.admin-page { margin-top: 10px; }
.admin-page .group-note { margin: 0; }
.admin-overview { display: flex; gap: 9px; align-items: center; overflow-wrap: anywhere; }
.admin-detail-list { display: grid; grid-template-columns: minmax(94px, auto) minmax(0, 1fr); gap: 7px 10px; margin: 15px 0; font-size: 13px; }
.admin-detail-list dt { color: var(--muted); }
.admin-detail-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.admin-cover { width: 100%; border-radius: 8px; }
.danger-button { color: #ffb6c2; }

@media (max-width: 760px) {
  .track-row, .search-layout .track-row { grid-template-columns: minmax(0,1fr) auto auto; gap: 5px; padding-right: 0; }
  .track-row .track-duration, .profile-row .track-duration, .queue-panel .track-duration { display: none; }
  .track-row .status-pill { min-width: 0; max-width: 22px; padding: 2px; }
  .track-row .status-pill:not(.ready, .pending, .error) { display: none; }
  .track-row .status-pill span { display: none; }
  .track-row .status-pill svg { display: inline; width: 13px; height: 13px; }
  .track-row .track-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    white-space: normal; overflow-wrap: anywhere; line-height: 1.2;
  }
  .track-button { gap: 7px; width: 100%; }
  .track-row .icon-button { width: 28px; min-height: 36px; }
  .track-row .track-actions { gap: 0; }
  .profile-row .track-row { grid-template-columns: minmax(0,1fr) auto; }
  .profile-row .status-cell { display: none; }
  .queue-panel .track-row { grid-template-columns: minmax(0,1fr); }
  .queue-panel .track-actions { display: none; }
  #admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .admin-row-meta { grid-column: 2; }
  .admin-row button { grid-column: 3; grid-row: 1 / 3; }
}
@media (max-width: 630px) {
  .full-player-grid { grid-template-columns: minmax(0,1fr); }
  #full-art { width: min(100%, 330px, 40vh); margin-inline: auto; }
  .full-player-info { gap: 10px; }
  #full-title, #full-artist { text-align: center; }
}
#full-playlist-notice { margin: 0; padding-top: 0; text-align: center; color: var(--good); }

.playlist-mark { overflow: hidden; flex: 0 0 auto; }
.playlist-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.playlist-card .playlist-mark { width: 100%; height: auto; aspect-ratio: 1; }
.playlist-card .playlist-mark svg { width: 32px; height: 32px; }
.collection-toolbar .playlist-mark { width: 68px; height: 68px; }
#collection-dialog-body > .split-actions { margin-top: 12px; }
.playlist-option, .invite-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding-block: 5px; border-bottom: 1px solid var(--line);
}
.playlist-option strong, .playlist-option small, .invite-row code { overflow-wrap: anywhere; }
.playlist-option-info { display: grid; gap: 4px; }
.playlist-option-info small, .invite-row small { color: var(--muted); }
.playlist-option .secondary-button { padding-inline: 8px; font-size: 12px; }
.playlist-option button.playlist-member { color: var(--good); opacity: 1; }
#playlist-fields { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: 10px; }
.playlist-cover-edit { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
#playlist-cover-preview .playlist-mark, #playlist-cover-preview canvas { display: grid; width: 70px; height: 70px; border-radius: 8px; }
#playlist-cover-input { width: 100%; min-width: 0; min-height: 30px; padding: 3px; font-size: 12px; }
#playlist-cover-limit, #playlist-save-status { margin: 0; padding: 0; }
#playlist-tracks-dialog { width: min(540px, calc(100vw - 24px)); max-height: 85dvh; }
#playlist-tracks-form { display: flex; align-items: center; gap: 7px; }
#playlist-tracks-query { flex: 1; min-width: 0; }
.playlist-picker-pages { margin-top: 10px; justify-content: space-between; }
.service-form, .service-invites { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.service-form fieldset { padding: 9px 0; border: 0; margin: 0 0 7px; }
.service-form legend, .service-invites h2 { font-size: 16px; font-weight: 750; }
.service-limits { display: flex; flex-wrap: wrap; gap: 9px; }
.service-limits label, #invite-form label, #invite-new { display: grid; gap: 5px; color: var(--muted); font-size: 13px; }
.service-form input[type="number"], #invite-form input, #invite-code {
  min-width: 0; min-height: 37px; padding: 6px 9px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
}
.service-form input[type="number"] { width: 100px; }
.service-check { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; }
.service-check input { accent-color: var(--accent); }
#invite-form { align-items: end; margin-top: 10px; }
#invite-new { width: min(100%, 310px); margin-bottom: 8px; }
#invite-code { font: 14px monospace; }
#service-status, #invite-status { padding-block: 3px; }
#service-status:empty, #invite-status:empty, #playlist-tracks-status:empty { display: none; }

@media (max-width: 420px) {
  .playlist-option { grid-template-columns: auto minmax(0, 1fr); }
  .playlist-option .secondary-button { grid-column: 2; justify-self: start; }
  .collection-toolbar .split-actions { margin-left: 0; }
}
