:root {
  --bg: #0a0b12;
  --bg-2: #0f1119;
  --text: #eef0f6;
  --muted: #99a0b5;
  --accent: #2f7bff;    /* primary blue */
  --accent-2: #4f9dff;  /* lighter blue (gradients) */
  --accent-3: #ff3b52;  /* red accent */
  --danger: #ff3b52;
  --ok: #34d399;
  --warn: #fbbf24;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-brd: rgba(255, 255, 255, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Animated mesh background */
.bg-mesh {
  position: fixed;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(40% 40% at 15% 20%, rgba(47, 123, 255, 0.35), transparent 60%),
    radial-gradient(35% 35% at 85% 15%, rgba(79, 157, 255, 0.28), transparent 60%),
    radial-gradient(45% 45% at 75% 85%, rgba(255, 59, 82, 0.25), transparent 60%),
    var(--bg);
  filter: saturate(1.1);
  animation: drift 22s var(--ease) infinite alternate;
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -3%, 0) scale(1.08); }
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.92rem; margin: 0; }
.error { color: var(--danger); min-height: 1.2em; margin: 0.75rem 0 0; }

/* Glass surface */
.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow);
}

/* ---------- buttons ---------- */
button { font-family: inherit; cursor: pointer; border: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #fff;
  border-radius: 999px;
  padding: 0.6rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(47, 123, 255, 0.4);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(47, 123, 255, 0.55); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary.lg { padding: 0.85rem 1.7rem; font-size: 1rem; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--glass-brd);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  transition: background 0.18s, transform 0.18s var(--ease);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.btn-danger { background: rgba(255, 84, 112, 0.15); color: var(--danger); border: 1px solid rgba(255, 84, 112, 0.4); border-radius: 999px; padding: 0.45rem 0.7rem; }
.btn-danger:hover { background: rgba(255, 84, 112, 0.28); }

.round { width: 42px; height: 42px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* ---------- inputs ---------- */
input, select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-brd);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 123, 255, 0.2);
}
.select { padding: 0.4rem 0.6rem; border-radius: 10px; font-size: 0.9rem; }

/* range */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; padding: 0; border: none; border-radius: 999px; background: rgba(255, 255, 255, 0.15); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(47, 123, 255, 0.25); }
input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border: none; border-radius: 50%; background: var(--accent); }

/* ---------- logo / auth ---------- */
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.logo-mark { filter: drop-shadow(0 4px 10px rgba(47, 123, 255, 0.6)); }
.logo-word { background: linear-gradient(135deg, #fff, var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { border-radius: var(--radius); padding: 2.2rem; width: 100%; max-width: 380px; animation: pop 0.5s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.tabs { display: flex; gap: 0.5rem; margin: 1.4rem 0 1rem; background: rgba(255,255,255,0.05); padding: 0.3rem; border-radius: 999px; }
.tab { flex: 1; background: transparent; color: var(--muted); border-radius: 999px; padding: 0.5rem; font-weight: 600; transition: all 0.2s var(--ease); }
.tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: #fff; }
#auth-form { display: flex; flex-direction: column; gap: 0.75rem; }
#auth-form .btn-primary { margin-top: 0.25rem; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.7rem 1.25rem;
  border-radius: 0;
  border-left: none; border-right: none; border-top: none;
  flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; gap: 0.4rem; }
.nav { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; }
.nav-btn { display: inline-flex; align-items: center; gap: 0.4rem; background: transparent; color: var(--muted); border-radius: 999px; padding: 0.5rem 0.9rem; font-size: 0.9rem; font-weight: 600; transition: all 0.2s var(--ease); }
.nav-btn span { font-size: 1rem; }
.nav-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-btn.active { color: #fff; background: linear-gradient(135deg, rgba(47, 123, 255, 0.9), rgba(255, 59, 82, 0.9)); box-shadow: 0 6px 18px rgba(47, 123, 255, 0.4); }
.user { display: flex; align-items: center; gap: 0.6rem; }
.user-chip { font-size: 0.85rem; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-brd); padding: 0.35rem 0.75rem; border-radius: 999px; }

/* ---------- content / views ---------- */
.content { padding: 2rem 1.5rem 8rem; max-width: 960px; margin: 0 auto; }
.view { animation: fade 0.35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.view-head { margin-bottom: 1.25rem; }
.view-head h2 { margin: 0 0 0.2rem; font-size: 1.6rem; letter-spacing: -0.02em; }

.inline-form { display: flex; gap: 0.6rem; margin: 0 0 1rem; }
.inline-form input { flex: 1; }

/* ---------- radio hero ---------- */
.now-playing {
  border-radius: var(--radius);
  padding: 2rem;
  display: flex; gap: 2rem; align-items: center;
}
.np-art { position: relative; flex-shrink: 0; width: 160px; height: 160px; display: grid; place-items: center; }
.disc {
  width: 160px; height: 160px; border-radius: 50%;
  background: conic-gradient(from 0deg, #2a2140, #17141f, #2a2140, #17141f, #2a2140);
  display: grid; place-items: center; font-size: 3rem;
  border: 6px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.6), 0 12px 40px rgba(0,0,0,0.5);
  position: relative;
}
.disc::after { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-2); border: 4px solid rgba(255,255,255,0.1); }
.disc span { position: relative; z-index: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6)); }
.now-playing.playing .disc { animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.eq { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; align-items: flex-end; height: 26px; opacity: 0; transition: opacity 0.3s; }
.now-playing.playing .eq { opacity: 1; }
.eq span { width: 5px; height: 8px; border-radius: 3px; background: linear-gradient(var(--accent-2), var(--accent)); }
.now-playing.playing .eq span { animation: bounce 0.9s var(--ease) infinite; }
.eq span:nth-child(2) { animation-delay: 0.15s; }
.eq span:nth-child(3) { animation-delay: 0.3s; }
.eq span:nth-child(4) { animation-delay: 0.45s; }
.eq span:nth-child(5) { animation-delay: 0.1s; }
@keyframes bounce { 0%, 100% { height: 8px; } 50% { height: 26px; } }

.np-meta { flex: 1; min-width: 0; }
.np-source { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5rem; }
.np-source label { display: inline-flex; align-items: center; gap: 0.5rem; }
.np-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { color: var(--muted); margin-top: 0.2rem; min-height: 1.2em; }
.np-controls { display: flex; gap: 1rem; align-items: center; margin: 1.25rem 0 0.75rem; flex-wrap: wrap; }
.vol { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.vol input { width: 120px; }
.normalize-opt { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; cursor: pointer; user-select: none; }
.normalize-opt input { cursor: pointer; }
.status { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.live .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

@media (max-width: 620px) {
  .now-playing { flex-direction: column; text-align: center; padding: 1.5rem; }
  .np-controls { justify-content: center; }
  .np-title { white-space: normal; }
}

/* ---------- search ---------- */
.search { position: relative; display: flex; align-items: center; margin-bottom: 1rem; }
.search-icon { position: absolute; left: 0.9rem; opacity: 0.6; pointer-events: none; }
.search input { width: 100%; padding-left: 2.5rem; }
.search .count { position: absolute; right: 0.9rem; font-size: 0.8rem; color: var(--muted); pointer-events: none; }

/* ---------- bulk selection bar ---------- */
.bulk-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.9rem; margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  position: sticky; top: 4.2rem; z-index: 15;
}
.bulk-count { font-weight: 700; margin-right: auto; }
.track-check {
  width: 18px; height: 18px; flex-shrink: 0;
  accent-color: var(--accent); cursor: pointer; padding: 0;
}

/* ---------- lists ---------- */
.track-list, .job-list, .playlist-index { list-style: none; padding: 0; margin: 0; }
.track-list li, .job-list li {
  display: flex; align-items: center; gap: 0.9rem;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  margin-bottom: 0.5rem;
  transition: transform 0.18s var(--ease), background 0.18s, border-color 0.18s;
}
.track-list li:hover { transform: translateX(4px); background: rgba(255,255,255,0.08); border-color: rgba(47,123,255,0.4); }
.track-num { width: 22px; text-align: center; color: var(--muted); font-size: 0.85rem; flex-shrink: 0; }
.track-main { flex: 1; min-width: 0; }
.track-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub { color: var(--muted); font-size: 0.8rem; }
.row-actions { display: flex; gap: 0.4rem; flex-shrink: 0; align-items: center; }
.row-actions .round { width: 36px; height: 36px; font-size: 0.85rem; }

.empty { color: var(--muted); text-align: center; padding: 2rem; }

/* badges */
.badge { font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.badge.pending { background: rgba(251, 191, 36, 0.18); color: var(--warn); }
.badge.downloading { background: rgba(79, 157, 255, 0.18); color: var(--accent-2); }
.badge.completed { background: rgba(52, 211, 153, 0.18); color: var(--ok); }
.badge.failed { background: rgba(255, 84, 112, 0.18); color: var(--danger); }
.badge.expanded { background: rgba(47, 123, 255, 0.2); color: #bcd3ff; }
.badge.skipped { background: rgba(153, 160, 181, 0.18); color: var(--muted); }
.badge.cancelled { background: rgba(153, 160, 181, 0.18); color: var(--muted); }
.badge.shared { background: rgba(47, 123, 255, 0.18); color: var(--accent-2); }
.badge.personal { background: rgba(255, 59, 82, 0.16); color: #ff8a97; }

/* download queue: actions + live progress */
.job-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.job-x {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.85rem; line-height: 1; padding: 0.35rem 0.45rem;
  border-radius: 8px; transition: background 0.15s, color 0.15s;
}
.job-x:hover { background: rgba(255, 84, 112, 0.16); color: var(--danger); }
.dl-progress { margin-top: 0.5rem; }
.dl-bar {
  height: 6px; background: rgba(255, 255, 255, 0.1);
  border-radius: 999px; overflow: hidden;
}
.dl-fill {
  height: 100%; background: var(--accent-2);
  border-radius: 999px; transition: width 0.4s var(--ease);
}
.dl-bar.indet { position: relative; }
.dl-bar.indet .dl-fill {
  width: 40%; transition: none;
  animation: dl-indet 1.2s ease-in-out infinite;
}
@keyframes dl-indet {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}
.dl-meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }

/* ---------- playlists ---------- */
.playlist-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; }
.playlist-index li {
  padding: 0.7rem 0.9rem; border: 1px solid var(--glass-brd); border-radius: var(--radius-sm);
  margin-bottom: 0.5rem; cursor: pointer; background: var(--glass);
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  transition: all 0.18s var(--ease);
}
.playlist-index li:hover { background: rgba(255,255,255,0.08); }
.playlist-index li.active { border-color: var(--accent); background: rgba(47,123,255,0.14); }
.pl-name { flex: 1; display: flex; align-items: center; gap: 0.5rem; overflow: hidden; }
.pl-name .vis { font-size: 0.8rem; }
.playlist-detail { border-radius: var(--radius); padding: 1.25rem 1.4rem; min-height: 220px; }
.pl-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pl-detail-head h3 { margin: 0; font-size: 1.3rem; }
.pl-detail-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { display: none; }
.switch { width: 40px; height: 22px; border-radius: 999px; background: rgba(255,255,255,0.15); position: relative; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.toggle input:checked + .switch { background: linear-gradient(135deg, var(--accent), var(--accent-3)); }
.toggle input:checked + .switch::after { transform: translateX(18px); }

@media (max-width: 640px) { .playlist-layout { grid-template-columns: 1fr; } }

/* ---------- card grid (public playlists) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.pub-card {
  background: var(--glass); border: 1px solid var(--glass-brd); border-radius: var(--radius);
  padding: 1.2rem; display: flex; flex-direction: column; gap: 0.35rem;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
.pub-card:hover { transform: translateY(-4px); border-color: rgba(47,123,255,0.5); }
.pub-card .pc-icon { font-size: 1.8rem; }
.pub-card .pc-name { font-weight: 700; font-size: 1.1rem; }
.pub-card .pc-meta { color: var(--muted); font-size: 0.82rem; }
.pub-card .btn-primary { margin-top: 0.75rem; align-self: flex-start; }

/* ---------- checkbox ---------- */
.checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); margin: 0 0 1rem; cursor: pointer; }
.checkbox input { width: auto; }

/* ---------- local player ---------- */
.local-player {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  width: min(760px, calc(100% - 2rem));
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; z-index: 40;
  animation: slideup 0.4s var(--ease);
}
@keyframes slideup { from { transform: translate(-50%, 120%); } to { transform: translateX(-50%); } }
.lp-art { width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-3)); display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.lp-main { flex: 1; min-width: 0; }
.lp-info { display: flex; flex-direction: column; }
.lp-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; }
.lp-sub { color: var(--muted); font-size: 0.75rem; }
.lp-progress { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.35rem; }
.lp-progress input { flex: 1; }
.lp-time { font-size: 0.7rem; color: var(--muted); min-width: 32px; text-align: center; }
.lp-controls { display: flex; gap: 0.4rem; align-items: center; flex-shrink: 0; }
.lp-controls .round { width: 38px; height: 38px; font-size: 0.85rem; }
@media (max-width: 560px) { .lp-art, .lp-progress { display: none; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 1.25rem; right: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 60; pointer-events: none; }
.toast { min-width: 220px; max-width: 340px; padding: 0.8rem 1.1rem; border-radius: var(--radius-sm); color: #fff; font-size: 0.9rem; font-weight: 500; box-shadow: var(--shadow); backdrop-filter: blur(12px); border: 1px solid var(--glass-brd); background: rgba(30,32,45,0.9); animation: toastin 0.3s var(--ease); }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.toast.hide { opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s; }
.toast.success { background: linear-gradient(135deg, rgba(16,84,60,0.95), rgba(20,60,50,0.95)); border-color: rgba(52,211,153,0.5); }
.toast.warn { background: linear-gradient(135deg, rgba(90,70,10,0.95), rgba(70,55,10,0.95)); border-color: rgba(251,191,36,0.5); }
.toast.error { background: linear-gradient(135deg, rgba(90,25,40,0.95), rgba(70,20,30,0.95)); border-color: rgba(255,84,112,0.5); }

/* ---------- custom dropdown ---------- */
.dd-mount { display: inline-block; }
.dropdown { position: relative; display: inline-block; }
.dd-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-brd);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem; font-weight: 600;
  transition: border-color 0.18s, background 0.18s;
}
.dd-toggle:hover { background: rgba(255, 255, 255, 0.12); }
.dropdown.open .dd-toggle { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47, 123, 255, 0.2); }
.dd-caret { font-size: 0.7rem; opacity: 0.7; transition: transform 0.2s; }
.dropdown.open .dd-caret { transform: rotate(180deg); }
.dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  min-width: 100%; max-height: 260px; overflow-y: auto;
  background: rgba(24, 26, 38, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-brd);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.35rem;
  animation: ddin 0.16s var(--ease);
}
@keyframes ddin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dd-option {
  padding: 0.5rem 0.75rem; border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; white-space: nowrap; color: var(--text);
  transition: background 0.12s;
}
.dd-option:hover { background: rgba(47, 123, 255, 0.25); }
.dd-option.sel {
  background: rgba(47, 123, 255, 0.18); font-weight: 600; padding-right: 1.9rem;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 16 16" fill="%234f9dff"><path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0"/></svg>');
  background-repeat: no-repeat; background-position: right 0.6rem center;
}

/* ---------- language switcher ---------- */
.dd-mount.lang .dd-toggle { padding: 0.4rem 0.7rem; }
.auth-lang { display: flex; justify-content: center; margin-top: 1.25rem; }

/* ---------- progress bar ---------- */
.np-progress { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; max-width: 460px; }
.np-progress input[type="range"] { flex: 1; }
.progress { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 0.25s linear; }

/* ---------- rating ---------- */
.rate { display: inline-flex; align-items: center; gap: 0.4rem; }
.rate-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-brd);
  border-radius: 999px; padding: 0.4rem 0.6rem; font-size: 0.95rem;
  filter: grayscale(0.6); opacity: 0.8;
  transition: transform 0.15s var(--ease), filter 0.15s, background 0.15s;
}
.rate-btn:hover { transform: translateY(-2px) scale(1.1); filter: grayscale(0); opacity: 1; }
/* Over-length (playlist-only) tracks: keep the buttons dimmed, no hover lift. */
.rate-btn:disabled, .rate-btn:disabled:hover { opacity: 0.4; filter: grayscale(1); transform: none; cursor: not-allowed; }
.rate-btn.on { filter: grayscale(0); opacity: 1; background: rgba(47, 123, 255, 0.25); border-color: var(--accent); }
/* Dislike is highlighted in red, like in blue. */
.rate-btn.dislike.on, #radio-dislike.on { background: rgba(255, 59, 82, 0.22); border-color: var(--danger); }
.rate-score { font-size: 0.85rem; color: var(--muted); min-width: 1.5rem; text-align: center; font-variant-numeric: tabular-nums; transition: color 0.2s; }
/* Brief pulse when a rating updates live over the WebSocket. */
.rate-score.flash { animation: score-flash 0.7s var(--ease); }
@keyframes score-flash {
  0% { color: var(--accent-2); transform: scale(1); }
  30% { color: var(--accent-2); transform: scale(1.45); }
  100% { color: var(--muted); transform: scale(1); }
}

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ===== Ads (admin) + Announcements ===== */
.num-input { flex: 0 0 5.5rem; max-width: 5.5rem; }
.muted.small { font-size: 0.82rem; }

.ad-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.ad-item { padding: 1rem 1.1rem; border-radius: var(--radius); display: flex; flex-direction: column; gap: 0.7rem; }
.ad-head-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }

.ad-assignments { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.assign-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(47, 123, 255, 0.16); border: 1px solid rgba(47, 123, 255, 0.35);
  color: var(--text); border-radius: 999px; padding: 0.28rem 0.6rem; font-size: 0.82rem;
}
.chip-x {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 0.75rem; padding: 0; line-height: 1;
}
.chip-x:hover { color: var(--danger); }

.assign-form {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  padding-top: 0.6rem; border-top: 1px solid var(--glass-brd);
}
.assign-form .dd-mount { min-width: 10rem; }

/* ===== Inline icons (Bootstrap Icons) ===== */
.bi { display: inline-block; vertical-align: -0.125em; fill: currentColor; flex-shrink: 0; }
.logo-mark { display: inline-flex; align-items: center; }
.logo-mark svg { width: 1.25em; height: 1.25em; }
.nav-btn svg { width: 1.05em; height: 1.05em; vertical-align: -0.15em; }
.round svg { width: 18px; height: 18px; }
.rate-btn svg { width: 20px; height: 20px; }
.dd-caret svg { width: 12px; height: 12px; }
.chip-x svg { width: 12px; height: 12px; vertical-align: middle; }
.search-icon svg, .vol svg { vertical-align: middle; }
.aviso-sched-label svg { vertical-align: -0.15em; }
.pc-icon svg { display: block; margin: 0 auto; }
.install-btn svg { width: 1em; height: 1em; vertical-align: -0.15em; }

/* ===== Guide (internal help) ===== */
.guide-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.2rem; }
.guide-links a { text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.guide-links svg { width: 1em; height: 1em; vertical-align: -0.15em; }
.guide-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.guide-card {
  background: var(--glass); border: 1px solid var(--glass-brd);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
}
.guide-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.guide-head h3 { margin: 0; font-size: 1.05rem; }
.guide-ic {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(47, 123, 255, 0.14); color: var(--accent-2);
}
.guide-ic svg { width: 20px; height: 20px; }
.guide-card p { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.guide-card p strong { color: var(--text); font-weight: 600; }
.guide-card ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.guide-card li { color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.25rem; }
.guide-card li strong { color: var(--text); font-weight: 600; }

/* ===== PWA install button ===== */
.install-btn {
  border-color: rgba(47, 123, 255, 0.5);
  color: var(--accent-2);
  white-space: nowrap;
}
.install-btn:hover { background: rgba(47, 123, 255, 0.14); border-color: var(--accent); }

/* ===== Aviso scheduling ===== */
.track-list li.aviso-item {
  flex-direction: column; align-items: stretch; gap: 0.7rem;
}
.track-list li.aviso-item:hover { transform: none; }  /* row-slide looks odd on a tall card */
.aviso-top { display: flex; align-items: center; gap: 0.9rem; }
.aviso-sched {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem;
  padding-top: 0.6rem; border-top: 1px solid var(--glass-brd);
}
.sched-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.sched-time {
  font-size: 0.85rem; font-variant-numeric: tabular-nums; color: var(--text);
  background: rgba(47, 123, 255, 0.16); border: 1px solid rgba(47, 123, 255, 0.35);
  border-radius: 999px; padding: 0.24rem 0.6rem;
}
.day-dots { display: inline-flex; gap: 0.22rem; }
.day-dot {
  width: 24px; height: 24px; border-radius: 50%; padding: 0;
  font: inherit; font-size: 0.68rem; line-height: 1; cursor: pointer;
  color: var(--muted); background: var(--glass); border: 1px solid var(--glass-brd);
}
.day-dot.on {
  color: #fff; background: rgba(47, 123, 255, 0.75);
  border-color: rgba(47, 123, 255, 0.9);
}
.day-dot:hover { filter: brightness(1.2); }
.aviso-sched-label { font-size: 0.8rem; color: var(--muted); margin-right: 0.2rem; }
.aviso-time {
  width: 8rem; padding: 0.3rem 0.5rem; font: inherit; font-size: 0.85rem;
  color: var(--text); background: var(--glass); border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm);
}
.aviso-time::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; }
.aviso-sched .round { width: 32px; height: 32px; font-size: 1rem; flex-shrink: 0; }

/* ===== Announcement TTS "Generate" panel ===== */
.tts-toggle { margin-bottom: 0.9rem; }
.tts-panel { padding: 1rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.tts-panel textarea {
  width: 100%; resize: vertical; min-height: 68px; font-family: inherit; font-size: 0.95rem;
  background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--glass-brd);
  border-radius: var(--radius-sm); padding: 0.7rem 0.9rem;
}
.tts-panel textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47,123,255,0.2); }
.tts-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.tts-controls .dd-mount { min-width: 12rem; }
.tts-controls input { flex: 1; min-width: 8rem; }
#tts-status { min-height: 1.1em; }
#tts-status.err { color: var(--danger); }
