/* MUSÉE SONORE — installed-app layer (PWA / standalone). */

.pwa-install {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--accent);
  font: 9px var(--mono);
  letter-spacing: .06em;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}

.site-footer {
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.pwa-install:hover,
.pwa-install:focus-visible {
  border-color: var(--accent);
  background: #eeece6;
  color: var(--ink);
}

.pwa-install[hidden] { display: none; }

.pwa-install .pwa-install-mark {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid currentColor;
  font-size: 9px;
  line-height: 1;
}

@media (max-width: 760px) {
  .site-footer {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .pwa-install {
    margin-left: 0;
  }
}

/* Windows desktop shell: native WebView2 zoom control in the footer. */
.desktop-text-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 8px var(--mono);
  letter-spacing: .05em;
  white-space: nowrap;
}

.desktop-text-size span {
  margin-right: 2px;
}

.desktop-text-size strong {
  min-width: 32px;
  color: var(--accent);
  font: 9px var(--mono);
  text-align: center;
}

.desktop-text-size button {
  padding: 2px 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font: 9px var(--mono);
  cursor: pointer;
}

.desktop-text-size button:hover,
.desktop-text-size button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.desktop-text-size + .pwa-install {
  margin-left: 8px;
}

@media (max-width: 760px) {
  .desktop-text-size { display: none; }
}

/* Keep the app clear of notches and the iOS home indicator. */
body.pwa-standalone {
  padding-bottom: calc(116px + env(safe-area-inset-bottom, 0px));
}

body.pwa-standalone .site-header {
  height: calc(78px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(5.55vw, calc((100vw - 1600px) / 2 + 88.8px), env(safe-area-inset-left, 0px));
  padding-right: max(5.55vw, calc((100vw - 1600px) / 2 + 88.8px), env(safe-area-inset-right, 0px));
}

body.pwa-standalone .site-footer {
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

body.pwa-standalone .player-bar {
  height: calc(88px + env(safe-area-inset-bottom, 0px));
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: max(5.55vw, env(safe-area-inset-left, 0px));
  padding-right: max(5.55vw, env(safe-area-inset-right, 0px));
}

@media (max-width: 760px) {
  body.pwa-standalone {
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  }

  body.pwa-standalone.player-page-body {
    padding-bottom: calc(226px + env(safe-area-inset-bottom, 0px));
  }

  body.pwa-standalone .site-header {
    height: calc(66px + env(safe-area-inset-top, 0px));
    padding-left: max(5%, env(safe-area-inset-left, 0px));
    padding-right: max(5%, env(safe-area-inset-right, 0px));
  }

  body.pwa-standalone .library-player-bar {
    height: calc(206px + env(safe-area-inset-bottom, 0px));
    min-height: calc(206px + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

/* Desktop PWA window controls overlay (Edge/Chrome). */
@media (display-mode: window-controls-overlay) {
  body.pwa-standalone .site-header {
    padding-top: 6px;
  }
}

/* --------------------------------------------------------------------------
   INTERACTION LAYER — clearer affordances, springy press feedback,
   larger touch targets and stronger keyboard focus.
   -------------------------------------------------------------------------- */
:root {
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --press: cubic-bezier(.2, .8, .2, 1);
}

:where(button, a, [role="button"], summary, label[for]) {
  -webkit-tap-highlight-color: rgba(164, 124, 90, .18);
}

:where(button:not(:disabled), a[href], [role="button"], summary, label[for]) {
  cursor: pointer;
  touch-action: manipulation;
}

:where(button:disabled) {
  cursor: not-allowed;
  opacity: .45;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Header actions: make the small icons read as controls, not decoration. */
.header-actions { gap: 10px; }
.collection-trigger {
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .38);
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s, transform .34s var(--spring);
}
.collection-trigger:hover,
.collection-trigger:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  background: #fffdf8;
  box-shadow: 0 5px 16px #1e1e1b10;
  transform: translateY(-1px);
}
.collection-mark { font-size: 16px; }
.collection-count {
  min-width: 19px;
  padding: 2px 5px;
  border-color: #c9c3b7;
  background: #fffdf8;
}
.search-trigger {
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .38);
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s, transform .34s var(--spring);
}
.search-trigger:hover,
.search-trigger:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  background: #fffdf8;
  box-shadow: 0 5px 16px #1e1e1b10;
  transform: translateY(-1px);
}
.search-trigger .arrow { transition: transform .25s var(--spring); }
.search-trigger:hover .arrow { transform: translate(2px, -2px); }
.language-toggle {
  background: rgba(255, 255, 255, .38);
  border-color: var(--line);
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s, transform .34s var(--spring);
}
.language-toggle:hover,
.language-toggle:focus-visible {
  background: #fffdf8;
  box-shadow: 0 5px 16px #1e1e1b10;
  transform: translateY(-1px);
}
.menu-toggle {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .42);
  border-radius: 50%;
  transition: background .2s, border-color .2s, transform .34s var(--spring);
}
.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: #fffdf8;
  border-color: var(--accent);
}
.menu-toggle:active { transform: scale(.92); }
.menu-toggle span { transition: width .2s, background .2s; }
.menu-toggle:hover span { width: 21px; background: var(--accent); }

/* Springy, clearly tactile buttons and controls. */
:is(.solid-button, .ghost-button, .scan-trigger, .add-audio-button,
    .language-toggle, .search-trigger, .collection-trigger, .menu-toggle,
    .play-button, .player-icon, .dialog-close, .record-clear,
    .genre-item, .recent-row, .cover-button, .row-button, .library-nav,
    .playlist-open, .sidebar-heading button, .queue-heading button) {
  transition-property: transform, background-color, color, border-color, box-shadow, opacity;
  transition-duration: .34s, .2s, .2s, .2s, .2s, .2s;
  transition-timing-function: var(--spring), ease, ease, ease, ease, ease;
}

.solid-button {
  box-shadow: inset 0 1px 0 #ffffff1f, 0 2px 0 #1e1e1b;
  transition: transform .34s var(--spring), background-color .2s, box-shadow .2s;
}
.solid-button:hover {
  background: #31312b;
  box-shadow: inset 0 1px 0 #ffffff2a, 0 5px 18px #1e1e1b24;
  transform: translateY(-1px);
}
.solid-button:active {
  background: #272723;
  box-shadow: inset 0 2px 6px #00000024;
  transform: translateY(1px) scale(.97);
  transition-duration: .08s;
}
.ghost-button {
  background: rgba(255, 255, 255, .42);
  border-color: #cec8bc;
}
.ghost-button:hover,
.ghost-button:focus-visible {
  background: #fffdf8;
  border-color: var(--accent);
  box-shadow: 0 5px 16px #1e1e1b10;
  transform: translateY(-1px);
}
.ghost-button:active,
.language-toggle:active,
.search-trigger:active,
.collection-trigger:active,
.add-audio-button:active,
.row-button:active {
  transform: translateY(1px) scale(.96);
  transition-duration: .08s;
}
.scan-trigger {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 #ffffff2e, 0 2px 0 #7f573b;
}
.scan-trigger:hover {
  background: #b48560;
  border-color: #b48560;
  box-shadow: inset 0 1px 0 #ffffff38, 0 6px 18px #a47c5a33;
  transform: translateY(-1px);
}
.scan-trigger:active {
  background: #8f6040;
  box-shadow: inset 0 2px 6px #3c281c33;
  transform: translateY(1px) scale(.97);
  transition-duration: .08s;
}
.add-audio-button {
  background: rgba(255, 255, 255, .45);
  border-color: #cec8bc;
}
.add-audio-button:hover {
  background: #fffdf8;
  border-color: var(--accent);
  box-shadow: 0 5px 16px #1e1e1b10;
  transform: translateY(-1px);
}
.play-button {
  transition: transform .34s var(--spring), background-color .2s, box-shadow .2s;
  box-shadow: 0 3px 10px #1e1e1b1f;
}
.play-button:hover {
  background: var(--accent);
  box-shadow: 0 7px 18px #a47c5a38;
  transform: translateY(-1px) scale(1.06);
}
.play-button:active {
  transform: translateY(1px) scale(.94);
  transition-duration: .08s;
}
.player-icon {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .34);
  transition: transform .34s var(--spring), background-color .2s, border-color .2s, color .2s;
}
.player-icon:hover,
.player-icon:focus-visible {
  background: #fffdf8;
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.player-icon:active { transform: scale(.9); transition-duration: .08s; }

/* Card and list affordances: always show a click arrow on touch devices. */
.record-card { transition: transform .36s var(--spring); }
@media (hover: hover) {
  .record-card:hover { transform: translateY(-4px); }
  .record-card:focus-within { transform: translateY(-2px); }
}
.cover-button {
  border: 1px solid #d8d2c7;
  box-shadow: 0 1px 0 #ffffff80 inset;
  transition: transform .34s var(--spring), box-shadow .25s, border-color .25s;
}
.cover-button:hover,
.cover-button:focus-visible {
  border-color: #bcb3a4;
  box-shadow: 0 18px 38px #1e1e1b1c, 0 1px 0 #ffffff80 inset;
}
.cover-button:active { transform: scale(.985); transition-duration: .08s; }
.cover-open {
  background: #1e1e1bb8;
  border-color: #ffffffd9;
  backdrop-filter: blur(4px);
  transition: opacity .25s, transform .3s var(--spring), background .2s;
}
.cover-button:hover .cover-open,
.cover-button:focus-visible .cover-open {
  opacity: 1;
  transform: translateY(0) scale(1.04);
  background: var(--accent);
}
.recent-row {
  border-left: 2px solid transparent;
  transition: transform .3s var(--spring), background .2s, padding .2s, border-color .2s;
}
.recent-row:hover,
.recent-row:focus-visible {
  border-left-color: var(--accent);
  background: #fffdf8;
}
.recent-row:active { transform: scale(.996); transition-duration: .08s; }
.genre-item {
  border-left: 2px solid transparent;
}
.genre-item:hover,
.genre-item.is-selected {
  border-left-color: var(--accent);
}
.genre-item:active { transform: scale(.995); transition-duration: .08s; }

/* Player side navigation, rows and playlists. */
.library-nav {
  border-left: 2px solid transparent;
  padding-left: 8px;
  padding-right: 6px;
  transition: transform .3s var(--spring), color .2s, padding .2s, background .2s, border-color .2s;
}
.library-nav:hover,
.library-nav:focus-visible,
.library-nav.is-active {
  padding-left: 12px;
  background: #f0ede6;
  border-left-color: var(--accent);
}
.library-nav:active { transform: scale(.985); transition-duration: .08s; }
.playlist-open {
  padding-left: 8px;
  border-left: 2px solid transparent;
  transition: color .2s, background .2s, padding .2s, border-color .2s, transform .3s var(--spring);
}
.playlist-open:hover,
.playlist-open:focus-visible,
.playlist-row.is-active .playlist-open {
  padding-left: 12px;
  background: #f0ede6;
  border-left-color: var(--accent);
}
.playlist-open:active { transform: scale(.985); transition-duration: .08s; }
.row-button {
  min-width: 30px;
  min-height: 28px;
  border-color: #ddd7cb;
  border-radius: 2px;
  background: rgba(255, 255, 255, .5);
}
.row-button:hover,
.row-button:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: #fffdf8;
  transform: translateY(-1px);
}
.track-table tr { transition: background .2s; }
.track-table tr:hover td { background: #fffdf8; }
.track-table tr.is-playing td { background: #f3e9de; }

/* Text links get a visible hit area and a directional micro-motion. */
.text-link,
.light-link {
  min-height: 34px;
  padding: 6px 2px 8px;
  transition: color .2s, border-color .2s, transform .34s var(--spring);
}
.text-link:hover,
.text-link:focus-visible,
.light-link:hover,
.light-link:focus-visible {
  transform: translateX(2px);
}
.text-link:active,
.light-link:active { transform: translateX(4px) scale(.99); transition-duration: .08s; }
.text-link span,
.light-link span { transition: transform .3s var(--spring); }
.text-link:hover span,
.light-link:hover span { transform: translate(2px, -2px); }

/* Mobile navigation and header density. */
@media (max-width: 760px) {
  .header-actions { gap: 4px; }
  .collection-trigger { padding: 5px 6px; gap: 4px; }
  .collection-mark { font-size: 15px; }
  .collection-count { min-width: 15px; padding: 1px 3px; }
  .language-toggle { padding: 6px; min-width: 34px; }
  .search-trigger {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }
  .search-trigger::before {
    content: "⌕";
    font: 17px/1 var(--sans);
    letter-spacing: 0;
  }
  .search-trigger .arrow { display: none; }
  .search-trigger span:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .menu-toggle {
    width: 34px;
    height: 34px;
    margin-right: 4px;
    margin-left: 0;
  }
  .wordmark { font-size: 15px; }
  .main-nav.is-open {
    box-shadow: 0 22px 40px #1e1e1b16;
  }
  .nav-link {
    width: 100%;
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
  }
  .nav-link:last-child { border-bottom: 0; }
  .nav-link.is-active {
    background: #fffdf8;
    padding-left: 14px;
  }
  .nav-link.is-active::after { left: auto; right: 12px; bottom: 50%; }
  .library-actions .solid-button,
  .library-actions .ghost-button { min-height: 42px; padding: 11px 13px; }
  .scan-row { min-height: 52px; }
  .scan-row input { width: 19px; height: 19px; }
  .row-button { min-width: 34px; min-height: 32px; }
}

/* On touch, the cover arrow is permanent so records look openable. */
@media (hover: none) {
  .cover-open {
    opacity: 1;
    transform: none;
    background: #1e1e1bcc;
  }
  .cover-button::after {
    background: linear-gradient(180deg, transparent 45%, #1111112e);
  }
  .record-card:active { transform: scale(.985); transition-duration: .08s; }
}

/* Generous, obvious touch targets. */
@media (pointer: coarse) {
  .menu-toggle,
  .collection-trigger,
  .language-toggle,
  .search-trigger,
  .nav-link,
  .ghost-button,
  .solid-button,
  .add-audio-button,
  .text-link,
  .light-link,
  .dialog-close { min-height: 44px; }
  .collection-trigger,
  .language-toggle,
  .search-trigger { display: inline-flex; align-items: center; }
  .dialog-close { min-width: 44px; }
}

/* --------------------------------------------------------------------------
   HEADER REFINEMENT — editorial utility rail instead of boxed controls.
   -------------------------------------------------------------------------- */
.site-header {
  border-bottom-color: #d5d0c5;
}
.header-actions {
  gap: 0;
  border-left: 1px solid var(--line);
  align-items: stretch;
}
.header-actions > * + * {
  border-left: 1px solid var(--line);
}
.collection-trigger,
.language-toggle,
.search-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-height: 44px;
  padding: 0 15px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #6f6c64;
  transform: none;
}
.collection-trigger {
  gap: 7px;
}
.collection-trigger:hover,
.collection-trigger:focus-visible,
.language-toggle:hover,
.language-toggle:focus-visible,
.search-trigger:hover,
.search-trigger:focus-visible {
  color: var(--ink);
  background: #eeece5;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}
.collection-trigger::after,
.language-toggle::after,
.search-trigger::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .26s var(--spring);
}
.collection-trigger:hover::after,
.collection-trigger:focus-visible::after,
.language-toggle:hover::after,
.language-toggle:focus-visible::after,
.search-trigger:hover::after,
.search-trigger:focus-visible::after {
  transform: scaleX(1);
}
.collection-trigger:active,
.language-toggle:active,
.search-trigger:active {
  background: #e6e1d7;
  transform: none;
}
.collection-mark {
  font-size: 14px;
  color: var(--accent);
}
.collection-label {
  color: inherit;
  font: 8px var(--mono);
  letter-spacing: .08em;
}
.collection-count {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: 8px var(--mono);
}
.collection-trigger.is-active .collection-count {
  background: transparent;
  color: var(--accent);
}
.language-toggle {
  min-width: 42px;
  font: 8px var(--mono);
  letter-spacing: .04em;
}
.search-trigger {
  gap: 10px;
}
.search-trigger .arrow {
  margin-left: 0;
  color: var(--accent);
}
.menu-toggle {
  order: 4;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0 0 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: #eeece5;
  border-color: transparent;
}
.menu-toggle:active {
  background: #e6e1d7;
  transform: scale(.92);
}
.menu-toggle span {
  width: 20px;
  height: 1px;
  background: var(--ink);
}
.menu-toggle:hover span {
  width: 20px;
  background: var(--accent);
}
.header-actions {
  order: 3;
}
.nav-link {
  color: #6f6c64;
  font-size: 9px;
  letter-spacing: .11em;
}
.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
  color: var(--ink);
}
.nav-link.is-active::after {
  left: 0;
  right: 0;
  bottom: 2px;
  width: auto;
  height: 1px;
  border-radius: 0;
  background: var(--accent);
  transform: none;
}
@media (hover: hover) {
  .nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .26s var(--spring);
  }
  .nav-link:hover::before,
  .nav-link:focus-visible::before {
    transform: scaleX(1);
  }
  .nav-link.is-active::before { display: none; }
}
@media (max-width: 1050px) {
  .collection-label { display: none; }
  .collection-trigger { padding: 0 10px; }
}
@media (max-width: 760px) {
  .site-header {
    gap: 0;
  }
  .header-actions {
    margin-left: auto;
    border-left: 1px solid var(--line);
  }
  .header-actions > * + * {
    border-left: 1px solid var(--line);
  }
  .collection-trigger,
  .language-toggle,
  .search-trigger {
    padding: 0 8px;
    height: 44px;
  }
  .collection-trigger { gap: 4px; }
  .collection-mark { font-size: 14px; }
  .collection-count { font-size: 7px; }
  .language-toggle { min-width: 36px; }
  .search-trigger {
    width: 40px;
    min-width: 40px;
    padding: 0;
    font-size: 0;
  }
  .search-trigger::before {
    content: "⌕";
    font: 18px/1 var(--sans);
  }
  .search-trigger .arrow { display: none; }
  .search-trigger span:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .menu-toggle {
    width: 44px;
    height: 44px;
    margin-left: 0;
  }
  .menu-toggle span { width: 19px; }
  .wordmark { font-size: 15px; }
  .header-actions .collection-trigger::after,
  .header-actions .language-toggle::after,
  .header-actions .search-trigger::after {
    left: 8px;
    right: 8px;
  }
}

/* Keep the home/discover player visually aligned with the library player. */
.player-library-link {
  color: var(--accent);
  font: 7px var(--mono);
  letter-spacing: .08em;
  text-decoration: none;
  white-space: nowrap;
}
.player-library-link:hover,
.player-library-link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.player-bar .volume-value {
  min-width: 30px;
  color: var(--accent);
  font: 7px var(--mono);
  text-align: right;
}
.player-bar .volume-wrap input { width: 72px; }
.player-bar .player-tools { gap: 8px; }
.player-bar .add-audio-button { min-height: 32px; }

@media (max-width: 760px) {
  .player-library-link { display: none; }
  .player-bar .volume-wrap input { width: 64px; }
  .player-bar .volume-value { min-width: 26px; }
  .player-bar .player-tools { gap: 6px; }
  .player-bar .add-audio-button { min-height: 30px; padding: 0 7px; font-size: 6px; }
}
html[lang="zh-CN"] .global-player-tab,
html[lang="zh-CN"] .global-drawer-tabs button,
html[lang="zh-CN"] .global-lyrics-save,
html[lang="zh-CN"] .global-queue-main {
  font-family: var(--sans);
  letter-spacing: 0;
}
html[lang="zh-CN"] .global-player-tab { font-size: 8px; }
html[lang="zh-CN"] .global-drawer-tabs button { font-size: 9px; }
html[lang="zh-CN"] .global-queue-main { font-size: 12px; }

/* Global (home / discover) player drawer and compact session controls. */
.global-player-tab {
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.35);
  color: var(--ink);
  font: 6px var(--mono);
  letter-spacing: .06em;
  cursor: pointer;
}
.global-player-tab:hover, .global-player-tab:focus-visible { border-color: var(--accent); color: var(--accent); }
.player-library-link { display: none; }
.global-player-drawer {
  position: fixed;
  z-index: 45;
  right: 5.55%;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  width: min(430px, calc(100% - 24px));
  max-height: min(56vh, 500px);
  display: flex;
  flex-direction: column;
  border: 1px solid #cfc8bc;
  background: #fbf9f3f7;
  box-shadow: 0 24px 70px #1f1d182e;
  backdrop-filter: blur(18px);
}
.global-player-drawer[hidden] { display: none; }
.global-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.global-drawer-tabs { display: flex; gap: 4px; }
.global-drawer-tabs button {
  padding: 8px 7px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 7px var(--mono);
  letter-spacing: .06em;
  cursor: pointer;
}
.global-drawer-tabs button.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.global-drawer-close { width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font: 20px var(--serif); cursor: pointer; }
.global-drawer-close:hover { color: var(--accent); }
.global-drawer-body { overflow: auto; padding: 8px 12px 12px; min-height: 90px; }
.global-drawer-empty { margin: 0; padding: 18px 0; color: var(--muted); font: 11px/1.6 var(--sans); }
.global-queue-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.global-queue-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 10px 0; border: 0; background: transparent; color: var(--ink); text-align: left; font: 11px var(--sans); cursor: pointer; }
.global-queue-main span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-queue-main span:last-child { margin-left: auto; color: var(--muted); font: 7px var(--mono); }
.global-queue-main.is-current { color: var(--accent); font-weight: 600; }
.global-queue-remove { width: 30px; height: 34px; border: 0; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.global-queue-remove:hover { color: #8d3d2e; }
.global-lyrics-meta { padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.global-lyrics-meta strong { display: block; font: 500 12px/1.3 var(--sans); }
.global-lyrics-meta span { display: block; margin-top: 3px; color: var(--muted); font: 9px var(--sans); }
.global-lyrics-input { width: 100%; min-height: 160px; margin-top: 10px; padding: 9px; resize: vertical; border: 1px solid var(--line); background: #fffdf8; color: var(--ink); font: 12px/1.55 var(--sans); }
.global-lyrics-save { margin-top: 8px; padding: 9px 11px; border: 1px solid var(--accent); background: var(--accent); color: var(--paper); font: 7px var(--mono); letter-spacing: .06em; cursor: pointer; }
.global-lyrics-note { margin: 8px 0 0; color: var(--muted); font: 9px/1.5 var(--sans); }

@media (max-width: 760px) {
  body { padding-bottom: 220px; }
  .player-bar {
    min-height: 206px;
    padding: 9px 5%;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px;
  }
  .player-track { grid-column: 1; grid-row: 1; padding-right: 0; }
  .player-controls { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
  .player-tools {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
  }
  .player-quality, .player-library-link { display: none; }
  .volume-wrap { display: flex; gap: 5px; }
  .player-bar .volume-wrap input { width: 58px; }
  .volume-value { display: inline-block; min-width: 25px; font-size: 7px; }
  .global-player-tab { min-height: 34px; padding: 0 6px; font-size: 6px; }
  .add-audio-button { padding: 0 7px; font-size: 6px; min-height: 34px; }
  .global-player-drawer { right: 10px; bottom: calc(198px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 20px); max-height: 52vh; }
  .toast { bottom: 220px; }
}

/* Shared transport icons: SVG avoids font-baseline drift across Android,
   Windows and mobile browsers. */
.player-icon,
.play-button {
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.transport-icon {
  display: block;
  width: 17px;
  height: 17px;
  fill: currentColor;
  pointer-events: none;
}
.player-icon .icon-stop { width: 13px; height: 13px; }
.play-button .transport-icon { width: 15px; height: 15px; }
.play-button .icon-play { margin-left: 1px; }
.play-button .icon-pause { display: none; }
.play-button.is-playing .icon-play { display: none; }
.play-button.is-playing .icon-pause { display: block; }
.preview-player-bar .player-icon .transport-icon { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .player-controls { grid-template-columns: 140px minmax(0, 1fr); gap: 10px; }
  .control-buttons { gap: 10px; }
  .player-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
  }
  .play-button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
  .transport-icon { width: 18px; height: 18px; }
  .play-button .transport-icon { width: 16px; height: 16px; }
  .player-icon .icon-stop { width: 14px; height: 14px; }
}

/* Respect reduced motion: keep the clarity, remove the bounce. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
