/* ─────────────────────────────────────────────────────────────
   01. PAGE HEADER
───────────────────────────────────────────────────────────── */
.bm-page-header {
  background: linear-gradient(
    135deg,
    #fef3c7 0%,
    #fef9c3 40%,
    #ecfdf5 100%
  );
  border-bottom: 1px solid var(--border);
  padding: var(--space-8) 0 var(--space-6);
  position: relative;
  overflow: hidden;
}

.bm-page-header::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(245, 158, 11, 0.12) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.bm-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.bm-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.bm-header-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  color: #fff;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
  flex-shrink: 0;
}

.bm-page-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.bm-page-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
}
.bm-page-sub span {
  font-weight: 700;
  color: var(--accent-dark);
}

.bm-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}


/* ─────────────────────────────────────────────────────────────
   02. TOOLBAR
───────────────────────────────────────────────────────────── */
.bm-toolbar-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--nav-height);
  z-index: 80;
  box-shadow: var(--shadow-sm);
}

.bm-toolbar {
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Search bar */
.bm-search-wrap {
  position: relative;
  max-width: 520px;
}

.bm-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--text-sm);
  pointer-events: none;
}

.bm-search-input {
  width: 100%;
  padding: var(--space-3) var(--space-10) var(--space-3) 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: var(--text-sm);
  font-family: var(--font);
  outline: none;
  transition:
    border-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease),
    background var(--duration-fast) var(--ease);
}
.bm-search-input::placeholder { color: var(--text-faint); }
.bm-search-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.bm-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}
.bm-search-clear:hover {
  background: var(--border-strong);
  color: var(--text);
}

/* Filter row */
.bm-filters {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.bm-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
}

.bm-filter-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bm-select {
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition:
    border-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}
.bm-select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}
.bm-select:hover { border-color: var(--border-strong); }

/* Active filters + result count row */
.bm-filter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 28px;
}

.bm-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.bm-results-count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
}
.bm-results-count span {
  color: var(--primary);
}

/* View toggle */
.bm-view-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  background: var(--bg-secondary);
  align-self: flex-end;
  flex-shrink: 0;
}

.bm-view-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease);
}
.bm-view-btn:hover { color: var(--text); background: var(--bg-tertiary); }
.bm-view-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}


/* ─────────────────────────────────────────────────────────────
   03. ACTIVE FILTER CHIPS
───────────────────────────────────────────────────────────── */
.bm-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-3) 3px var(--space-2);
  background: var(--primary-pale);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary-dark);
  animation: chipIn 150ms var(--ease-spring) both;
}

.bm-filter-chip-remove {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
  padding: 0;
  line-height: 1;
}
.bm-filter-chip-remove:hover {
  background: var(--primary);
  color: #fff;
}

@keyframes chipIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1);   }
}


/* ─────────────────────────────────────────────────────────────
   04. COLLECTION / FOLDER TABS
───────────────────────────────────────────────────────────── */
.bm-main { padding: var(--space-6) 0 var(--space-16); }

.bm-collections-bar {
  margin-bottom: var(--space-5);
}

.bm-collections-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.bm-collections-scroll::-webkit-scrollbar { display: none; }

.bm-collection-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease);
  flex-shrink: 0;
}
.bm-collection-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-pale);
}
.bm-collection-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}
.bm-collection-tab.active .bm-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.bm-tab-count {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  transition: all var(--duration-fast) var(--ease);
}

.bm-collection-add {
  border-style: dashed;
  color: var(--text-faint);
}
.bm-collection-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  border-style: solid;
  background: var(--primary-pale);
}


/* ─────────────────────────────────────────────────────────────
   05. SUBJECT QUICK-FILTER CHIPS
───────────────────────────────────────────────────────────── */
.bm-subject-chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.bm-subject-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  white-space: nowrap;
}
.bm-subject-chip i {
  font-size: 0.85em;
  color: var(--primary);
}
.bm-subject-chip .bm-chip-count {
  background: var(--bg-tertiary);
  color: var(--text-faint);
  border-radius: var(--radius-full);
  padding: 1px 6px;
  font-size: 10px;
}
.bm-subject-chip:hover,
.bm-subject-chip.active {
  border-color: var(--primary);
  background: var(--primary-pale);
  color: var(--primary-dark);
}
.bm-subject-chip.active .bm-chip-count {
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary-dark);
}


/* ─────────────────────────────────────────────────────────────
   06. SELECTION BAR (bulk actions)
───────────────────────────────────────────────────────────── */
.bm-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: var(--secondary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  animation: slideDownFade 200ms var(--ease) both;
}

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

.bm-selection-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #fff;
  font-weight: 600;
  font-size: var(--text-sm);
}

.bm-deselect-all {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}
.bm-deselect-all:hover { background: rgba(255, 255, 255, 0.25); }

.bm-selection-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.bm-selection-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}
.bm-selection-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.25);
}
.bm-danger-btn {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}
.bm-danger-btn:hover {
  background: rgba(239, 68, 68, 0.35) !important;
}


/* ─────────────────────────────────────────────────────────────
   07. PROGRESS BANNER
───────────────────────────────────────────────────────────── */
.bm-progress-banner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.bm-progress-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
}
.bm-progress-info i { color: var(--primary); }
.bm-progress-info strong { color: var(--text); }

.bm-progress-bar-wrap {
  flex: 1;
  min-width: 120px;
}

.bm-progress-track {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease);
}


/* ─────────────────────────────────────────────────────────────
   08. CARDS GRID & LIST LAYOUT
───────────────────────────────────────────────────────────── */
.bm-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

/* List view override */
.bm-cards-grid.bm-list-view {
  grid-template-columns: 1fr;
  gap: var(--space-3);
}


/* ─────────────────────────────────────────────────────────────
   09. BOOKMARK CARD (GRID VIEW)
───────────────────────────────────────────────────────────── */
.bm-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  cursor: pointer;
  transition:
    transform var(--duration-base) var(--ease-spring),
    box-shadow var(--duration-base) var(--ease),
    border-color var(--duration-fast) var(--ease);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: cardIn 250ms var(--ease) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.bm-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

/* Color strip at top-left based on status */
.bm-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  background: var(--border);
  transition: background var(--duration-fast) var(--ease);
}
.bm-card.status-correct::before  { background: var(--success); }
.bm-card.status-wrong::before    { background: var(--danger);  }
.bm-card.status-unanswered::before { background: var(--border-strong); }

/* Selected state */
.bm-card.is-selected {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: var(--secondary-pale);
}
.bm-card.is-selected::before {
  background: var(--secondary);
}

/* Checkbox */
.bm-card-select {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 2;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}
.bm-card:hover .bm-card-select,
.bm-card.is-selected .bm-card-select {
  opacity: 1;
}

.bm-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bm-checkbox-custom {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.bm-checkbox-custom::after {
  content: '✓';
  font-size: 11px;
  color: #fff;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}
.bm-checkbox:checked ~ .bm-checkbox-custom,
.is-selected .bm-checkbox-custom {
  background: var(--secondary);
  border-color: var(--secondary);
}
.bm-checkbox:checked ~ .bm-checkbox-custom::after,
.is-selected .bm-checkbox-custom::after {
  opacity: 1;
}

/* Card top row */
.bm-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  padding-right: var(--space-6);
}

.bm-card-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Subject badge */
.bm-subject-badge {
  padding: 3px var(--space-3);
  background: var(--primary-pale);
  color: var(--primary-dark);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Difficulty badge */
.bm-diff-badge {
  padding: 3px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.diff-easy   { background: #dcfce7; color: #166534; }
.diff-medium { background: #fef9c3; color: #78350f; }
.diff-hard   { background: #fee2e2; color: #991b1b; }

/* Card icon buttons */
.bm-card-actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}
.bm-card:hover .bm-card-actions { opacity: 1; }

.bm-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.bm-icon-btn:hover { background: var(--bg-tertiary); color: var(--text); }
.bm-remove-btn:hover { color: var(--danger); background: var(--danger-pale); }
.bm-tag-btn:hover    { color: var(--accent-dark); background: var(--accent-pale); }

/* Remove (bookmarked) active state */
.bm-remove-btn.bookmarked { color: var(--accent); }

/* Question text */
.bm-card-question {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: -webkit-line-clamp var(--duration-base) var(--ease);
}
.bm-card-question.expanded {
  -webkit-line-clamp: unset;
  display: block;
}


/* ─────────────────────────────────────────────────────────────
   10. BOOKMARK CARD (LIST VIEW)
───────────────────────────────────────────────────────────── */
.bm-list-view .bm-card {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
}

.bm-list-view .bm-card-top {
  flex-direction: column;
  padding-right: 0;
  gap: var(--space-2);
  min-width: 140px;
  flex-shrink: 0;
}

.bm-list-view .bm-card-question {
  flex: 1;
  -webkit-line-clamp: 2;
  font-size: var(--text-sm);
}

.bm-list-view .bm-card-expand-btn {
  display: none;
}

.bm-list-view .bm-card-footer {
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-end;
  min-width: 100px;
}

.bm-list-view .bm-card-actions {
  opacity: 1;
  flex-direction: column;
}


/* ─────────────────────────────────────────────────────────────
   11. CARD STATUS STATES
───────────────────────────────────────────────────────────── */
.bm-card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px var(--space-2);
  border-radius: var(--radius-full);
}
.bm-card-status i { font-size: 7px; }

.status-correct {
  background: #dcfce7;
  color: #166534;
}
.status-wrong {
  background: #fee2e2;
  color: #991b1b;
}
.status-unanswered {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* Card date */
.bm-card-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--text-faint);
}
.bm-card-date i { font-size: 10px; }


/* ─────────────────────────────────────────────────────────────
   12. CARD OPTIONS (EXPANDED)
───────────────────────────────────────────────────────────── */
.bm-card-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  animation: expandDown 200ms var(--ease) both;
}

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

.bm-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
}

.bm-option.is-correct {
  background: var(--success-pale, #f0fdf4);
  border-color: var(--success);
  color: #166534;
}
.bm-option.is-wrong {
  background: var(--danger-pale);
  border-color: var(--danger);
  color: #991b1b;
}
.bm-option.is-selected-wrong {
  background: var(--danger-pale);
  border-color: var(--danger);
  color: #991b1b;
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}

.bm-option-letter {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease);
}
.bm-option.is-correct .bm-option-letter  {
  background: var(--success);
  color: #fff;
}
.bm-option.is-wrong .bm-option-letter,
.bm-option.is-selected-wrong .bm-option-letter {
  background: var(--danger);
  color: #fff;
}

.bm-option-text {
  flex: 1;
  line-height: 1.5;
}

/* Explanation box (inside options area) */
.bm-explanation {
  padding: var(--space-3);
  background: var(--accent-pale);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}
.bm-explanation strong {
  display: block;
  color: var(--accent-dark);
  margin-bottom: 4px;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Expand / collapse button */
.bm-card-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.bm-card-expand-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

.bm-expand-icon {
  transition: transform var(--duration-base) var(--ease);
}
.bm-card-expand-btn[aria-expanded="true"] .bm-expand-icon {
  transform: rotate(180deg);
}


/* ─────────────────────────────────────────────────────────────
   13. CARD FOOTER & TAGS
───────────────────────────────────────────────────────────── */
.bm-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.bm-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.bm-card-tag-wrap {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

/* Individual tag pills */
.bm-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter var(--duration-fast) var(--ease);
}
.bm-tag-pill:hover { filter: brightness(0.9); }
.bm-tag-pill i { font-size: 9px; }

/* Tag colours */
.tag-important { background: #fef9c3; color: #78350f; }
.tag-review    { background: var(--secondary-pale); color: var(--secondary-dark); }
.tag-confused  { background: #fce7f3; color: #9d174d; }
.tag-mastered  { background: #dcfce7; color: #166534; }

/* Tag close button */
.bm-tag-pill-remove {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background var(--duration-fast) var(--ease);
}
.bm-tag-pill-remove:hover { background: rgba(0, 0, 0, 0.3); }


/* ─────────────────────────────────────────────────────────────
   14. TAG PICKER DROPDOWN
───────────────────────────────────────────────────────────── */
.bm-tag-picker {
  position: fixed;
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 200px;
  overflow: hidden;
  animation: tagPickerIn 150ms var(--ease-spring) both;
}

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

.bm-tag-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bm-tag-picker-close {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  cursor: pointer;
}
.bm-tag-picker-close:hover { background: var(--bg-tertiary); }

.bm-tag-options {
  display: flex;
  flex-direction: column;
  padding: var(--space-2);
  gap: var(--space-1);
}

.bm-tag-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: background var(--duration-fast) var(--ease);
  width: 100%;
}
.bm-tag-option:hover { background: var(--bg-secondary); }

.bm-tag-option.selected {
  background: var(--primary-pale);
  color: var(--primary-dark);
}
.bm-tag-option.selected::after {
  content: '✓';
  margin-left: auto;
  font-weight: 700;
  color: var(--primary);
}

/* Tag icon colours */
.tag-icon-important { color: #d97706; }
.tag-icon-review    { color: var(--secondary); }
.tag-icon-confused  { color: #db2777; }
.tag-icon-mastered  { color: var(--success); }


/* ─────────────────────────────────────────────────────────────
   15. EMPTY STATE
───────────────────────────────────────────────────────────── */
.bm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-20) var(--space-8);
  gap: var(--space-4);
  animation: fadeIn 300ms var(--ease) both;
}

.bm-empty-icon {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--accent);
}

.bm-empty-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent-pale);
  animation: emptyPulse 2.5s ease-in-out infinite;
}

.bm-empty-icon i { position: relative; z-index: 1; }

@keyframes emptyPulse {
  0%, 100% { transform: scale(1);    opacity: 0.6; }
  50%       { transform: scale(1.15); opacity: 0.3; }
}

.bm-empty-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
}

.bm-empty-sub {
  font-size: var(--text-base);
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.7;
}

.bm-empty-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

.bm-empty-tip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--accent-pale);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--accent-dark);
  max-width: 440px;
}
.bm-empty-tip i { color: var(--accent); flex-shrink: 0; }


/* ─────────────────────────────────────────────────────────────
   16. NO RESULTS STATE
───────────────────────────────────────────────────────────── */
.bm-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  gap: var(--space-3);
  animation: fadeIn 300ms var(--ease) both;
}

.bm-no-results-icon {
  font-size: 3rem;
  color: var(--text-faint);
  opacity: 0.4;
}

.bm-no-results h3 {
  font-size: var(--text-xl);
  color: var(--text);
}

.bm-no-results p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}


/* ─────────────────────────────────────────────────────────────
   17. SKELETON LOADER
───────────────────────────────────────────────────────────── */
.bm-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

.bm-skeleton-card {
  height: 200px;
  border-radius: var(--radius-xl);
}


/* ─────────────────────────────────────────────────────────────
   18. LOAD MORE
───────────────────────────────────────────────────────────── */
.bm-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: var(--space-8) 0;
}

.bm-load-more-btn {
  min-width: 200px;
  transition: all var(--duration-fast) var(--ease);
}
.bm-load-more-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.bm-load-more-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}
.bm-load-more-btn.loading i {
  animation: spin 0.8s linear infinite;
}

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


/* ─────────────────────────────────────────────────────────────
   19. STATS PANEL (slide-in sidebar)
───────────────────────────────────────────────────────────── */
.bm-stats-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-2xl);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease);
}
.bm-stats-panel.open {
  transform: translateX(0);
}

.bm-stats-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}

.bm-stats-panel-header h3 {
  font-size: var(--text-lg);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.bm-stats-panel-header h3 i { color: var(--primary); }

.bm-stats-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.bm-stats-close:hover {
  background: var(--danger-pale);
  color: var(--danger);
}

.bm-stats-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}


/* ─────────────────────────────────────────────────────────────
   20. DONUT CHART
───────────────────────────────────────────────────────────── */
.bm-donut-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.bm-donut {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.bm-donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.bm-donut-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 12;
}

.bm-donut-correct,
.bm-donut-wrong,
.bm-donut-unseen {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 0.8s var(--ease);
}

.bm-donut-correct { stroke: var(--success); }
.bm-donut-wrong   { stroke: var(--danger);  }
.bm-donut-unseen  { stroke: var(--border-strong); }

.bm-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.bm-donut-pct {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.bm-donut-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Donut legend */
.bm-donut-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bm-donut-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.bm-donut-legend-item strong { color: var(--text); margin-left: 2px; }

.bm-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-correct { background: var(--success); }
.dot-wrong   { background: var(--danger);  }
.dot-unseen  { background: var(--border-strong); }

/* Subject breakdown bars */
.bm-subject-breakdown { }

.bm-breakdown-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.bm-breakdown-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.bm-breakdown-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-breakdown-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bm-breakdown-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease);
}

.bm-breakdown-count {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  min-width: 24px;
  text-align: right;
}

/* Quick stats grid */
.bm-quick-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bm-quick-stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.bm-quick-stat > i {
  font-size: var(--text-xl);
  color: var(--primary);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.bm-quick-stat div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bm-quick-stat strong {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.bm-quick-stat span {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}


/* ─────────────────────────────────────────────────────────────
   21. STATS FAB
───────────────────────────────────────────────────────────── */
.bm-stats-fab {
  position: fixed;
  bottom: calc(var(--mobile-nav-h) + var(--space-5));
  right: var(--space-5);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  font-size: var(--text-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-fast) var(--ease);
  z-index: 350;
}
.bm-stats-fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.45);
}
.bm-stats-fab:active { transform: scale(0.96); }


/* ─────────────────────────────────────────────────────────────
   22. DELETE MODAL
───────────────────────────────────────────────────────────── */
.bm-delete-modal { max-width: 400px; }

.bm-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
}
.btn-danger:hover { background: var(--danger-dark); color: #fff; }


/* ─────────────────────────────────────────────────────────────
   23. ANIMATIONS
───────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Staggered card animation */
.bm-cards-grid .bm-card:nth-child(1)  { animation-delay:  30ms; }
.bm-cards-grid .bm-card:nth-child(2)  { animation-delay:  60ms; }
.bm-cards-grid .bm-card:nth-child(3)  { animation-delay:  90ms; }
.bm-cards-grid .bm-card:nth-child(4)  { animation-delay: 120ms; }
.bm-cards-grid .bm-card:nth-child(5)  { animation-delay: 150ms; }
.bm-cards-grid .bm-card:nth-child(6)  { animation-delay: 180ms; }
.bm-cards-grid .bm-card:nth-child(7)  { animation-delay: 210ms; }
.bm-cards-grid .bm-card:nth-child(8)  { animation-delay: 240ms; }
.bm-cards-grid .bm-card:nth-child(n+9){ animation-delay: 260ms; }


/* ─────────────────────────────────────────────────────────────
   24. DARK MODE
───────────────────────────────────────────────────────────── */
[data-theme="dark"] .bm-page-header {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.07) 0%,
    rgba(10, 15, 30, 1) 60%,
    rgba(16, 185, 129, 0.06) 100%
  );
  border-color: var(--border);
}

[data-theme="dark"] .bm-toolbar-wrap {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .bm-search-input {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .bm-search-input:focus {
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

[data-theme="dark"] .bm-select {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

[data-theme="dark"] .bm-collection-tab {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}
[data-theme="dark"] .bm-collection-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

[data-theme="dark"] .bm-card {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .bm-card:hover { border-color: var(--accent); }
[data-theme="dark"] .bm-card.is-selected {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--secondary);
}

[data-theme="dark"] .bm-subject-badge {
  background: var(--primary-pale);
  color: var(--primary-light);
}

[data-theme="dark"] .diff-easy   { background: rgba(34, 197, 94, 0.12);  color: #4ade80; }
[data-theme="dark"] .diff-medium { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
[data-theme="dark"] .diff-hard   { background: rgba(239, 68, 68, 0.12);  color: #f87171; }

[data-theme="dark"] .bm-option {
  border-color: var(--border);
  color: var(--text-secondary);
}
[data-theme="dark"] .bm-option.is-correct {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--success);
  color: #4ade80;
}
[data-theme="dark"] .bm-option.is-wrong,
[data-theme="dark"] .bm-option.is-selected-wrong {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--danger);
  color: #f87171;
}
[data-theme="dark"] .bm-option-letter { background: var(--surface-2); }

[data-theme="dark"] .bm-card-footer { border-color: var(--border); }

[data-theme="dark"] .bm-card-expand-btn {
  border-color: var(--border);
  color: var(--text-muted);
}
[data-theme="dark"] .bm-card-expand-btn:hover {
  background: var(--surface-2);
}

[data-theme="dark"] .status-correct {
  background: rgba(16, 185, 129, 0.12);
  color: #4ade80;
}
[data-theme="dark"] .status-wrong {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}
[data-theme="dark"] .status-unanswered {
  background: var(--surface-2);
  color: var(--text-muted);
}

[data-theme="dark"] .bm-tag-pill.tag-important {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}
[data-theme="dark"] .bm-tag-pill.tag-review {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
}
[data-theme="dark"] .bm-tag-pill.tag-confused {
  background: rgba(236, 72, 153, 0.12);
  color: #f9a8d4;
}
[data-theme="dark"] .bm-tag-pill.tag-mastered {
  background: rgba(16, 185, 129, 0.12);
  color: #4ade80;
}

[data-theme="dark"] .bm-filter-chip {
  background: var(--primary-pale);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--primary-light);
}

[data-theme="dark"] .bm-progress-banner {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .bm-progress-track { background: var(--surface-2); }

[data-theme="dark"] .bm-subject-chip {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .bm-tag-picker {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .bm-tag-picker-header { border-color: var(--border); }
[data-theme="dark"] .bm-tag-option:hover  { background: var(--surface-2); }

[data-theme="dark"] .bm-stats-panel {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .bm-stats-panel-header { background: var(--surface-2); }

[data-theme="dark"] .bm-donut-bg { stroke: var(--surface-2); }
[data-theme="dark"] .dot-unseen  { background: var(--surface-3); }

[data-theme="dark"] .bm-quick-stat {
  background: var(--surface-2);
  border-color: var(--border);
}

[data-theme="dark"] .bm-explanation {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--accent);
}

[data-theme="dark"] .bm-empty-tip {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

[data-theme="dark"] .bm-view-toggle {
  background: var(--surface-2);
  border-color: var(--border);
}
[data-theme="dark"] .bm-view-btn.active { background: var(--surface); }


/* ─────────────────────────────────────────────────────────────
   25. RESPONSIVE – TABLET (≤ 1024px)
───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bm-stats-panel { width: 290px; }

  .bm-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .bm-filters { gap: var(--space-2); }
  .bm-filter-group { min-width: 110px; }
}


/* ─────────────────────────────────────────────────────────────
   26. RESPONSIVE – MOBILE (≤ 768px)
───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Page header */
  .bm-page-header { padding: var(--space-6) 0 var(--space-4); }
  .bm-header-content { gap: var(--space-3); }
  .bm-header-left  { gap: var(--space-3); }
  .bm-header-icon  { width: 44px; height: 44px; font-size: var(--text-xl); }
  .bm-page-title   { font-size: var(--text-xl); }
  .bm-header-actions { gap: var(--space-2); }

  /* Toolbar sticky below main nav */
  .bm-toolbar-wrap { top: var(--nav-height); }

  /* Filters scroll horizontally */
  .bm-filters {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .bm-filters::-webkit-scrollbar { display: none; }
  .bm-filter-group { min-width: 120px; flex-shrink: 0; }

  /* Cards: single column */
  .bm-cards-grid {
    grid-template-columns: 1fr;
  }
  .bm-skeleton-grid { grid-template-columns: 1fr; }

  /* List view stays 1 col, simplify */
  .bm-list-view .bm-card {
    flex-direction: column;
    gap: var(--space-3);
  }
  .bm-list-view .bm-card-top {
    flex-direction: row;
    align-items: center;
  }
  .bm-list-view .bm-card-footer {
    flex-direction: row;
    align-items: center;
    min-width: 0;
  }

  /* Stats panel full-width on mobile */
  .bm-stats-panel {
    width: 100%;
    left: 0;
    border-left: none;
    border-top: 1px solid var(--border);
    transform: translateY(100%);
    transition: transform var(--duration-slow) var(--ease);
    top: auto;
    bottom: var(--mobile-nav-h);
    height: 70dvh;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  }
  .bm-stats-panel.open { transform: translateY(0); }

  /* FAB position */
  .bm-stats-fab {
    bottom: calc(var(--mobile-nav-h) + var(--space-3));
    right: var(--space-4);
    width: 46px;
    height: 46px;
    font-size: var(--text-lg);
  }

  /* Selection bar */
  .bm-selection-bar { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .bm-selection-actions { width: 100%; flex-wrap: wrap; }

  /* Progress banner */
  .bm-progress-banner { flex-wrap: wrap; gap: var(--space-3); }
  .bm-progress-bar-wrap { min-width: 100%; }

  /* Empty state */
  .bm-empty { padding: var(--space-12) var(--space-4); }
  .bm-empty-actions { flex-direction: column; width: 100%; }
  .bm-empty-actions .btn { width: 100%; }

  /* Collection tabs don't wrap */
  .bm-collections-scroll { padding-bottom: 6px; }
}


/* ─────────────────────────────────────────────────────────────
   27. RESPONSIVE – SMALL MOBILE (≤ 480px)
───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .bm-page-title { font-size: var(--text-lg); }
  .bm-page-sub   { font-size: var(--text-xs); }

  /* Hide export button on tiny screens */
  #bmExportBtn { display: none; }

  /* Card options: full labels */
  .bm-option { padding: var(--space-2); font-size: var(--text-xs); }
  .bm-option-letter { width: 20px; height: 20px; font-size: 10px; }

  /* Card */
  .bm-card { padding: var(--space-4); }
  .bm-card-question { font-size: var(--text-sm); }

  /* Filters: 2 wide, scroll */
  .bm-filter-group { min-width: 130px; }

  /* Filter meta: stack */
  .bm-filter-meta { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .bm-results-count { margin-left: 0; }

  /* Subject chips wrap */
  .bm-subject-chips { gap: var(--space-1); }
  .bm-subject-chip  { font-size: 11px; padding: var(--space-1) var(--space-2); }

  /* Selection actions stack */
  .bm-selection-actions .btn { font-size: var(--text-xs); }

  /* Tag picker */
  .bm-tag-picker { width: 180px; }

  /* Donut + legend stack */
  .bm-donut-wrap { flex-direction: column; align-items: center; text-align: center; }
  .bm-donut-legend { align-items: center; }
}
/* ═══════════════════════════════════════════════════════════════
   Dr.MCQ – Profile Page
   css/profile.css

   TABLE OF CONTENTS
   ─────────────────
   01. Profile Main Layout
   02. Profile Hero Card
   03. Avatar Upload & Display
   04. Profile Info Section
   05. Rank Badge
   06. Quick Stats Grid
   07. Profile Tabs Bar
   08. Panel: Stats (Accuracy Ring + Activity)
   09. Panel: Subject Mastery Bars
   10. Panel: Badges Grid
   11. Panel: Settings (Toggles + Selects)
   12. Settings – Account & Danger Zone
   13. Edit Profile Modal
   14. Crop Modal
   15. Leaderboard CSS (leaderboard.css)
   16. Animations
   17. Dark Mode
   18. Responsive – Tablet (≤ 1024px)
   19. Responsive – Mobile (≤ 768px)
   20. Responsive – Small (≤ 480px)
═══════════════════════════════════════════════════════════════ */
