:root {
  --bg-canvas: #09090B;
  --bg-surface-1: #121215;
  --bg-surface-2: #1C1C21;
  --bg-surface-3: #27272A;
  --border-subtle: #27272A;
  --border-focus: #52525B;
  --border-light: #3F3F46;
  --text-primary: #FFFFFF;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --accent-monochrome: #FAFAFA;
  --accent-glow: rgba(255, 255, 255, 0.12);
  --overlay-mask: rgba(9, 9, 11, 0.85);
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-pill: 9999px;
  --speed-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --speed-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
.hub-card,
.subject-card,
.lecture-item,
.chapter-card,
.fab-add,
.category-tab,
.hub-tab,
.subject-tab,
.pomodoro-header,
.student-progress-counter,
.search-bar,
input,
select {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Allow text selection in content areas only */
.page-wrap,
.hub-main,
.admin-content,
.lecture-info,
.chapter-preview-row {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 28px;
  background-color: var(--bg-surface-1);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-logo {
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all var(--speed-fast);
  flex-shrink: 0;
}
.back-link:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-surface-1);
  color: var(--text-primary);
}
.back-icon {
  display: block;
}
.site-logo .accent { color: var(--accent-monochrome); }
.search-bar {
  flex: 1;
  max-width: 420px;
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--speed-fast), box-shadow var(--speed-fast);
}
.search-bar:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-bar::placeholder { color: var(--text-muted); }
.subject-tabs {
  display: flex;
  gap: 6px;
}
.subject-tab {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.88rem;
  border: 1px solid transparent;
  background-color: transparent;
  transition: all var(--speed-normal);
  cursor: pointer;
}
.subject-tab:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-2);
}
.subject-tab.active {
  color: var(--text-primary);
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
}
.student-progress-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.student-progress-counter .progress-value {
  color: var(--accent-monochrome);
  font-weight: 600;
}
.pomodoro-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: var(--bg-surface-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  transition: all var(--speed-fast);
}
.pomodoro-header:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-surface-1);
}
.pomodoro-header .pomodoro-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-monochrome);
  white-space: nowrap;
  cursor: pointer;
  padding: 2px 6px;
}
.pomodoro-header .pomodoro-time:hover {
  background-color: var(--bg-surface-1);
  border-radius: var(--radius-btn);
}
.pomodoro-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 4px;
  font-size: 1.1rem;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all var(--speed-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pomodoro-toggle:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-1);
}
.pomodoro-input {
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-focus);
  color: var(--text-primary);
  border-radius: var(--radius-btn);
  font-size: 0.88rem;
  text-align: center;
  outline: none;
}
.pomodoro-plus, .pomodoro-minus {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all var(--speed-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.pomodoro-plus:hover, .pomodoro-minus:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-surface-1);
  color: var(--text-primary);
}
.pomodoro-reset {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all var(--speed-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.pomodoro-reset:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-surface-1);
  color: var(--text-primary);
}
.pomodoro-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-monochrome);
  white-space: nowrap;
}
.pomodoro-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-monochrome);
  white-space: nowrap;
}
.stream-heading {
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--text-primary);
  transition: transform var(--speed-normal);
}
.stream-heading:hover {
  transform: translateX(4px);
}
.pomodoro-banner.pomodoro-transition {
  background-color: var(--accent-glow);
}
.pomodoro-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-surface-1);
  border-bottom: 1px solid var(--border-subtle);
}
@media (max-width: 600px) {
  .pomodoro-banner {
    gap: 8px;
    padding: 8px 12px;
  }
  .pomodoro-banner .pomodoro-time {
    font-size: 0.9rem;
  }
  .pomodoro-banner .pomodoro-mode {
    font-size: 0.75rem;
    padding: 2px 8px;
  }
}
.pomodoro-time {
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-monochrome);
}
.pomodoro-mode {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}
.pomodoro-mode[data-mode="break"] { color: var(--text-secondary); }
.page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.stream-heading {
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--text-primary);
}
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.subject-card {
  display: block;
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  transition: all var(--speed-normal), transform 150ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  animation: cardFadeIn 0.4s ease-out;
  animation-fill-mode: both;
}
.subject-card:nth-child(1) { animation-delay: 0.05s; }
.subject-card:nth-child(2) { animation-delay: 0.1s; }
.subject-card:nth-child(3) { animation-delay: 0.15s; }
.subject-card:nth-child(4) { animation-delay: 0.2s; }
.subject-card:nth-child(5) { animation-delay: 0.25s; }
.subject-card:nth-child(6) { animation-delay: 0.3s; }
.subject-card:nth-child(7) { animation-delay: 0.35s; }
.subject-card:nth-child(8) { animation-delay: 0.4s; }
.subject-card:nth-child(9) { animation-delay: 0.45s; }
.subject-card:nth-child(10) { animation-delay: 0.5s; }
.subject-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.subject-card:focus-visible {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.subject-card h3 {
  margin: 4px 0 6px;
  font-size: 1.02rem;
  color: var(--text-primary);
}
.subject-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.lecture-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 1fr);
  gap: 24px;
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
}
@media (max-width: 960px) {
  .lecture-layout {
    grid-template-columns: 1fr;
  }
  .playlist-column {
    display: block;
    max-height: min(50vh, 420px);
    margin-top: 4px;
  }
}
.player-column {
  min-width: 0;
}
.player-frame-wrap {
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border-subtle);
  position: relative;
  transition: border-color var(--speed-normal);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  /* Force hardware layer so overflow:hidden reliably clips the YouTube iframe */
  transform: translateZ(0);
  clip-path: inset(0 round 16px);
}
.player-frame-wrap:hover {
  border-color: var(--border-focus);
}

/* Video.js 10 layout — fill the frame edge-to-edge (no black corner gaps) */
.player-frame-wrap .hsc-player,
.player-frame-wrap video-player {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
.player-frame-wrap .hsc-video-skin,
.player-frame-wrap video-skin {
  display: block;
  width: 100%;
  height: 100%;
  /* Parent owns aspect-ratio + radius; skin must not re-impose its own */
  aspect-ratio: unset !important;
  border-radius: 0 !important;
  overflow: hidden;
}
.player-frame-wrap youtube-video,
.player-frame-wrap video,
.player-frame-wrap iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  border: 0;
  border-radius: 0 !important;
  object-fit: cover;
  background: #000;
}
/* YouTube iframe host often injects a sized box — force fill */
.player-frame-wrap youtube-video *,
.player-frame-wrap .html-video-container {
  width: 100% !important;
  height: 100% !important;
}

.hsc-player {
  width: 100%;
  height: 100%;
}
.video-mask-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 10;
  pointer-events: none;
}
.video-mask-bottom {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 140px;
  height: 56px;
  z-index: 10;
  pointer-events: none;
}
.player-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 10px 14px;
}
.source-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.source-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.source-select {
  padding: 8px 32px 8px 12px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--speed-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3c svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3cpolyline points='6 9 12 15 18 9'%3E%3c/polyline%3E%3c/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 10px) center;
  background-size: 12px;
}
.source-select option {
  color: #FFFFFF;
  background-color: var(--bg-surface-2);
}
.source-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-glow);
  outline: none;
}
.source-select:hover {
  border-color: var(--border-focus);
}
.custom-dropdown {
  position: relative;
  display: inline-block;
}
.custom-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 32px 8px 12px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--speed-fast);
  white-space: nowrap;
  position: relative;
}
.custom-dropdown-btn::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-secondary);
  transition: transform var(--speed-fast);
}
.custom-dropdown.open .custom-dropdown-btn::after {
  transform: translateY(-50%) rotate(180deg);
}
.custom-dropdown-btn:hover {
  border-color: var(--border-focus);
}
.custom-dropdown-btn:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-glow);
  outline: none;
}
.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 4px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  max-height: 280px;
  overflow-y: auto;
}
.custom-dropdown.open .custom-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--speed-fast);
  white-space: nowrap;
}
.dropdown-option:hover {
  background: var(--bg-surface-1);
}
.dropdown-option.selected {
  background: var(--border-subtle);
  color: var(--text-primary);
}
.dropdown-option .check-icon {
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity var(--speed-fast);
  flex-shrink: 0;
  color: var(--accent-monochrome);
}
.dropdown-option.selected .check-icon {
  opacity: 1;
}
.youtube-escape-btn {
  color: var(--text-primary);
  border-style: solid;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-2);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--speed-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.youtube-escape-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background-color: var(--bg-surface-1);
}
.breadcrumb {
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.breadcrumb-segment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--speed-fast);
  font-weight: 500;
  text-decoration: none;
  user-select: none;
}
.breadcrumb-segment:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
  border-color: var(--border-focus);
}
.breadcrumb-segment:active {
  transform: scale(0.98);
}
.breadcrumb-segment .seg-icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}
.breadcrumb-segment:hover .seg-icon {
  opacity: 1;
}
.breadcrumb-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--text-primary);
  background: var(--bg-surface-1);
  border: 1px solid var(--border-focus);
  font-weight: 600;
  user-select: none;
}
.breadcrumb-current .seg-icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
  flex-shrink: 0;
}
.breadcrumb-chevron {
  color: var(--text-muted);
  opacity: 0.4;
  user-select: none;
  display: flex;
  align-items: center;
}
.breadcrumb-chevron svg {
  width: 12px;
  height: 12px;
}
.lecture-title-block {
  margin-top: 22px;
}
.lecture-title-block h1 {
  font-size: 1.15rem;
  padding-top: 10px;
  margin: 0 0 4px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.playlist-column {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.playlist-column::-webkit-scrollbar {
  width: 6px;
}
.playlist-column::-webkit-scrollbar-track {
  background: transparent;
}
.playlist-column::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}
.playlist-column::-webkit-scrollbar-thumb:hover {
  background: var(--border-focus);
}
.playlist-heading {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 4px 8px 12px;
  color: var(--text-secondary);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.chapter-group-heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 16px 8px 8px;
  font-weight: 600;
}
.lecture-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-1);
  margin-bottom: 6px;
  transition: all var(--speed-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.lecture-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-monochrome);
  opacity: 0;
  transition: opacity var(--speed-fast);
  border-radius: 0 2px 2px 0;
}
.lecture-item:hover::before {
  opacity: 0.5;
}
.lecture-item.active::before {
  opacity: 1;
}
.lecture-item:hover {
  background-color: var(--bg-surface-2);
  border-color: var(--border-focus);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.lecture-item.active {
  background-color: var(--bg-surface-2);
  border-color: var(--border-light);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.lecture-item .lecture-index {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-surface-2);
  font-weight: 600;
  transition: all var(--speed-fast);
  position: relative;
}
.lecture-item .lecture-index .idx-text {
  transition: opacity var(--speed-fast);
}
.lecture-item .lecture-index .play-icon {
  position: absolute;
  opacity: 0;
  transition: opacity var(--speed-fast);
  color: var(--bg-canvas);
}
.lecture-item:hover .lecture-index .idx-text {
  opacity: 0;
}
.lecture-item:hover .lecture-index .play-icon {
  opacity: 1;
}
.lecture-item:hover .lecture-index {
  background: var(--accent-monochrome);
}
.lecture-item.active .lecture-index {
  background: var(--accent-monochrome);
  color: var(--bg-canvas);
}
.lecture-item.active .lecture-index .idx-text {
  opacity: 0;
}
.lecture-item.active .lecture-index .play-icon {
  opacity: 1;
}
.lecture-item .lecture-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.lecture-item .lecture-info .title {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  font-weight: 500;
  display: block;
}
.lecture-item .lecture-info .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lecture-item .lecture-info .subtitle .duration {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.lecture-item .lecture-info .subtitle .instructor {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0.7;
}
.mini-progress-track {
  height: 3px;
  background: var(--border-subtle);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
  max-width: 220px;
}
.mini-progress-fill {
  height: 100%;
  background: var(--accent-monochrome);
  width: 0%;
  transition: width var(--speed-normal);
}
.completed-check {
  color: var(--accent-monochrome);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity var(--speed-fast);
}
.completed-check.visible {
  opacity: 1;
}
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.loading-spinner::before {
  content: "";
  width: 20px;
  height: 20px;
  margin-right: 12px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-monochrome);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}
.empty-state::before {
  content: "⋯";
  font-size: 2rem;
  opacity: 0.3;
  margin-bottom: 16px;
}
.error-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-secondary);
  text-align: center;
}
.error-panel h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin: 0 0 8px;
}
.error-panel p {
  margin: 0;
  font-size: 0.9rem;
}
.card-surface {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  transition: border-color var(--speed-fast), background-color var(--speed-fast);
}
.card-surface:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-surface-2);
}
.btn-monochrome {
  background-color: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--speed-fast);
}
.btn-monochrome:hover {
  border-color: var(--border-focus);
}
.playlist-item.active {
  background-color: var(--bg-surface-2);
  border-left: 3px solid var(--accent-monochrome);
}
.home-divider {
  width: 100%;
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  margin: 24px 0;
}
.home-title {
  font-family: 'Comic Sans MS', 'Permanent Marker', 'Segoe UI', system-ui, sans-serif;
  font-size: 3.2rem;
  font-weight: normal;
  text-align: center;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.category-tab {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.88rem;
  border: 1px solid transparent;
  background-color: transparent;
  transition: all var(--speed-normal);
  cursor: pointer;
}
.category-tab:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-2);
}
.category-tab.active {
  color: var(--text-primary);
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
}
.course-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.course-card-main {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 24px;
  transition: all var(--speed-normal), transform 150ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  animation: cardFadeIn 0.4s ease-out;
  animation-fill-mode: both;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}
.course-card-main a.course-card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.course-card-main:nth-child(1) { animation-delay: 0.05s; }
.course-card-main:nth-child(2) { animation-delay: 0.1s; }
.course-card-main:nth-child(3) { animation-delay: 0.15s; }
.course-card-main:hover {
  border-color: var(--border-focus);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.course-card-main:focus-visible {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-glow);
  outline: none;
}
.course-card-content h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--text-primary);
}
.course-card-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}
.fab-add {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-card);
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  transition: all var(--speed-normal), transform 150ms ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}
.fab-add.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.fab-add:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-surface-1);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}
.fab-add:active {
  transform: translateY(0);
}
.fab-icon {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}
.fab-sparkles {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 2px;
  opacity: 0.6;
}
.sparkle {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background-color: var(--accent-monochrome);
  animation: sparkleGlow 2s infinite ease-in-out;
}
.sparkle:nth-child(2) { animation-delay: 0.3s; }
.sparkle:nth-child(3) { animation-delay: 0.6s; }
@keyframes sparkleGlow {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 0.8; transform: scale(1.2); }
}
.chapters-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@keyframes chapterFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chapter-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
  transition: all var(--speed-normal), transform 150ms ease;
  animation: chapterFadeIn 0.3s ease-out;
  animation-fill-mode: both;
}
.chapter-card:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-surface-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.chapter-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}
.lecture-row-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lecture-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-btn);
  transition: all var(--speed-fast);
  cursor: pointer;
}
.lecture-row:hover {
  background-color: var(--bg-surface-2);
  transform: translateX(3px);
}
.lecture-row .title {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.9rem;
}
.lecture-row .badge-duration {
  color: var(--text-muted);
  font-size: 0.82rem;
  background: var(--bg-surface-2);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
@media (max-width: 960px) {
  .site-header {
    gap: 16px;
    padding: 12px 16px;
  }
  .page-wrap {
    padding: 20px 12px 48px;
  }
  .lecture-layout {
    padding: 16px;
  }
  .hub-header {
    padding: 12px 16px;
  }
  .hub-main {
    padding: 20px 16px 64px;
  }
  .subject-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }
}
.hub-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(18, 18, 18, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #27272a;
}
.hub-header-row {
  display: none; /* legacy; controls live in one row with brand */
}
.hub-brand {
  display: flex;
  align-items: baseline;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  user-select: none;
  flex-shrink: 0;
}
.hub-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
}
.hub-controls .search-bar {
  flex: 0 1 220px;
  min-width: 120px;
  max-width: 280px;
}
.hub-controls .pomodoro-header {
  flex-shrink: 0;
}
.hub-controls .student-progress-counter {
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .hub-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas:
      "brand search history group"
      "pomodoro pomodoro pomodoro pomodoro";
    align-items: center;
    padding: 8px 10px;
    gap: 6px 8px;
    flex-wrap: unset;
  }
  .hub-brand {
    grid-area: brand;
    font-size: 1.15rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .hub-controls {
    display: contents;
  }
  .hub-controls .search-bar {
    display: none;
  }
  .hub-controls .mobile-search-toggle {
    grid-area: search;
    justify-self: center;
  }
  .hub-controls .recent-history-widget {
    grid-area: history;
    justify-self: center;
  }
  .hub-controls .switch-group-btn {
    grid-area: group;
    justify-self: center;
  }
  .hub-controls .pomodoro-header {
    grid-area: pomodoro;
    width: 60%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-self: center;
    justify-content: space-between;
    gap: 4px;
    padding: 6px 10px;
    box-sizing: border-box;
    background-color: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
  }
  .hub-controls .pomodoro-header .pomodoro-time {
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-monochrome);
    padding: 2px 6px;
    white-space: nowrap;
  }
  .hub-controls .student-progress-counter {
    grid-area: group;
    justify-self: end;
  }
  .pomodoro-toggle {
    min-width: 36px;
    min-height: 36px;
    font-size: 1rem;
  }
  .pomodoro-plus, .pomodoro-minus, .pomodoro-reset {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  .student-progress-counter {
    font-size: 0.72rem;
    padding: 5px 8px;
    gap: 4px;
    border-radius: 8px;
  }
  .student-progress-counter .progress-value {
    font-size: 0.75rem;
  }

  /* Site header mobile (lecture page) */
  .site-header {
    gap: 10px;
    padding: 10px 12px;
    flex-wrap: wrap;
  }
  .site-header .search-bar {
    max-width: 100%;
    order: 3;
    flex: 1 1 100%;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  .site-header .subject-tabs {
    order: 2;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .site-header .subject-tabs::-webkit-scrollbar {
    display: none;
  }
  .subject-tab {
    padding: 10px 14px;
    min-height: 44px;
    white-space: nowrap;
  }
  .pomodoro-header {
    padding: 4px 8px;
    gap: 4px;
    border-radius: 8px;
  }
  .pomodoro-header .pomodoro-time {
    font-size: 0.82rem;
    padding: 2px 6px;
    min-height: 28px;
    display: flex;
    align-items: center;
  }

  .hub-main {
    padding: 16px 12px 64px;
  }
  .hub-hero {
    font-size: 2rem;
    margin: 4px 0;
  }
  .hub-tagline {
    font-size: 0.85rem;
    margin-bottom: 20px;
  }
  .hub-tabs {
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .hub-tabs::-webkit-scrollbar {
    display: none;
  }
  .hub-tab {
    padding: 10px 12px;
    min-height: 44px;
    white-space: nowrap;
    flex: 1 1 0%;
  }
  .hub-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .hub-card {
    min-height: 140px;
    padding: 16px;
  }
  .hub-card-title {
    font-size: 0.95rem;
    padding-top: 10px;
  }
  .home-title {
    font-size: 1.8rem;
  }
  .course-cards-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .course-card-main {
    padding: 20px;
    min-height: 120px;
  }
  .category-tabs {
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .category-tabs::-webkit-scrollbar {
    display: none;
  }
  .category-tab {
    padding: 10px 16px;
    min-height: 44px;
    white-space: nowrap;
  }
  .fab-add {
    bottom: 20px;
    right: 16px;
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
    border-radius: 14px;
  }
  .lecture-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
  .player-frame-wrap {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    clip-path: inset(0 round 12px);
  }
  .player-actions {
    padding: 10px 12px;
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  .source-dropdown-wrap {
    width: 100%;
  }
  .custom-dropdown-btn {
    width: 100%;
    justify-content: space-between;
    min-height: 44px;
  }
  .youtube-escape-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  .breadcrumb {
    font-size: 0.75rem;
    gap: 4px;
    margin-bottom: 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .breadcrumb::-webkit-scrollbar {
    display: none;
  }
  .breadcrumb-segment {
    padding: 6px 8px;
    min-height: 36px;
    white-space: nowrap;
  }
  .breadcrumb-current {
    padding: 6px 8px;
    min-height: 36px;
  }
  .lecture-title-block h1 {
    font-size: 1rem;
  }
  .mobile-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
  }
  .mobile-tab {
    flex: 1;
    padding: 12px;
    min-height: 44px;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--speed-fast);
  }
  .mobile-tab.active, .mobile-tab:hover {
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
  }
  .mobile-tab-panel {
    display: none;
  }
  .mobile-tab-panel.active {
    display: block;
  }
  .subject-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .subject-card {
    padding: 16px;
    min-height: 100px;
  }
  .lecture-item {
    padding: 12px;
    min-height: 56px;
  }
  .chapter-group-heading {
    font-size: 0.75rem;
    margin: 12px 0 6px;
  }

  /* ── Mobile search toggle ── */
  .mobile-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill);
    background-color: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }
  .mobile-search-toggle:hover,
  .mobile-search-toggle:active {
    background-color: var(--bg-surface-3);
    color: var(--text-primary);
    border-color: var(--border-focus);
  }

  /* ── Mobile search overlay ── */
  .mobile-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(8px);
    padding: 12px;
    align-items: flex-start;
    padding-top: 12px;
    animation: searchOverlayIn 0.2s ease-out;
  }
  .mobile-search-overlay.show {
    display: flex;
  }
  @keyframes searchOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  .mobile-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 4px 4px 4px 12px;
  }
  .mobile-search-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
  }
  .mobile-search-back:hover,
  .mobile-search-back:active {
    color: var(--text-primary);
    background: var(--bg-surface-3);
  }
  .mobile-search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 16px; /* prevents iOS zoom */
    padding: 8px 8px 8px 0;
    outline: none;
    font-family: inherit;
  }
  .mobile-search-input::placeholder {
    color: var(--text-muted);
  }
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-focus);
}
.home-page {
  background: #121212;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.hub-brand-white { color: #ffffff; }
.hub-brand-blue { color: #7097ff; margin-left: 3px; }
.student-progress-counter .progress-label {
  color: var(--text-muted);
}

/* Recent History Widget */
.recent-history-widget {
  position: relative;
}
.recent-history-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.82rem;
}
.recent-history-btn:hover {
  background-color: var(--bg-surface-3);
  color: var(--text-primary);
  border-color: var(--accent-blue);
}
.recent-history-count {
  background: var(--accent-blue);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.recent-history-count:empty,
.recent-history-count[data-count="0"] {
  display: none;
}
.recent-history-popup {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: #16161a;
  border: 1px solid #2a2a30;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
  z-index: 1000;
  overflow: hidden;
}
.recent-history-popup.show {
  display: flex;
  flex-direction: column;
}
.recent-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #2a2a30;
  background: #1c1c21;
  flex-wrap: wrap;
}
.recent-history-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.recent-history-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}
.recent-history-clear-btn {
  border: 1px solid #3a3a42;
  background: transparent;
  color: #a1a1aa;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.recent-history-clear-btn:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.08);
}
.recent-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  background: #16161a;
}
.recent-history-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.recent-history-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
  align-items: flex-start;
}
.recent-history-item:hover {
  background: #1e1e24;
}
.recent-history-item-remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-left: auto;
  margin-top: 2px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #71717a;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.recent-history-item:hover .recent-history-item-remove {
  opacity: 1;
}
.recent-history-item-remove:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}
.recent-history-item-thumb {
  width: 80px;
  height: 45px;
  border-radius: 6px;
  background: #222228;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.recent-history-item-thumb svg {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}
.recent-history-item-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent-blue);
  transition: width 0.2s ease;
}
.recent-history-item-info {
  flex: 1;
  min-width: 0;
}
.recent-history-item-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.recent-history-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-history-item-stats {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.recent-history-item-stats span {
  display: flex;
  align-items: center;
  gap: 3px;
}
.recent-history-item-completed {
  color: var(--accent-green);
  font-weight: 500;
}
@media (max-width: 960px) {
  .recent-history-popup {
    width: 300px;
    right: -40px;
  }
  .recent-history-btn {
    padding: 5px 8px;
  }
  .recent-history-btn svg {
    width: 14px;
    height: 14px;
  }
}

/* Switch Group Button */
.switch-group-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.switch-group-btn:hover {
  background-color: var(--bg-surface-3);
  color: var(--text-primary);
  border-color: var(--accent-blue);
}
@media (max-width: 960px) {
  .switch-group-btn {
    width: 32px;
    height: 32px;
  }
  .switch-group-btn svg {
    width: 14px;
    height: 14px;
  }
}
.hub-main {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 72px;
  flex: 1;
}
.hub-hero {
  font-family: 'Gochi Hand', 'Comic Sans MS', 'Segoe UI', cursive;
  font-size: 3.4rem;
  font-weight: 400;
  text-align: center;
  letter-spacing: 0.02em;
  margin: 6px 0 6px;
  user-select: none;
}
.hub-hero-white { color: #ffffff; }
.hub-hero-blue { color: #7097ff; margin-left: 10px; }
.hub-tagline {
  text-align: center;
  color: #c6c6ce;
  font-size: 0.95rem;
  font-weight: 300;
  max-width: 520px;
  margin: 0 auto 28px;
}
.hub-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 22px;
  flex-wrap: nowrap;
  align-items: stretch;
}
.hub-tab {
  padding: 7px 18px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #9ca3af;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hub-tab:hover { color: #ffffff; }
.hub-tab.active {
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.hub-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  background: #1a1b22;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #9ca3af;
  min-height: 20px;
}
.hub-crumb-btn {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
  font-size: 0.85rem;
  transition: color 150ms;
}
.hub-crumb-btn:hover { color: #ffffff; }
.hub-crumb-sep { color: #52525b; }
.hub-crumb-current { color: #ffffff; font-weight: 600; }
/* Level 4 — appended while a provider accordion is expanded */
.hub-crumb-provider {
  font-size: 0.7rem;
  font-weight: 600;
  color: #c4b5fd;
  background: rgba(109, 40, 217, 0.2);
  border: 1px solid #4c1d95;
  padding: 2px 8px;
  border-radius: 6px;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.hub-grid.animate-grid-change {
  animation: hubGridChange 0.2s cubic-bezier(0.05, 0.7, 0.1, 1) forwards;
}
@keyframes hubGridChange {
  0% { opacity: 0.35; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}
.animate-grid-change { animation: hubGridChange 0.2s cubic-bezier(0.05, 0.7, 0.1, 1) forwards; }
@keyframes lectureFadeIn {
  0% { opacity: 0.4; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.lecture-layout {
  animation: lectureFadeIn 0.25s cubic-bezier(0.05, 0.7, 0.1, 1) forwards;
}
.hub-card {
  background: #1a1b22;
  border: 1px solid #2b2c36;
  border-radius: 14px;
  padding: 20px;
  min-height: 176px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hub-card:hover {
  background: #22242e;
  border-color: #3a3c4a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.hub-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.hub-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
  border: 1px solid #2b2c36;
  background: #16171d;
  padding: 3px 8px;
  border-radius: 5px;
}
.hub-badge.chapter {
  color: #93c5fd;
  background: rgba(37, 58, 122, 0.25);
  border-color: #2b3b6b;
}
.hub-badge.lecture {
  color: #6ee7b7;
  background: rgba(6, 78, 59, 0.25);
  border-color: #155e4f;
}
.hub-badge.provider {
  color: #c4b5fd;
  background: rgba(109, 40, 217, 0.25);
  border-color: #581c87;
}
.hub-card-icon {
  color: #6b7280;
  display: flex;
  transition: color 150ms;
}
.hub-card-icon svg { width: 20px; height: 20px; display: block; }
.hub-card:hover .hub-card-icon { color: #7097ff; }
.hub-play { width: 26px; height: 26px; }
.hub-play svg {
  width: 18px;
  height: 18px;
  padding: 4px;
  border-radius: 50%;
  background: #121212;
  border: 1px solid #2b2c36;
  color: #fff;
  transition: all 150ms;
}
.hub-card:hover .hub-play svg { background: #7097ff; border-color: #7097ff; }
.hub-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  padding-top: 15px;
  margin: 4px 0 6px;
  line-height: 1.3;
}
.hub-card-sub {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0;
}
.hub-card-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #7097ff;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 14px;
}
.hub-loading,
.hub-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #9ca3af;
  padding: 48px 24px;
  font-size: 0.92rem;
}
.hub-loading::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #333;
  border-top-color: #7097ff;
  border-radius: 50%;
  animation: hub-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
  margin-top: -2px;
}
@keyframes hub-spin { to { transform: rotate(360deg); } }
.hub-empty { color: #6b7280; }
.hub-footer {
  border-top: 1px solid #1f1f23;
  padding: 18px;
  text-align: center;
  font-size: 0.78rem;
  color: #55555e;
}

/* ==========================================================================
   PROVIDER ACCORDION LIST + THIN LECTURE ITEMS
   Full-width vertical provider list. Lectures expand inline beneath each
   provider row via GSAP push-down (height 0 -> auto), chevron rotates 180deg.
   ========================================================================== */
.hub-provider-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.provider-accordion {
  background: #1a1b22;
  border: 1px solid #2b2c36;
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
              background 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.provider-accordion:hover { border-color: #3a3c4a; }
.provider-accordion.is-open {
  border-color: rgba(124, 92, 246, 0.5);
  background: #1c1d29;
}

.provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.provider-row:hover { background: #22242e; }
.provider-row:focus-visible {
  outline: 2px solid #7097ff;
  outline-offset: -2px;
}

.provider-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.provider-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(109, 40, 217, 0.28);
  border: 1px solid #4c1d95;
  color: #c4b5fd;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.provider-info-text { min-width: 0; }
.provider-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.provider-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: #9ca3af;
}
.provider-count svg { width: 12px; height: 12px; display: block; color: #6b7280; }
.provider-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 150ms;
}
.provider-row:hover .provider-name { color: #a78bfa; }

.provider-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.provider-hint {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7097ff;
  opacity: 0;
  transition: opacity 150ms;
}
.provider-row:hover .provider-hint { opacity: 1; }
/* Low-opacity gray dropdown indicator, rotated by GSAP */
.provider-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: background 150ms;
}
.provider-row:hover .provider-chevron { background: rgba(255, 255, 255, 0.1); }
.provider-chevron svg {
  width: 16px;
  height: 16px;
  display: block;
  color: #9ca3af;
  opacity: 0.4;
  transition: opacity 150ms;
}
.provider-row:hover .provider-chevron svg { opacity: 0.9; }

.provider-panel {
  height: 0;
  overflow: hidden;
  opacity: 0;
  display: none;
  background: #15161d;
  border-top: 1px solid #24252e;
}
.provider-panel-inner { padding: 14px 16px 16px; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #23242c;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
}
.panel-heading span:last-child {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #6b7280;
}

/* Lecture items: 1 column on mobile, 2 on desktop (md:grid-cols-2 equivalent) */
.lecture-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 768px) {
  .lecture-list { grid-template-columns: repeat(2, 1fr); }
}

.lecture-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: #1c1d26;
  border: 1px solid #2b2c36;
  border-radius: 11px;
  cursor: pointer;
  transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.lecture-item:hover {
  background: #22242e;
  border-color: rgba(16, 185, 129, 0.4);
}
.lecture-item:focus-visible {
  outline: 2px solid #7097ff;
  outline-offset: 1px;
}
.lecture-item-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding-right: 6px;
}
.lecture-play {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(6, 78, 59, 0.35);
  border: 1px solid #155e4f;
  color: #34d399;
  transition: transform 150ms;
}
.lecture-item:hover .lecture-play { transform: scale(1.1); }
.lecture-play svg { width: 12px; height: 12px; display: block; }
.lecture-item-text { min-width: 0; }
.lecture-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.lecture-item-duration { font-size: 0.66rem; color: #6b7280; }
.lecture-item-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 150ms;
}
.lecture-item:hover .lecture-item-title { color: #6ee7b7; }
.lecture-watch {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.lecture-watch:hover {
  background: #10b981;
  border-color: #10b981;
  color: #06251c;
}
.lecture-watch svg { width: 12px; height: 12px; display: block; }

/* Lecture provider badges — sits below the card title */
.lecture-provider-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: #c4b5fd;
  background: rgba(109, 40, 217, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 6px;
  width: fit-content;
}

/* Admin chapter-provider styles */
.chapter-providers-assigned {
  margin-bottom: 16px;
}

.chapter-providers-available {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.chapter-provider-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-surface-2);
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--border-subtle);
}

.chapter-provider-item.inactive {
  opacity: 0.6;
}

.chapter-provider-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chapter-provider-name {
  font-weight: 600;
  color: var(--text-primary);
}

.chapter-provider-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chapter-provider-status {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.chapter-provider-item.active .chapter-provider-status {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}

.chapter-provider-item.inactive .chapter-provider-status {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.chapter-provider-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Provider management panel styles */
.provider-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.provider-manage-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 5px;
}

.provider-add-card {
  justify-content: center;
  align-items: center;
  cursor: pointer;
  min-height: 100px;
}

.provider-add-card:hover {
  border-color: var(--accent);
  background: var(--bg-surface-3);
}

.provider-manage-card .provider-name {
  font-weight: 600;
  color: var(--text-primary);
}

.provider-manage-card .provider-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* Provider chapter grid (inside chapter view) */
.provider-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.provider-chapter-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.provider-chapter-card:hover {
  border-color: var(--accent);
  background: var(--bg-surface-3);
  transform: translateY(-1px);
}

.provider-chapter-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(109, 40, 217, 0.15);
  color: #c4b5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.provider-chapter-info {
  flex: 1;
  min-width: 0;
}

.provider-chapter-name {
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
  font-size: 0.95rem;
}

.provider-chapter-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.provider-chapter-arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.provider-chapter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.provider-chapter-actions .fa-btn {
  opacity: 0.55;
}

.provider-chapter-card:hover .provider-chapter-actions .fa-btn {
  opacity: 1;
}

/* Add provider section */
.add-provider-section {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.add-provider-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.provider-dropdown {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.provider-dropdown:focus {
  outline: none;
  border-color: var(--accent);
}

/* Provider badge in context */
.provider-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: #c4b5fd;
  background: rgba(109, 40, 217, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

/* Chapter preview row for providers */
.pv-provider-icon {
  color: #c4b5fd;
  margin-right: 8px;
}

.pv-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* View context updates */
.view-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--bg-surface-2);
  border-radius: 6px;
  font-size: 0.9rem;
}

.view-context-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* =========================================================================
   Group Selection Modal (First Visit)
   ========================================================================= */
.group-selection-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeInOverlay 0.4s ease-out forwards;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.group-selection-modal {
  background: linear-gradient(145deg, #1a1b22 0%, #121215 100%);
  border: 1px solid #2b2c36;
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  animation: modalSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.group-selection-logo {
  font-family: 'Gochi Hand', 'Comic Sans MS', cursive;
  font-size: 2.4rem;
  margin-bottom: 8px;
  user-select: none;
}

.group-selection-logo .brand-white { color: #ffffff; }
.group-selection-logo .brand-blue { color: #7097ff; margin-left: 6px; }

.group-selection-subtitle {
  color: #9ca3af;
  font-size: 0.95rem;
  margin: 0 0 32px;
  font-weight: 300;
}

.group-selection-question {
  color: #d1d5db;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 24px;
}

.group-selection-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.group-selection-card {
  background: #16171d;
  border: 2px solid #2b2c36;
  border-radius: 16px;
  padding: 32px 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.group-selection-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(112, 151, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.group-selection-card:hover {
  border-color: #7097ff;
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(112, 151, 255, 0.2);
}

.group-selection-card:hover::before {
  opacity: 1;
}

.group-selection-card:active {
  transform: translateY(-2px);
}

.group-card-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: rgba(112, 151, 255, 0.12);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  transition: transform 0.25s ease;
}

.group-selection-card:hover .group-card-icon {
  transform: scale(1.1);
}

.group-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.group-card-desc {
  font-size: 0.82rem;
  color: #9ca3af;
  margin: 0;
  line-height: 1.4;
}

.group-selection-hint {
  color: #6b7280;
  font-size: 0.78rem;
  margin: 0;
}

@media (max-width: 480px) {
  .group-selection-modal {
    padding: 36px 24px;
    border-radius: 20px;
  }

  .group-selection-logo {
    font-size: 2rem;
  }

  .group-selection-cards {
    gap: 12px;
  }

  .group-selection-card {
    padding: 24px 16px;
  }

  .group-card-title {
    font-size: 1.1rem;
  }
}

/* ── Mobile search: hidden on desktop ── */
@media (min-width: 601px) {
  .mobile-search-toggle {
    display: none;
  }
}
.mobile-search-overlay {
  display: none;
}

/* ==========================================================================
   PROVIDER SECTION HEADER + EXPAND/COLLAPSE ALL
   ========================================================================== */
.provider-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 8px;
}
.provider-section-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
}
.expand-all-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #141622;
  border: 1px solid #2b2c36;
  color: #9ca3af;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
  white-space: nowrap;
}
.expand-all-btn:hover {
  color: #a78bfa;
  border-color: rgba(124, 92, 246, 0.45);
}
.expand-all-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}