/* ===================================================================
   BarTrain — theme + layout stylesheet
   =================================================================== */

* { box-sizing: border-box; }
html, body { height: 100%; }
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
}

:root,
[data-theme="dark"] {
  --bg: #1a1611;
  --panel: #241f18;
  --panel-alt: #2c2519;
  --text: #ece4d4;
  --muted: rgba(236, 228, 212, 0.62);
  --border: rgba(236, 228, 212, 0.12);
  --accent-rgb: 209, 137, 47;           /* #d1892f */
  --accent-highlight-rgb: 232, 160, 74; /* #e8a04a */
  --danger-rgb: 214, 90, 74;
  --success-rgb: 116, 186, 106;
}

[data-theme="light"] {
  --bg: #f5f0e8;
  --panel: #fff9f0;
  --panel-alt: #f1e9d8;
  --text: #2a1f10;
  --muted: rgba(42, 31, 16, 0.62);
  --border: rgba(42, 31, 16, 0.14);
  --accent-rgb: 176, 108, 33;           /* darker amber base */
  --accent-highlight-rgb: 209, 137, 47; /* #d1892f as the "lit" state */
  --danger-rgb: 178, 58, 44;
  --success-rgb: 69, 128, 63;
}

body {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .25s ease, color .25s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

/* ---------- Gradient background effect ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(760px circle at 12% -8%, rgba(var(--accent-highlight-rgb), 0.22), transparent 62%),
    radial-gradient(640px circle at 100% 18%, rgba(var(--accent-rgb), 0.19), transparent 58%),
    radial-gradient(900px circle at 50% 115%, rgba(var(--accent-rgb), 0.14), transparent 62%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg) 100%);
  background-attachment: fixed;
  animation: gradientDrift 22s ease-in-out infinite alternate;
}
@keyframes gradientDrift {
  0%   { filter: hue-rotate(0deg) brightness(1); }
  100% { filter: hue-rotate(8deg) brightness(1.04); }
}
.app-shell, .app-header, .bottom-nav, .overlay, .modal { position: relative; z-index: 1; }

/* Effects are opt-out (Settings → Visual Effects) and auto-off for anyone
   whose OS/browser asks for reduced motion — animated gradients + pulsing
   glow are pure GPU/battery cost on a shared tablet with no functional
   benefit, so they shouldn't be forced on everyone. */
html[data-motion="reduced"] body::before,
html[data-motion="reduced"] .btn-primary {
  animation: none !important;
}
html[data-motion="reduced"] body::before {
  filter: none;
}
@media (prefers-reduced-motion: reduce) {
  body::before, .btn-primary { animation: none !important; }
}

.hidden { display: none !important; }

a, button, input { font-family: inherit; color: inherit; }
button { touch-action: manipulation; }

/* ---------- App shell ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; }
.header-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
  font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:active { background: rgba(var(--accent-rgb), 0.28); }

.main-content {
  padding: 16px 16px calc(100px + env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
}

.screen { display: none; }
.screen.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.screen-title { font-size: 1.4rem; margin: 4px 0 16px; }
.section-heading {
  font-size: .85rem; margin: 22px 0 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 6px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: transparent; border: none;
  color: var(--muted);
  font-size: .72rem; font-weight: 600;
  padding: 10px 4px;
  border-radius: 14px;
  min-height: 58px;
  cursor: pointer;
}
.nav-btn .nav-icon { font-size: 1.4rem; }
.nav-btn.active {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.16);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35), 0 0 18px rgba(var(--accent-rgb), 0.25);
}
.nav-btn:active { transform: scale(.96); }

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  cursor: pointer;
}
.card:active { border-color: rgba(var(--accent-rgb), 0.55); }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-title { margin: 0 0 6px; font-size: 1.05rem; }
.card-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; margin-top: 10px; }

.continue-card {
  background: linear-gradient(150deg, var(--panel), var(--panel-alt));
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 0 26px rgba(var(--accent-rgb), 0.14);
  cursor: default;
}
.continue-title { margin: 6px 0; font-size: 1.15rem; }

.muted-text { color: var(--muted); font-size: .9rem; line-height: 1.55; margin: 0; }

/* ---------- Chips ---------- */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: .85rem; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.22);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  min-height: 50px;
}
.btn-block { width: 100%; }
.btn-primary {
  background: rgb(var(--accent-rgb));
  color: #1a1611;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.38), 0 0 0 rgba(var(--accent-highlight-rgb), 0);
  animation: btnGlowPulse 3.2s ease-in-out infinite;
}
.btn-primary:active { background: rgb(var(--accent-highlight-rgb)); }
.btn-primary:disabled { opacity: .6; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:active { background: rgba(var(--accent-rgb), 0.12); }
.btn-danger {
  background: rgba(var(--danger-rgb), 0.15);
  color: rgb(var(--danger-rgb));
  border-color: rgba(var(--danger-rgb), 0.4);
}
.btn-danger:active { background: rgba(var(--danger-rgb), 0.32); }
.btn-small { padding: 10px 14px; min-height: 40px; font-size: .82rem; }

.dashboard-footer { margin-top: 26px; }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
}
.stat-value { font-size: 1.6rem; font-weight: 700; color: rgb(var(--accent-highlight-rgb)); }
.stat-label { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.progress-bar { height: 8px; border-radius: 99px; background: var(--panel-alt); overflow: hidden; margin-top: 8px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, rgb(var(--accent-rgb)), rgb(var(--accent-highlight-rgb))); }

/* ---------- Quick links ---------- */
.quicklinks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.quicklink-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 6px;
  text-align: center;
  font-size: .8rem; font-weight: 600;
  cursor: pointer;
  min-height: 90px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.quicklink-tile:active { border-color: rgba(var(--accent-rgb), 0.55); box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.22); }
.quicklink-icon { font-size: 1.5rem; }

/* ---------- Type icon (T / M / S / ▶ letter badge) ---------- */
.lesson-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.lesson-card-head-main { flex: 1 1 auto; min-width: 0; }
.lesson-card-head .card-row { margin-bottom: 6px; }
.lesson-card-head .card-title { margin: 0; }
.continue-card .lesson-card-head .continue-title { margin: 0; }

/* ---------- Channel row (Videos tab) ---------- */
.channel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
@media (max-width: 300px) {
  .channel-row { grid-template-columns: 1fr; }
}
.channel-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
}
.channel-card-text { min-width: 0; }
.channel-card-text .card-title { margin: 2px 0 0; font-size: .95rem; }

.type-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem;
  background: rgba(var(--accent-rgb), 0.16);
  color: rgb(var(--accent-highlight-rgb));
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.28);
}
.type-icon-sm { width: 30px; height: 30px; font-size: .85rem; border-radius: 9px; }

/* ---------- Glow effect ----------
   Kept deliberately to ONE pulsing element (the primary CTA button) so it
   draws the eye instead of competing with itself — everything else gets a
   static glow that only reacts on press/hover. */
.glow, .btn-primary, .type-icon, .continue-card, .nav-btn.active, .chip.active {
  transition: box-shadow .25s ease, border-color .25s ease;
}
}
@keyframes btnGlowPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.38), 0 0 10px rgba(var(--accent-highlight-rgb), 0.15); }
  50%      { box-shadow: 0 4px 26px rgba(var(--accent-rgb), 0.5), 0 0 22px rgba(var(--accent-highlight-rgb), 0.4); }
}
.card:active, .lesson-card:active {
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.28);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  background: rgba(var(--accent-rgb), 0.18);
  color: rgb(var(--accent-highlight-rgb));
  border: 1px solid rgba(var(--accent-rgb), 0.35);
}
.badge-success {
  background: rgba(var(--success-rgb), 0.18);
  color: rgb(var(--success-rgb));
  border-color: rgba(var(--success-rgb), 0.4);
}
.badge-danger {
  background: rgba(var(--danger-rgb), 0.18);
  color: rgb(var(--danger-rgb));
  border-color: rgba(var(--danger-rgb), 0.4);
}
.badge-mandatory {
  background: rgba(var(--danger-rgb), 0.16);
  color: rgb(var(--danger-rgb));
  border-color: rgba(var(--danger-rgb), 0.45);
  font-weight: 800;
}
.badge-info {
  background: rgba(var(--accent-rgb), 0.16);
  color: rgb(var(--accent-highlight-rgb));
  border-color: rgba(var(--accent-rgb), 0.4);
}

/* ---------- Search input ---------- */
.search-row { margin-bottom: 14px; }
.text-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: .95rem;
}
.text-input:focus { outline: 2px solid rgba(var(--accent-rgb), 0.5); outline-offset: 1px; }
.select-row { margin-bottom: 14px; }
select.text-input { appearance: none; min-height: 48px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.empty-state { color: var(--muted); text-align: center; padding: 30px 10px; }

/* ---------- Overlays (lesson / quiz) ---------- */
.overlay {
  position: fixed; inset: 0;
  background:
    radial-gradient(760px circle at 12% -8%, rgba(var(--accent-highlight-rgb), 0.22), transparent 62%),
    radial-gradient(640px circle at 100% 18%, rgba(var(--accent-rgb), 0.19), transparent 58%),
    radial-gradient(900px circle at 50% 115%, rgba(var(--accent-rgb), 0.14), transparent 62%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg) 100%);
  background-attachment: fixed;
  animation: gradientDrift 22s ease-in-out infinite alternate;
  z-index: 50;
  transform: translateY(100%);
  transition: transform .3s ease;
  display: flex; flex-direction: column;
}
.overlay.open { transform: translateY(0); }
.overlay-header {
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex: 0 0 auto;
}
.overlay-title { font-weight: 700; }
.overlay-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 16px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
.overlay-footer {
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--panel);
  display: flex; gap: 10px; flex-wrap: wrap;
  flex: 0 0 auto;
}
.overlay-footer .btn { flex: 1; }
.quiz-result-summary { width: 100%; text-align: center; font-weight: 700; margin-bottom: 2px; }
.quiz-progress-row { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 600; color: var(--muted); }

/* ---------- Score ring (quiz results) ---------- */
.results-score-ring {
  width: 96px; height: 96px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
  background:
    conic-gradient(rgb(var(--ring-rgb, var(--success-rgb))) calc(var(--pct, 0) * 1%), rgba(var(--border-rgb, var(--accent-rgb)), 0.18) 0);
  position: relative;
}
.results-score-ring::before {
  content: "";
  position: absolute; inset: 7px;
  border-radius: 50%;
  background: var(--panel);
}
.results-score-ring span { position: relative; z-index: 1; }
.results-score-ring.fail { --ring-rgb: var(--danger-rgb); }
.results-pass-line { text-align: center; font-size: .85rem; color: var(--muted); margin-bottom: 14px; }

/* ---------- Per-question inline feedback ---------- */
.question-feedback {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .85rem;
  display: none;
}
.question-feedback.show { display: block; }
.question-feedback.correct-fb {
  background: rgba(var(--success-rgb), 0.14);
  border: 1px solid rgba(var(--success-rgb), 0.35);
  color: rgb(var(--success-rgb));
}
.question-feedback.incorrect-fb {
  background: rgba(var(--danger-rgb), 0.14);
  border: 1px solid rgba(var(--danger-rgb), 0.35);
  color: rgb(var(--danger-rgb));
}
.quiz-option.answered { pointer-events: none; }
.quiz-option.reveal-correct { border-color: rgba(var(--success-rgb), 0.6); background: rgba(var(--success-rgb), 0.1); }

/* Lesson content blocks */
.lesson-heading { margin: 0 0 6px; font-size: 1.3rem; }
.lesson-summary { margin-bottom: 18px; }
.content-heading { font-size: 1.05rem; margin: 22px 0 8px; color: rgb(var(--accent-highlight-rgb)); }
.content-paragraph { line-height: 1.65; margin: 0 0 14px; }
.content-list { padding-left: 20px; line-height: 1.75; margin: 0 0 14px; }
.content-paragraph code, .content-list code, .content-note code {
  background: rgba(var(--accent-rgb), 0.16);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .88em;
}
.content-note {
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  padding: 12px 14px;
  border-radius: 12px;
  margin: 0 0 14px;
  font-size: .9rem;
}

/* ---------- Checklist content block ---------- */
.checklist-block { margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  font-size: .92rem;
  font-family: inherit;
}
.checklist-item:active { border-color: rgba(var(--accent-rgb), 0.5); }
.checklist-item.checked {
  border-color: rgba(var(--success-rgb), 0.5);
  background: rgba(var(--success-rgb), 0.1);
}
.checklist-box {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 7px;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700;
  color: rgb(var(--success-rgb));
}
.checklist-item.checked .checklist-box { border-color: rgb(var(--success-rgb)); }
.checklist-item.checked .checklist-text { text-decoration: line-through; opacity: .75; }

/* ---------- Quiz question UI ---------- */
.quiz-question { margin-bottom: 24px; }
.quiz-question-text { font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.quiz-option {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  cursor: pointer;
  background: var(--panel);
}
.quiz-option:active { border-color: rgba(var(--accent-rgb), 0.5); }
.quiz-option.selected { border-color: rgba(var(--accent-rgb), 0.65); background: rgba(var(--accent-rgb), 0.14); }
.quiz-option.correct { border-color: rgba(var(--success-rgb), 0.75); background: rgba(var(--success-rgb), 0.16); }
.quiz-option.incorrect { border-color: rgba(var(--danger-rgb), 0.75); background: rgba(var(--danger-rgb), 0.16); }
.explanation-text { font-size: .85rem; color: var(--muted); margin: -2px 0 16px 2px; }

/* ---------- Settings modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-panel {
  background: var(--panel);
  width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  transform: translateY(24px);
  transition: transform .25s ease;
  max-height: 85vh;
  overflow-y: auto;
}
.modal.open .modal-panel { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-header h2 { margin: 0; font-size: 1.2rem; }

.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row-column { flex-direction: column; align-items: flex-start; gap: 10px; }
.settings-row:last-child { border-bottom: none; }
.confirm-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.confirm-row-column { flex-direction: column; align-items: stretch; }

.switch {
  width: 52px; height: 30px;
  border-radius: 99px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .25s ease, background .25s ease;
}
.switch[aria-checked="true"] { background: rgba(var(--accent-rgb), 0.35); border-color: rgba(var(--accent-rgb), 0.5); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(22px); background: rgb(var(--accent-highlight-rgb)); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px;
  transform: translate(-50%, 20px);
  background: var(--panel);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.35);
  opacity: 0;
  transition: all .3s ease;
  z-index: 80;
  font-size: .88rem;
  max-width: 90vw;
  text-align: center;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Video embeds ---------- */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.25);
}
.video-embed iframe, .video-embed video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ---------- Playlists ---------- */
.playlist-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px;
}
.playlist-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 18px;
}
.playlist-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  font-size: .9rem;
  font-family: inherit;
  cursor: pointer;
}
.playlist-item-num {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), 0.18);
  color: rgb(var(--accent-highlight-rgb));
  font-size: .75rem; font-weight: 700;
}
.playlist-item.is-active {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.12);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.2);
}

/* ---------- Load error banner ---------- */
.load-error-banner {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(220, 90, 90, 0.16);
  border: 1px solid rgba(220, 90, 90, 0.4);
  color: var(--text);
  font-size: .85rem;
  line-height: 1.4;
}

/* ---------- Profile picker ---------- */
.profile-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 240px; overflow-y: auto;
}
.profile-item {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  font-size: .95rem;
  font-family: inherit;
  cursor: pointer;
}
.profile-item:active {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.12);
}

/* ---------- Small screens tweak ---------- */
@media (max-width: 360px) {
  .quicklink-tile { font-size: .72rem; }
  .stat-value { font-size: 1.3rem; }
}
