/* ============================================
   PathEdge — CSS Additions
   Premium Redesign — Professional Edition
   ============================================ */

/* ===== BELL DOT — dynamic hide/show ===== */
.bell-dot {
  display: none;
}

/* ===== PER-QUESTION TIMER ===== */
.per-q-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  min-width: 60px;
  justify-content: center;
  letter-spacing: .02em;
}

.per-q-timer.warning {
  background: rgba(232, 93, 93, .12);
  border-color: rgba(232, 93, 93, .35);
  color: var(--red);
  animation: timerPulse .7s ease-in-out infinite alternate;
}

@keyframes timerPulse {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: .6; transform: scale(.97); }
}

.quiz-timer:not(.per-q-timer) {
  font-size: .8rem;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

/* ===== MCQ OPTIONS — no-label variant ===== */
.quiz-option.no-label {
  padding-left: 18px;
}
.quiz-option.no-label .quiz-option-letter {
  display: none;
}

/* ===== OPTION LABEL — fixed width ===== */
.quiz-option-letter {
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: .82rem;
  color: var(--txt3);
}

/* ===== NUMERIC INPUT CONTROL ===== */
.num-input-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--card2, var(--card));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px 4px;
  flex-shrink: 0;
}

.num-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--border);
  color: var(--txt1);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  flex-shrink: 0;
  line-height: 1;
}
.num-btn:active { background: var(--accent); color: #fff; }
.num-btn:active { transform: scale(.92); }
.num-btn.neg:hover { background: var(--red, #e85d5d); color: #fff; }
.num-btn.neg:active { transform: scale(.92); }

.num-input {
  width: 44px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--txt1);
  font-size: .85rem;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  -moz-appearance: textfield;
}
.num-input::-webkit-inner-spin-button,
.num-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.num-unit {
  font-size: .7rem;
  color: var(--txt3);
  font-weight: 600;
  margin-left: 0;
  text-transform: uppercase;
}

/* ===== SETTING DROPDOWN (Label Style) ===== */
.setting-dropdown-wrap {
  position: relative;
  flex-shrink: 0;
}

.setting-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card2, var(--card));
  border: 1px solid var(--border);
  color: var(--txt1);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s ease;
}
.setting-dropdown-trigger:hover,
.setting-dropdown-trigger.open {
  border-color: var(--accent);
  background: rgba(91,108,255,.06);
}

.setting-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: .8rem;
  color: var(--txt2);
  cursor: pointer;
  transition: all .12s ease;
  white-space: nowrap;
}
.setting-dropdown-item:hover { background: rgba(255,255,255,.05); }
.setting-dropdown-item.selected {
  color: var(--accent);
  font-weight: 700;
  background: rgba(91,108,255,.08);
}

/* ===== ATTEMPT DROPDOWN — upward ===== */
.custom-dropdown-wrap {
  position: relative;
}

.custom-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: .82rem;
  color: var(--txt2);
  cursor: pointer;
  transition: all .12s ease;
}
.custom-dropdown-item:hover { background: rgba(255,255,255,.05); }
.custom-dropdown-item.selected {
  color: var(--accent2);
  font-weight: 700;
  background: rgba(91,108,255,.08);
}

/* ===== TOGGLE — consistent sizing ===== */
.toggle {
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background .3s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.toggle.on .toggle-knob { transform: translateX(20px); }

.profile-av,
.edit-av {
  overflow: hidden;
}

.profile-av img,
.edit-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* ===== LAW timer badge ===== */
.law-timer {
  font-size: .8rem;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  font-weight: 600;
}

/* ===== LOGOUT item ===== */
.menu-item.logout { color: var(--red, #e85d5d); }
.menu-item.logout svg { stroke: var(--red, #e85d5d); }

/* ===== MARK-READ button ===== */
.mark-read {
  cursor: pointer;
  font-size: .78rem;
  color: var(--accent2);
  padding: 5px 10px;
  border-radius: 8px;
  transition: all .15s ease;
  font-weight: 600;
}
.mark-read:active { background: rgba(91,108,255,.1); }

/* ===== SET-ROW opacity transition ===== */
.set-row { transition: opacity .25s ease; }

/* ===== QUIZ RESULT subtitle ===== */
.quiz-result-subtitle {
  font-size: .78rem;
  color: var(--txt3);
  margin-top: 6px;
  text-align: center;
  font-weight: 500;
  letter-spacing: .01em;
}

/* ===== LABEL STYLE DROPDOWN ===== */
.setting-dropdown-menu {
  position: absolute;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 200px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
  z-index: 200;
  overflow: hidden;

  max-height: 0;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;

  transition:
    max-height 400ms cubic-bezier(.22, 1, .36, 1),
    opacity 300ms ease,
    transform 400ms cubic-bezier(.22, 1, .36, 1);
}

.setting-dropdown-menu.upward {
  bottom: calc(100% + 8px);
  top: auto;
  transform: translateY(10px);
}

.setting-dropdown-menu.open {
  max-height: 320px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== ATTEMPT DROPDOWN ===== */
.custom-dropdown-menu.upward {
  position: absolute;
  bottom: calc(100% + 8px);
  top: auto !important;
  left: 0;
  right: 0;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
  z-index: 200;
  overflow: hidden;

  max-height: 0;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;

  transition:
    max-height 400ms cubic-bezier(.22, 1, .36, 1),
    opacity 300ms ease,
    transform 400ms cubic-bezier(.22, 1, .36, 1);
}

.custom-dropdown-menu.open {
  max-height: 240px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== QUIZ QUESTION NUM ROW (with bookmark) ===== */
.quiz-question-num-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* ===== BOOKMARK BUTTON ===== */
.bm-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px;
  color: var(--txt3);
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}
.bm-btn:hover { 
  color: var(--accent2); 
  background: rgba(91,108,255,.08); 
}
.bm-btn.bm-active { 
  color: var(--accent2); 
}
.bm-btn svg { width: 18px; height: 18px; }

/* ============================================
   BOOKMARK POPUP — Premium Redesign
   ============================================ */
.bm-popup-overlay {
  position: fixed; 
  inset: 0; 
  z-index: 9999;
  display: flex; 
  align-items: flex-end;
  opacity: 0; 
  transition: opacity .3s ease;
}
.bm-popup-overlay.open { opacity: 1; }

.bm-popup-backdrop {
  position: absolute; 
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bm-popup-panel {
  position: relative; 
  width: 100%; 
  z-index: 1;
  background: linear-gradient(180deg, var(--card) 0%, var(--bg) 100%);
  border-radius: 24px 24px 0 0;
  padding: 24px 22px 40px;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.32,1,.23,1);
  max-height: 88vh; 
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 -8px 40px rgba(0,0,0,.4);
}
.bm-popup-overlay.open .bm-popup-panel { 
  transform: translateY(0); 
}

.bm-popup-head {
  display: flex; 
  align-items: center; 
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.bm-popup-icon {
  width: 40px; 
  height: 40px; 
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(91,108,255,.15), rgba(91,108,255,.05));
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: var(--accent2); 
  flex-shrink: 0;
  border: 1px solid rgba(91,108,255,.12);
}
.bm-popup-icon svg { width: 20px; height: 20px; }

.bm-popup-title { 
  font-size: 1.05rem; 
  font-weight: 700; 
  flex: 1;
  color: var(--txt);
  letter-spacing: -.01em;
}

.bm-popup-close {
  background: none; 
  border: none; 
  cursor: pointer;
  color: var(--txt3); 
  padding: 6px;
  display: flex; 
  align-items: center;
  border-radius: 8px;
  transition: all .15s ease;
}
.bm-popup-close:hover { 
  background: rgba(255,255,255,.06); 
  color: var(--txt1); 
}

.bm-popup-preview {
  font-size: .8rem; 
  color: var(--txt3);
  background: var(--bg2); 
  border-radius: 14px;
  padding: 14px 16px; 
  margin-bottom: 18px;
  line-height: 1.6; 
  border-left: 3px solid var(--accent2);
  font-weight: 500;
}

.bm-popup-label { 
  font-size: .72rem; 
  color: var(--txt4); 
  font-weight: 700; 
  margin-bottom: 10px; 
  text-transform: uppercase; 
  letter-spacing: .06em; 
}

.bm-cat-grid { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  margin-bottom: 14px; 
}

.bm-cat-chip {
  padding: 8px 16px; 
  border-radius: 24px;
  border: 1.5px solid var(--border);
  font-size: .78rem; 
  font-weight: 600;
  cursor: pointer; 
  color: var(--txt2);
  transition: all .2s ease; 
  background: none;
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bm-cat-chip:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(91,108,255,.04);
}
.bm-cat-chip.selected {
  border-color: var(--accent2);
  background: linear-gradient(135deg, rgba(91,108,255,.14), rgba(91,108,255,.06));
  color: var(--accent2);
  box-shadow: 0 2px 8px rgba(91,108,255,.15);
}

.bm-add-cat-btn {
  display: flex; 
  align-items: center; 
  gap: 8px;
  background: none; 
  border: 1.5px dashed var(--border);
  color: var(--txt3); 
  padding: 9px 16px;
  border-radius: 24px; 
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer; 
  transition: all .2s ease;
  letter-spacing: .01em;
}
.bm-add-cat-btn:hover { 
  border-color: var(--accent2); 
  color: var(--accent2); 
  background: rgba(91,108,255,.04);
}

.bm-custom-input {
  flex: 1; 
  background: var(--bg2); 
  border: 1.5px solid var(--border);
  border-radius: 12px; 
  padding: 10px 14px;
  font-size: .82rem; 
  color: var(--txt); 
  outline: none;
  font-weight: 500;
  transition: border-color .2s ease;
}
.bm-custom-input:focus { 
  border-color: var(--accent2); 
  box-shadow: 0 0 0 3px rgba(91,108,255,.1);
}

.bm-custom-confirm {
  background: var(--accent2); 
  color: #fff;
  border: none; 
  border-radius: 12px;
  padding: 10px 16px; 
  font-size: .82rem;
  font-weight: 700; 
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 2px 8px rgba(91,108,255,.25);
}
.bm-custom-confirm:hover { 
  transform: translateY(-1px); 
  box-shadow: 0 4px 12px rgba(91,108,255,.35);
}
.bm-custom-confirm:active { transform: translateY(0); }

div#bmCustomInput { display: flex; gap: 10px; }

.bm-popup-footer {
  display: flex; 
  gap: 12px; 
  margin-top: 20px;
}

.bm-popup-cancel {
  flex: 1; 
  padding: 14px; 
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: none; 
  color: var(--txt2);
  font-size: .88rem; 
  font-weight: 600; 
  cursor: pointer;
  transition: all .15s ease;
}
.bm-popup-cancel:hover { 
  background: rgba(255,255,255,.04); 
  border-color: var(--txt3);
}

.bm-popup-submit {
  flex: 2; 
  padding: 14px; 
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent2), var(--accent)); 
  color: #fff;
  border: none; 
  font-size: .88rem;
  font-weight: 700; 
  cursor: pointer;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px;
  transition: all .15s ease;
  box-shadow: 0 4px 16px rgba(91,108,255,.3);
}
.bm-popup-submit:hover { 
  transform: translateY(-1px); 
  box-shadow: 0 6px 20px rgba(91,108,255,.4);
}
.bm-popup-submit:active { transform: translateY(0); }

/* ============================================
   BOOKMARKS REDESIGN — Premium Professional
   ============================================ */
.bm-sort-btn {
  background: none; 
  border: none; 
  cursor: pointer;
  color: var(--txt2); 
  padding: 8px;
  display: flex; 
  align-items: center;
  margin-left: auto;
  border-radius: 10px;
  transition: all .15s ease;
}
.bm-sort-btn:hover { 
  background: rgba(255,255,255,.06); 
  color: var(--txt1); 
}

.bm-sort-menu {
  position: absolute; 
  right: 16px; 
  top: 56px;
  background: var(--card); 
  border: 1px solid var(--border);
  border-radius: 16px; 
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  z-index: 200; 
  width: 200px;
  opacity: 0; 
  transform: scale(.95) translateY(-10px);
  pointer-events: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.bm-sort-menu.open { 
  opacity: 1; 
  transform: scale(1) translateY(0); 
  pointer-events: all; 
}

.bm-sort-item {
  display: flex; 
  align-items: center; 
  gap: 12px;
  padding: 13px 18px; 
  font-size: .82rem;
  color: var(--txt2); 
  cursor: pointer;
  transition: all .12s ease;
  font-weight: 500;
}
.bm-sort-item:hover { background: var(--bg2); }
.bm-sort-item.active { 
  color: var(--accent2); 
  font-weight: 700; 
  background: rgba(91,108,255,.08);
}

.bm-stats-row {
  display: grid; 
  grid-template-columns: repeat(4, 1fr);
  gap: 10px; 
  margin-bottom: 16px;
}

.bm-stat {
  background: linear-gradient(145deg, rgba(130, 130, 130, 0.12) 0%, rgba(130, 130, 130, 0.04) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 16px 8px; 
  text-align: center;
  border: 1px solid rgba(130, 130, 130, 0.15);
  border-top: 1px solid rgba(130, 130, 130, 0.3);
  border-left: 1px solid rgba(130, 130, 130, 0.3);
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.bm-stat-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  opacity: 0.8;
  transition: all .3s ease;
}
.bm-stat.stat-saved .bm-stat-icon { color: var(--accent); }
.bm-stat.stat-doubts .bm-stat-icon { color: var(--red); }
.bm-stat.stat-imp .bm-stat-icon { color: var(--amber); }
.bm-stat.stat-subj .bm-stat-icon { color: var(--green); }

.bm-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0.5;
  transition: all .3s ease;
}
.bm-stat.stat-saved::before { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.bm-stat.stat-doubts::before { background: linear-gradient(90deg, #ff4d4d, #ff8a8a); }
.bm-stat.stat-imp::before { background: linear-gradient(90deg, #ffb534, #ffd175); }
.bm-stat.stat-subj::before { background: linear-gradient(90deg, #4ade80, #86efac); }

.bm-stat:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  background: rgba(255, 255, 255, 0.06);
}
.bm-stat:hover .bm-stat-icon {
  opacity: 1;
  transform: scale(1.1);
}
.bm-stat:hover::before {
  opacity: 1;
}

.bm-stat-val { 
  font-size: 1.5rem; 
  font-weight: 800; 
  color: var(--txt);
  letter-spacing: -.02em;
  margin-bottom: 2px;
}
.bm-stat-lbl { 
  font-size: .7rem; 
  color: var(--txt3); 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.bm-filter-scroll {
  display: flex; 
  gap: 8px; 
  overflow-x: auto;
  padding-bottom: 12px; 
  margin-bottom: 16px;
  scrollbar-width: none;
}
.bm-filter-scroll::-webkit-scrollbar { display: none; }

.bm-filter-chip {
  padding: 7px 16px; 
  border-radius: 24px;
  border: 1.5px solid var(--border);
  white-space: nowrap; 
  font-size: .76rem;
  font-weight: 600; 
  cursor: pointer; 
  background: none;
  color: var(--txt2); 
  transition: all .2s ease;
  letter-spacing: .01em;
}
.bm-filter-chip:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(91,108,255,.04);
}
.bm-filter-chip.active {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(91,108,255,.25);
}

.bm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px; 
  padding: 18px;
  margin-bottom: 12px;
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}
.bm-card:hover {
  border-color: rgba(91,108,255,.3);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

.bm-card-head { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  margin-bottom: 12px; 
}

.bm-card-cat {
  font-size: .7rem; 
  font-weight: 700;
  padding: 4px 10px; 
  border-radius: 6px;
  text-transform: uppercase; 
  letter-spacing: .04em;
}

.bm-card-meta {
  display: flex; 
  align-items: center; 
  gap: 5px;
  font-size: .72rem; 
  color: var(--txt3);
  font-weight: 500;
}

.bm-card-q {
  font-size: .88rem; 
  color: var(--txt);
  line-height: 1.6; 
  margin-bottom: 14px;
  font-weight: 500;
}

.bm-card-opts-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent2);
  cursor: pointer;
  margin-bottom: 12px;
  width: fit-content;
  user-select: none;
}
.bm-card-opts-toggle svg {
  transition: transform .2s ease;
}

.bm-card-opts-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  background: var(--bg2);
  border-radius: 10px;
  padding: 12px;
}

.bm-card-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .82rem;
  color: var(--txt2);
}
.bm-card-opt.correct {
  border-color: var(--green);
  background: rgba(74,222,128,.08);
}
.bm-opt-idx {
  font-weight: 800;
  color: var(--txt3);
  background: var(--bg2);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.bm-card-opt.correct .bm-opt-idx {
  color: var(--green);
  background: rgba(74,222,128,.15);
}
.bm-opt-text {
  flex: 1;
  line-height: 1.5;
}
.bm-opt-check {
  color: var(--green);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bm-card-foot { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
}

.bm-card-date {
  display: flex; 
  align-items: center; 
  gap: 5px;
  font-size: .72rem; 
  color: var(--txt4);
  font-weight: 500;
}

.bm-del-btn {
  background: none; 
  border: none; 
  cursor: pointer;
  color: var(--txt4); 
  padding: 6px;
  display: flex; 
  transition: all .15s ease;
  border-radius: 8px;
}
.bm-del-btn:hover { 
  color: var(--red); 
  background: rgba(232,93,93,.08);
}

.bm-empty {
  text-align: center; 
  padding: 56px 24px;
  color: var(--txt3); 
  display: flex;
  flex-direction: column; 
  align-items: center;
}

/* ===== COMPACT MODE ===== */
.compact-header {
  display: flex; 
  align-items: center; 
  gap: 10px;
  padding: 12px 16px; 
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; 
  top: 0; 
  z-index: 10;
}
.compact-close {
  background: none; 
  border: none; 
  cursor: pointer;
  color: var(--txt2); 
  display: flex; 
  padding: 5px;
  border-radius: 8px;
  transition: all .15s ease;
}
.compact-close:hover { background: var(--card-light); }
.compact-close svg { width: 18px; height: 18px; }

.compact-meta {
  display: flex; 
  align-items: center; 
  gap: 12px;
  flex: 1; 
  justify-content: center;
}
.compact-pos { 
  font-size: .82rem; 
  font-weight: 700; 
  color: var(--txt); 
}
.compact-timer {
  display: flex; 
  align-items: center; 
  gap: 4px;
  font-size: .78rem; 
  color: var(--txt3);
  font-weight: 600;
}
.compact-timer.warn { 
  color: var(--red); 
  font-weight: 700; 
}
.compact-correct {
  display: flex; 
  align-items: center; 
  gap: 4px;
  font-size: .78rem; 
  color: var(--green); 
  font-weight: 700;
}
.compact-wrong {
  display: flex; 
  align-items: center; 
  gap: 4px;
  font-size: .78rem; 
  color: var(--red); 
  font-weight: 700;
}
.compact-body { padding: 16px; }
.compact-qnum {
  font-size: .7rem; 
  font-weight: 800; 
  color: var(--accent2);
  text-transform: uppercase; 
  letter-spacing: .07em;
  margin-bottom: 8px;
}
.compact-question { font-size: .88rem; }
.compact-options { gap: 8px; }
.compact-option {
  padding: 12px 14px;
  border-radius: 12px;
}

/* ===== DENSE PRACTICE MODE ===== */
.dense-header { padding: 12px 16px; }
.dense-body { 
  padding: 0 16px 16px; 
  display: flex; 
  flex-direction: column; 
  gap: 14px; 
}
.dense-card {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg2) 100%);
  border: 1px solid var(--border);
  border-radius: 18px; 
  padding: 18px;
  transition: all .2s ease;
}
.dense-card:active {
  border-color: rgba(91,108,255,.15);
}
.dense-card-head {
  display: flex; 
  align-items: center;
  justify-content: space-between; 
  margin-bottom: 8px;
}
.dense-qnum {
  font-size: .7rem; 
  font-weight: 800; 
  color: var(--accent2);
  text-transform: uppercase; 
  letter-spacing: .07em;
}
.dense-question { 
  font-size: .84rem; 
  margin-bottom: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.dense-opts { gap: 6px; }
.dense-opt { 
  padding: 10px 13px; 
  font-size: .82rem;
  border-radius: 12px;
}
.dense-opt-lbl {
  font-size: .74rem; 
  font-weight: 700;
  color: var(--txt3); 
  margin-right: 8px; 
  flex-shrink: 0;
}
.dense-selected {
  border-color: var(--accent2) !important;
  background: linear-gradient(135deg, rgba(91,108,255,.12), rgba(91,108,255,.04)) !important;
  box-shadow: 0 2px 8px rgba(91,108,255,.12);
}

/* ============================================
   QUIZ STYLE OVERLAY — Full Page Premium
   ============================================ */
.qs-overlay {
  position: fixed; 
  inset: 0; 
  z-index: 3000;
  display: flex; 
  align-items: flex-end;
  opacity: 0; 
  transition: opacity .3s ease;
}
.qs-overlay.open { opacity: 1; }

.qs-backdrop {
  position: absolute; 
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.qs-panel {
  position: relative; 
  width: 100%; 
  z-index: 1;
  background: linear-gradient(180deg, var(--bg) 0%, var(--card) 100%);
  border-radius: 28px 28px 0 0;
  transform: translateY(100%);
  height:60vh;
  min-height:320px;
  max-height:100vh;
  transition:
    height .2s ease,
    transform .35s cubic-bezier(.32,1,.23,1);
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -12px 48px rgba(0,0,0,.45);
}
.qs-overlay.open .qs-panel { transform: translateY(0); }

.qs-head {
  display: flex; 
  align-items: center; 
  gap: 14px;
  padding: 20px 22px; 
  border-bottom: 1px solid var(--border);
  position: sticky; 
  top: 0; 
  background: var(--bg); 
  z-index: 1;
}
.qs-head .back-btn {
  padding: 8px;
  border-radius: 10px;
}

.qs-content { padding: 20px 22px 40px; }

.qs-desc { 
  font-size: .82rem; 
  color: var(--txt3); 
  margin-bottom: 24px;
  font-weight: 500;
  line-height: 1.5;
}

.qs-option {
  border: 1.5px solid var(--border); 
  border-radius: 18px;
  padding: 14px 16px; 
  border-radius: 16px;
  margin-bottom: 12px; 
  cursor: pointer;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(180deg, var(--card) 0%, var(--bg2) 100%);
  position: relative;
  overflow: hidden;
}
.qs-option::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 2px solid transparent;
  transition: border-color .25s ease;
  pointer-events: none;
}
.qs-option:hover {
  border-color: rgba(91,108,255,.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.qs-option.selected { 
  border-color: var(--accent2); 
  background: linear-gradient(180deg, rgba(91,108,255,.08) 0%, rgba(91,108,255,.02) 100%);
  box-shadow: 0 4px 16px rgba(91,108,255,.15);
}
.qs-option.selected::before {
  border-color: rgba(91,108,255,.2);
}

.qs-opt-head { 
  display: flex; 
  align-items: center; 
  gap: 14px; 
}

.qs-opt-radio {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: rgba(255, 255, 255, .03);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: .25s;
}

.qs-opt-radio.on {
  background: var(--accent2);
  border-color: var(--accent2);
  color: #fff;
}

.qs-opt-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(91, 108, 255, .06);
  border: 1px solid rgba(91, 108, 255, .12);
  color: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qs-opt-icon svg {
  width: 20px;
  height: 20px;
}
.qs-option:hover .qs-opt-icon {
  background: linear-gradient(135deg, rgba(91,108,255,.1), rgba(91,108,255,.04));
  color: var(--accent2);
  border-color: rgba(91,108,255,.2);
}
.qs-option.selected .qs-opt-icon {
  background: linear-gradient(135deg, rgba(91,108,255,.15), rgba(91,108,255,.05));
  color: var(--accent2);
  border-color: rgba(91,108,255,.25);
}

.qs-opt-title { 
  font-size: .92rem; 
  font-weight: 700; 
  color: var(--txt);
  letter-spacing: -.01em;
}
.qs-opt-sub { 
  font-size: .76rem; 
  color: var(--txt3); 
  margin-top: 3px;
  font-weight: 500;
}

.qs-dense-config { 
  margin-top: 16px; 
  padding-top: 16px; 
  border-top: 1px solid var(--border); 
}
.qs-dense-label { 
  font-size: .8rem; 
  color: var(--txt3); 
  font-weight: 700;
  letter-spacing: .02em;
}
.qs-dense-hint { 
  font-size: .72rem; 
  color: var(--txt4); 
  margin-top: 8px;
  font-weight: 500;
}

/* ============================================
   MTP / RTP OVERLAY — Premium Redesign
   ============================================ */
.mtprtp-overlay {
  position: fixed; 
  inset: 0; 
  z-index: 3000;
  display: flex; 
  align-items: flex-end;
  opacity: 0; 
  transition: opacity .3s ease;
}
.mtprtp-overlay.open { opacity: 1; }

.mtprtp-backdrop {
  position: absolute; 
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mtprtp-panel {
  position: relative; 
  width: 100%; 
  z-index: 1;
  background: linear-gradient(180deg, var(--bg) 0%, var(--card) 100%);
  border-radius: 28px 28px 0 0;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.32,1,.23,1);
  max-height: 92vh; 
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -12px 48px rgba(0,0,0,.45);
}
.mtprtp-overlay.open .mtprtp-panel { transform: translateY(0); }

.mtprtp-head {
  display: flex; 
  align-items: center; 
  gap: 14px;
  padding: 20px 22px; 
  border-bottom: 1px solid var(--border);
  position: sticky; 
  top: 0; 
  background: var(--bg); 
  z-index: 1;
}
.mtprtp-head .back-btn {
  padding: 8px;
  border-radius: 10px;
}

.mtprtp-content { padding: 20px 22px 44px; }

.mtprtp-intro {
  display: flex; 
  align-items: center; 
  gap: 12px;
  font-size: .84rem; 
  color: var(--txt2);
  background: linear-gradient(135deg, rgba(91,108,255,.08), rgba(91,108,255,.02));
  border-radius: 16px; 
  padding: 14px 16px;
  margin-bottom: 6px;
  border: 1px solid rgba(91,108,255,.1);
  font-weight: 500;
}

.mtprtp-attempt-card {
  display: flex; 
  align-items: center; 
  gap: 14px;
  background: linear-gradient(180deg, var(--card) 0%, var(--bg2) 100%);
  border: 1.5px solid var(--border);
  border-radius: 18px; 
  padding: 18px;
  margin-bottom: 10px; 
  cursor: pointer;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.mtprtp-attempt-card::before {
  content: '';
  position: absolute;
  top: 0; 
  left: 0; 
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  opacity: 0;
  transition: opacity .2s ease;
}
.mtprtp-attempt-card:hover { 
  border-color: rgba(91,108,255,.3); 
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.mtprtp-attempt-card:hover::before {
  opacity: 1;
}

.mtprtp-attempt-label { 
  font-size: .95rem; 
  font-weight: 700; 
  flex: 1;
  letter-spacing: -.01em;
}
.mtprtp-attempt-meta { 
  font-size: .76rem; 
  color: var(--txt3);
  font-weight: 500;
}

.mtprtp-paper-card {
  display: flex; 
  align-items: center; 
  gap: 14px;
  background: linear-gradient(180deg, var(--card) 0%, var(--bg2) 100%);
  border: 1.5px solid var(--border);
  border-radius: 18px; 
  padding: 18px;
  margin-bottom: 10px; 
  cursor: pointer;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.mtprtp-paper-card::before {
  content: '';
  position: absolute;
  top: 0; 
  left: 0; 
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  opacity: 0;
  transition: opacity .2s ease;
}
.mtprtp-paper-card:hover { 
  border-color: rgba(91,108,255,.3); 
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.mtprtp-paper-card:hover::before {
  opacity: 1;
}

.mtprtp-paper-icon {
  width: 42px; 
  height: 42px; 
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(91,108,255,.12), rgba(91,108,255,.04));
  color: var(--accent2);
  display: flex; 
  align-items: center; 
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(91,108,255,.15);
}
.mtprtp-paper-icon svg { width: 20px; height: 20px; }

.mtprtp-paper-title { 
  font-size: .92rem; 
  font-weight: 700;
  letter-spacing: -.01em;
}
.mtprtp-paper-meta { 
  font-size: .76rem; 
  color: var(--txt3); 
  margin-top: 3px;
  font-weight: 500;
}

.mtprtp-back-btn {
  display: flex; 
  align-items: center; 
  gap: 8px;
  background: none; 
  border: none; 
  cursor: pointer;
  color: var(--txt3); 
  font-size: .8rem;
  padding: 0; 
  margin-bottom: 6px;
  font-weight: 600;
  transition: color .15s ease;
}
.mtprtp-back-btn:hover { color: var(--txt); }
.mtprtp-back-btn svg { width: 16px; height: 16px; }

.mtprtp-subjects { 
  display: flex; 
  flex-direction: column; 
  gap: 10px; 
}

.mtprtp-subj-card {
  display: flex; 
  align-items: center; 
  gap: 14px;
  border-radius: 18px; 
  padding: 18px;
  border: 1.5px solid transparent;
  background: linear-gradient(180deg, var(--card) 0%, var(--bg2) 100%);
  transition: all .2s ease;
}
.mtprtp-subj-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.mtprtp-subj-icon { 
  width: 38px; 
  height: 38px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--bg2);
}
.mtprtp-subj-icon svg { width: 20px; height: 20px; }

.mtprtp-subj-info { flex: 1; }
.mtprtp-subj-name { 
  font-size: .9rem; 
  font-weight: 700; 
  color: var(--txt);
  letter-spacing: -.01em;
}
.mtprtp-subj-type { 
  font-size: .76rem; 
  color: var(--txt3); 
  margin-top: 3px;
  font-weight: 500;
}

.mtprtp-subj-actions { display: flex; gap: 8px; }

.mtprtp-mode-btn {
  display: flex; 
  align-items: center; 
  gap: 6px;
  padding: 8px 14px; 
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card); 
  color: var(--txt2);
  font-size: .76rem; 
  font-weight: 700; 
  cursor: pointer;
  transition: all .2s ease;
  letter-spacing: .01em;
}
.mtprtp-mode-btn:hover { 
  border-color: var(--accent2); 
  color: var(--accent2);
  background: rgba(91,108,255,.06);
  transform: translateY(-1px);
}
.mtprtp-mode-btn:active { transform: translateY(0); }

.mtprtp-full-attempt { margin-top: 20px; }
.mtprtp-papers { display: flex; flex-direction: column; }
.qs-drag-handle {
  width: 56px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  margin: 12px auto 8px;
  cursor: grab;
  touch-action: none;
}

.qs-drag-handle:active {
  cursor: grabbing;
}
/* ===== BOOKMARK POPUP REDESIGN ===== */
.bm-popup-panel {
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 32px;
}
.bm-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bm-popup-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--txt1);
}
.bm-popup-preview {
  font-size: .8rem;
  color: var(--txt3);
  line-height: 1.5;
  margin-bottom: 16px;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent2);
}
.bm-cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.bm-cat-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  color: var(--txt2);
  cursor: pointer;
  transition: all .18s;
  -webkit-tap-highlight-color: transparent;
}
.bm-cat-chip:active { transform: scale(.95); }
.bm-cat-chip.selected {
  background: var(--accent2);
  border-color: var(--accent2);
  color: #fff;
}
.bm-chip-emoji { font-size: .9rem; display: flex; align-items: center; flex-shrink: 0; }
.bm-chip-emoji svg { width: 14px; height: 14px; }

.bm-add-cat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--txt3);
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  cursor: pointer;
  margin-top: 4px;
  transition: color .2s, border-color .2s;
}
.bm-add-cat-btn:active { opacity: .7; }
.bm-custom-input {
  flex: 1;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .82rem;
  color: var(--txt1);
  outline: none;
}
.bm-custom-input:focus { border-color: var(--accent2); }
.bm-custom-confirm {
  background: var(--accent2);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}

/* ===== BOOKMARK PRACTICE BUTTONS ===== */
.bm-practice-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px 0;
  background: var(--accent2);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
  -webkit-tap-highlight-color: transparent;
}
.bm-practice-all-btn:active { opacity: .85; transform: scale(.98); }
.bm-practice-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--accent2);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bm-practice-btn:active { opacity: .8; transform: scale(.95); }
.bm-subj-row { margin-bottom: 6px; }
.bm-filter-chip.subj.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===== MTP/RTP FULLPAGE OVERLAY ===== */
.mtprtp-overlay.fullpage {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.mtprtp-overlay.fullpage.open {
  transform: translateX(0);
}
.mtprtp-overlay.fullpage .mtprtp-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: none;
  border-radius: 0;
  overflow: hidden;
}
.mtprtp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.mtprtp-mode-badge {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  background: var(--accent2);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
}
.mtprtp-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.mtprtp-intro-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: .82rem;
  color: var(--txt2);
  border: 1px solid var(--border);
}
.mtprtp-attempt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.mtprtp-attempt-card:active { background: var(--surface); }
.mtprtp-attempt-label { font-size: .9rem; font-weight: 700; color: var(--txt1); }
.mtprtp-attempt-meta { font-size: .74rem; color: var(--txt3); margin-top: 2px; }
.mtprtp-paper-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mtprtp-paper-card:active { opacity: .8; }
.mtprtp-paper-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mtprtp-paper-title { font-size: .88rem; font-weight: 700; color: var(--txt1); }
.mtprtp-paper-meta { font-size: .72rem; color: var(--txt3); margin-top: 2px; }
.mtprtp-subj-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mtprtp-subj-card:active { opacity: .8; }
.mtprtp-subj-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mtprtp-subj-icon svg { width: 18px; height: 18px; }
.mtprtp-subj-info { flex: 1; min-width: 0; }
.mtprtp-subj-name { font-size: .85rem; font-weight: 700; color: var(--txt1); }
.mtprtp-subj-type { font-size: .72rem; color: var(--txt3); margin-top: 1px; }
.mtprtp-start-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.mtprtp-start-btn:active { transform: scale(.95); }
.mtprtp-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--txt3);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-bottom: 4px;
}
.mtprtp-back-btn:active { opacity: .7; }
.mtprtp-papers { display: flex; flex-direction: column; }
.mtprtp-subjects { display: flex; flex-direction: column; }

/* ===== AVATAR CROP PREVIEW — INTERACTIVE PAN/ZOOM CROPPER ===== */
.avatar-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  background: rgba(8,9,14,.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.avatar-crop-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.avatar-crop-backdrop {
  position: absolute;
  inset: 0;
}
.avatar-crop-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  width: 100%;
  padding: 0 0 32px;
  transform: translateY(60px);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.4);
}
.avatar-crop-overlay.open .avatar-crop-panel { transform: translateY(0); }
.avatar-crop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.avatar-crop-head h2 { flex: 1; text-align: center; }
.avatar-crop-body { padding: 16px 16px 8px; }
.avatar-crop-hint {
  font-size: .78rem;
  color: var(--txt3);
  text-align: center;
  margin-bottom: 14px;
}

/* The square cropping stage: a fixed viewport the image pans/zooms inside */
.avatar-crop-stage {
  position: relative;
  width: min(78vw, 300px);
  height: min(78vw, 300px);
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  touch-action: none;
  cursor: grab;
  border: 1px solid var(--border);
}
.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform, width, height;
}
/* Subtle ring + rule-of-thirds guide lines overlaying the stage */
.avatar-crop-ring {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 2px solid rgba(255,255,255,.55);
  pointer-events: none;
  background-image:
    linear-gradient(to right, transparent 33.3%, rgba(255,255,255,.25) 33.3%, rgba(255,255,255,.25) calc(33.3% + 1px), transparent calc(33.3% + 1px)),
    linear-gradient(to right, transparent 66.6%, rgba(255,255,255,.25) 66.6%, rgba(255,255,255,.25) calc(66.6% + 1px), transparent calc(66.6% + 1px)),
    linear-gradient(to bottom, transparent 33.3%, rgba(255,255,255,.25) 33.3%, rgba(255,255,255,.25) calc(33.3% + 1px), transparent calc(33.3% + 1px)),
    linear-gradient(to bottom, transparent 66.6%, rgba(255,255,255,.25) 66.6%, rgba(255,255,255,.25) calc(66.6% + 1px), transparent calc(66.6% + 1px));
}

.avatar-crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(78vw, 300px);
  margin: 16px auto 4px;
}
.avatar-crop-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
}
.avatar-crop-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent2);
  cursor: pointer;
  border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.avatar-crop-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent2);
  cursor: pointer;
  border: 3px solid var(--surface);
}

.avatar-crop-actions {
  display: flex;
  gap: 10px;
  padding: 0 16px;
  margin-top: 18px;
}
.avatar-crop-actions .btn-secondary,
.avatar-crop-actions .btn-primary {
  flex: 1;
}

/* DARK */
.avatar-preview-modal {
  background: #0b1020;
  color: #fff;
}

/* LIGHT */
body.light .avatar-preview-modal {
  background: #ffffff;
  color: #111827;
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .12);
}

body.light .avatar-preview-overlay {
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(18px);
}

body.light .avatar-editor {
  background: #f5f7fb;
  border: 1px solid rgba(0, 0, 0, .08);
}

body.light .avatar-preview-title,
body.light .avatar-preview-text {
  color: #111827;
}

body.light .avatar-preview-sub {
  color: #6b7280;
}
body.light .avatar-cancel{
  background:#f3f4f6;
  color:#111827;
}

body.light .avatar-use{
  color:#fff;
}
/* ============================================
   LIVE XP TRACKER — shared across MCQ / Law / Live Test attempt
   ============================================ */
.live-xp-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(255,191,64,.12), rgba(91,108,255,.08));
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
  font-weight: 700;
  color: var(--txt);
  position: relative;
  flex-shrink: 0;
}
.live-xp-bar svg { width: 14px; height: 14px; color: #ffbf40; flex-shrink: 0; }
.live-xp-label { color: var(--txt3); font-weight: 600; margin-right: 2px; }
.live-xp-val { color: var(--txt); font-weight: 800; }
.live-xp-bar.xp-pulse { animation: xpBarPulse .5s ease; }
@keyframes xpBarPulse {
  0% { background: linear-gradient(135deg, rgba(255,191,64,.35), rgba(91,108,255,.2)); }
  100% { background: linear-gradient(135deg, rgba(255,191,64,.12), rgba(91,108,255,.08)); }
}
.live-xp-pop {
  position: absolute;
  right: 16px;
  top: 4px;
  font-size: .72rem;
  font-weight: 800;
  color: #ffbf40;
  pointer-events: none;
  animation: xpPopFloat .9s ease forwards;
}
@keyframes xpPopFloat {
  0% { opacity: 0; transform: translateY(4px) scale(.8); }
  20% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(1); }
}

/* ============================================
   BLOGS OVERLAY
   ============================================ */
.blog-grid { display: flex; flex-direction: column; gap: 12px; }
.blog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.blog-card:active { transform: scale(.98); }
.blog-card:hover { border-color: var(--accent2); }
.blog-card-media { width: 100%; height: 140px; overflow: hidden; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: flex; align-items: center; justify-content: center; }
.blog-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-ph { color: rgba(255,255,255,.85); }
.blog-card-ph svg { width: 32px; height: 32px; }
.blog-card-body { padding: 14px 16px; }
.blog-card-cat {
  display: inline-block;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(91,108,255,.1);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.blog-card-title { font-size: .92rem; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.blog-card-excerpt { font-size: .78rem; color: var(--txt3); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card-meta { font-size: .7rem; color: var(--txt4); margin-top: 8px; }

.blog-detail-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; margin-bottom: 16px; }
.blog-detail-cat {
  display: inline-block;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(91,108,255,.1);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.blog-detail-title { font-size: 1.25rem; font-weight: 800; line-height: 1.3; margin-bottom: 6px; }
.blog-detail-meta { font-size: .76rem; color: var(--txt3); margin-bottom: 18px; }
.blog-detail-body { font-size: .9rem; line-height: 1.65; color: var(--txt); }
.blog-detail-body p { margin-bottom: 14px; }
.blog-detail-body h1, .blog-detail-body h2, .blog-detail-body h3 { font-weight: 700; margin: 20px 0 10px; line-height: 1.3; }
.blog-detail-body ul, .blog-detail-body ol { margin: 0 0 14px 20px; }
.blog-detail-body li { margin-bottom: 6px; }
.blog-detail-body img { max-width: 100%; border-radius: 10px; margin: 10px 0; }
.blog-detail-body a { color: var(--accent2); text-decoration: underline; }
.blog-detail-body blockquote { border-left: 3px solid var(--accent2); padding-left: 12px; color: var(--txt3); margin: 14px 0; }
.blog-detail-body strong { font-weight: 700; color: var(--txt); }

/* ============================================
   LEGAL PAGES (Privacy / Disclaimer) + CONTACT US
   ============================================ */
.legal-content { font-size: .86rem; line-height: 1.65; color: var(--txt2); }
.legal-content h3 { font-size: .95rem; font-weight: 700; color: var(--txt); margin: 22px 0 8px; }
.legal-content h3:first-child { margin-top: 0; }
.legal-content p { margin-bottom: 12px; }
.legal-content ul { margin: 0 0 12px 18px; }
.legal-content li { margin-bottom: 6px; }
.legal-updated { font-size: .72rem; color: var(--txt4); margin-bottom: 18px; }

.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--txt);
}
.contact-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(91,108,255,.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-icon svg { width: 19px; height: 19px; color: var(--accent2); }
.contact-info { flex: 1; min-width: 0; }
.contact-label { font-size: .68rem; color: var(--txt3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.contact-value { font-size: .86rem; font-weight: 600; word-break: break-word; }

/* ============================================
   LIVE TEST ATTEMPT — direct-answer questions
   ============================================ */
.quiz-direct-input {
  width: 100%;
  min-height: 110px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: .88rem;
  color: var(--txt);
  font-family: inherit;
  resize: vertical;
  margin-top: 4px;
}
.quiz-direct-input:focus { outline: none; border-color: var(--accent2); }
.quiz-direct-input:disabled { opacity: .7; }
.quiz-direct-correct {
  margin-top: 12px;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--green);
  background: rgba(52,199,89,.08);
  border: 1px solid rgba(52,199,89,.2);
  border-radius: 12px;
  padding: 10px 12px;
}

/* ============================================
   CONTACT US — minimalist form
   ============================================ */
.contact-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.contact-field { margin-bottom: 14px; }
.contact-field:last-of-type { margin-bottom: 16px; }
.contact-field label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--txt3);
  margin-bottom: 6px;
}
.contact-field input,
.contact-field textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .86rem;
  color: var(--txt);
  font-family: inherit;
}
.contact-field textarea { min-height: 90px; resize: vertical; }
.contact-field input:focus,
.contact-field textarea:focus { outline: none; border-color: var(--accent2); }
.contact-submit-btn {
  width: 100%;
  background: var(--accent2);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
}
.contact-submit-btn:active { opacity: .85; }

/* ===== COMING SOON OVERLAY ===== */
.glass-overlay-soon {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
}
.glass-overlay-soon span {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
  background: linear-gradient(135deg, #fff, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== GUEST GLASSMORPHISM OVERLAY ===== */
.restricted-by-guest {
  position: relative !important;
}

.restricted-by-guest > *:not(.guest-glass-overlay) {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: 0.6;
}

.guest-glass-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: inherit;
  color: var(--txt);
  text-align: center;
  padding: 20px;
}
.dark-theme .guest-glass-overlay {
  background: rgba(0, 0, 0, 0.2);
}

.guest-glass-overlay svg {
  color: var(--accent);
  margin-bottom: 12px;
}
.guest-glass-overlay h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.guest-glass-overlay p {
  font-size: 0.85rem;
  color: var(--txt2);
  margin-bottom: 16px;
  line-height: 1.4;
}
.guest-glass-btn {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(91,108,255,0.3);
  transition: all 0.2s ease;
}
.guest-glass-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(91,108,255,0.4);
}

/* ===== CUSTOM FILTER PANEL (Flipkart Style) ===== */
.bm-filter-panel-overlay {
  position: absolute;
  top: 64px;
  left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  backdrop-filter: blur(4px);
}
.bm-filter-panel {
  width: 320px;
  height: 100%;
  background: var(--bg);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s forwards;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.bm-filter-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bm-filter-head h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}
.bm-filter-close {
  background: none;
  border: none;
  color: var(--txt3);
  cursor: pointer;
  padding: 4px;
}
.bm-filter-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.bm-filter-section {
  margin-bottom: 24px;
}
.bm-filter-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--txt);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bm-filter-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Custom Checkbox */
.bm-checkbox, .bm-radio {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  font-size: 0.95rem;
  color: var(--txt2);
}
.bm-checkbox input, .bm-radio input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
.bm-check-mark, .bm-radio-mark {
  height: 18px;
  width: 18px;
  background-color: var(--bg2);
  border: 1px solid var(--border);
  margin-right: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
}
.bm-check-mark {
  border-radius: 4px;
}
.bm-radio-mark {
  border-radius: 50%;
}
.bm-checkbox:hover input ~ .bm-check-mark, 
.bm-radio:hover input ~ .bm-radio-mark {
  border-color: var(--accent);
  background-color: rgba(91,108,255,0.1);
}
.bm-checkbox input:checked ~ .bm-check-mark,
.bm-radio input:checked ~ .bm-radio-mark {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(91,108,255,0.4);
}
/* checkmark icon */
.bm-check-mark:after {
  content: "";
  display: none;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}
.bm-radio-mark:after {
  content: "";
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}
.bm-checkbox input:checked ~ .bm-check-mark:after,
.bm-radio input:checked ~ .bm-radio-mark:after {
  display: block;
}
.bm-checkbox input:disabled ~ .bm-check-mark,
.bm-checkbox input:disabled ~ .bm-check-label {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Date Picker */
.bm-date-picker {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--txt);
  font-family: inherit;
  font-size: 0.9rem;
}
.bm-date-picker:focus {
  outline: none;
  border-color: var(--accent2);
}

.bm-filter-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  background: var(--bg);
}
.bm-filter-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.bm-filter-btn.secondary {
  background: var(--bg2);
  color: var(--txt2);
  border: 1px solid var(--border);
}
.bm-filter-btn.secondary:hover {
  background: var(--border);
}
.bm-filter-btn.primary {
  background: var(--accent2);
  color: #fff;
  border: none;
}
.bm-filter-btn.primary:hover {
  opacity: 0.9;
}

/* ============================================
   PDF LIBRARY & CRUX (Blog) OVERLAYS
   ============================================ */

/* Common Overlay Topbar (Matches Main App) */
.fs-overlay .topbar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.fs-overlay .topbar .back-btn {
  background: none;
  border: none;
  color: var(--txt);
  padding: 8px;
  margin: -8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fs-overlay .topbar .back-btn svg {
  width: 20px;
  height: 20px;
}
.fs-overlay .topbar .share-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--txt);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* PDF Library */
.coming-soon-banner {
  background: rgba(91,108,255,0.1);
  border: 1px dashed var(--accent);
  padding: 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.coming-soon-banner svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}
.coming-soon-banner-text {
  font-size: 0.85rem;
  color: var(--txt);
  line-height: 1.4;
}
.stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.stat-box {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.stat-box-val {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.stat-box-lbl {
  font-size: 0.7rem;
  color: var(--txt3);
  font-weight: 600;
}
.search-wrap {
  padding: 16px 16px 0;
  background: var(--bg);
}
.search-input-wrap {
  position: relative;
  width: 100%;
}
.search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--txt3);
}
.search-input {
  width: 100%;
  padding: 12px 16px 12px 38px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--txt);
  font-family: inherit;
  font-size: 0.9rem;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.tabs-wrap {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab-btn {
  padding: 8px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--txt2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 16px;
  -ms-overflow-style: none;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--txt2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.pdf-card {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}
.pdf-card:active {
  transform: scale(0.98);
}
.pdf-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-right: 14px;
  flex-shrink: 0;
}
.pdf-icon svg {
  width: 22px;
  height: 22px;
}
.pdf-meta {
  flex: 1;
  min-width: 0;
}
.pdf-name {
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--txt);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-sub {
  font-size: 0.7rem;
  color: var(--txt3);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.pdf-sub-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--txt4);
}
.pdf-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pdf-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.pdf-action {
  color: var(--txt4);
  padding-left: 10px;
}
.pdf-action svg {
  width: 20px;
  height: 20px;
}
.cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.cat-title {
  font-weight: 700;
  color: var(--txt);
  font-size: 0.95rem;
}
.cat-count {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--txt4);
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

/* Crux (Insights) */
.cats-wrap {
  display: flex;
  gap: 10px;
  padding: 16px;
  overflow-x: auto;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.cats-wrap::-webkit-scrollbar { display: none; }
.cat-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.cat-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.article-card {
  display: flex;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}
.article-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.article-thumb svg {
  width: 28px;
  height: 28px;
}
.article-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.article-category {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.article-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.3;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--txt4);
}
.article-row-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--txt4);
}
.article-body h2 {
  font-size: 1.1rem;
  color: var(--txt);
  margin: 24px 0 12px;
}
.article-body p {
  font-size: 0.95rem;
  color: var(--txt2);
  line-height: 1.6;
  margin-bottom: 16px;
}
.article-body ul {
  padding-left: 20px;
  margin-bottom: 16px;
  color: var(--txt2);
}
.article-body li {
  margin-bottom: 8px;
  line-height: 1.5;
}
.tip-box {
  background: rgba(91,108,255,0.08);
  border-left: 3px solid var(--accent);
  padding: 16px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
}
.tip-box-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tip-box p {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--txt);
}
.highlight {
  background: var(--bg2);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 20px 0;
  text-align: center;
  font-style: italic;
}
.highlight p {
  margin-bottom: 0;
  color: var(--txt);
  font-weight: 500;
}

/* ===== UNIFIED TABLE DESIGN SYSTEM (qt-*) ===== */

/* Solo table wrapper - sits inside quiz-body between question & options */
.qt-wrap {
  margin: 14px 0 18px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg2);
}

/* TableGroup shared table banner - above the dense card area */
.tg-table-wrap {
  margin: 0 16px 6px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  background: var(--bg2);
  flex-shrink: 0;
}

/* Scrollable inner container */
.qt-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.qt-scroll::-webkit-scrollbar { height: 4px; }
.qt-scroll::-webkit-scrollbar-track { background: transparent; }
.qt-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* The actual table */
.qt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: center;
  min-width: 280px;
}

/* Header row — bold, accent background */
.qt-table .qt-header-row {
  background: var(--accent);
}
.qt-table .qt-head-cell {
  padding: 10px 12px;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,0.2);
  white-space: nowrap;
}
.qt-table .qt-head-cell:last-child { border-right: none; }

/* Body rows — zebra striping */
.qt-table .qt-body-row { transition: background 0.15s; }
.qt-table .qt-even {
  background: var(--bg2);
}
.qt-table .qt-odd {
  background: var(--bg3, rgba(0,0,0,0.06));
}

/* All body cells */
.qt-table .qt-cell {
  padding: 9px 12px;
  color: var(--txt);
  font-weight: 500;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.qt-table .qt-cell:last-child { border-right: none; }

/* Subtle bottom border between rows */
.qt-table .qt-body-row + .qt-body-row td { border-top: 1px solid var(--border); }
