/* 100% Pure Static PW Study Portal Styles */

:root {
  --bg: #070d18;
  --surface: #0e1726;
  --surface-2: #162238;
  --surface-3: #1e2d48;
  --border: #233350;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent-blue: #0080ff;
  --accent-green: #00c988;
  --accent-gold: #f59e0b;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --border: #cbd5e1;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
}

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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(14, 23, 38, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.85);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 201, 136, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 201, 136, 0.3);
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.session-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.7rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

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

.session-countdown-text {
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .session-countdown {
    padding: 0 0.55rem;
    font-size: 0.75rem;
    gap: 0.3rem;
  }
}

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  border-color: var(--primary);
  background: var(--surface-3);
}

.icon-btn-logout:hover {
  border-color: #ef4444;
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

/* Breadcrumbs */
.breadcrumbs-bar {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}

.breadcrumbs-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.crumb {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

.crumb:hover {
  color: var(--text-main);
}

.crumb.active {
  color: var(--text-main);
  font-weight: 600;
  cursor: default;
}

/* Main Layout */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

/* Filter Bar */
.filter-section {
  margin-bottom: 1.5rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.75rem 2.5rem 0.75rem 2.6rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

#searchInput:focus {
  border-color: var(--primary);
}

.clear-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
}

.batch-stats {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Grids & Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.15rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.card-thumb-link {
  display: block;
  position: relative;
  text-decoration: none;
}

.card-enrolled-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.94);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary);
}

.card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.45rem;
}

.card-title-link {
  text-decoration: none;
  color: inherit;
}

.card-title-link:hover .card-title {
  color: var(--primary);
}

.card-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-primary {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

/* Section Headers & Tabs */
.page-header {
  margin-bottom: 1.25rem;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* List Items (Topics, Videos) */
.list-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.15s;
}

.item-row:hover {
  border-color: var(--primary);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.item-video-thumb {
  width: 112px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
  position: relative;
}

.item-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-details {
  min-width: 0;
  flex: 1;
}

.item-title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Notes 4-Column Grid & Card UX */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1024px) {
  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .notes-grid {
    grid-template-columns: 1fr;
  }
}

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 145px;
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.note-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.note-card-top {
  margin-bottom: 0.75rem;
}

.note-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: block;
}

.note-card-actions {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.note-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.note-action-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
  background: var(--surface-3);
}

/* Load More Button */
.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
  padding-bottom: 0.5rem;
}

.btn-load-more {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 140px;
}

.btn-load-more:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--surface-2);
}

.btn-load-more:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-blue {
  background: var(--accent-blue);
  color: #fff;
  height: 44px;
  border-radius: 10px;
}

.btn-blue:hover {
  background: #0070e0;
}

.btn-green {
  background: var(--accent-green);
  color: #fff;
  height: 44px;
  border-radius: 10px;
}

.btn-green:hover {
  background: #00b57a;
}

/* Video Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.video-modal-card {
  width: 100%;
  max-width: 800px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.video-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-player-container video {
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  display: block;
}

.video-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
}

/* Player Toolbar */
.player-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
}

.player-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.player-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

/* Quality & Speed Controls */
.player-control-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.player-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.player-select {
  background: var(--surface-2);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
}

.player-select:focus {
  border-color: var(--primary);
}

.speed-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.speed-btn {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.speed-btn:hover {
  color: var(--text-main);
}

.speed-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.player-duration-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.toolbar-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-link-btn:hover {
  background: var(--surface-3);
  color: var(--primary);
  border-color: var(--primary);
}

.toolbar-download-btn {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.1);
}

.toolbar-download-btn:hover {
  background: rgba(34, 197, 94, 0.2);
  color: #16a34a;
  border-color: #22c55e;
}

/* Unplayable URL Overlay */
.video-unplayable-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(9, 13, 22, 0.94);
  z-index: 5;
}

.unplayable-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.unplayable-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 1rem;
  display: grid;
  place-items: center;
}

.unplayable-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.unplayable-reason {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  word-break: break-word;
}

.unplayable-reason.is-api-error {
  width: 100%;
  text-align: left;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  color: #fca5a5;
  background: var(--surface-2);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  max-height: 150px;
  overflow: auto;
}

.unplayable-url-box {
  width: 100%;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.2rem;
}

.unplayable-url-input {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none;
}

.unplayable-url-input:focus {
  border-color: var(--primary);
}

.unplayable-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

/* PDF Modal (Specific Mobile-Safe Box) */
.pdf-modal-card {
  width: calc(100vw - 2rem);
  max-width: 340px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.pdf-tag-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding-right: 2rem;
}

.pdf-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.pdf-top-title {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-title {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 2rem;
}

.modal-close-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--surface-3);
}

.pdf-modal-body {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pdf-golden-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(120, 53, 15, 0.35);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-gold);
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
}

.pdf-main-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0 0.25rem;
}

.pdf-filename-pill {
  margin-top: 0.5rem;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.7rem;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1.4rem;
}

/* Player Choice Modal (Inbuilt vs External Redirect Player) */
.player-choice-card {
  width: calc(100vw - 2rem);
  max-width: 380px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
}

.player-choice-body {
  padding: 1.15rem 1rem 1.25rem;
}

.player-choice-lecture-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.player-choice-duration {
  margin-top: 0.3rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.player-choice-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.05rem;
}

.player-choice-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.player-choice-option:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.player-choice-option:disabled {
  opacity: 0.65;
  cursor: wait;
}

.player-choice-option.is-primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(79, 70, 229, 0.08));
  border-color: rgba(99, 102, 241, 0.45);
}

.player-choice-option.is-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.24), rgba(79, 70, 229, 0.14));
  border-color: var(--primary);
}

.player-choice-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.player-choice-option.is-primary .player-choice-icon {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.player-choice-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.player-choice-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.player-choice-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.player-choice-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Loading Skeletons & Spinners */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--surface-3) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 600px) {
  .item-row {
    flex-direction: column;
    align-items: stretch;
  }
  .item-video-thumb {
    width: 96px;
    height: 54px;
  }
  .btn {
    width: 100%;
  }
  .player-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Batch View Tabs (All Batches / My Batches) */
.batch-view-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.batch-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.batch-view-tab:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.batch-view-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.batch-tab-count {
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--text-muted);
}

.batch-view-tab.active .batch-tab-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Batch Card Footer: Blue Price + 100% Free Badge + Study & Enroll Now Buttons */
.card-footer-actions {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.batch-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.batch-price-free {
  font-size: 1.05rem;
  font-weight: 800;
  color: #3b82f6;
  letter-spacing: -0.01em;
}

[data-theme="light"] .batch-price-free {
  color: #2563eb;
}

.batch-price-strike {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: line-through;
}

.batch-free-pill {
  display: inline-block;
  align-self: flex-start;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
}

.batch-btn-study {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.batch-btn-study:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  color: #60a5fa;
}

[data-theme="light"] .batch-btn-study:hover {
  color: #2563eb;
}

.batch-btn-enroll {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1rem;
  border-radius: 10px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.batch-btn-enroll:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.batch-btn-enroll:active {
  transform: scale(0.985);
}

.batch-btn-enroll.is-enrolled {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(59, 130, 246, 0.55);
  color: #60a5fa;
}

[data-theme="light"] .batch-btn-enroll.is-enrolled {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.batch-btn-enroll.is-enrolled:hover {
  background: rgba(37, 99, 235, 0.22);
}

/* Lecture Actions Group & Secondary Button */
.item-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: var(--surface-3);
}

/* Schedule Details View */
.schedule-back-row {
  margin-bottom: 1rem;
}

.schedule-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.schedule-hero-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1;
}

.schedule-hero-thumb {
  width: 140px;
  height: 80px;
}

.schedule-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.schedule-section {
  margin-top: 1.5rem;
}

.schedule-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

@media (max-width: 600px) {
  .item-actions-group {
    width: 100%;
    flex-direction: column;
  }
  .schedule-hero-card {
    flex-direction: column;
    align-items: stretch;
  }
  .schedule-hero-main {
    flex-direction: column;
    align-items: flex-start;
  }
  .schedule-hero-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

/* Rendering performance for long lists and card grids */
.grid-cards .card,
.list-stack .item-row,
.notes-grid .note-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

.list-stack .item-row {
  contain-intrinsic-size: auto 84px;
}

.notes-grid .note-card {
  contain-intrinsic-size: auto 150px;
}

/* ==================== WATCH PAGE (watch.html) ==================== */

body.watch-page {
  --bg: #050608;
  --surface: #0e0f14;
  --surface-elevated: #14161e;
  --surface-hover: #1c1f2a;
  --surface-menu: #121319;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #5b5bf6;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(91, 91, 246, 0.16);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --pdf-red: #dc2626;
  --success: #22c55e;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  height: 100%;
  background: var(--bg);
  color: var(--text-main);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.watch-page button,
body.watch-page a {
  font-family: inherit;
  color: inherit;
}

body.watch-page button:focus-visible,
body.watch-page a:focus-visible,
body.watch-page input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.watch-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.player-column {
  display: flex;
  flex-direction: column;
  background: #000;
  flex-shrink: 0;
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 76dvh;
  background: #000;
  overflow: hidden;
  user-select: none;
}

.player-stage.is-fullscreen {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  aspect-ratio: auto;
}

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

.watch-video.is-audio-hidden {
  opacity: 0;
  pointer-events: none;
}

.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem 1.75rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.42) 60%, transparent 100%);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.player-stage.controls-hidden .player-top-bar,
.player-stage.is-locked .player-top-bar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.lecture-top-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.stage-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.16s ease, color 0.16s ease, transform 0.15s ease;
}

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

.stage-icon-btn:active {
  transform: scale(0.94);
}

.screen-lock-btn {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 16;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 17, 23, 0.72);
  backdrop-filter: blur(8px);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.16s ease, border-color 0.16s ease;
}

.screen-lock-btn:hover {
  background: rgba(28, 30, 42, 0.88);
  border-color: rgba(255, 255, 255, 0.26);
}

.screen-lock-btn.is-locked {
  border-color: var(--accent);
  background: rgba(91, 91, 246, 0.3);
}

.player-stage.controls-hidden:not(.is-locked) .screen-lock-btn {
  opacity: 0;
  pointer-events: none;
}

.audio-mode-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: radial-gradient(circle at 50% 42%, #191c2b 0%, #090a0f 75%);
  padding: 1.5rem;
  text-align: center;
}

.audio-mode-disc {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 91, 246, 0.4);
  color: #a5b4fc;
  display: grid;
  place-items: center;
}

.audio-mode-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  max-width: 380px;
}

.audio-mode-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stage-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.72);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.watch-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  animation: watchSpin 0.8s linear infinite;
}

@keyframes watchSpin {
  to {
    transform: rotate(360deg);
  }
}

.stage-error-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(6, 7, 11, 0.94);
}

.stage-error-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stage-error-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.stage-error-message {
  font-size: 0.76rem;
  line-height: 1.48;
  color: #fca5a5;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(239, 68, 68, 0.32);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  max-height: 135px;
  overflow: auto;
}

.stage-error-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.watch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-hover);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.watch-btn:hover {
  background: #252938;
}

.watch-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.watch-btn-primary:hover {
  background: var(--accent-hover);
}

.settings-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.settings-menu-card {
  width: min(100%, 380px);
  max-height: min(82dvh, 480px);
  overflow-y: auto;
  background: rgba(16, 17, 22, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.72);
}

.settings-row {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1.15rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s ease;
}

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

.settings-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.settings-row-value {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.settings-row-value.is-active {
  color: #818cf8;
}

.settings-submenu-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.settings-back-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.settings-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.settings-submenu-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.settings-option-check {
  color: #818cf8;
  font-weight: 700;
}

.settings-custom-sleep {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.settings-custom-sleep input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #0b0c12;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
}

.settings-custom-sleep input::placeholder {
  color: var(--text-dim);
}

.more-menu-popover {
  position: absolute;
  top: 52px;
  right: 12px;
  z-index: 22;
  min-width: 210px;
  background: rgba(18, 19, 25, 0.97);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.35rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
}

.more-menu-item {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
}

.more-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.stage-bottom-seek {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  padding: 1.1rem 0.75rem 0.4rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.35) 65%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: opacity 0.2s ease;
}

.player-stage.is-locked .stage-bottom-seek {
  opacity: 0;
  pointer-events: none;
}

.time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  color: #e2e8f0;
}

.sleep-badge-text {
  color: #a5b4fc;
  font-size: 0.72rem;
}

.seek-track {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.seek-rail {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.seek-buffered {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.36);
}

.seek-played {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: var(--accent);
}

.seek-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91, 91, 246, 0.45);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.player-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.5rem 0.65rem;
  background: #000;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.player-controls-bar::-webkit-scrollbar {
  display: none;
}

.ctrl-btn {
  min-width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.14s ease;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ctrl-btn:active {
  transform: scale(0.92);
}

.ctrl-btn.is-active {
  color: #818cf8;
  background: rgba(91, 91, 246, 0.18);
}

.volume-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.volume-slider {
  width: 68px;
  accent-color: var(--accent);
  cursor: pointer;
  display: none;
}

@media (min-width: 768px) {
  .volume-slider {
    display: inline-block;
  }
}

.resource-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-height: 0;
}

.resource-panel.is-collapsed {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: #11131a;
  border-bottom: 1px solid var(--border);
}

.panel-heading {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f8fafc;
}

.panel-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.panel-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.panel-restore-bar {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  background: #0c0d12;
  border-bottom: 1px solid var(--border);
}

.panel-restore-bar.is-visible {
  display: flex;
}

.resource-tabs-wrap {
  padding: 0.9rem 1rem 0.65rem;
}

.resource-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  padding: 0.3rem;
  background: #0a0b10;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.resource-tab-btn {
  min-height: 40px;
  padding: 0.5rem 0.55rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.resource-tab-btn:hover {
  color: #fff;
}

.resource-tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 91, 246, 0.35);
}

.resource-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem 1rem 2rem;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0.65rem 0 0.75rem;
  font-variant-numeric: tabular-nums;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 0.95rem;
  background: #0b0c11;
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.attachment-card:hover {
  border-color: var(--border-strong);
  background: #10121a;
}

.pdf-icon-box {
  width: 44px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: #cbd5e1;
}

.pdf-mini-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--pdf-red);
  color: #fff;
  line-height: 1.1;
}

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

.attachment-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}

.attachment-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.attachment-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.att-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #141620;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.att-icon-btn:hover {
  background: #1d2030;
  border-color: var(--accent);
  color: #fff;
}

.slides-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.slides-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .slides-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.slide-card {
  background: #0c0d13;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.slide-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.slide-card.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(91, 91, 246, 0.45);
}

.slide-thumb-btn {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  padding: 0;
  background: #12141c;
  cursor: pointer;
  overflow: hidden;
  display: block;
}

.slide-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.slide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem;
}

.slide-index {
  font-size: 0.76rem;
  font-weight: 600;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.slide-seek-btn {
  border: 1px solid var(--border);
  background: #141622;
  color: #a5b4fc;
  border-radius: 6px;
  padding: 0.22rem 0.48rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.slide-seek-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.timeline-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  background: #0c0d13;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.timeline-item:hover {
  border-color: var(--accent);
  background: #12141e;
}

.timeline-item.is-current {
  border-color: var(--accent);
  background: rgba(91, 91, 246, 0.1);
}

.timeline-title {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}

.timeline-time {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  color: #a5b4fc;
  flex-shrink: 0;
}

.empty-state-box {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  margin-top: 0.5rem;
}

.skeleton-row {
  height: 68px;
  border-radius: 12px;
  background: linear-gradient(90deg, #101219 25%, #191c26 50%, #101219 75%);
  background-size: 200% 100%;
  animation: watchShimmer 1.3s infinite linear;
  margin-bottom: 0.6rem;
}

@keyframes watchShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 4, 7, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
}

.lightbox-meta {
  font-size: 0.86rem;
  font-weight: 600;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(16, 17, 23, 0.85);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-nav-btn.prev {
  left: 0.5rem;
}

.lightbox-nav-btn.next {
  right: 0.5rem;
}

.lightbox-nav-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.watch-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(16px);
  z-index: 80;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(20, 22, 30, 0.96);
  border: 1px solid var(--border-strong);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.watch-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 1024px) {
  .watch-shell {
    flex-direction: row;
    height: 100dvh;
    overflow: hidden;
  }

  .player-column {
    flex: 1;
    min-width: 0;
    justify-content: center;
    background: #000;
  }

  .player-stage {
    flex: 1;
    aspect-ratio: auto;
    max-height: none;
  }

  .player-controls-bar {
    padding: 0.55rem 1.25rem;
    justify-content: center;
    gap: 0.9rem;
  }

  .resource-panel {
    width: 420px;
    flex: 0 0 420px;
    border-left: 1px solid var(--border);
    height: 100dvh;
  }

  .slides-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  body.watch-page *,
  body.watch-page *::before,
  body.watch-page *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== DPP QUIZ TAB CARDS (PORTAL VIEW) ==================== */

.quiz-list-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.quiz-list-card:hover {
  border-color: var(--primary);
}

.quiz-list-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.quiz-list-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #a78bfa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quiz-list-body {
  flex: 1;
  min-width: 0;
}

.quiz-list-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.38;
  margin-bottom: 0.35rem;
}

.quiz-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.quiz-list-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.quiz-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.btn-quiz-start {
  background: #7c3aed;
  border: 1px solid #8b5cf6;
  color: #ffffff;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 9px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.14s ease;
}

.btn-quiz-start:hover {
  background: #8b5cf6;
}

.btn-quiz-start:active {
  transform: scale(0.98);
}

@media (min-width: 640px) {
  .quiz-list-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .quiz-list-actions {
    flex-shrink: 0;
  }
}

/* ==================== IMMERSIVE DPP QUIZ PLAYER ==================== */

body.quiz-mode {
  background: #050608;
  color: #f8fafc;
}

body.quiz-mode .app-header,
body.quiz-mode .breadcrumbs-bar,
body.quiz-mode #filterSection {
  display: none !important;
}

body.quiz-mode .main-container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.dpp-quiz-shell {
  min-height: 100dvh;
  background: #050608;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dpp-quiz-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #050608;
  border-bottom: 1px solid #151720;
}

.dpp-quiz-topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  height: 56px;
  padding: 0 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dpp-quiz-top-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.dpp-quiz-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.dpp-quiz-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.dpp-quiz-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: #e2e8f0;
  font-size: 0.92rem;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.dpp-quiz-timer svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.dpp-quiz-submit-top-btn {
  height: 36px;
  padding: 0 0.95rem;
  border-radius: 8px;
  border: 1px solid #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
  color: #c4b5fd;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dpp-quiz-submit-top-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
  border-color: #a78bfa;
}

.dpp-quiz-strip-wrap {
  position: sticky;
  top: 56px;
  z-index: 25;
  background: #050608;
  border-bottom: 1px solid #161922;
}

.dpp-quiz-strip-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.dpp-quiz-num-strip {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding: 2px 0;
}

.dpp-quiz-num-strip::-webkit-scrollbar {
  display: none;
}

.dpp-q-pill {
  position: relative;
  min-width: 38px;
  height: 38px;
  padding: 0 0.4rem;
  border-radius: 8px;
  border: 1px solid #1d202b;
  background: #08090d;
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.dpp-q-pill:hover {
  border-color: #3b4257;
  color: #fff;
}

.dpp-q-pill.is-answered {
  background: #171636;
  border-color: #6366f1;
  color: #c7d2fe;
}

.dpp-q-pill.is-correct {
  background: #062817;
  border-color: #22c55e;
  color: #86efac;
}

.dpp-q-pill.is-wrong {
  background: #330d14;
  border-color: #ef4444;
  color: #fca5a5;
}

.dpp-q-pill.is-active {
  background: #3b82f6;
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.dpp-q-pill.is-bookmarked::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
}

.dpp-palette-trigger {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #262a36;
  background: #090b10;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dpp-palette-trigger:hover {
  background: #141722;
  border-color: #475569;
}

.dpp-quiz-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 0.9rem 6.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dpp-quiz-title-caption {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.dpp-q-meta-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.dpp-q-index-box {
  min-width: 28px;
  height: 28px;
  padding: 0 0.45rem;
  border-radius: 6px;
  background: #3d424f;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dpp-q-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dpp-q-tag.easy {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.dpp-q-tag.medium {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}

.dpp-q-tag.hard {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
}

.dpp-q-marks {
  font-size: 0.74rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.dpp-q-meta-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.dpp-meta-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dpp-meta-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.dpp-meta-icon-btn.is-bookmarked {
  color: #f59e0b;
}

.dpp-more-menu {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 35;
  min-width: 195px;
  background: #12141c;
  border: 1px solid #262b3a;
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65);
}

.dpp-more-menu-item {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.83rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.dpp-more-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dpp-question-card {
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 0.85rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.dpp-question-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  object-fit: contain;
}

.dpp-question-text {
  font-size: 0.98rem;
  line-height: 1.55;
  color: #0f172a;
}

.dpp-question-text + .dpp-question-img,
.dpp-question-img + .dpp-question-text {
  margin-top: 0.75rem;
}

.dpp-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.dpp-option-row {
  width: 100%;
  min-height: 54px;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid #1d202b;
  background: #08090d;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dpp-option-row:hover:not(:disabled) {
  border-color: #363c52;
  background: #0d0f16;
}

.dpp-option-row:disabled {
  cursor: default;
}

.dpp-option-row.is-selected {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
}

.dpp-option-row.is-correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.dpp-option-row.is-wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.dpp-option-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  flex: 1;
}

.dpp-option-num {
  font-size: 0.88rem;
  font-weight: 500;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.dpp-option-sep {
  width: 1px;
  height: 18px;
  background: #232735;
  flex-shrink: 0;
}

.dpp-option-content {
  min-width: 0;
  flex: 1;
  font-size: 0.94rem;
  font-weight: 500;
  color: #f8fafc;
  word-break: break-word;
}

.dpp-option-img {
  max-width: 100%;
  max-height: 120px;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
  display: block;
}

.dpp-option-right {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.dpp-option-pct {
  font-size: 0.74rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.dpp-radio-circle {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1.5px solid #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dpp-radio-circle.is-checkbox {
  border-radius: 5px;
}

.dpp-option-row.is-selected .dpp-radio-circle {
  border-color: #8b5cf6;
  background: #7c3aed;
}

.dpp-option-row.is-selected .dpp-radio-circle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
}

.dpp-option-row.is-selected .dpp-radio-circle.is-checkbox::after {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.dpp-option-row.is-correct .dpp-radio-circle {
  border-color: #22c55e;
  background: #22c55e;
  color: #052e16;
}

.dpp-option-row.is-wrong .dpp-radio-circle {
  border-color: #ef4444;
  background: #ef4444;
  color: #ffffff;
}

.dpp-numeric-box {
  background: #0b0d13;
  border: 1px solid #242836;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dpp-numeric-label {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
}

.dpp-numeric-input {
  width: 100%;
  height: 46px;
  padding: 0 0.85rem;
  border-radius: 8px;
  border: 1px solid #2e3448;
  background: #050609;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dpp-numeric-input:focus {
  outline: none;
  border-color: #8b5cf6;
}

.dpp-solution-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.dpp-verdict-banner {
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.dpp-verdict-banner.correct {
  background: rgba(34, 197, 94, 0.13);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.dpp-verdict-banner.wrong {
  background: rgba(239, 68, 68, 0.13);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.dpp-verdict-banner.skipped {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid #262b3a;
  color: #cbd5e1;
}

.dpp-solution-card {
  background: #0b0d14;
  border: 1px solid #1e2230;
  border-radius: 12px;
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dpp-solution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dpp-solution-title {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a78bfa;
}

.dpp-video-sol-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.45);
  background: rgba(124, 58, 237, 0.18);
  color: #ddd6fe;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dpp-video-sol-btn:hover {
  background: #7c3aed;
  color: #ffffff;
}

.dpp-solution-img-wrap {
  background: #ffffff;
  border-radius: 10px;
  padding: 0.65rem;
}

.dpp-solution-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.dpp-solution-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #e2e8f0;
  white-space: pre-wrap;
}

.dpp-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: #050608;
  border-top: 1px solid #181b24;
  padding: 0.7rem 0.9rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

.dpp-bottom-bar-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.dpp-nav-sq-btn {
  width: 48px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #262a38;
  background: #090b10;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.dpp-nav-sq-btn:hover:not(:disabled) {
  background: #141824;
  border-color: #475569;
}

.dpp-nav-sq-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dpp-primary-submit-btn {
  flex: 1;
  height: 46px;
  border-radius: 10px;
  border: none;
  background: #7c3aed;
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.15s ease, transform 0.12s ease;
}

.dpp-primary-submit-btn:hover {
  background: #8b5cf6;
}

.dpp-primary-submit-btn:active {
  transform: scale(0.99);
}

.dpp-primary-submit-btn.is-secondary {
  background: #1e293b;
  border: 1px solid #334155;
}

.dpp-primary-submit-btn.is-secondary:hover {
  background: #283548;
}

/* Modal overlays inside DPP Quiz (Palette + Submit Confirmation) */
.dpp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dpp-modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 84dvh;
  overflow-y: auto;
  background: #0e1017;
  border: 1px solid #242938;
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.72);
}

.dpp-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dpp-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.dpp-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.dpp-palette-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.dpp-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dpp-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.dpp-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 560px) {
  .dpp-summary-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dpp-stat-box {
  background: #0a0c12;
  border: 1px solid #1d2130;
  border-radius: 10px;
  padding: 0.8rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dpp-stat-val {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.dpp-stat-label {
  font-size: 0.74rem;
  color: #94a3b8;
}

.dpp-result-hero {
  background: #0b0d14;
  border: 1px solid #222738;
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dpp-result-score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dpp-result-score-big {
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.dpp-result-score-big span {
  font-size: 1rem;
  font-weight: 600;
  color: #94a3b8;
}

.dpp-marks-breakdown {
  font-size: 0.78rem;
  color: #cbd5e1;
  background: #0a0c12;
  border: 1px solid #1d2130;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-variant-numeric: tabular-nums;
}

.dpp-quiz-toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%) translateY(10px);
  z-index: 70;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: #171a24;
  border: 1px solid #30364a;
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dpp-quiz-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dpp-raw-error-box {
  background: #0d0f16;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dpp-raw-error-pre {
  background: #050609;
  border: 1px solid #232736;
  border-radius: 8px;
  padding: 0.75rem;
  color: #fca5a5;
  font-size: 0.78rem;
  line-height: 1.48;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}


