:root {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color-scheme: dark;
  --mica: #202020;
  --card: #2b2b2b;
  --layer: #2b2b2b;
  --drawer: #3a3a3a;
  --drawer-border: #585858;
  --stroke: #363636;
  --text: #fff;
  --secondary: #ffffffbf;
  --muted: #ffffff94;
  --subtle: #ffffff0f;
  --hover: #ffffff16;
  --pressed: #ffffff23;
  --accent: #60cdff;
  --accent-text: #071920;
  --alert: #fca7a7;
  --footer-bg: #252525;
  --shadow: #0008;
}
:root[data-theme="light"] {
  color-scheme: light;
  --mica: #f3f3f3;
  --card: #fbfbfb;
  --layer: #fff;
  --drawer: #fafafa;
  --drawer-border: #ddd;
  --stroke: #e5e5e5;
  --text: #191919;
  --secondary: #383838;
  --muted: #595959;
  --subtle: #00000007;
  --hover: #0000000a;
  --pressed: #00000016;
  --accent: #0067c0;
  --accent-text: #fff;
  --alert: #a12622;
  --footer-bg: #f3f3f3;
  --shadow: #0003;
}
:root { --control-height: 34px; --control-radius: 4px; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--mica); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, input, textarea { min-width: 0; }
button { cursor: pointer; min-height: var(--control-height); border-radius: var(--control-radius); border: 1px solid transparent; padding: 4px 9px; background: transparent; }
button, .center { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
button:hover { background-color: var(--hover); }
button:active, button[aria-pressed="true"] { background-color: var(--pressed); }
button:disabled, input:disabled { cursor: default; opacity: .46; }
:focus { outline: none; }
:where(button, select, input, textarea, a) { -webkit-tap-highlight-color: transparent; }
:where(button, select, input, textarea, a):focus-visible { outline: none; }
:where(button):focus-visible:not(.lyric-group, .song-name, .primary) { background-color: var(--hover); }
select, input:not([type=checkbox], [type=range], [type=file]), textarea {
  min-height: var(--control-height);
  border: 1px solid var(--stroke);
  border-bottom-color: var(--muted);
  border-radius: var(--control-radius);
  background: var(--subtle);
  padding: 4px 9px;
}
input[type=checkbox], input[type=range], progress { accent-color: var(--accent); }
input[type=checkbox] { width: 17px; height: 17px; margin: 0; }
input[type=range] { width: 100%; min-width: 0; margin: 0; }
progress { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; }
.glyph { width: 16px; height: 16px; }
.fluent-glyph { flex: none; display: grid; place-items: center; font: 16px/1 "MUZY Fluent Icons"; }
.artwork .fluent-glyph { width: auto; height: auto; font-size: 26px; }
.tile .artwork .fluent-glyph, .hero .fluent-glyph, .large-cover .fluent-glyph { font-size: 48px; }
.volume-symbol .fluent-glyph { font-size: 13px; }
.player-left .transport-buttons button.primary .fluent-glyph { font-size: 28px; }
.icon { width: 34px; padding: 0; flex: none; }
.standard { background: var(--subtle); border-color: var(--stroke); }
.primary, button.primary:hover { background: var(--accent); color: var(--accent-text); }
.danger { color: var(--alert); }
.muted, small { color: var(--muted); }
.clip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app {
  display: grid;
  grid-template-rows: var(--title-height, 48px) auto auto minmax(0, 1fr) var(--footer-height, 112px);
  height: 100dvh;
}
.titlebar {
  grid-row: 1; display: flex; align-items: center; gap: 10px; padding-inline-start: 16px;
  font-size: var(--title-size, 13px);
}
.titlebar img { width: 18px; height: 18px; }
.titlebar .fullscreen { margin-inline-start: auto; width: 46px; height: 100%; }
.titlebar button[data-action="drawer"] { display: none; }
.notifications {
  position: fixed; z-index: 12; inset-block-start: 56px;
  inset-inline-end: 14px;
  width: min(360px, calc(100vw - 28px)); display: grid; gap: 8px; pointer-events: none;
}
.notification {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 42px; padding: 5px 7px 5px 13px; pointer-events: auto;
  border-radius: 10px; border: 1px solid var(--drawer-border); background: var(--drawer);
  color: var(--text); box-shadow: 0 6px 20px var(--shadow);
  overflow-wrap: anywhere; animation: notification-enter .16s ease-out;
}
.notification.error { color: var(--alert); }
.notification .icon { width: 26px; min-height: 27px; }
@keyframes notification-enter { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .notification { animation: none; } }
.workspace { grid-row: 4; display: grid; grid-template-columns: var(--side-width, 220px) minmax(0, 1fr); position: relative; min-height: 0; }
.sidebar { display: flex; flex-direction: column; gap: 20px; padding: var(--side-padding, 20px 14px 16px 16px); min-height: 0; }
.nav-scroll { overflow: auto; flex: 1; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 20px; }
.nav-heading {
  display: flex; align-items: center; justify-content: space-between; min-height: var(--side-head-height, 36px);
  padding-inline: 14px 4px; font-size: var(--side-heading, 12px); font-weight: 600; color: var(--secondary);
}
.nav-heading .icon { width: 29px; }
.nav-row { display: flex; position: relative; }
.nav-link {
  display: flex; position: relative; flex: 1; min-width: 0; width: 100%; min-height: var(--side-row-height, 40px); padding: 0 13px;
  justify-content: flex-start; gap: 12px; text-align: start; border-radius: var(--transport-radius, 8px);
}
.nav-link .glyph { opacity: .72; }
.nav-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover, .nav-more:hover { background: var(--nav-hover, var(--hover)); }
.nav-link[aria-current="page"] { background: var(--nav-selected, var(--pressed)); }
.nav-link[aria-current="page"]::before {
  content: ""; position: absolute; width: 3px; height: 18px; left: 0; border-radius: 2px; background: var(--accent);
}
.nav-row[data-context="playlist"] .nav-link { padding-inline-end: 40px; }
.nav-more { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 30px; min-height: 32px; border-radius: 6px; opacity: 0; }
.nav-row:hover .nav-more, .nav-row:focus-within .nav-more { opacity: 1; }
.nav-scrim { display: none; }
.page {
  display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: var(--page-spacing, 18px); min-height: 0; min-width: 0;
  margin: var(--card-margin, 8px 16px 16px 0); padding: var(--page-padding, 24px 28px 12px);
  background: var(--card); border: var(--card-border, 1px) solid var(--stroke); border-radius: var(--card-radius, 12px);
}
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; min-width: 0; }
.heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
h1 { font-weight: 600; font-size: var(--page-title, 28px); line-height: 1.18; overflow-wrap: anywhere; }
.header-tools, .page-actions, .action-group { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.header-tools { justify-content: flex-end; margin-inline-start: auto; }
.header-tools .primary { white-space: nowrap; }
.header-summary { font-size: 12px; color: var(--muted); }
.page-actions { grid-row: 2; }
.page-body { grid-row: 3; min-height: 0; min-width: 0; overflow: auto; scrollbar-width: thin; container-type: inline-size; }
.search-box { display: flex; align-items: center; gap: 8px; }
.search-box input { width: clamp(135px, 18vw, 220px); }
.empty { display: grid; min-height: 130px; place-items: center; padding: 22px; text-align: center; color: var(--muted); }
.table { width: 100%; min-width: 0; }
.table-row {
  display: grid; grid-template-columns: var(--columns); gap: var(--column-gap);
  padding: 0 var(--row-padding); align-items: center; min-height: var(--row-height);
  border-radius: var(--row-radius, 7px); min-width: 0;
}
.table-row:not(.table-head):hover { background: var(--hover); }
.table-row[aria-selected="true"] { background: var(--nav-selected, var(--pressed)); }
.table-row.current .cell-title { color: var(--accent); }
.table-head {
  min-height: var(--header-height); font-size: var(--header-size); color: var(--muted);
  border-bottom: 1px solid var(--stroke);
}
.table-row .cell { min-width: 0; }
.table-row .cell.right { text-align: end; }
.table-row .song-name { justify-content: flex-start; text-align: start; width: 100%; padding: 3px 0; }
.song-copy { display: grid; min-width: 0; text-align: start; gap: 3px; }
.song-copy strong { font-weight: var(--title-weight, 400); }
.second-line { font-size: 11px; }
.table:not(.two-line) .second-line { display: none; }
.table .row-more { width: 26px; opacity: 0; }
.table-row:hover .row-more, .table-row:focus-within .row-more { opacity: 1; }
.row-more:hover, .row-more:focus-visible { opacity: 1; }
.cell-index, .cell-format { color: var(--muted); }
.table .cell[hidden] { display: none; }
.gallery { display: grid; align-items: start; align-content: start; grid-auto-rows: max-content; grid-template-columns: repeat(var(--columns-count, 2), minmax(0, 1fr)); gap: 20px var(--gallery-gap, 16px); }
.tile { align-self: start; position: relative; min-width: 0; display: block; }
.tile-main { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; appearance: none; -webkit-appearance: none; height: auto; width: 100%; min-width: 0; text-align: left; padding: 0; border: none; border-radius: var(--cover-radius, 10px); padding-bottom: 8px; }
.tile-meta { display: grid; min-width: 0; gap: 4px; margin-top: 6px; padding-inline-end: 35px; }
.tile-main strong { margin-top: 4px; font-weight: 600; }
.tile-main small { font-size: 11px; }
.tile .artwork { flex: none; width: 100%; height: var(--cover-size, 160px); aspect-ratio: auto; padding: 0; display: block; }
.tile .artwork > .glyph { position: absolute; inset: 0; margin: auto; }
.tile.artist .tile-main { text-align: center; }
.tile.artist .tile-meta { padding-inline-start: 35px; }
.tile.artist .artwork { border-radius: 50%; }
.tile .row-more { position: absolute; inset-inline-end: 0; bottom: 4px; background: transparent; }
.artwork { display: grid; place-items: center; aspect-ratio: 1; width: 100%; border-radius: var(--cover-radius, 10px); overflow: hidden; background: var(--subtle); position: relative; }
.artwork .glyph { width: 32%; height: 32%; opacity: .36; }
.artwork img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero { display: grid; grid-template-columns: var(--hero-size, 152px) minmax(0, 1fr); align-items: center; gap: 24px; margin: 0 0 16px; }
.hero .artwork { border-radius: var(--hero-radius, 10px); }
.hero.artist .artwork { border-radius: 50%; }
.hero h2 { font-size: var(--hero-title, 28px); overflow-wrap: anywhere; font-weight: 600; }
.hero p { margin-top: 6px; color: var(--secondary); }
.settings { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; padding-bottom: 6px; }
.settings-card { border: 1px solid var(--stroke); background: var(--subtle); border-radius: var(--settings-radius, 10px); padding: var(--settings-padding, 13px 16px 14px); min-width: 0; }
.settings-card h2 { font-size: var(--settings-title, 18px); margin-bottom: 7px; font-weight: 600; }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: center; gap: 8px 16px; min-height: var(--settings-row, 42px); }
.setting-control { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; flex-wrap: wrap; }
.setting-control > :is(input:not([type=checkbox]), select) { max-width: 100%; width: 168px; }
.setting-control > input[type=checkbox] {
  appearance: none; width: 39px; height: 20px; border: 1px solid var(--muted); border-radius: 10px; display: flex; align-items: center; padding: 3px; cursor: pointer;
}
.setting-control > input[type=checkbox]::before { content: ""; width: 12px; height: 12px; border-radius: 100%; background: var(--muted); }
.setting-control > input[type=checkbox]:checked { background: var(--accent); border-color: transparent; justify-content: flex-end; }
.setting-control > input[type=checkbox]:checked::before { background: var(--accent-text); }
.folder-list { padding: 0; margin: 4px 0 9px; list-style: none; }
.folder-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.folder-list li span { margin-inline-end: auto; overflow-wrap: anywhere; min-width: 0; }
.eq { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 6px; }
.eq label { display: grid; text-align: center; gap: 5px; }
.footer {
  z-index: 2; grid-row: 5; min-width: 0; display: grid; align-items: center;
  grid-template-columns: var(--footer-side, 260px) minmax(0, 1fr) var(--footer-side, 260px);
  padding: var(--footer-margin, 14px 24px); gap: var(--footer-gap, 24px); background: var(--footer-bg);
}
.now { justify-content: flex-start; text-align: start; min-width: 0; padding: 0; gap: 14px; }
.now .artwork { width: 64px; flex: none; border-radius: 8px; }
.now strong { font-weight: 600; font-size: 13px; }
.transport { min-width: 0; display: grid; gap: 4px; justify-items: center; }
.transport-buttons { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--transport-gap, 8px); }
.transport-group { display: flex; align-items: center; gap: inherit; min-width: 0; }
.transport-group.before { justify-content: flex-end; }
.transport-group.after { justify-content: flex-start; }
.queue-badge { position: absolute; right: -1px; top: 0; display: grid; place-items: center; border-radius: 50%; min-width: 15px; height: 15px; background: var(--accent); color: var(--accent-text); font-size: 9px; }
.queue-badge:empty { display: none; }
[data-action="queue"] { position: relative; }
.transport-buttons button { height: var(--transport-size, 32px); min-width: var(--transport-size, 32px); padding: 0 4px; border-radius: var(--transport-radius, 8px); font-size: 11px; }
.transport-buttons button.primary { width: var(--primary-size, 44px); height: var(--primary-size, 44px); border-radius: 50%; }
.transport-buttons button[aria-pressed="true"] { color: var(--accent); }
.seek { width: 100%; height: 26px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 10px; align-items: center; font-size: 10px; color: var(--muted); }
.seek output:last-child { text-align: end; }
.volume { justify-self: end; display: flex; align-items: center; width: min(100%, 136px); position: relative; height: 32px; }
.volume input {
  appearance: none; height: 24px; border-radius: 12px; background: transparent; position: absolute; inset: 4px 0;
}
.volume input::-webkit-slider-runnable-track { height: 4px; border-radius: 8px; background: linear-gradient(to right, var(--accent) var(--volume, 0%), var(--muted) 0%); }
.volume input::-webkit-slider-thumb { appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; background: var(--accent); }
.volume input::-moz-range-track { height: 4px; border-radius: 8px; background: linear-gradient(to right, var(--accent) var(--volume, 0%), var(--muted) 0%); }
.volume input::-moz-range-thumb { border: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); }
.volume-symbol { position: absolute; display: grid; place-items: center; pointer-events: none; inset-inline: 12px; color: var(--accent-text); }
.volume-symbol .glyph { position: absolute; left: var(--volume, 0%); transform: translateX(-50%); width: 13px; height: 13px; }
.player {
  grid-row: 1 / 6; z-index: 3; grid-column: 1; display: grid; grid-template-rows: auto minmax(0, 1fr);
  padding: 28px 40px 22px; background: #181b22; color: white; overflow: hidden; position: relative;
  --muted: #fffc; --secondary: #fffd; --accent: white; --accent-text: #151821; --hover: #ffffff19; --pressed: #ffffff35;
}
.player-backdrop { position: absolute; inset: -60px; pointer-events: none; background-position: center; background-size: cover; filter: blur(48px); opacity: .56; }
.player::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: #090b105a; }
.player-top, .player-columns { position: relative; z-index: 1; min-width: 0; }
.player-top { display: flex; justify-content: space-between; }
.player-columns {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 64px; padding: 10px 32px;
  align-items: center; min-height: 0; width: min(100%, 1420px); justify-self: center;
}
.player-left { display: grid; min-width: 0; align-content: center; justify-self: center; width: min(100%, 500px); gap: 12px; }
.large-cover { width: min(100%, 43dvh, 500px); justify-self: center; padding: 0; border: 0; display: block; }
.large-cover .artwork { border-radius: 16px; }
.player-info h2 { font-size: 26px; font-weight: 600; }
.player-info div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--secondary); }
.player-left .volume { justify-self: center; width: min(65%, 300px); }
.player-left .transport-group { justify-content: space-evenly; }
.player-left .transport-buttons button.primary { width: 62px; height: 62px; }
.player-left .transport-buttons button.primary .glyph { width: 27px; height: 27px; }
.lyrics { min-height: 0; max-height: 100%; height: 100%; overflow: auto; scrollbar-width: none; position: relative; padding: 10px 8px; mask-image: linear-gradient(transparent, black 13%, black 87%, transparent); }
.lyric-pad { height: 39%; min-height: 50px; }
.lyric-group { display: grid; justify-content: stretch; gap: 4px; margin: 18px 0; min-height: 36px; padding: 0; width: 100%; text-align: start; line-height: 1.18; font-size: var(--lyric-size, 30px); font-family: var(--lyric-font, inherit); font-weight: var(--lyric-weight, 600); opacity: .36; }
.lyric-group.active { opacity: 1; font-size: calc(var(--lyric-size, 30px) * 1.2); }
.lyric-group:is(:hover,:active,:focus,:focus-visible) { background: transparent; box-shadow: none; outline: none; }
.lyric-group.plain { opacity: .75; }
.player.lyrics-only { grid-row: 1 / 5; }
.player.lyrics-only .player-columns { grid-template-columns: minmax(0, 1fr); }
.player.lyrics-only .player-left { display: none; }
.player.lyrics-only .lyrics { display: block; width: min(100%, 1000px); justify-self: center; --lyric-size: calc(var(--lyric-base, 30px) * 1.5); }
.player.lyrics-only .lyric-group { text-align: center; }
.footer.lyrics-footer { color: var(--text); --footer-bg: var(--lyrics-footer-bg, var(--mica)); --accent: white; --accent-text: #151821; --muted: #fffc; --hover: #ffffff19; --pressed: #ffffff35; }
.popup {
  width: min(820px, calc(100% - 26px)); max-height: min(720px, calc(100dvh - 46px));
  padding: 20px 26px; border: 1px solid var(--drawer-border); border-radius: 14px;
  background: var(--layer); color: var(--text); box-shadow: 0 12px 48px var(--shadow);
}
.popup::backdrop { background: #0005; }
.popup.small { width: min(440px, calc(100% - 26px)); }
.popup.side { margin: auto 16px auto auto; width: min(530px, calc(100% - 32px)); }
.popup.bottom { margin: auto auto max(17px, var(--footer-height, 112px)); max-height: min(430px, 70dvh); width: min(980px, calc(100% - 30px)); }
.popup header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.popup h2 { font-size: 22px; font-weight: 600; }
.popup form { display: grid; gap: 12px; }
.popup .buttons { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.popup .body-copy, .form-status { overflow-wrap: anywhere; }
.popup .form-status { color: var(--alert); }
.form-field { display: grid; gap: 5px; }
.field-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tag-field label { display: flex; align-items: center; gap: 7px; }
.popup .wide { grid-column: 1 / -1; }
.cover-edit { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; align-items: center; }
.queue-now { display: grid; gap: 4px; border-radius: 9px; padding: 10px 12px; margin: 0 0 8px; background: var(--subtle); }
.queue-list { margin: 2px 0 10px; padding: 0; list-style: none; }
.queue-list li { display: flex; gap: 8px; min-height: 40px; align-items: center; }
.queue-list li button:first-child { flex: 1; justify-content: flex-start; }
.queue-list .current { color: var(--accent); }
.menu {
  position: fixed; z-index: 9; overflow: auto; max-height: calc(100dvh - 20px); display: grid; align-content: start; min-width: 170px; max-width: calc(100vw - 16px);
  padding: 4px; border-radius: 8px; border: 1px solid var(--drawer-border); background: var(--drawer); color: var(--text); box-shadow: 0 8px 24px var(--shadow);
}
.menu button { justify-content: flex-start; text-align: start; min-height: 34px; }
.menu button[aria-checked="true"] { color: var(--accent); }
.menu hr { border: 0; border-top: 1px solid var(--stroke); margin: 4px; width: calc(100% - 8px); }

html.compact .workspace { grid-template-columns: minmax(0, 1fr); }
html.compact .titlebar button[data-action="drawer"] { display: inline-flex; }
html.compact .page { margin: 0; padding: 13px 14px 6px; background: transparent; border: none; border-radius: 0; gap: 12px; }
html.compact .sidebar {
  position: absolute; z-index: 5; inset: 0 auto 0 0; width: min(var(--side-drawer, 272px), 84%);
  background: var(--drawer); border: 1px solid var(--drawer-border); border-radius: 0 12px 12px 0; visibility: hidden;
}
html.compact .workspace.nav-open .sidebar { visibility: visible; }
html.compact .nav-scrim { display: block; position: absolute; inset: 0; background: #0005; border: 0; border-radius: 0; z-index: 4; width: 100%; }
html.compact .header-tools { gap: 5px; }
html.compact .header-summary { display: none; }
html.compact .footer { gap: 4px 8px; padding: 10px 8px; }
html.compact .transport-buttons { gap: 5px; }
html.compact .now .artwork { width: 48px; }
html.compact .now { gap: 8px; }
html.compact :is(.table .row-more, .nav-more) { opacity: 1; }
html.hide-lyrics .app { grid-template-rows: var(--title-height, 48px) auto auto minmax(0, 1fr) var(--narrow-footer-height, 172px); }
html.hide-lyrics .footer { grid-template-columns: minmax(0, 1fr) 160px; grid-template-rows: minmax(44px, 1fr) auto; gap: 8px 24px; }
html.hide-lyrics .transport { grid-row: 2; grid-column: 1 / -1; }
html.hide-lyrics .footer .volume { grid-row: 1; grid-column: 2; width: 80px; }
html.compact .footer { grid-template-columns: minmax(0, 1fr) 136px; gap: 4px 8px; }
html.compact .footer .volume { width: 128px; }
html.narrow-footer .transport-buttons { gap: 2px; }
html.narrow-footer .hero { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
html.hide-lyrics .player:not(.lyrics-only) .player-columns { grid-template-columns: minmax(0, 1fr); }
html.hide-lyrics .player:not(.lyrics-only) .lyrics { display: none; }
@media (max-width: 410px) {
  .page-header { gap: 7px; }
  .header-tools { margin-inline-start: 0; }
  .header-tools .primary { flex: 0 0 34px; }
  .setting-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .setting-control > :is(input:not([type=checkbox]), select) { max-width: 122px; }
  .player { padding: 14px 16px; }
  .player-columns { padding: 6px 0; }
  .popup { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
.conversion-count { position:absolute; inset-inline-end: 9px; align-self:center; pointer-events:none; }
.conversion-table progress { width:100%; height:5px; display:block; }
.transport-buttons .format { max-width:58px; }
.transport-buttons .format span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
:root { --footer-bg: var(--mica); }
.popup { background: var(--drawer); }
.body-copy { overflow-wrap: anywhere; }
.tile .row-more { opacity: 0; }
.tile:hover .row-more, .tile:focus-within .row-more, html.compact .tile .row-more { opacity: 1; }
#settings-scan { margin-top: 5px; }

.app > * { grid-column: 1; }
@media (max-height: 540px) {
  .player { padding-block: 6px; }
  .player-left { gap: 5px; }
}
@media (pointer: coarse) {
  .nav-more, .tile .row-more, .table .row-more { opacity: 1; }
}

@media (max-width: 370px) {
  .transport-buttons button:not(.primary) { min-width: 25px; padding-inline: 2px; }
  .transport-buttons .format { max-width: 44px; }
}

html.hide-lyrics .popup.bottom { margin-bottom: var(--narrow-footer-height, 172px); }

/* Player and settings use the same type hierarchy and inset controls as the desktop. */
.table-row .song-name:is(:hover, :active, :focus-visible) { background: transparent; }
.artist-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--stroke); border-radius: 8px; background: var(--subtle); }
.artist-tabs button { min-height: 27px; white-space: nowrap; }
.artist-tabs button[aria-pressed="true"] { color: var(--accent); background: var(--layer); box-shadow: 0 1px 2px var(--shadow); }

.player {
  --accent: #91c7eb; --accent-text: #17222d;
  --secondary: #ffffff99; --muted: #ffffff99;
  --player-top-padding: calc(24px + var(--title-height, 48px));
  color-scheme: inherit;
  color: var(--player-ink, white);
  padding: var(--player-top-padding) 40px 28px;
  background: linear-gradient(135deg, var(--ambient-top, var(--player-top, #253440)),
    var(--ambient-middle, var(--player-middle, #17222d)) 55%,
    var(--ambient-bottom, var(--player-bottom, #11131b)));
}
.player:not(.lyrics-only) .player-backdrop { display: none; }
.player.lyrics-only .player-backdrop { filter: blur(32px); opacity: .64; }
.player::after { background: linear-gradient(to bottom, var(--mica), transparent 145px); }
.player.lyrics-only::after { background: linear-gradient(to bottom, var(--mica), transparent 145px), var(--player-backdrop-shade, #090b105a); }
html[data-theme="light"] .player {
  --player-ink: #111820; --secondary: #252d36; --muted: #36424e;
  --hover: #00000012; --pressed: #00000022; --accent: #174c79;
  --player-backdrop-shade: #ffffff95; --accent-text: white;
}
.player-top { min-height: 44px; }
.player-top .player-return { padding: 12px; width: auto; min-width: 40px; border: 0; }
.player-top .player-return .glyph { width: 18px; height: 18px; }
.player-columns {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--player-gap, 64px); width: 100%; padding: 12px 32px;
}
.player-left {
  width: min(100%, var(--player-left-max, 500px)); gap: var(--player-left-gap, 20px);
  justify-items: stretch; min-height: 0;
}
.large-cover {
  width: min(100%, clamp(100px, calc(100dvh - 379px - var(--player-top-padding)), 460px)); justify-self: center;
  border-radius: var(--player-cover-radius, 14px);
  box-shadow: 0 26px 65px #060a15a0, 0 3px 12px #090d1a65;
}
.large-cover .artwork { border-radius: inherit; background: #ffffff22; }
.large-cover .artwork .fluent-glyph { font-size: 84px; opacity: .25; }
.player-info { display: grid; gap: 7px; min-width: 0; text-align: start; }
.player-info h2 { font-size: var(--player-title, 26px); font-weight: 600; }
.player-info .player-subline {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
}
.player-info p { color: var(--secondary); min-width: 0; font-size: var(--player-artist, 18px); }
.player-info .player-options { display: flex; align-items: center; gap: 8px; }
.player-options button { height: 28px; min-height: 28px; border: 0; border-radius: 8px; font-size: 12px; }
.player-options button[data-action="favorite-playing"] { width: 28px; border-radius: 50%; padding: 0; }
.player-options button[data-action="formats"] { min-width: 48px; }
.player-options button[data-action="speed"] { min-width: 42px; }
.player-controls { display: grid; justify-items: stretch; gap: 12px; }
.player .seek {
  display: grid; height: 50px; grid-template-columns: 1fr 1fr; grid-template-rows: 32px 18px;
  gap: 0; font-size: 12px; font-variant-numeric: tabular-nums;
}
.player .seek input { grid-row: 1; grid-column: 1 / -1; accent-color: var(--accent); }
.player .seek output { grid-row: 2; }
.player .seek output:last-child { grid-column: 2; }
.player-left .transport-buttons { gap: 10px; }
.player-left .transport-group { gap: 8px; }
.player-left .transport-group.before { justify-content: flex-end; }
.player-left .transport-group.after { justify-content: flex-start; }
.player-left .transport-buttons button {
  width: 38px; height: 38px; border-radius: 50%; padding: 0; color: inherit;
}
.player-left .transport-buttons button:is([data-action="previous"],[data-action="next"]) { width: 46px; height: 46px; }
.player-left .transport-buttons button.primary {
  width: var(--player-play-size, 64px); height: var(--player-play-size, 64px);
  border-radius: 50%; background: #ffffff16;
}
.player-left .transport-buttons button.primary:hover { background: #ffffff25; }
.player-left .transport-buttons .glyph { font-size: 19px; }
.player-left .transport-buttons button.primary .glyph { font-size: 32px; width: 32px; height: 32px; }
.player-left .volume { width: min(65%, 300px); justify-self: center; }
.player .volume-symbol { color: white; }
.player .volume input::-webkit-slider-thumb { background: #4a4e55; }
.player .volume input::-moz-range-thumb { background: #4a4e55; }
.lyrics-footer { --footer-bg: var(--lyrics-footer-bg, var(--mica)); }
html[data-theme="light"] .footer.lyrics-footer { color: #111820; --accent: #174c79; --accent-text: white; --muted: #36424e; --hover: #00000012; --pressed: #00000022; }
html.hide-lyrics .player { --player-top-padding: calc(12px + var(--title-height, 48px)); padding-inline: 24px; }
html.hide-lyrics .player-columns { gap: 0; padding-inline: 0; }
:fullscreen .player { --player-top-padding: 24px; }
html.hide-lyrics:fullscreen .player { --player-top-padding: 12px; }
@media (max-height: 530px) { html.hide-lyrics .player { --player-top-padding: 12px; } }
html.immersive { background: var(--mica); }
html.immersive body { background: inherit; }
html.immersive .workspace { visibility: hidden; }
.lyrics {
  padding-inline: clamp(8px, 1.6vw, 22px);
  mask-image: linear-gradient(to bottom, transparent 0%, #0004 8%, #000c 16%, black 24%,
    black 76%, #000c 84%, #0004 92%, transparent 100%);
  overscroll-behavior: contain;
}
.lyric-pad { height: 50%; pointer-events: none; }
.lyric-group {
  margin: clamp(15px, 2.3vh, 24px) 0;
  opacity: .4; appearance: none; border: 0; background: none;
  transition: opacity .34s ease, color .34s ease;
  line-height: 1.16;
}
.lyric-group { color: inherit; -webkit-appearance: none; background-color: transparent; border: 0; box-shadow: none; }
.lyric-group.active { font-size: var(--lyric-size, 30px); opacity: 1; color: inherit; }
.lyric-text { display: grid; gap: 4px; filter: none; width: calc(100% / 1.2); transform-origin: left center; transition: transform .44s cubic-bezier(.22, .75, .24, 1); }
.lyric-group[data-blurred] .lyric-text > span {
  color: transparent; text-shadow: 0 0 var(--lyric-blur) var(--player-ink, white);
}
.lyric-group.active .lyric-text { transform: scale(1.2); }
.lyrics-only .lyric-text { margin-inline: auto; transform-origin: center; }
.lyrics-only .player-columns { padding-inline: 0; }
.lyric-group.plain .lyric-text { width: 100%; }

.settings { max-width: var(--settings-max, 820px); gap: var(--settings-gap, 14px); padding: 0 2px 14px; }
.settings-card { background: color-mix(in srgb, var(--layer), var(--mica) 18%); padding: var(--settings-padding, 16px 20px); }
.settings-card-head { padding-bottom: 5px; }
.settings-card-head h2 { margin: 0; line-height: 1.25; }

.settings-card-content { display: grid; margin-top: 6px; }
.setting-row { padding-block: 4px; column-gap: 16px; }
.setting-row + .setting-row { border-top: 1px solid var(--subtle); }
.setting-control > :is(input:not([type=checkbox]), select) { width: min(180px, 36cqw); }
.setting-control > input[type=checkbox]::before { transition: transform .17s ease; }
.setting-control > input[type=checkbox]:checked { justify-content: flex-start; }
.setting-control > input[type=checkbox]:checked::before { transform: translateX(17px); }
.settings-preview { margin-top: 9px; padding: 10px 13px; border-radius: 8px; background: var(--subtle); min-width: 0; }
.settings-preview p { overflow-wrap: anywhere; line-height: 1.25; margin-top: 3px; }
.settings-card .eq { margin-top: 8px; }
.settings-card-content > .action-group, .settings-card-content > .standard { justify-self: start; margin-top: 7px; }
@container (width < 430px) {
  .setting-row:has(.setting-control > :is(select, input:not([type=checkbox], [type=radio]))) {
    grid-template-columns: minmax(0, 1fr); row-gap: 5px; padding-block: 8px;
  }
  .setting-row:has(.setting-control > :is(select, input:not([type=checkbox], [type=radio]))) .setting-control { justify-content: stretch; }
  .setting-control > :is(input:not([type=checkbox]), select) { width: 100%; max-width: 100%; }
}
@media (max-height: 590px) {
  .player-controls { gap: 3px; }
  .player-left { gap: 5px; }
  .player-info .player-options { margin-top: 1px; }
}
@media (max-width: 560px) {
  .artist-tabs button { padding-inline: 5px; min-width: 42px; }
  .player-columns { grid-template-columns: minmax(0, 1fr); padding-inline: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .lyric-group, .lyric-text, .setting-control > input[type=checkbox]::before { transition: none; }
}

html.hide-lyrics .player:not(.lyrics-only) .player-columns { overflow: auto; align-items: safe center; scrollbar-width: thin; padding: 48px 32px 72px; }

/* Keep the heading and its controls on one line. The search input opens below it. */
.page { position: relative; container-type: inline-size; }
.page-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; flex-wrap: nowrap; }
.heading h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-tools { flex-wrap: nowrap; flex: none; gap: 6px; margin-inline: 0; }
.header-select > .glyph { display: none; }
.header-select select { max-width: 132px; }
.search-box { position: absolute; margin-top: 40px; inset-inline-end: 0; width: min(290px, 100%); z-index: 5;
  border-radius: 7px; background: var(--drawer); box-shadow: 0 8px 22px var(--shadow); }
.search-box input { width: 100%; }
@container (width < 560px) {
  .header-tools .header-summary, .header-tools .primary > span:not(.glyph), .artist-tabs button > span:not(.glyph) { display: none; }
  .header-tools .primary, .artist-tabs button { width: 30px; min-width: 30px; padding-inline: 0; }
  .header-select { width: 31px; height: var(--control-height); min-height: var(--control-height); display: grid; place-items: center; position: relative; border-radius: 6px; background: var(--subtle); }
  .header-select > .glyph { display: block; pointer-events: none; }
  .header-select select { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
}
@container (width < 340px) {
  .heading { gap: 2px; }
  .heading h1 { font-size: 23px; }
  .heading .icon, .header-tools > .icon, .header-tools .primary, .header-select { min-width: 26px; width: 26px; }
  .header-tools { gap: 3px; }
  .artist-tabs { gap: 0; }
  .artist-tabs button { min-width: 26px; width: 26px; }
}


.header-tools [data-action="selection"]:not(:hover, :focus-visible) { background: transparent; }
.header-tools [data-action="selection"][aria-pressed="true"] { color: var(--accent); }
.lyrics-offset {
  position: fixed; z-index: 10; display: flex; align-items: center; gap: 3px;
  padding: 4px 8px; max-width: calc(100vw - 16px);
  background: var(--drawer); color: var(--text); border: 1px solid var(--drawer-border);
  border-radius: var(--control-radius); box-shadow: 0 8px 24px var(--shadow); font-size: 12px;
}
.lyrics-offset output { min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.lyrics-offset .icon { width: 28px; }

.login-page { display: grid; place-items: center; padding: 20px; }
.login-card {
  width: min(100%, 370px); padding: 26px; display: grid; gap: 20px;
  border-radius: 12px; background: var(--card); border: 1px solid var(--stroke);
}
.login-card h1 { display: flex; align-items: center; gap: 10px; }
.login-card h1 img { width: 26px; height: 26px; }
.login-card form { display: grid; gap: 12px; }
.login-trust { display: flex; align-items: center; gap: 8px; }
#login-status { color: var(--alert); }
.page-loading {
  width: 22px; height: 22px; margin: 28px auto; border: 2px solid var(--stroke);
  border-top-color: var(--accent); border-radius: 50%; animation: loading-spin .7s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .page-loading { animation: none; } }
.table-row:not(.table-head) { content-visibility: auto; contain-intrinsic-block-size: auto var(--row-height); }
.scan-progress {
  position: fixed; z-index: 8; inset-inline-end: 14px; bottom: calc(var(--footer-height, 112px) + 12px);
  width: min(390px, calc(100vw - 28px)); max-height: min(45dvh, 420px); overflow: auto;
  padding: 8px 14px 14px; background: var(--drawer); color: var(--text);
  border: 1px solid var(--drawer-border); border-radius: 10px; box-shadow: 0 8px 24px var(--shadow);
}
.scan-progress header { display: flex; align-items: center; justify-content: space-between; }
.scan-progress h2 { font-size: 16px; font-weight: 600; }
html.hide-lyrics .scan-progress { bottom: calc(var(--narrow-footer-height, 172px) + 12px); }
@media (max-width: 340px) { .lyrics-offset .offset-label { display: none; } }

:where(button, select, input:not([type=checkbox], [type=radio], [type=range], [type=file]), textarea) {
  box-sizing: border-box;
}
:where(.page, .popup, .menu, .lyrics-offset, .scan-progress, .login-card) button:not(.tile-main, .song-name),
:where(.page, .popup, .menu, .login-card) select,
:where(.page, .popup, .login-card) input:not([type=checkbox], [type=radio], [type=range], [type=file]) {
  height: var(--control-height); min-height: var(--control-height);
  border-radius: var(--control-radius); line-height: 20px; padding-block: 0;
}
:where(.page, .popup, .login-card) textarea { border-radius: var(--control-radius); min-height: var(--control-height); }
select { -webkit-appearance: none; appearance: none; padding-inline-end: 27px; background-repeat: no-repeat;
  background-position: right 9px center; background-size: 10px 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%23808080' stroke-width='1.5'/%3E%3C/svg%3E");
}
html { background: var(--mica); }


.artwork img:not([src]) { visibility: hidden; }
.menu[popover] { margin: 0; inset: auto; }
.header-tools button:not(.tile-main), .header-tools select, .header-tools .header-select {
  height: var(--control-height); min-height: var(--control-height); max-height: var(--control-height);
  border-radius: var(--control-radius); padding-block: 0; line-height: 20px;
}
.artist-tabs { padding-block: 0; border: 0; }
.pwa-statusbar { display: none; }
html.standalone .titlebar .fullscreen { display: none; }
html.standalone .app {
  position: fixed; inset: 0; height: 100%; margin: 0;
  grid-template-rows: calc(var(--title-height, 48px) + env(safe-area-inset-top, 0px)) auto auto minmax(0, 1fr) var(--footer-height, 112px);
}
html.standalone.hide-lyrics .app { grid-template-rows: calc(var(--title-height, 48px) + env(safe-area-inset-top, 0px)) auto auto minmax(0, 1fr) var(--narrow-footer-height, 172px); }
html.standalone .titlebar { padding-top: env(safe-area-inset-top, 0px); z-index: 2; }
html.standalone .workspace { position: relative; isolation: isolate; }
html.standalone .workspace::before { content: ""; position: absolute; z-index: -1; inset: calc(-1 * (var(--title-height, 48px) + env(safe-area-inset-top, 0px))) 16px 0 var(--side-width, 220px); background: var(--card); }
html.standalone.compact .workspace::before { inset-inline: 0; }
html.standalone .page { margin-top: 0; border-top: 0; border-start-start-radius: 0; border-start-end-radius: 0; }
html.standalone .player { --player-top-padding: calc(24px + var(--title-height, 48px) + env(safe-area-inset-top, 0px)); }
.page-loading { min-height: 140px; display: grid; gap: 12px; padding-block: 12px; }
.page-loading span { display: block; height: 30px; border-radius: 6px; background: var(--subtle); }
.page[data-loading="true"]::after { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--accent); opacity: .55; }

/* Loading feedback does not change layout or block interaction. */
.page-loading span {
  background-image: linear-gradient(100deg, transparent 20%, var(--hover) 48%, transparent 76%);
  background-size: 220% 100%; animation: loading-shimmer 1.5s linear infinite;
}
.page-loading span:nth-child(2) { animation-delay: .1s; width: 86%; }
.page-loading span:nth-child(3) { animation-delay: .2s; width: 68%; }
@keyframes loading-shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }
@media (prefers-reduced-motion: reduce) { .page-loading span { animation: none; } }
