/* Instrumental player, sign-in popups and the Playback list (js/instrumentals.js).
   Mirrors the desktop app's player; colours come from the --as-* tokens. */

/* ── Player: pinned to the bottom of the song panel ───────────────────────────
   #songContainer scrolls itself, so `sticky; bottom` keeps the player on its
   bottom edge while the song scrolls. The negative margins cancel the panel's
   padding (0 1px 12px 15px) so it spans edge to edge. */
.inst-player {
  position: sticky;
  bottom: -12px;
  z-index: 5;
  box-sizing: border-box;
  display: none;
  align-items: center;
  gap: 12px;
  margin: 8px -1px -12px -15px;
  padding: 10px 16px 12px;
  background: color-mix(in srgb, var(--as-card) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--as-border);
  font-family: "Tajawal", sans-serif;
  font-weight: normal;
  user-select: none;
  -webkit-user-select: none;
}
/* RTL card, but the play button sits on the left (reversed row). */
.inst-player.show { display: flex; flex-direction: row-reverse; }
.inst-player * { box-sizing: border-box; }

.inst-play {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: none;
  background: var(--as-accent);
  color: var(--as-accent-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.inst-play:hover { opacity: 0.9; }
.inst-play:active { transform: scale(0.95); }
.inst-play svg { display: block; }

.inst-body { flex: 1; min-width: 0; }
.inst-head { display: flex; align-items: baseline; gap: 8px; }
.inst-title {
  max-width: 60%;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--as-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inst-dist {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  color: var(--as-muted-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inst-times {
  display: flex;
  justify-content: space-between;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  color: var(--as-muted-fg);
  font-variant-numeric: tabular-nums;
}

/* Seek: native range, 24px tall so the whole band is clickable; the 4px
   track is the background. Left to right like any media timeline. */
.inst-seek { position: relative; }
.inst-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
/* The app styles every <input> as a text field; undo that for the slider. */
.inst-player .inst-range,
.inst-player .inst-range:hover,
.inst-player .inst-range:focus {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  min-height: 0;
}
.inst-range:disabled { cursor: default; opacity: 0.5; }
.inst-range:focus { outline: none; }
.inst-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 9999px;
  background: linear-gradient(to right, var(--as-accent) var(--seek-pct, 0%), var(--as-muted) var(--seek-pct, 0%));
}
.inst-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 9999px;
  background: var(--as-accent);
  border: 2px solid var(--as-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease;
}
.inst-range:active::-webkit-slider-thumb { transform: scale(1.2); }
.inst-range::-moz-range-track { height: 4px; border-radius: 9999px; background: var(--as-muted); }
.inst-range::-moz-range-progress { height: 4px; border-radius: 9999px; background: var(--as-accent); }
.inst-range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 9999px;
  background: var(--as-accent); border: 2px solid var(--as-card);
}

.inst-bubble {
  position: absolute;
  bottom: 100%;
  margin-bottom: 4px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--as-border);
  background: var(--as-card);
  color: var(--as-fg);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.inst-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 6px;
  height: 6px;
  background: var(--as-card);
  border-right: 1px solid var(--as-border);
  border-bottom: 1px solid var(--as-border);
  transform: translate(-50%, -50%) rotate(45deg);
}

/* ── Account pill beside the bottom bar ──────────────────────────────────────
   Shares .floating-buttons (look and 48px buttons); only its position differs,
   set from JS so it hugs the centred bar. */
.floating-buttons.account-dock { left: 0; transform: none; }
.account-dock .account-btn { padding: 0; }
.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--as-accent), hsl(25 95% 40%));
  color: #fff;
  font-family: "Tajawal", sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.account-avatar.lg { width: 36px; height: 36px; font-size: 15px; }

.account-menu {
  position: fixed;
  z-index: 1200;
  width: 230px;
  padding: 6px;
  background: var(--as-card);
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius);
  box-shadow: 0 18px 50px -10px rgba(0, 0, 0, 0.55);
  font-family: "Tajawal", sans-serif;
  text-align: right;
  animation: inst-drop 0.15s ease;
}
.account-menu[hidden] { display: none; }
@keyframes inst-drop { from { opacity: 0; transform: translateY(4px); } }
.account-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px; }
.account-menu-id { display: flex; flex-direction: column; min-width: 0; }
.account-name { font-size: 12.5px; color: var(--as-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-email { font-size: 10.5px; color: var(--as-muted-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.account-menu-sep { height: 1px; margin: 4px 6px; background: var(--as-border); }
.account-menu-item {
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--as-fg);
  font-family: inherit;
  font-size: 12px;
  text-align: right;
  cursor: pointer;
}
.account-menu-item:hover { background: var(--as-muted); }
.account-menu-item.danger { color: hsl(0 80% 65%); }
.account-menu-item.danger:hover { background: hsl(0 70% 50% / 0.12); }

/* ── Popups (sign-in required, sign in / register, account) ───────────────── */
.inst-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: "Tajawal", sans-serif;
  animation: inst-fade 0.18s ease;
}
@keyframes inst-fade { from { opacity: 0; } }
.inst-modal-card {
  position: relative;
  box-sizing: border-box;
  width: 360px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 28px 28px 24px;
  background: var(--as-card);
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius-xl);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-align: center;
  color: var(--as-fg);
}
.inst-modal-card * { box-sizing: border-box; }
.inst-modal-bar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(to right, #f97316, var(--as-accent), #fbbf24);
}
.inst-modal-x {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--as-muted-fg);
  cursor: pointer;
}
.inst-modal-x:hover { background: var(--as-muted); color: var(--as-fg); }
.inst-modal-icon {
  align-self: center;
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--as-accent), hsl(25 95% 40%));
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px var(--as-accent-tint);
  margin-bottom: 4px;
}
.inst-modal-card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.inst-modal-card p { margin: 0 0 6px; font-size: 12px; line-height: 1.7; color: var(--as-muted-fg); }
.inst-note { font-size: 10px !important; opacity: 0.7; margin-top: 4px !important; }

.inst-btn {
  height: 40px;
  border-radius: var(--as-radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.inst-btn:disabled { opacity: 0.6; cursor: default; }
.inst-btn.primary { background: var(--as-accent); color: var(--as-accent-fg); }
.inst-btn.primary:hover { opacity: 0.9; }
.inst-btn.ghost { background: transparent; color: var(--as-muted-fg); height: 34px; font-weight: 500; }
.inst-btn.ghost:hover { background: var(--as-muted); color: var(--as-fg); }
.inst-btn.google { background: var(--as-item); color: var(--as-fg); border-color: var(--as-border); font-weight: 500; }
.inst-btn.google:hover { background: var(--as-muted); }
.inst-btn.danger { background: hsl(0 70% 50% / 0.12); color: hsl(0 80% 65%); }
.inst-btn.danger:hover { background: hsl(0 70% 50% / 0.2); }

.inst-or { display: flex; align-items: center; gap: 10px; font-size: 10px; color: var(--as-muted-fg); }
.inst-or::before, .inst-or::after { content: ""; flex: 1; height: 1px; background: var(--as-border); }

.inst-input {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--as-border);
  background: var(--as-input-bg);
  color: var(--as-fg);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}
.inst-input[hidden] { display: none; }
.inst-input:focus { border-color: var(--as-accent-soft); background: var(--as-input-focus-bg); }
.inst-input::placeholder { color: var(--as-placeholder); }

.inst-msg { font-size: 11px !important; color: hsl(0 80% 65%) !important; margin: 0 !important; }
.inst-msg.ok { color: hsl(152 60% 55%) !important; }
.inst-switch { font-size: 11px !important; margin: 4px 0 0 !important; }
.inst-switch button {
  border: none;
  background: none;
  color: var(--as-accent);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.inst-toast {
  position: fixed;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  z-index: 2200;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--as-card);
  border: 1px solid var(--as-border);
  color: var(--as-fg);
  font-family: "Tajawal", sans-serif;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: inst-fade 0.18s ease;
}

/* ── Playback list: rows styled like the search dropdown (#dropdown li) ─── */
.pb-list { list-style: none; margin: 0; padding: 0; text-align: right; }
.pb-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  border-bottom: 1px solid hsl(220 15% 18% / 0.5);
  border-right: 2px solid transparent;
  transition: background 0.15s ease;
}
.pb-list li:last-child { border-bottom: 0; }
.pb-list li:hover { background: var(--as-surface); }
.pb-text { flex: 1; margin-inline-start: 10px; }
.pb-list .title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  direction: rtl;
  font-weight: 600;
  font-size: 17px;
  color: var(--as-fg);
}
.pb-list .line { font-size: 14px; font-weight: 400; color: hsl(215 15% 55% / 0.75); }
.pb-empty { color: #999; text-align: center; margin-top: 20px; }

/* ── Star on the far left ─────────────────────────────────────────────────
   List rows are RTL (star goes last); search-dropdown rows are LTR (first). */
.pb-list li .save-btn { order: 2; margin-inline-start: 10px; }
.pb-list li .pb-text { margin-inline-start: 0 !important; }
#dropdown li .save-btn { order: -1; margin-right: 10px; }

/* ── Playlists ───────────────────────────────────────────────────────────── */
.playlist-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-inline-end: 12px;
  border-radius: 9px;
  background: var(--as-accent-tint);
  color: var(--as-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}
.pb-list .row-action {
  flex-shrink: 0;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--as-muted-fg);
  font-family: "Tajawal", sans-serif;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pb-list li:hover .row-action, .pb-list .row-action.confirm { opacity: 1; }
.pb-list .row-action:hover, .pb-list .row-action.confirm { background: hsl(0 70% 50% / 0.12); color: hsl(0 80% 65%); }
.pb-list li.missing { cursor: default; opacity: 0.6; }
.playlist-back .title, .playlist-add .title { font-size: 14px !important; color: var(--as-muted-fg) !important; }
.playlist-add:hover .title { color: var(--as-accent) !important; }
.playlist-inline-new, .playlist-menu-new { display: flex; gap: 6px; width: 100%; }
.playlist-inline-new input, .playlist-menu-new input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--as-border);
  background: var(--as-input-bg);
  color: var(--as-fg);
  font-family: "Tajawal", sans-serif;
  font-size: 13px;
  outline: none;
}
.playlist-inline-new input:focus, .playlist-menu-new input:focus { border-color: var(--as-accent-soft); }
.playlist-inline-new button, .playlist-menu-new button {
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: var(--as-accent);
  color: var(--as-accent-fg);
  font-family: "Tajawal", sans-serif;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

/* "Add to playlist" menu next to a star (like the desktop app) */
.playlist-menu {
  position: fixed;
  z-index: 2050;
  width: 220px;
  background: var(--as-card);
  border: 1px solid var(--as-border);
  border-radius: 12px;
  box-shadow: 0 18px 50px -10px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  font-family: "Tajawal", sans-serif;
  text-align: right;
  animation: inst-fade 0.12s ease;
}
.playlist-menu-head { padding: 8px 12px; border-bottom: 1px solid var(--as-border); background: hsl(220 15% 16% / 0.3); }
.playlist-menu-head p { margin: 0; font-size: 11px; font-weight: 700; color: var(--as-muted-fg); }
.playlist-menu-head span { display: block; font-size: 10px; color: var(--as-muted-fg); opacity: 0.7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-menu-list { max-height: 180px; overflow-y: auto; padding: 4px 0; }
.playlist-menu-empty { margin: 0; padding: 8px 12px; font-size: 11px; color: var(--as-muted-fg); }
.playlist-menu-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: none;
  background: transparent;
  color: var(--as-fg);
  font-family: inherit;
  font-size: 12px;
  text-align: right;
  cursor: pointer;
}
.playlist-menu-row:hover { background: var(--as-muted); }
.playlist-menu-check { width: 12px; color: var(--as-accent); font-weight: 700; }
.playlist-menu-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-menu-row.on .playlist-menu-name { color: var(--as-accent); }
.playlist-menu-count { font-size: 10px; color: var(--as-muted-fg); }
.playlist-menu-foot { border-top: 1px solid var(--as-border); padding: 6px; }
.playlist-menu-add {
  width: 100%;
  padding: 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--as-accent);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  cursor: pointer;
}
.playlist-menu-add:hover { background: var(--as-accent-tint); }

/* Purple "has music" tag (desktop: violet-500 badge) */
.result-tag--music {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-inline-start: 6px;
  color: hsl(255 92% 80%);
  background: hsl(258 90% 66% / 0.12);
  border: 1px solid hsl(258 90% 66% / 0.35);
}
.result-tag--music svg { flex-shrink: 0; }
/* The add-to-playlist icon reuses .star-icon sizing from style.css. */
.save-btn .star-icon { width: 17px; height: 17px; }
.save-btn.active .star-icon { fill: none; stroke: white; }

/* ── Where a playlist is saved (as in the desktop app) ─────────────────────
   .in  = in the account: orange save icon with a check
   .out = on this device: plain save icon, click to upload */
/* A 24px circle like the desktop app's badges, centred against the row. */
.cloud-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  margin-inline: 8px;
  border: 1px solid var(--as-border);
  border-radius: 9999px;
  background: transparent;
  padding: 0;
  align-self: center;
}
.cloud-badge svg { width: 14px; height: 14px; }
.cloud-badge.sm { width: 22px; height: 22px; margin: 0; }
.cloud-badge.sm svg { width: 11px; height: 11px; }
.cloud-badge.in { color: var(--as-accent); border-color: hsl(25 95% 55% / 0.4); background: var(--as-accent-tint); }
.cloud-badge.out { color: var(--as-muted-fg); cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.cloud-badge.out:hover { color: var(--as-accent); border-color: hsl(25 95% 55% / 0.4); background: var(--as-accent-tint); }
.cloud-badge.out.busy { opacity: 0.5; cursor: progress; animation: inst-pulse 1s ease-in-out infinite; }
@keyframes inst-pulse { 50% { opacity: 0.2; } }
.cloud-check {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 11px;
  height: 11px;
  border-radius: 9999px;
  background: var(--as-accent);
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  line-height: 11px;
  text-align: center;
  box-shadow: 0 0 0 1.5px var(--as-card);
}
.cloud-badge.sm .cloud-check { width: 9px; height: 9px; font-size: 6px; line-height: 9px; bottom: -2px; left: -2px; }

/* Add-to-playlist menu: rows were 100% wide plus padding, which overflowed
   sideways; and the default (white) scrollbars showed. */
.playlist-menu, .playlist-menu * { box-sizing: border-box; }
.playlist-menu-list { overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--as-surface) transparent; }
.playlist-menu-list::-webkit-scrollbar { width: 6px; height: 0; }
.playlist-menu-list::-webkit-scrollbar-track { background: transparent; }
.playlist-menu-list::-webkit-scrollbar-thumb { background: var(--as-surface); border-radius: 9999px; }
.playlist-menu-name { min-width: 0; }

/* ── القوائم المحفوظة (account menu) ──────────────────────────────────────── */
.saved-pl-sub { margin-top: -4px !important; }
.saved-pl-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; text-align: right; scrollbar-width: thin; scrollbar-color: var(--as-surface) transparent; }
.saved-pl-list li { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; }
.saved-pl-list li:hover { background: var(--as-muted); }
.saved-pl-empty { justify-content: center; text-align: center; padding: 24px 8px !important; font-size: 12px; color: var(--as-muted-fg); line-height: 1.8; }
.saved-pl-empty:hover { background: none !important; }
.saved-pl-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px 6px; border: none; background: none; color: var(--as-fg); font-family: inherit; text-align: right; cursor: pointer; }
.saved-pl-open b { font-size: 13px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-pl-open span { font-size: 11px; color: var(--as-muted-fg); }
.saved-pl-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s ease; }
.saved-pl-list li:hover .saved-pl-actions, .saved-pl-actions .confirm { opacity: 1; }
.saved-pl-actions button { min-width: 28px; height: 28px; padding: 0 6px; border: none; border-radius: 8px; background: transparent; color: var(--as-muted-fg); font-family: inherit; font-size: 12px; cursor: pointer; }
.saved-pl-actions button:hover { background: var(--as-surface); color: var(--as-fg); }
.saved-pl-actions button.danger:hover, .saved-pl-actions button.confirm { background: hsl(0 70% 50% / 0.12); color: hsl(0 80% 65%); }
.saved-pl-list .playlist-inline-new { padding: 2px; }

/* ── Search result type tiles (desktop UnifiedSearch: 40px, rounded-xl) ───── */
.result-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-inline-start: 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.result-icon--song    { color: var(--as-accent);   background: hsl(25 95% 55% / 0.1); }
.result-icon--bible   { color: hsl(213 94% 68%);   background: hsl(217 91% 60% / 0.1); }
.result-icon--liturgy { color: hsl(43 96% 56%);    background: hsl(38 92% 50% / 0.1); }
#dropdown li:hover .result-icon--song,    #dropdown li.active .result-icon--song    { background: hsl(25 95% 55% / 0.2); }
#dropdown li:hover .result-icon--bible,   #dropdown li.active .result-icon--bible   { background: hsl(217 91% 60% / 0.2); }
#dropdown li:hover .result-icon--liturgy, #dropdown li.active .result-icon--liturgy { background: hsl(38 92% 50% / 0.2); }

/* ── القوائم المحفوظة: no sideways scroll ─────────────────────────────────── */
.saved-pl-list, .saved-pl-list * { box-sizing: border-box; }
.saved-pl-list { overflow-x: hidden; }
.saved-pl-list::-webkit-scrollbar { width: 6px; height: 0; }
.saved-pl-list::-webkit-scrollbar-track { background: transparent; }
.saved-pl-list::-webkit-scrollbar-thumb { background: var(--as-surface); border-radius: 9999px; }

/* Each search result row: more breathing room top and bottom (was 13px). */
#dropdown li:not(.search-filters):not(.no-results) { padding-top: 24px; padding-bottom: 24px; }

/* ── Sign in / register / reset (mirrors the desktop app's popups) ───────── */
.auth-card { width: 380px; padding: 28px 32px 30px; text-align: right; gap: 0; }
.auth-body { display: flex; flex-direction: column; gap: 14px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.auth-logo img { height: 46px; object-fit: contain; }
.auth-logo p { margin: 0 !important; font-size: 11px !important; color: var(--as-muted-fg); }
.auth-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 40px; border-radius: 12px; border: 1px solid var(--as-border);
  background: var(--as-card); color: var(--as-fg); font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
}
.auth-google:hover { background: var(--as-muted); }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; }
.auth-label-row label { font-size: 11px; font-weight: 500; color: var(--as-muted-fg); }
.auth-input-wrap { position: relative; }
.auth-input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--as-border); background: var(--as-input-bg); color: var(--as-fg);
  font-family: inherit; font-size: 12px; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input.has-eye { padding-right: 36px; }
.auth-input:focus { border-color: hsl(25 95% 55% / 0.6); box-shadow: 0 0 0 3px hsl(25 95% 55% / 0.1); }
.auth-input.good { border-color: hsl(152 60% 45% / 0.6); }
.auth-input.bad { border-color: hsl(0 70% 55% / 0.6); }
.auth-input::placeholder { color: var(--as-placeholder); }
.auth-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: var(--as-muted-fg); opacity: 0.6; cursor: pointer; padding: 2px; display: flex;
}
.auth-eye:hover { opacity: 1; }
.auth-hint { margin: 0 !important; font-size: 10px !important; line-height: 1.4 !important; }
.auth-hint.good { color: hsl(152 60% 55%) !important; }
.auth-hint.bad { color: hsl(0 80% 65%) !important; }
.auth-hint span.good { color: hsl(152 60% 55%); }
.auth-hint span.bad { color: hsl(0 80% 65%); }
.auth-error { margin: -4px 0 0 !important; text-align: center; font-size: 11px !important; color: hsl(0 80% 65%) !important; }
.auth-error.ok { color: hsl(152 60% 55%) !important; }
.auth-submit {
  height: 42px; border: none; border-radius: 12px; background: var(--as-accent); color: var(--as-accent-fg);
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: opacity 0.15s ease, transform 0.1s ease;
}
.auth-submit:hover { opacity: 0.9; }
.auth-submit:active { transform: scale(0.98); }
.auth-submit:disabled { opacity: 0.4; cursor: default; transform: none; }
.auth-switch { margin: 0 !important; text-align: center; font-size: 11px !important; color: var(--as-muted-fg); }
.auth-link { border: none; background: none; padding: 0; color: var(--as-accent); font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.auth-link:hover { opacity: 0.8; }
.auth-link.small { font-size: 10px; font-weight: 500; opacity: 0.8; }
.auth-spinner {
  width: 16px; height: 16px; border-radius: 9999px;
  border: 2px solid rgb(255 255 255 / 0.3); border-top-color: #fff; animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-title { margin: 0 !important; font-size: 15px !important; }
.auth-text { margin: 0 !important; font-size: 11.5px !important; }
.auth-steps { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--as-muted-fg); }
.auth-steps span { display: flex; align-items: center; gap: 6px; opacity: 0.55; }
.auth-steps span.on, .auth-steps span.done { opacity: 1; color: var(--as-fg); }
.auth-steps b {
  width: 20px; height: 20px; border-radius: 9999px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; background: var(--as-muted); color: var(--as-fg);
}
.auth-steps span.on b { background: var(--as-accent); color: #fff; }
.auth-steps span.done b { background: hsl(152 60% 40%); color: #fff; }
.auth-steps i { flex: 1; height: 1px; background: var(--as-border); }
.auth-steps i.done { background: hsl(25 95% 55% / 0.6); }
.auth-box { border-radius: 12px; background: var(--as-muted); padding: 14px; font-size: 12px; line-height: 1.8; }
.auth-box p { margin: 0 0 6px !important; color: var(--as-fg) !important; font-size: 12px !important; }
.auth-box p.muted { color: var(--as-muted-fg) !important; }
.auth-box p.small { font-size: 10.5px !important; margin: 0 !important; }
.auth-waiting { margin: 0 !important; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px !important; }
.auth-waiting span { width: 6px; height: 6px; border-radius: 9999px; background: var(--as-accent); animation: inst-pulse 1.4s ease-in-out infinite; }

.auth-success { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0 4px; text-align: center; }
.auth-avatar {
  width: 64px; height: 64px; border-radius: 9999px; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--as-accent), hsl(25 95% 40%)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700;
  box-shadow: 0 0 0 4px hsl(25 95% 55% / 0.3); animation: auth-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes auth-pop { from { transform: scale(0); } }
.auth-success-title { margin: 0 !important; font-size: 13px !important; font-weight: 700; color: var(--as-fg) !important; }
.auth-success-title::first-letter { color: hsl(152 60% 55%); }
.auth-success-name { margin: 0 !important; font-size: 15px !important; font-weight: 600; color: var(--as-fg) !important; }
.auth-success-email { margin: 0 !important; font-size: 11px !important; }
.auth-progress { width: 100%; height: 4px; margin-top: 10px; border-radius: 9999px; background: var(--as-muted); overflow: hidden; }
.auth-progress span { display: block; height: 100%; border-radius: 9999px; background: var(--as-accent); animation: auth-fill 1.7s linear forwards; }
@keyframes auth-fill { from { width: 0; } to { width: 100%; } }

/* First play of a track: saving it in the browser before it plays. */
.preparing .inst-play { opacity: 0.6; animation: inst-preparing 1s ease-in-out infinite; pointer-events: none; }
@keyframes inst-preparing { 50% { opacity: 0.25; } }

/* Bot check (Turnstile) inside the sign-in / sign-up / reset popups. */
.auth-captcha { display: flex; justify-content: center; min-height: 65px; margin: 4px 0; }
.auth-captcha-error { min-height: 0; color: hsl(0 80% 65%); font-size: 11px; text-align: center; }
