:root {
  --bg: #0e0f12;
  --card: #181a20;
  --card-hover: #21242d;
  --surface-1: #121318;
  --surface-2: #181a20;
  --surface-3: #22252e;
  --surface-4: #2d313d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --highlight: rgba(255, 255, 255, 0.06);
  --radius-panel: 18px;
  --player-left: 0;
  --player-right: 0;
  --player-max-width: none;
  --text: #f3f5f8;
  --muted: #9aa2b1;
  --accent: #F8DF94;
  --accent-dim: rgba(248, 223, 148, 0.16);
  --accent-dark: #8A6D2D;
  --accent-surface: #FFF5DA;
  --accent-border: #DFC171;
  --accent-track: #EEEADD;
  --border: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

.auth-gate {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  z-index: 1000;
}
.auth-lang.lang-switch {
  position: absolute !important;
  top: calc(20px + env(safe-area-inset-top, 0px)) !important;
  right: calc(24px + env(safe-area-inset-right, 0px)) !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 1001 !important;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 22px;
  max-width: 340px;
  text-align: center;
}
.auth-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-card code { background: rgba(255,255,255,.1); padding: 2px 6px; border-radius: 6px; color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.auth-form input { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; color: var(--text); font-size: 14px; text-align: center; }
.auth-gate-error {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
.auth-tg-note-wrap {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  opacity: 0.75;
}

.app-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

html.has-token #appShell {
  display: flex !important;
}
@media (max-width: 899px) {
  html.has-token #appShell {
    flex-direction: column !important;
  }
}
@media (min-width: 900px) {
  html.has-token #appShell {
    flex-direction: row !important;
  }
}
html.has-token #authGate {
  display: none !important;
}

.topbar {
  flex: none;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand-ico { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--card);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.user-badge:hover { color: var(--text); border-color: var(--accent); }
.user-badge[aria-expanded="true"] { color: var(--text); border-color: var(--accent); background: var(--card-hover); }
.user-badge-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px 2px 2px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.mobile-avatar-btn:hover {
  background: var(--surface-4);
  border-color: rgba(255, 255, 255, 0.22);
}
.user-avatar-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #0c0d11;
  font-weight: 700;
  font-size: 11px;
  display: grid;
  place-items: center;
  text-transform: uppercase;
  flex: none;
}
#userMenu {
  width: 200px;
  padding: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}
#userMenu .menu-user-profile {
  padding: 4px 8px 3px;
  font-size: 12px;
}
#userMenu .menu-sp-btn {
  padding: 6px 8px;
  gap: 8px !important;
}
#userMenu .menu-sp-btn svg {
  width: 16px;
  height: 16px;
}
#userMenu .menu-sp-label {
  font-size: 11.5px;
}
#userMenu .menu-sp-val {
  font-size: 10px;
}
#userMenu .menu-sec-label {
  padding: 4px 8px 2px;
  font-size: 10px;
}
#userMenu button {
  padding: 7px 8px;
  font-size: 12px;
}
.user-chev { transition: transform 0.16s ease; opacity: 0.8; flex: none; }
.user-badge[aria-expanded="true"] .user-chev { transform: rotate(180deg); }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.lang-switch { position: relative; flex: none; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.lang-btn:hover { border-color: var(--accent); }
.lang-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--card-hover); }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 148px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #1a1c22;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.lang-menu.up { top: auto; bottom: calc(100% + 6px); right: auto; left: 0; }
.lang-menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.lang-menu button[data-lang] {
  justify-content: space-between;
}
.lang-menu button:hover { background: var(--card-hover); }
.lang-menu button.active { color: var(--accent); }
.lang-menu button.active::after { content: "✓"; font-size: 12px; }

#btnOpenShortcuts {
  display: none !important;
}
@media (min-width: 900px) {
  #btnOpenShortcuts {
    display: flex !important;
  }
}

.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
  -webkit-overflow-scrolling: touch;
}

.tab-view { display: none; }
.tab-view.active {
  display: block;
  animation: tabIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes tabIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.sec-title {
  margin: 18px 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 10px;
}
.sec-head .sec-title { margin: 0; }
.sec-acts { display: flex; align-items: center; gap: 6px; }
.sec-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 99px;
  cursor: pointer;
}
.sec-add-btn.ghost { color: var(--text); }
.add-url-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.add-url-form input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.add-url-form input:focus { border-color: var(--accent); }

.sub-tutorial {
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
}
.sub-tutorial img {
  display: block;
  width: auto;
  height: auto;
  aspect-ratio: 1400 / 983;
  max-width: 100%;
  max-height: 40vh;
  margin: 0 auto;
  background: #0e0f12;
}
.sub-tutorial-cap {
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
#addUrlBackdrop .action-sheet {
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.import-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.import-sep::before,
.import-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
#btnImportCsvModal {
  justify-content: center;
  gap: 7px;
}
.empty-tutorial {
  margin: 14px 0 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}
.empty-tutorial img {
  display: block;
  width: 100%;
  aspect-ratio: 1400 / 983;
  height: auto;
}
.empty-tutorial-cap {
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.quick-card,
.pl-card,
.alb-card,
.trk-row {
  transition: background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}
.pill-btn,
.dl-circle,
.icon-act,
.mp-btn,
.mp-icon-btn,
.play-disc,
.np-ctrl,
.np-icon-btn,
.as-btn,
.as-cancel,
.tab-btn,
.btn-go {
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}
.pill-btn:active,
.dl-circle:active,
.icon-act:active,
.mp-btn:active,
.np-ctrl:active,
.np-icon-btn:active,
.as-btn:active,
.as-cancel:active,
.tab-btn:active,
.btn-go:active {
  transform: scale(0.96);
}

#tab-home > .sec-head:first-child { margin-top: 2px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.quick-card {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 10px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  min-width: 0;
}
.accent-dw { background: linear-gradient(135deg, #1b2838, #181a20); }
.accent-rr { background: linear-gradient(135deg, #2b1d34, #181a20); }
.qc-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--text);
}
.accent-dw .qc-ico { color: #6ec1ff; background: rgba(110, 193, 255, 0.14); }
.accent-rr .qc-ico { color: #d896ff; background: rgba(216, 150, 255, 0.14); }
.qc-title { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-list { display: flex; flex-direction: column; gap: 8px; }
.pl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.pl-thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #262933; flex: none; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--muted); }
.chev { color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pl-meta { flex: 1; min-width: 0; }
.pl-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.sub-playlists-wrap { width: 100%; box-sizing: border-box; }
.sub-section-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 14px 0 8px 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sub-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}
.sub-pl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  min-height: 58px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.sub-pl-card:active {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(0.985);
}
.sub-pl-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 214, 0, 0.12);
  color: #ffd600;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
@media (min-width: 640px) {
  .sub-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}
@media (min-width: 1024px) {
  .sub-cards-grid {
    gap: 12px;
  }
}

.search-box {
  position: relative;
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.search-box.compact { margin: 10px 0; }
.search-box input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.search-box input:focus { border-color: var(--accent); }
.btn-go {
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  background: var(--accent);
  color: #3b2f0e;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-hint { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.live-sec { margin-bottom: 20px; }
.live-sec:last-child { margin-bottom: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 0;
  font-size: 13.5px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
}
.chip-main {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 8px 8px 8px 15px;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-x {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px 11px 8px 4px;
  display: inline-flex;
  align-items: center;
}
.chip-x:hover, .chip-x:active { color: var(--text); }
.chip:not(.chip-rem) { padding: 8px 15px; }
.chip:active { border-color: var(--accent); color: var(--accent); }

.pl-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  min-height: 120px;
}
.pl-tile:active { border-color: var(--accent); }
.pl-tile-ico {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #3b2f0e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.pl-tile-txt { font-size: 12.5px; color: var(--muted); }

.artist-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ar-card {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: center;
  color: var(--text);
  min-width: 0;
}
.ar-picw { position: relative; width: 100%; padding-bottom: 100%; border-radius: 50%; overflow: hidden; background: #262933; }
.ar-pic { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.ar-name { font-size: 12.5px; font-weight: 500; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-cov-round { border-radius: 50% !important; }

.album-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.alb-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  color: var(--text);
  min-width: 0;
}
.alb-covw { position: relative; width: 100%; padding-bottom: 100%; border-radius: 8px; overflow: hidden; background: #262933; }
.alb-cover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.pl-provider { position: absolute; right: 5px; bottom: 5px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 6px; box-shadow: 0 1px 4px #0008; }
.pl-provider img { width: 16px; height: 16px; }
.pl-provider-sp { background: #121212; }
.pl-provider-dz { background: #6806cf; }
.pl-provider-yt { background: #e62117; }
.pl-provider-apple { background: #8727cd; }
.alb-t { font-weight: 600; font-size: 13px; margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alb-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.track-list { display: flex; flex-direction: column; gap: 6px; }
.trk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  background: var(--card);
  border: 1px solid transparent;
}
.trk-row.playing {
  border-color: rgba(248, 223, 148, 0.55);
  background: linear-gradient(90deg, rgba(248, 223, 148, 0.24) 0%, rgba(248, 223, 148, 0.09) 100%);
}
.trk-row.playing .trk-t { color: var(--accent); }
@keyframes rowJumpPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(248, 223, 148, 0.75);
    background-color: rgba(248, 223, 148, 0.35);
  }
  45% {
    box-shadow: 0 0 0 6px rgba(248, 223, 148, 0);
    background-color: rgba(248, 223, 148, 0.22);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(248, 223, 148, 0);
  }
}
.trk-row.row-jump-highlight {
  animation: rowJumpPulse 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.trk-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.trk-thumb-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  overflow: hidden;
  background: #262933;
  flex: none;
}
.trk-cov {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  object-fit: cover;
  background: #262933;
  display: block;
  transition: opacity 0.16s ease;
}
.trk-row.playing .trk-cov { opacity: 0; }
.trk-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 223, 148, 0.22);
  color: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.trk-row.playing .trk-play-badge { opacity: 1; }
.trk-txt { flex: 1; min-width: 0; }
.trk-t {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trk-a { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.js-album-artist {
  cursor: pointer;
  transition: color 0.15s ease, opacity 0.15s ease;
}
.js-album-artist:hover {
  color: var(--text);
  text-decoration: underline;
}
#mpArtist, #npSub, #asSub.as-sub-link {
  cursor: pointer;
}
#mpArtist:hover, #npSub:hover, #asSub.as-sub-link:hover {
  text-decoration: underline;
  color: var(--text);
}
.trk-acts { display: flex; gap: 4px; flex: none; }
.icon-act {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-act.active { background: var(--accent-dim); color: var(--accent); }

/* Podcast Episode Card (Spotify-style multi-line wrap & layout) */
.trk-row.pod-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  box-sizing: border-box;
}

.trk-row.pod-card.playing {
  border-color: rgba(248, 223, 148, 0.45);
  background: linear-gradient(180deg, rgba(248, 223, 148, 0.12) 0%, rgba(24, 26, 32, 0.98) 100%);
}

.pod-main {
  display: flex;
  flex-direction: column;
  width: 100%;
  cursor: pointer;
  min-width: 0;
}

.pod-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.pod-thumb-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: #262933;
}

.pod-cov {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pod-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 223, 148, 0.22);
  color: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.trk-row.pod-card.playing .pod-play-badge {
  opacity: 1;
}

.pod-title {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.32;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trk-row.pod-card.playing .pod-title {
  color: var(--accent);
}

.pod-desc {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pod-meta {
  margin-top: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pod-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 2px;
}

.pod-acts {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pod-acts .icon-act {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.pod-acts .icon-act:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.pod-acts .icon-act.saved {
  color: var(--accent);
}

.pod-play-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  flex: none;
  background: #ffffff;
  color: #121212;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  margin-left: auto;
}

.pod-play-circle svg {
  display: block;
}

.pod-play-circle:not(.playing) svg {
  margin-left: 2px;
}

.pod-play-circle:hover {
  transform: scale(1.06);
}

.pod-play-circle:active {
  transform: scale(0.96);
}

.trk-row.pod-card.playing .pod-play-circle {
  background: var(--accent);
  color: #1e1706;
}

.pod-card .ms-check {
  display: none;
}

.track-list.selecting .pod-card .pod-acts .icon-act,
.track-list.selecting .pod-card .pod-play-circle {
  display: none;
}

.track-list.selecting .pod-card .ms-check {
  display: inline-flex;
}

@media (max-width: 480px) {
  .trk-row.pod-card {
    padding: 10px 12px;
  }
  .pod-thumb-wrap {
    width: 48px;
    height: 48px;
  }
  .pod-title {
    font-size: 14px;
  }
  .pod-desc {
    font-size: 12px;
  }
  .pod-acts .icon-act {
    width: 30px;
    height: 30px;
  }
  .pod-play-circle {
    width: 32px;
    height: 32px;
  }
}

.shazam-box { display: flex; flex-direction: column; align-items: center; padding: 28px 12px; text-align: center; }
.shazam-orb {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 2px solid rgba(248, 223, 148, 0.45);
  background: radial-gradient(circle, rgba(248, 223, 148, 0.25), #151922 70%);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.shazam-orb.rec {
  animation: pulse 1.2s infinite;
  border-color: #ff4f6d;
  background: radial-gradient(circle, rgba(255, 79, 109, 0.3), #1c151b 70%);
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.orb-ico { font-size: 42px; }
.orb-lbl { font-size: 13px; font-weight: 700; }
.shazam-hint { font-size: 13px; color: var(--muted); max-width: 280px; margin-top: 16px; line-height: 1.4; }
.shazam-result { width: 100%; margin-top: 18px; text-align: left; }
.shz-history-section {
  width: 100%;
  max-width: 680px;
  margin-top: 28px;
  text-align: left;
}
.shz-history-section .sec-head {
  margin-bottom: 10px;
}

.detail-sticky-bar {
  position: sticky;
  top: -14px;
  z-index: 15;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  gap: 8px;
  margin: -14px -16px 8px;
  padding: 8px 16px;
  background: rgba(14, 15, 18, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.detail-sticky-bar.scrolled {
  background: rgba(14, 15, 18, 0.95);
  border-bottom-color: var(--border);
}
.detail-sticky-title {
  text-align: center;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.detail-sticky-bar.scrolled .detail-sticky-title {
  opacity: 1;
  transform: translateY(0);
}
.back-btn {
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  padding: 6px 8px 6px 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.detail-header { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.podcast-head-text { flex: 1; min-width: 0; }
.podcast-save-btn { flex: none; }
.podcast-save-btn.done { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
@media (max-width: 420px) {
  .podcast-save-btn span { display: none; }
  .podcast-save-btn { padding: 9px 11px; }
}
.detail-cov { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: #262933; flex: none; }
.detail-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.pill-btn {
  padding: 9px 16px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.pill-btn.primary { background: var(--accent); color: #3b2f0e; border-color: var(--accent); }
.dl-circle {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
}
.dl-circle.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #3b2f0e;
}
.dl-circle.busy {
  border-color: var(--accent);
  color: var(--accent);
}
.dl-circle.busy.queued {
  border-color: var(--border);
  color: var(--sub);
  background: var(--card);
}
.dl-circle.busy.queued svg {
  color: var(--sub);
}
.icon-act.saved { background: transparent; color: var(--accent); }
.icon-act.js-like.saved svg {
  width: 20px;
  height: 20px;
  padding: 3.5px;
  border-radius: 50%;
  background: var(--accent);
  color: #3b2f0e;
  stroke-width: 3;
}

.trk-row .ms-check { display: none; }
.track-list.selecting .trk-row .js-like,
.track-list.selecting .trk-row .js-more,
.track-list.selecting .trk-row .js-share,
.track-list.selecting .trk-row .js-save-ep,
.track-list.selecting .trk-row .js-off-ep { display: none; }
.track-list.selecting .trk-row .ms-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #3b2f0e;
  flex: none;
  cursor: pointer;
  margin-right: 4px;
}
.track-list.selecting .trk-row {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.track-list.selecting .trk-row.selected {
  background: rgba(248, 223, 148, 0.14);
}
.track-list.selecting {
  padding-bottom: 60px;
}
.track-list.selecting .trk-row.selected .ms-check {
  background: var(--accent);
  border-color: var(--accent);
}

/* Playlist Reorder Mode */
.track-list.reordering,
.card-list.reordering {
  padding-bottom: 70px;
}
.card-list.reordering {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px;
}
.reorder-row,
.pl-reorder-row {
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  position: relative;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.reorder-row.dragging,
.pl-reorder-row.dragging {
  opacity: 0.35;
  background: rgba(248, 223, 148, 0.1);
  border: 1px dashed var(--accent);
  cursor: grabbing;
}
.reorder-row.drag-over,
.pl-reorder-row.drag-over {
  border-color: var(--accent);
  background: rgba(248, 223, 148, 0.14);
}
.reorder-row.longpress-active,
.pl-reorder-row.longpress-active {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border-color: var(--accent);
  z-index: 50;
}
.reorder-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  width: 24px;
  text-align: center;
  flex: none;
}
.reorder-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.reorder-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: background 0.14s ease, transform 0.12s ease;
}
.reorder-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}
.reorder-btn:active:not(:disabled) {
  transform: scale(0.92);
}
.reorder-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.reorder-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}
.reorder-handle:hover {
  color: var(--accent);
}
.reorder-handle:active {
  cursor: grabbing;
}
.ms-bar {
  flex: none;
  margin: 4px 10px 0;
  padding: 8px 12px;
  background: rgba(27, 30, 39, 0.98);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 22;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.ms-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ms-right { display: flex; align-items: center; gap: 8px; flex: none; }
.ms-icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ms-count { font-size: 13px; font-weight: 700; white-space: nowrap; }
.ms-act-btn { padding: 7px 14px; font-size: 12.5px; cursor: pointer; }
.ms-act-btn:disabled { opacity: 0.4; cursor: default; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}
.pager-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}
.pager-btn:disabled { opacity: 0.35; }
.pager-info { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Island Container & Player Bar (adapted from musike)
   ========================================================================== */
.island {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  padding: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.island-core {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  height: 100%;
}

.mini-player {
  position: relative;
  flex: none;
  margin: 6px 10px;
  z-index: 25;
  animation: miniIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes miniIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mp-core {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 8px;
  position: relative;
  overflow: hidden;
  min-height: 56px;
}

/* Left: Track Info */
.mp-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.mp-swipe-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.mp-swipe-track {
  display: flex;
  width: 100%;
  transform: translate3d(-100%, 0, 0);
  will-change: transform;
}
.mp-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  overflow: hidden;
}
.mp-slide-prev,
.mp-slide-next {
  opacity: 0.85;
}
.mp-art-btn {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.mp-art-btn:hover { transform: scale(1.04); }
.mp-art-btn:active { transform: scale(0.96); }

.mp-cover {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.mp-meta { min-width: 0; flex: 1; }
.mp-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  line-height: 1.35;
}
.mp-artist {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  cursor: default;
  pointer-events: none;
}
.mp-artist.loading { color: var(--accent); }

/* PlayDisc: Solid Accent Disc (from musike) */
.play-disc {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #0b0c0f;
  border: 0;
  padding: 0;
  cursor: pointer;
  flex: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease;
}
.play-disc:hover { transform: scale(1.06); }
.play-disc:active { transform: scale(0.94); }
.play-disc .spin {
  width: 17px;
  height: 17px;
  border-width: 2.5px;
  border-color: #0b0c0f;
  border-top-color: transparent;
}

/* Icon Buttons: circular with hover and active dots */
.mp-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 0;
  cursor: pointer;
  flex: none;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease, background-color 0.15s ease;
}
.mp-icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}
.mp-icon-btn:active { transform: scale(0.92); }
.mp-icon-btn.active {
  color: var(--accent);
}
.mp-icon-btn.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.mp-icon-btn.mp-like.active {
  color: var(--accent);
}
.mp-icon-btn.repeat-one svg text,
.np-ctrl.repeat-one svg text,
.btn-icon.repeat-one svg text {
  fill: currentColor;
  stroke: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 800;
}
.mp-icon-btn.mp-like.active::after {
  display: none;
}

/* Mobile Controls */
.mp-mobile-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.mp-mobile-play {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.mp-mobile-play:hover { background: rgba(255, 255, 255, 0.14); }

/* Center: Transport & Scrubber */
.mp-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mp-transport {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mp-scrubber {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.mp-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  user-select: none;
}
#mpCur { text-align: right; }
#mpDur { text-align: left; }

/* Custom Sliders: Seek & Volume (from musike) */
.mp-slider {
  position: relative;
  flex: 1;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}
.mp-slider-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 9999px;
  background: var(--surface-4);
  overflow: hidden;
  transition: height 0.16s ease;
}
.mp-slider:hover .mp-slider-track,
.mp-slider.dragging .mp-slider-track {
  height: 6px;
}
.mp-slider-buffer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  pointer-events: none;
}
.mp-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: #ffffff;
  border-radius: 9999px;
  pointer-events: none;
  transition: background-color 0.15s ease;
}
.mp-slider:hover .mp-slider-fill,
.mp-slider.dragging .mp-slider-fill {
  background: var(--accent);
}
.mp-slider-thumb {
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.mp-slider:hover .mp-slider-thumb,
.mp-slider.dragging .mp-slider-thumb {
  opacity: 1;
}
.mp-slider-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

/* Right: Actions & Volume */
.mp-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.mp-vol-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
}
.mp-vol-slider {
  width: 84px;
  flex: none;
}

/* Spinner */
.spin {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.75s linear infinite;
}
.np-ctrl.main { display: flex; align-items: center; justify-content: center; }
.np-ctrl.main .spin { width: 22px; height: 22px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile progress bar */
.mp-progress { position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; transition: height 0.18s ease; }
.mp-progress.dl { height: 3.5px; background: rgba(56, 189, 248, 0.18); }
.mp-progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.24s ease; }
.mp-progress-fill.dl {
  background: linear-gradient(90deg, #38bdf8, #F8DF94, #38bdf8);
  background-size: 200% 100%;
  animation: dlShimmer 1.2s linear infinite;
}
@keyframes dlShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: 0% 0; }
}

.tabbar {
  flex: none;
  padding: 8px 8px max(10px, env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 25;
}
.tab-btn {
  border: 0;
  background: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 18px;
}
.tab-btn small { font-size: 10.5px; font-weight: 600; }
.tab-btn.active { color: var(--accent); }
.tab-btn.active svg { transform: translateY(-1px); transition: transform 0.18s ease; }

.np-sheet {
  position: fixed;
  inset: 0;
  background-color: #0e0f12;
  background-image: linear-gradient(180deg, var(--np-glow, #1b222c) 0%, #0e0f12 66%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, visibility 0s linear 0s;
}
.np-sheet.hidden {
  display: flex !important;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease, visibility 0s linear 0.34s;
}
.np-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.np-handle {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.24);
  margin: 0 auto 10px;
  flex: none;
}
.np-icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  background: rgba(255,255,255,.08);
  color: var(--text);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.np-context {
  min-width: 0;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: transparent;
  border: 0;
  padding: 5px 12px;
  margin: 0;
  font-family: inherit;
  line-height: inherit;
  border-radius: 999px;
  cursor: default;
  transition: color 0.15s, background-color 0.15s, transform 0.15s;
}
.np-context.is-clickable {
  cursor: pointer;
}
.np-context.is-clickable:hover {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.09);
}
.np-context.is-clickable:active {
  transform: scale(0.97);
}
.np-art-wrap { display: flex; justify-content: center; margin: 22px 0; }
.np-cover-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  padding: 12px 0 32px;
  margin: -12px 0 -32px;
  cursor: grab;
}
.np-cover-viewport:active {
  cursor: grabbing;
}
.np-cover-viewport.hidden {
  display: none !important;
}
.np-cover-track {
  display: flex;
  width: 100%;
  transform: translate3d(-100%, 0, 0);
  will-change: transform;
}
.np-cover-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.np-cover-slide-prev .np-cover,
.np-cover-slide-next .np-cover {
  opacity: 0.82;
  transform: scale(0.92);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.np-cover-slide-current .np-cover {
  opacity: 1;
  transform: scale(1);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.np-cover {
  width: min(76vw, 310px);
  height: min(76vw, 310px);
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(0,0,0,.55);
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.np-sheet.hidden .np-cover { transform: scale(0.92) !important; }
.np-title { font-size: 21px; font-weight: 800; }
.np-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
  cursor: pointer;
}
.np-sub:hover {
  text-decoration: underline;
  color: var(--text);
}
.np-info-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.np-info-txt { min-width: 0; flex: 1; }
.np-info-txt .np-title,
.np-info-txt .np-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-like-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  cursor: pointer;
}
.np-like-btn.saved {
  background: var(--accent);
  border-color: var(--accent);
  color: #3b2f0e;
}
.np-seek-wrap { margin: 18px 0 8px; }
.np-seek-wrap input { width: 100%; accent-color: var(--accent); touch-action: none; -webkit-tap-highlight-color: transparent; }
.np-seek-wrap input.dl { accent-color: #38bdf8; }
.np-times { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.np-controls { display: flex; align-items: center; justify-content: space-between; margin: 14px 8px 22px; }
.np-ctrl {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.np-ctrl.sm { color: var(--muted); }
.np-ctrl.sm.active { color: var(--accent); }
.np-ctrl.main { width: 66px; height: 66px; background: var(--text); color: #0e0f12; }
.np-q-head { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }

.toast {
  position: fixed;
  left: 50%;
  transform: translate(-50%, 0);
  bottom: calc(134px + env(safe-area-inset-bottom, 0px));
  background: rgba(30, 34, 46, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  z-index: 90;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: normal;
  max-width: min(440px, calc(100vw - 32px));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  word-break: break-word;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}
.toast.hidden {
  display: block !important;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.2s ease, visibility 0s linear 0.24s;
}

.off-dot {
  color: var(--accent);
  font-weight: 800;
  margin-right: 4px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.22s ease, visibility 0s linear 0s;
}
.sheet-backdrop.hidden {
  display: flex !important;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0s linear 0.28s;
}
.action-sheet {
  width: 100%;
  max-width: 520px;
  background: #1a1d24;
  border-top: 1px solid var(--border);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 10px 16px max(18px, env(safe-area-inset-bottom, 0px));
  transform: translateY(0);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.5);
}
.sheet-backdrop.hidden .action-sheet {
  transform: translateY(105%);
}
.as-handle {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 auto 12px;
}
.as-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.as-cov { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; background: #262933; }
.as-meta { flex: 1; min-width: 0; }
.as-t { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.as-actions { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.as-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.as-ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: none;
}
.as-btn.accent .as-ico { color: var(--accent); }
.as-btn.danger { color: #ff6b7a; }
.as-btn.danger .as-ico { color: #ff6b7a; }
.as-btn.accent { color: var(--accent); }
.as-cancel {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

/* Action Sheet Accordion for secondary actions */
#trackSheetBackdrop .action-sheet {
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.as-accordion {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 2px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.as-accordion[open] {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
.as-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  transition: color 0.16s ease;
}
.as-accordion-summary::-webkit-details-marker {
  display: none;
}
.as-accordion-summary:hover {
  color: var(--text);
}
.as-accordion-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.as-accordion-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.as-accordion[open] .as-accordion-arrow {
  transform: rotate(90deg);
}
.as-accordion-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 8px 10px 8px;
}
.as-accordion-content .as-btn {
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
  padding: 11px 12px;
}
.as-accordion-content .as-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Add Content Menu: Sheet on Mobile, Dropdown on Desktop */
.add-menu-panel {
  padding: 10px 16px max(18px, env(safe-area-inset-bottom, 0px));
}
.add-menu-head {
  margin-bottom: 12px;
}
.add-menu-head .as-t {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 3px;
}
.add-menu-head .as-s {
  font-size: 12px;
  color: var(--muted);
}
.add-menu-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.add-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.add-menu-row:hover,
.add-menu-row:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}
.add-menu-row:active {
  transform: scale(0.985);
}
.add-menu-row-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--accent);
  flex-shrink: 0;
}
.add-menu-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.add-menu-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.add-menu-row-sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 2px;
}

/* Desktop dropdown mode (viewport > 640px) */
@media (min-width: 641px) {
  .sheet-backdrop.add-menu-backdrop {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    transition: opacity 0.12s ease;
  }
  .add-menu-panel {
    position: fixed;
    width: 280px;
    max-width: 300px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
    z-index: 100;
    transform: translateY(0) scale(1) !important;
    transition: opacity 0.15s ease, transform 0.15s ease !important;
  }
  .sheet-backdrop.add-menu-backdrop.hidden .add-menu-panel {
    transform: translateY(-6px) scale(0.96) !important;
    opacity: 0 !important;
  }
  .add-menu-panel .as-handle,
  .add-menu-panel .add-menu-head,
  .add-menu-panel .as-cancel {
    display: none !important;
  }
  .add-menu-items {
    gap: 2px;
    margin-bottom: 0;
  }
  .add-menu-row {
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    gap: 10px;
  }
  .add-menu-row:hover,
  .add-menu-row:focus-visible {
    background: var(--card-hover);
  }
  .add-menu-row-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }
  .add-menu-row-ico svg {
    width: 15px;
    height: 15px;
  }
  .add-menu-row-title {
    font-size: 13px;
    font-weight: 500;
  }
  .add-menu-row-sub {
    display: none;
  }
}

@media (min-width: 768px) {
  .topbar {
    padding-left: max(24px, calc(50% - 410px));
    padding-right: max(24px, calc(50% - 410px));
  }
  .view-container {
    padding: 20px 24px 28px;
  }
  .detail-sticky-bar {
    top: -20px;
    margin: -20px -24px 10px;
    padding: 10px 24px;
  }
  .view-container > .tab-view {
    max-width: 820px;
    margin: 0 auto;
  }
  .album-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .artist-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .mini-player {
    max-width: 820px;
    width: calc(100% - 48px);
    margin: 8px auto;
  }
  .tabbar {
    padding-left: max(24px, calc(50% - 410px));
    padding-right: max(24px, calc(50% - 410px));
  }
  .np-sheet {
    padding-left: 24px;
    padding-right: 24px;
  }
  .np-top, .np-art-wrap, .np-info, .np-seek-wrap, .np-controls, .np-device-bar-wrap, .np-seg, .np-queue, .np-lyrics {
    width: 100%;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}

.detail-header.tinted {
  background: linear-gradient(135deg, var(--det-glow, rgba(255,255,255,0.04)) 0%, rgba(24,26,32,0.4) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}

.np-device-bar-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  margin: -8px auto 12px;
  padding: 0 2px;
  box-sizing: border-box;
}
.np-mode-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.np-mode-toggle-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.np-mode-toggle-btn:active {
  transform: scale(0.92);
}
.np-mode-toggle-btn.active {
  color: var(--accent);
}
.np-mode-toggle-btn svg {
  display: block;
}
.np-device-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: 99px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}
.np-device-pill:hover {
  background: rgba(248, 223, 148, 0.12);
}
.np-device-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.np-device-pill-icon svg {
  display: block;
}
.np-device-pill-label {
  display: inline-block;
  line-height: 1;
}

.np-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  width: 100%;
  margin: 0 auto 12px;
}
.np-seg-btn {
  border: 0;
  border-radius: 9px;
  padding: 8px 10px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.np-seg-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.np-lyrics {
  padding: 4px 2px 24px;
  min-height: 180px;
}
.np-lyrics-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lyr-src {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.lyr-line {
  font-size: 17px;
  line-height: 1.45;
  font-weight: 700;
  color: rgba(243, 245, 248, 0.42);
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}
.lyr-line.past { color: rgba(243, 245, 248, 0.34); }
.lyr-line.active {
  color: #ffffff;
  background: rgba(248, 223, 148, 0.12);
  transform: scale(1.01);
}
.lyr-word { color: rgba(255, 255, 255, 0.45); transition: color 0.1s ease; }
.lyr-word.lit { color: var(--accent); }
.lyr-plain {
  white-space: pre-line;
  font-size: 15.5px;
  line-height: 1.65;
  color: rgba(243, 245, 248, 0.85);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}
.stat-val { font-size: 20px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.stats-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
  height: 128px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px 10px;
  margin-bottom: 16px;
}
.stats-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.stats-bar-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.stats-bar {
  width: 72%;
  min-height: 4px;
  border-radius: 6px 6px 3px 3px;
  background: var(--accent);
  transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.stats-bar.zero { background: rgba(255, 255, 255, 0.1); }
.stats-day { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.stats-min { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* === Telegram-style Storage Management in Stats === */
.stats-nav-wrap {
  margin-bottom: 14px;
}
.stats-segmented-bar {
  display: flex;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  gap: 4px;
}
.stats-mobile-select-wrap {
  display: none;
  align-items: center;
  position: relative;
  width: 100%;
  background: var(--surface-1, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  height: 44px;
  box-sizing: border-box;
}
.stats-select-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-right: 10px;
  flex-shrink: 0;
}
.stats-mobile-select {
  flex: 1;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.stats-mobile-select option {
  background: #18181c;
  color: #fff;
}
.stats-select-arrow {
  pointer-events: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  margin-left: 8px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .stats-segmented-bar {
    display: none !important;
  }
  .stats-mobile-select-wrap {
    display: flex !important;
  }
}
.stats-segmented-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: none;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.stats-segmented-btn.active {
  background: var(--card-hover);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.storage-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 16px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.storage-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.storage-summary-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.storage-summary-lbl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.storage-summary-acts {
  display: flex;
  align-items: center;
  gap: 8px;
}
.storage-btn-danger {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.storage-btn-danger:hover {
  background: rgba(255, 107, 107, 0.22);
}

.storage-scope-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.storage-scope-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.storage-scope-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

.storage-admin-bar {
  display: flex;
  gap: 6px;
  margin: 10px 0 4px 0;
  padding: 3px;
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: 12px;
}
.storage-admin-tab {
  flex: 1;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}
.storage-admin-tab.active {
  color: var(--text);
  background: var(--card-bg, rgba(255, 255, 255, 0.12));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Telegram tab bar: e.g. Chats Media Files Music Voice */
.storage-type-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  padding: 0 4px 6px;
  overflow-x: auto;
}
.storage-type-tab {
  background: none;
  border: none;
  padding: 6px 4px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.18s ease;
  white-space: nowrap;
}
.storage-type-tab.active {
  color: #2b95e9;
}
.storage-type-tab.active::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 0;
  right: 0;
  height: 2.5px;
  background: #2b95e9;
  border-radius: 2px 2px 0 0;
}

/* Telegram-style item rows */
.storage-list {
  display: flex;
  flex-direction: column;
}
.storage-row {
  display: flex;
  align-items: center;
  padding: 10px 8px;
  gap: 12px;
  border-radius: 10px;
  transition: background 0.15s ease, opacity 0.2s ease, transform 0.2s ease;
  user-select: none;
}
.storage-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.storage-row.removing {
  opacity: 0;
  transform: translateX(20px);
}
.storage-play-circle {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  background: #2b95e9;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, filter 0.15s ease;
  box-shadow: 0 2px 6px rgba(43, 149, 233, 0.35);
}
.storage-play-circle:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}
.storage-play-circle:active {
  transform: scale(0.95);
}
.storage-play-circle.playing {
  background: var(--accent);
  color: #121318;
  box-shadow: 0 2px 8px var(--accent-dim);
}

.storage-pl-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 10px;
  background: rgba(43, 149, 233, 0.15);
  color: #2b95e9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.storage-meta-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}
.storage-item-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.storage-item-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.storage-right-col {
  display: flex;
  align-items: center;
  gap: 10px;
}
.storage-item-size {
  font-size: 13.5px;
  font-weight: 600;
  color: #b0b8c4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.storage-del-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.storage-del-btn:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.15);
}

/* === Desktop layout === */
.sidebar { display: none; }
.sb-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.sb-brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-ico { width: 28px; height: 28px; border-radius: 6px; }
.sb-avatar-wrap {
  position: relative;
}
.sb-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 3px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sb-avatar-btn:hover {
  background: var(--surface-4);
  border-color: rgba(255, 255, 255, 0.22);
}
.sb-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #0c0d11;
  font-weight: 700;
  font-size: 11.5px;
  display: grid;
  place-items: center;
  text-transform: uppercase;
}
.sb-avatar-wrap .lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: -6px;
  width: 216px;
  box-sizing: border-box;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  z-index: 100;
}
.menu-user-profile {
  padding: 6px 10px 4px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.menu-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.menu-sec-label {
  padding: 6px 10px 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.menu-sp-btn {
  width: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 7px 10px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
  box-sizing: border-box;
}
.menu-sp-btn:hover {
  background: var(--highlight);
}
.menu-sp-btn svg {
  flex: none;
}
.menu-sp-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.menu-sp-label {
  font-size: 12.5px;
  font-weight: 600;
}
.menu-sp-val {
  font-size: 11px;
  color: var(--muted);
}
.menu-logout-btn {
  color: #ff6b6b !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 8px 10px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: left !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}
.menu-logout-btn svg {
  flex: none;
  opacity: 0.9;
}
.menu-logout-btn:hover {
  background: rgba(255, 107, 107, 0.12) !important;
  color: #ff8585 !important;
}
.sb-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.sb-btn { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; width: 100%; }
.sb-btn svg { flex: none; }
.sb-btn.active { background: var(--card); color: var(--text); }
.sb-btn:hover { color: var(--text); }
.sb-section { padding: 12px 10px 8px; flex: 1; overflow-y: auto; min-height: 0; }
.sb-sec-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 8px 8px; }
.sb-playlist-list { display: flex; flex-direction: column; gap: 2px; }
.sb-pl { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border: 0; border-left: 3px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font-size: 13.5px; text-align: left; cursor: pointer; width: 100%; }
.sb-pl:hover { background: var(--card); }
.sb-pl.active { background: rgba(255, 255, 255, 0.07); border-left-color: transparent; color: var(--text); }
.sb-pl-cov { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; background: #262933; flex: none; }
.sb-pl-ico { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: #262933; border-radius: 4px; color: var(--muted); flex: none; }
.sb-pl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-empty { font-size: 12px; color: var(--muted); padding: 6px 8px; }

.mp-desktop { display: none !important; }

@media (min-width: 900px) {
  .app-shell { display: flex; flex-direction: row; }
  .app-shell.hidden { display: none; }
  .sidebar {
    display: flex;
    flex-direction: column;
    width: 230px;
    min-width: 230px;
    height: calc(100vh - 86px);
    background: var(--card);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
  }
  .topbar { display: none; }
  .view-container { flex: 1; min-width: 0; padding-bottom: 110px; max-width: none; }
  .view-container > .tab-view { max-width: 1180px; margin: 0 auto; padding: 24px 32px; }
  .tabbar { display: none; }
  .mp-mobile-ctrl { display: none !important; }
  .mp-desktop { display: flex !important; }
  .mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    height: 86px;
    padding: 0;
    margin: 0;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--border);
    background: var(--surface-1);
    box-shadow: none;
    box-sizing: border-box;
    z-index: 50;
  }
  .mini-player.island {
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--border);
    background: var(--surface-1);
    box-shadow: none;
  }
  .mp-core {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(380px, 2.6fr) minmax(200px, 1fr);
    align-items: center;
    height: 100%;
    padding: 0 28px;
    gap: 20px;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
  }
  .mp-info {
    min-width: 0;
    gap: 14px;
  }
  .mp-swipe-viewport {
    overflow: visible;
  }
  .mp-swipe-track {
    transform: none !important;
  }
  .mp-slide-prev,
  .mp-slide-next {
    display: none !important;
  }
  .mp-slide-current {
    flex: 1;
    min-width: 0;
    gap: 14px;
  }
  .mp-artist {
    cursor: pointer;
    pointer-events: auto;
  }
  .mp-artist:hover {
    text-decoration: underline;
    color: var(--text);
  }
  .mp-cover {
    width: 56px;
    height: 56px;
    border-radius: 10px;
  }
  .mp-center {
    width: 100%;
    max-width: 720px;
    min-width: 0;
    justify-self: center;
    gap: 6px;
  }
  .mp-transport {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .mp-scrubber {
    width: 100%;
    min-width: 0;
    gap: 10px;
  }
  .mp-slider {
    flex: 1;
    min-width: 80px;
  }
  .mp-actions {
    min-width: 0;
    justify-self: end;
    gap: 6px;
  }
  .mp-vol-wrap {
    min-width: 0;
    gap: 4px;
    margin-left: 8px;
  }
  .mp-vol-slider {
    width: 90px;
  }
  .mp-progress { display: none; }
  .album-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .artist-row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

  /* Desktop Multi-select floating action dock */
  .ms-bar {
    position: fixed;
    bottom: 24px;
    left: calc(230px + (100% - 230px) / 2);
    transform: translateX(-50%);
    width: auto;
    min-width: 380px;
    max-width: 560px;
    margin: 0;
    padding: 8px 16px 8px 12px;
    background: rgba(22, 25, 34, 0.94);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 60;
    animation: msBarInDesktop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    transition: bottom 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.has-player .ms-bar,
  body:has(#miniPlayer:not(.hidden)) .ms-bar {
    bottom: calc(86px + 20px);
  }

  .ms-bar .ms-left {
    gap: 10px;
  }
  .ms-bar .ms-count {
    font-size: 13.5px;
    font-weight: 700;
  }
  .ms-bar .ms-right {
    gap: 10px;
  }
  .ms-bar .sec-add-btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text);
  }
  .ms-bar .sec-add-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.28);
  }
  .ms-bar .ms-act-btn {
    padding: 7px 18px;
    font-size: 13px;
    border-radius: 999px;
    font-weight: 700;
  }
}

@keyframes msBarInDesktop {
  from {
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

/* Shortcuts Sheet */
#shortcutsBackdrop {
  z-index: 9999;
}
@media (min-width: 641px) {
  #shortcutsBackdrop {
    align-items: center !important;
    justify-content: center !important;
  }
  #shortcutsBackdrop .shortcuts-sheet {
    border-radius: 20px !important;
    border: 1px solid var(--line-strong) !important;
    transform: translateY(0) scale(1) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75) !important;
  }
  #shortcutsBackdrop.hidden .shortcuts-sheet {
    transform: translateY(16px) scale(0.96) !important;
  }
}
.shortcuts-sheet {
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.sc-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--border);
}
.xs-btn {
  padding: 4px 10px !important;
  font-size: 11px !important;
  height: auto !important;
}
.sc-sheet-body {
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}
.sc-section {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.sc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.sc-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.sc-section-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.sc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s ease;
}
.sc-row:hover {
  background: rgba(255, 255, 255, 0.05);
}
.sc-row-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.sc-toggle-chk {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex: none;
}
.sc-row-label {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-row.disabled .sc-row-label {
  color: var(--muted);
  opacity: 0.6;
}
.sc-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.sc-key-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sc-key-btn:hover {
  background: var(--surface-4);
  border-color: rgba(255, 255, 255, 0.25);
}
.sc-key-btn.recording {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  animation: scPulse 1.2s infinite;
}
.sc-key-btn.unset {
  color: var(--muted);
  border-style: dashed;
}
.sc-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}
.sc-del-btn:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.15);
}
@keyframes scPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(0.98); }
}

/* Admin Users & Activity View */
.admin-users-view {
  padding: 4px 0 24px;
}
/* Admin Settings View */
.admin-settings-view {
  padding: 4px 0 24px;
}
/* Admin Proxy Control Card */
.admin-proxy-card {
  background: var(--card-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}
.admin-proxy-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}
.admin-proxy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-proxy-title-wrap {
  flex: 1 1 200px;
  min-width: 0;
}
.admin-proxy-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-proxy-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.admin-proxy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.admin-proxy-badge.active {
  background: rgba(110, 193, 255, 0.14);
  color: #6ec1ff;
  border: 1px solid rgba(110, 193, 255, 0.3);
}
.admin-proxy-badge.direct {
  background: rgba(80, 227, 194, 0.12);
  color: #50e3c2;
  border: 1px solid rgba(80, 227, 194, 0.25);
}
.admin-proxy-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-proxy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-proxy-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-proxy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.admin-proxy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}
.admin-proxy-url-box {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.admin-proxy-url-input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 11px;
  font-family: monospace;
}
.admin-proxy-url-input:focus {
  outline: none;
  border-color: var(--accent);
}
.admin-proxy-test-result {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  word-break: break-word;
}
.admin-proxy-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.admin-proxy-mode-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.admin-proxy-mode-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.admin-proxy-mode-btn.active {
  background: rgba(110, 193, 255, 0.12);
  border-color: var(--accent);
}
.admin-proxy-mode-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-proxy-mode-desc {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.3;
}
.admin-proxy-stats {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.admin-proxy-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-proxy-stat-pill strong {
  color: var(--text);
}

@media (max-width: 600px) {
  .admin-proxy-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .admin-proxy-title-wrap {
    width: 100%;
  }
  .admin-proxy-btns {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .admin-proxy-btn {
    flex: 1 1 0;
    justify-content: center;
    padding: 7px 8px;
    font-size: 11.5px;
    text-align: center;
  }
  .admin-proxy-modes {
    grid-template-columns: 1fr;
  }
  .admin-proxy-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .admin-proxy-stats {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .admin-proxy-badge {
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
  }
}
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.admin-stat-card {
  background: var(--card-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.admin-stat-lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.admin-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.admin-add-user-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.admin-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--accent);
  color: #0b0c10;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.admin-btn-add:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.admin-user-card {
  background: var(--card-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: border-color 0.18s ease;
}
.admin-user-card:hover {
  border-color: var(--border-hover, rgba(255, 255, 255, 0.2));
}
.admin-user-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(110, 193, 255, 0.18);
  color: #6ec1ff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-user-avatar.is-admin {
  background: rgba(255, 193, 7, 0.18);
  color: #ffc107;
}
.admin-user-meta {
  flex: 1;
  min-width: 0;
}
.admin-user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-user-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-user-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}
.admin-user-tag.admin {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}
.admin-user-tag.blocked {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
}
.admin-user-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-user-email-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent, #6ec1ff);
  background: rgba(110, 193, 255, 0.12);
  border: 1px solid rgba(110, 193, 255, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.admin-user-metrics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 9px 0 8px 0;
}
.admin-metric-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--muted);
}
.admin-metric-pill strong {
  color: var(--text);
}
.admin-last-track-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 9px;
}
.admin-last-track-img {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
}
.admin-last-track-info {
  flex: 1;
  min-width: 0;
}
.admin-last-track-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-last-track-sub {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}
.admin-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.admin-act-btn:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.08));
}
.admin-act-btn.copy {
  color: #6ec1ff;
  border-color: rgba(110, 193, 255, 0.35);
}
.admin-act-btn.copy:hover {
  background: rgba(110, 193, 255, 0.12);
}
.admin-act-btn.danger {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.35);
}
.admin-act-btn.danger:hover {
  background: rgba(255, 107, 107, 0.12);
}
.admin-history-drawer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  max-height: 280px;
  overflow-y: auto;
}
.admin-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.admin-history-item:last-child {
  border-bottom: none;
}
.admin-history-img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
}
.admin-history-meta {
  flex: 1;
  min-width: 0;
}
.admin-history-title {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-history-artist {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-history-time {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ==========================================================================
   Audio / Video Switcher & Video Embed Player
   ========================================================================== */
.np-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: 20px;
  margin: 0 auto 12px;
}
.np-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.np-mode-btn:hover {
  color: var(--text);
}
.np-mode-btn.active {
  background: var(--surface-2, rgba(255, 255, 255, 0.16));
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.np-video-container {
  width: min(90vw, 360px);
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  background: #000;
  position: relative;
}
.np-video-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.floating-video {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 320px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border);
  z-index: 999;
  display: flex;
  flex-direction: column;
}
.floating-video.hidden { display: none !important; }
.floating-video-header {
  height: 28px;
  background: rgba(18, 18, 22, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.floating-video-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}
.floating-video-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  line-height: 1;
}
.floating-video-close:hover { color: #fff; }
.floating-video-body {
  flex: 1;
  width: 100%;
  height: calc(100% - 28px);
}
.floating-video-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ==========================================================================
   Devices Sheet / Spotify Connect style
   ========================================================================== */
.devices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  margin: 8px 0;
}
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  transition: all 0.2s ease;
}
.device-row.is-current {
  border-color: rgba(248, 223, 148, 0.28);
  background: rgba(248, 223, 148, 0.06);
}
.device-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.device-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex-shrink: 0;
}
.device-row.is-current .device-icon {
  background: var(--accent);
  color: #0c0d11;
}
.device-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.device-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-status {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #666;
  flex-shrink: 0;
}
.device-dot.online {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(248, 223, 148, 0.6);
}
.device-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.device-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.device-btn:hover {
  background: var(--accent);
  color: #0c0d11;
  border-color: var(--accent);
}
.device-btn.primary {
  background: var(--accent);
  color: #0c0d11;
  border-color: var(--accent);
}
.device-btn.btn-remove-device {
  padding: 5px 9px;
  background: rgba(255, 60, 60, 0.12);
  color: #ff6b6b;
  border-color: rgba(255, 60, 60, 0.25);
  font-size: 13px;
  line-height: 1;
}
.device-btn.btn-remove-device:hover {
  background: #ff4d4d;
  color: #fff;
  border-color: #ff4d4d;
}

/* ── UPDATER UI ──────────────────────────────────────────────── */
.update-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(24, 26, 32, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--accent-border);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-dim);
  border-radius: 12px;
  padding: 10px 18px;
  animation: ubSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ubSlideDown {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.ub-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}
.ub-icon {
  font-size: 16px;
}
.ub-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ub-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}
.ub-btn-primary {
  background: var(--accent);
  color: #121318;
}
.ub-btn-primary:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}
.ub-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.ub-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.update-modal-backdrop {
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.update-modal {
  width: 90%;
  max-width: 420px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: ubZoomIn 0.25s ease-out;
}

@keyframes ubZoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.um-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}
.um-icon-badge {
  font-size: 32px;
  margin-bottom: 8px;
}
.um-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}
.um-version {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}
.um-body {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
}
.um-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.um-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.um-percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.um-footer-note {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.8;
}

/* --- Smart Fill --- */
.smart-fill-sheet {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.sf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.sf-title-wrap {
  flex: 1;
  min-width: 0;
}
.sf-refresh-icon {
  display: inline-block;
  font-size: 13px;
  margin-right: 2px;
}
.sf-tracks-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 180px;
  max-height: 50vh;
  margin-bottom: 14px;
  padding-right: 2px;
}
.sf-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.sf-row:hover {
  background: var(--hover);
}
.sf-cov {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--card);
}
.sf-meta {
  flex: 1;
  min-width: 0;
}
.sf-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.sf-artist {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b2f0e;
  background: transparent;
  flex-shrink: 0;
  transition: all 0.15s;
}
.sf-row.selected .sf-check {
  background: var(--accent);
  border-color: var(--accent);
}
.sf-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.smart-fill-footer {
  display: flex;
  justify-content: center;
  padding: 24px 0 16px 0;
}
.smart-fill-footer .pill-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 99px;
  transition: all 0.2s;
}
.smart-fill-footer .pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Sleep Timer */
.sleep-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent, #6366f1);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 8px;
  line-height: 1.2;
  pointer-events: none;
}
.sleep-active-status {
  font-size: 13px;
  color: var(--accent, #6366f1);
  font-weight: 600;
  margin-left: auto;
}
.np-icon-btn.sleep-active svg,
.mp-icon-btn.sleep-active svg {
  stroke: var(--accent, #6366f1);
  color: var(--accent, #6366f1);
}
.as-btn-danger {
  color: #ef4444 !important;
}




