:root {
  --bg: #14111f;
  --bg-card: #1c1829;
  --bg-elevated: #231f33;
  --text: #f4f2ff;
  --text-muted: #9b94b8;
  --accent: #7c6cff;
  --accent-soft: rgba(124, 108, 255, 0.18);
  --gradient-title: linear-gradient(135deg, #b8b0ff 0%, #ffffff 55%, #8fd3ff 100%);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --nav-height: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #221c35 0%, var(--bg) 42%);
  color: var(--text);
  min-height: 100%;
  line-height: 1.45;
  overflow-x: hidden;
}

a { color: inherit; }

.phone-frame {
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  background: radial-gradient(circle at top, #221c35 0%, var(--bg) 42%);
}

.screen-shell {
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
}

@media (min-width: 900px) {
  body.app-body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
  }

  .phone-frame {
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    overflow: hidden;
    height: min(860px, 100dvh);
    max-height: min(860px, 100dvh);
    display: flex;
    flex-direction: column;
  }

  .screen-shell {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.75rem;
  }

  .bottom-nav {
    position: absolute;
    left: 0;
    transform: none;
    width: 100%;
  }
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.5rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }

.btn-pdf-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(124, 108, 255, 0.3);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-pdf-download:hover {
  background: rgba(124, 108, 255, 0.28);
  border-color: rgba(124, 108, 255, 0.55);
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: 0 1.25rem 1rem;
  background: var(--gradient-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.search-row {
  display: flex;
  gap: 0.65rem;
  padding: 0 1.25rem 1.25rem;
}

.search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-pill);
  padding: 0.85rem 1rem;
}

.search-wrap svg { color: var(--text-muted); flex-shrink: 0; }

.search-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.search-wrap input::placeholder { color: var(--text-muted); }

.section { padding: 0 0 1.35rem; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem 0.85rem;
}

.section-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.search-result-count {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #888);
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  padding: 0.15em 0.6em;
  vertical-align: middle;
  margin-left: 0.4rem;
}

.section-head a {
  color: #9eb4ff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem 0.35rem;
  padding: 0 1.25rem;
}

.category-item {
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.category-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 0.45rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.category-icon svg {
  width: 26px;
  height: 26px;
}

.pictogram { fill: #fff; }

.category-item span {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.15;
  display: block;
  padding: 0 0.1rem;
}

.category-item.active span,
.category-item:hover span {
  color: var(--text);
  font-weight: 600;
}

.recent-grid,
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0 1.25rem;
}

.recent-card,
.video-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 11;
  background: linear-gradient(135deg, #2a2240, #171322);
}

.thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  cursor: pointer;
}

.video-card-body {
  padding: 0.75rem 0.85rem 0.9rem;
}

.video-card-body h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tag-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: #b7adff;
  background: var(--accent-soft);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.date-small {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.discover-list,
.saved-list,
.profile-panel {
  padding: 0 1.25rem 1rem;
}

.discover-grid {
  padding-bottom: 1rem;
}

.list-card-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.list-card-wrap .list-card {
  flex: 1;
  margin-bottom: 0;
}

.list-card-btns {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.list-card {
  display: flex;
  gap: 0.85rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  text-decoration: none;
  color: inherit;
}

.list-thumb {
  width: 96px;
  height: 64px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2f2748, #171322);
  flex-shrink: 0;
  overflow: hidden;
}

.list-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.list-card h3 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.list-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.profile-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.stat-row {
  display: flex;
  gap: 0.75rem;
}

.stat {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 0.85rem;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 0.15rem;
}

.stat span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.92rem;
  text-decoration: none;
  color: inherit;
}

.settings-item:last-child { border-bottom: none; }

.settings-item small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, 100%);
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(16, 13, 26, 0.98);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  min-width: 64px;
}

.nav-item svg { width: 22px; height: 22px; }

.nav-item.active { color: var(--text); }

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

.badge-count {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.top-bar .icon-btn { position: relative; }

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  background: var(--gradient-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.login-card label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #c8ced9;
}

.login-card input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-card button {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.error {
  background: #3a1f1f;
  border: 1px solid #7a3030;
  color: #ff8a8a;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Card action buttons (delete + favourite) */
.thumb { position: relative; }

.card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 5px;
  z-index: 2;
}

.card-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  opacity: 0.75;
}

.card-btn:hover  { opacity: 1; transform: scale(1.12); }
.card-btn:active { transform: scale(0.95); }

/* Desktop: fade in on card hover */
@media (hover: hover) {
  .card-btn        { opacity: 0; }
  .video-card:hover .card-btn,
  .list-card-wrap:hover .card-btn { opacity: 0.85; }
  .video-card:hover .card-btn:hover,
  .list-card-wrap:hover .card-btn:hover { opacity: 1; }
}

/* Mobile: always slightly visible */
@media (hover: none) {
  .card-btn { opacity: 0.75; }
}

.fav-btn.is-fav { color: #ff6b9d; }
.fav-btn.is-fav svg { fill: currentColor; }
.fav-btn.is-fav:hover { background: rgba(255, 107, 157, 0.3); }

.delete-btn:hover { background: #ef4444; }

/* Queue status list */
.queue-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.queue-item:last-child { border-bottom: none; }

.queue-status {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  margin-top: 2px;
}

.queue-status--downloaded { background: rgba(34,197,94,0.18); color: #4ade80; }
.queue-status--pending    { background: rgba(251,191,36,0.18); color: #fbbf24; }
.queue-status--failed     { background: rgba(239,68,68,0.18);  color: #f87171; }
.queue-status--auth_required { background: rgba(168,85,247,0.18); color: #c084fc; }
.queue-status--unknown    { background: rgba(100,116,139,0.18); color: #94a3b8; }

.queue-info { flex: 1; min-width: 0; }

.queue-title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-notes {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Section head with actions ──────────────────────────────────────────── */
.section-head-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ─── Training mode toggle button ────────────────────────────────────────── */
.training-toggle-btn {
  padding: 0.3rem 0.75rem;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.training-toggle-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Training-select checkbox overlay on cards ──────────────────────────── */
.training-select {
  display: none;
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 4;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.training-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Show checkboxes and hide action buttons in training mode */
body.training-mode .training-select {
  display: flex;
}

body.training-mode .card-actions {
  display: none;
}

/* ─── List-card training select ──────────────────────────────────────────── */
.list-training-select {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  flex-shrink: 0;
  cursor: pointer;
}

body.training-mode .list-training-select {
  display: flex;
}

body.training-mode .list-card-btns {
  display: none;
}

/* Highlight selected list cards */
.list-card-wrap.is-selected .list-card {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* Highlight selected cards */
.video-card.is-selected .thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2.5px var(--accent);
  pointer-events: none;
  z-index: 3;
}

/* ─── Create session sticky bar ──────────────────────────────────────────── */
.create-session-bar {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: min(410px, calc(100% - 2rem));
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  background: rgba(26, 22, 40, 0.97);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-lg);
  padding: 10px 10px 10px;
}

.create-session-bar.is-visible {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

/* ─── Preview strip (thumbnail avatars of selected videos) ───────────────── */
.session-preview-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-height: 0;
  opacity: 0;
  padding: 0;
  transition: max-height 0.22s ease, opacity 0.18s ease, padding-bottom 0.22s ease;
}

.session-preview-strip::-webkit-scrollbar { display: none; }

.session-preview-strip.has-items {
  max-height: 90px;
  opacity: 1;
  padding-bottom: 9px;
}

.session-preview-thumb {
  position: relative;
  width: 50px;
  flex-shrink: 0;
  overflow: visible;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.session-preview-thumb-inner {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: var(--bg-elevated);
  transition: border-color 0.15s, opacity 0.15s;
}

.session-preview-thumb:hover .session-preview-thumb-inner {
  border-color: rgba(239, 68, 68, 0.6);
  opacity: 0.8;
}

.session-preview-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.session-preview-thumb-label {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  padding: 2px;
  line-height: 1.2;
  overflow: hidden;
}

.session-preview-title {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50px;
  line-height: 1.2;
}

.session-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(220, 50, 50, 0.92);
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  z-index: 2;
  padding: 0;
  transition: background 0.12s, transform 0.1s;
}

.session-preview-remove:hover { background: #ef4444; transform: scale(1.15); }
.session-preview-remove:active { transform: scale(0.9); }

/* ─── Preview strip hover/long-press tooltip ─────────────────────────────── */
.session-thumb-tooltip {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  max-height: 0;
  opacity: 0;
  padding: 0 0.5rem;
  transition: max-height 0.15s ease, opacity 0.15s ease, padding 0.15s ease;
  pointer-events: none;
}

.session-thumb-tooltip.is-visible {
  max-height: 24px;
  opacity: 1;
  padding: 4px 0.5rem;
}

.create-session-btn {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(124, 108, 255, 0.45);
  transition: opacity 0.2s, transform 0.15s;
}

.create-session-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.create-session-btn:not(:disabled):hover {
  transform: scale(1.02);
}

/* ─── Session view ───────────────────────────────────────────────────────── */
.session-body {
  padding: 0 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.session-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.1rem 1rem;
}

.session-card h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.session-count {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  text-transform: none;
}

.session-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.session-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.session-meta {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.5rem 0 1rem;
}

.reset-banners-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.15s;
}
.reset-banners-link:hover {
  color: var(--text);
}

.session-removed-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 1rem 0.75rem;
  padding: 0.7rem 0.85rem;
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 35%, transparent);
  border-radius: var(--radius-lg);
  font-size: 0.83rem;
  color: var(--text);
  line-height: 1.4;
}

.session-removed-banner svg {
  flex-shrink: 0;
  color: #f59e0b;
}

.session-removed-banner > span {
  flex: 1;
}

.session-removed-link {
  color: #f59e0b;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.session-removed-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem;
  color: var(--text-muted);
  line-height: 0;
  border-radius: var(--radius-sm);
}

.session-removed-close:hover {
  color: var(--text);
}

/* Playlist player */
.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.playlist-pos {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.playlist-nav {
  display: flex;
  gap: 0.25rem;
}

.playlist-video-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  margin-bottom: 0.75rem;
}

.playlist-video-wrap video {
  width: 100%;
  display: block;
  max-height: 240px;
  object-fit: contain;
}

.playlist-removed-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 160px;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.playlist-removed-notice svg {
  opacity: 0.5;
}

.playlist-removed-notice p {
  margin: 0;
  font-size: 0.85rem;
}

.playlist-removed-name {
  font-weight: 700;
  font-size: 0.95rem !important;
  color: var(--text);
}

.playlist-info {
  margin-bottom: 0.4rem;
}

.playlist-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.playlist-technique {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 0.15rem;
}

.playlist-key-points ul {
  margin: 0.5rem 0 0 1.1rem;
  list-style: disc;
}

.playlist-key-points li {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.2rem;
}

/* Coaching notes */
.coaching-note {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.coaching-note:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.coaching-note h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.coaching-note ul {
  margin-left: 1.1rem;
  list-style: disc;
}

.coaching-note li {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.15rem;
}

/* ─── Category filter pill row (Favourites page) ─────────────────────────── */
.filter-pill-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0 1.25rem 1rem;
  scrollbar-width: none;
}

.filter-pill-row::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex-shrink: 0;
  padding: 0.3rem 0.85rem;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-pill.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.search-section {
  padding-bottom: 0.5rem;
}

.search-section-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem 0.4rem;
}

.search-section-label svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item { min-width: 52px; }

/* ─── Missing-video restoration notice ───────────────────────────────────── */
.session-missing-notice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem 1rem 0;
  padding: 0.65rem 0.85rem;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.35;
  animation: fadeInDown 0.25s ease;
}

.session-missing-notice p {
  flex: 1;
  margin: 0;
}

.session-missing-notice button {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: #92400e;
  opacity: 0.7;
}

.session-missing-notice button:hover { opacity: 1; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Bulk Add page ────────────────────────────────────────────── */
.add-page {
  padding: 1rem 1rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.add-hint {
  font-size: 0.82rem;
  color: var(--text-muted, #888);
  line-height: 1.5;
  margin: 0;
}

.add-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.add-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border, #333);
  border-radius: 10px;
  color: var(--text, #f0f0f0);
  font-size: 0.78rem;
  font-family: ui-monospace, monospace;
  line-height: 1.6;
  padding: 0.75rem;
  resize: vertical;
  outline: none;
}

.add-textarea:focus {
  border-color: var(--accent, #e63946);
}

.add-submit {
  align-self: flex-end;
  background: var(--accent, #e63946);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.add-submit:hover { opacity: 0.85; }

.add-results {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.result-group {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: var(--card-bg, #1a1a1a);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
}

.result-icon {
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.result-ok  { border-left: 3px solid #22c55e; }
.result-ok  .result-icon { color: #22c55e; }
.result-skip { border-left: 3px solid #888; }
.result-skip .result-icon { color: #888; }
.result-err  { border-left: 3px solid #ef4444; }
.result-err  .result-icon { color: #ef4444; }

.result-list {
  margin: 0.3rem 0 0;
  padding-left: 1rem;
  color: var(--text-muted, #999);
  word-break: break-all;
  line-height: 1.6;
}
