/* ===== STUDY MODE — Mobile-first C# Exam Prep ===== */
:root {
  --bg: #0b0f14;
  --bg-card: #121820;
  --bg-soft: #1a2230;
  --bg-hover: #1e2a3a;
  --border: #1f2937;
  --border-accent: #2a3a52;
  --text: #e5e7eb;
  --text-dim: #9ca3af;
  --text-faint: #6b7280;
  --accent: #7aa2ff;
  --accent-soft: rgba(122,162,255,.12);
  --accent-border: rgba(122,162,255,.25);
  --success: #6ee7a7;
  --success-soft: rgba(110,231,167,.10);
  --danger: #ff8a8a;
  --danger-soft: rgba(255,138,138,.10);
  --hint: #ffd84d;
  --hint-soft: rgba(255,216,77,.08);
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

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

html { font-size: calc(16px * var(--text-scale, 1)); -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ===== LAYOUT ===== */
.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px;
  padding-bottom: 80px; /* space for bottom nav */
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #5b7fd6);
  color: #fff;
  font-weight: 700;
  font-size: calc(16px * var(--text-scale, 1));
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand h1 { font-size: calc(18px * var(--text-scale, 1)); font-weight: 700; line-height: 1; }
.brand p { font-size: calc(12px * var(--text-scale, 1)); color: var(--text-faint); margin-top: 1px; }
.header-right {
  display: flex; align-items: center; gap: 8px;
}
.header-stat {
  font-family: var(--mono);
  font-size: calc(14px * var(--text-scale, 1));
  color: var(--text-faint);
  background: var(--bg-soft);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

/* ===== TOPIC FILTER BAR ===== */
.topic-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 8px;
}
.topic-bar::-webkit-scrollbar { display: none; }

.topic-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topic-pill:hover { border-color: var(--accent-border); color: var(--text); }
.topic-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.topic-pill .count {
  font-size: calc(11px * var(--text-scale, 1));
  font-family: var(--mono);
  opacity: .7;
}

/* ===== QUESTION CARD ===== */
.q-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
  transition: border-color .25s, box-shadow .25s;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.q-card:hover { border-color: var(--border-accent); box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.q-card.revealed { border-color: rgba(110,231,167,.35); box-shadow: 0 4px 24px rgba(110,231,167,.06); }

.q-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.q-badge {
  font-family: var(--mono);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 99px;
}
.q-topics {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.q-topic-tag {
  font-size: calc(10px * var(--text-scale, 1));
  font-family: var(--mono);
  color: var(--text-faint);
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.q-text {
  font-size: calc(16px * var(--text-scale, 1));
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 16px;
  color: var(--text);
}
.q-text code {
  font-family: var(--mono);
  font-size: calc(14px * var(--text-scale, 1));
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* Options */
.q-options { display: grid; gap: 8px; }
.q-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: all .2s;
  font-size: calc(15px * var(--text-scale, 1));
  line-height: 1.4;
}
.q-opt:hover { border-color: var(--accent-border); background: var(--bg-hover); }
.q-opt:active { transform: scale(.985); }
.q-opt .letter {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 600;
  display: grid;
  place-items: center;
  transition: all .2s;
}
.q-opt.correct-revealed {
  border-color: var(--success);
  background: var(--success-soft);
}
.q-opt.correct-revealed .letter {
  background: var(--success);
  color: #000;
}
.q-opt.wrong-revealed {
  border-color: var(--danger);
  background: var(--danger-soft);
  opacity: .6;
}
.q-opt code {
  font-family: var(--mono);
  font-size: calc(13px * var(--text-scale, 1));
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent);
}

/* Reveal toggle */
.reveal-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.reveal-btn:hover { border-color: var(--accent-border); color: var(--text); }
.reveal-btn.active {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-soft);
}
.reveal-btn svg { flex-shrink: 0; }

/* ===== SIMILAR QUESTIONS DROPDOWN ===== */
.similar-section {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.similar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-dim);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.similar-toggle:hover { border-color: var(--accent-border); }
.similar-toggle.open {
  border-color: var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.similar-toggle .arrow {
  transition: transform .2s;
}
.similar-toggle.open .arrow {
  transform: rotate(180deg);
}

.similar-list {
  border: 1px solid var(--accent-border);
  border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg);
}
.similar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  font-size: calc(13px * var(--text-scale, 1));
  color: var(--text-dim);
  line-height: 1.3;
}
.similar-item:last-child { border-bottom: 0; }
.similar-item:hover { background: var(--bg-hover); color: var(--text); }
.similar-item .sim-badge {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: calc(12px * var(--text-scale, 1));
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 4px;
}
.similar-item .sim-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.similar-item .sim-topics {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.sim-topic-label {
  font-size: calc(8px * var(--text-scale, 1));
  font-family: var(--mono);
  color: var(--text-faint);
  background: var(--bg-soft);
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}

/* ===== BOTTOM NAV (mobile) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-info {
  font-family: var(--mono);
  font-size: calc(14px * var(--text-scale, 1));
  color: var(--text-faint);
}
.nav-info strong { color: var(--accent); }
.nav-arrows {
  display: flex;
  gap: 8px;
}
.nav-btn {
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.nav-btn:disabled { opacity: .3; cursor: default; }
.nav-btn:active:not(:disabled) { transform: scale(.92); }

/* ===== SEARCH BAR ===== */
.search-bar {
  position: relative;
  margin-bottom: 8px;
}
.search-bar input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: calc(14px * var(--text-scale, 1));
  font-family: var(--sans);
  outline: none;
  transition: border-color .2s;
}
.search-bar input::placeholder { color: var(--text-faint); }
.search-bar input:focus { border-color: var(--accent); }
.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

/* ===== JUMP-TO MODAL ===== */
.jump-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.jump-sheet {
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 720px;
  max-height: 75dvh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-bottom: 0;
  animation: slideUp .25s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.jump-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.jump-header h3 {
  font-size: calc(16px * var(--text-scale, 1));
  font-weight: 600;
}
.jump-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.jump-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.jump-search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: calc(14px * var(--text-scale, 1));
  font-family: var(--sans);
  outline: none;
}
.jump-search input:focus { border-color: var(--accent); }
.jump-body {
  overflow-y: auto;
  flex: 1;
  padding: 8px;
  -webkit-overflow-scrolling: touch;
}
.jump-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  font-size: calc(14px * var(--text-scale, 1));
  line-height: 1.3;
}
.jump-item:hover { background: var(--bg-hover); }
.jump-item.current { background: var(--accent-soft); border: 1px solid var(--accent-border); }
.jump-item .j-num {
  font-family: var(--mono);
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
  width: 32px;
}
.jump-item .j-text {
  flex: 1;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== PROGRESS RING ===== */
.progress-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.progress-ring-wrap {
  position: relative;
  width: 52px; height: 52px;
  flex-shrink: 0;
}
.progress-ring-wrap .pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 700;
  color: var(--accent);
}
.progress-info h3 { font-size: calc(16px * var(--text-scale, 1)); font-weight: 600; margin-bottom: 2px; }
.progress-info p { font-size: calc(12px * var(--text-scale, 1)); color: var(--text-faint); font-family: var(--mono); }
.progress-bar-wrap {
  flex: 1;
}
.progress-bar {
  height: 4px;
  background: var(--bg-soft);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 99px;
  transition: width .3s;
}

/* ===== VIEW MODES ===== */
.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.view-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.view-btn.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* ===== FLASHCARD MODE ===== */
.flashcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.flashcard .q-text { font-size: calc(18px * var(--text-scale, 1)); flex: 1; }
.flashcard-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.fc-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  min-width: 0;
}
.fc-btn:hover { border-color: var(--accent-border); color: var(--text); }
.fc-btn.primary { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ===== SWIPE INDICATOR ===== */
.swipe-hint {
  text-align: center;
  font-size: calc(12px * var(--text-scale, 1));
  color: var(--text-faint);
  padding: 4px;
  opacity: .6;
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: calc(13px * var(--text-scale, 1));
  color: var(--text-dim);
  font-family: var(--mono);
}
.stat-chip .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* ===== QUIZ MODE TOGGLE (top) ===== */
.mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.q-card { animation: fadeInUp .22s ease-out; }

@keyframes subtlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

.progress-section {
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.bottom-nav {
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
}

/* ===== TABLET SIDEBAR LAYOUT ===== */
.study-layout {
  display: block; /* mobile default */
}

.sidebar-col {
  display: none; /* hidden on mobile */
}

@media (min-width: 768px) {
  .app {
    max-width: 1100px;
    padding: 16px 24px;
    padding-bottom: 80px;
  }

  .study-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
  }

  .sidebar-col {
    display: block;
    position: sticky;
    top: 16px;
  }

  /* Hide inline similar on tablet — sidebar replaces it */
  .q-card .similar-section {
    display: none;
  }
}

/* Sidebar panel styles */
.sidebar-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,.12);
}

/* Current question indicator */
.sidebar-current {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(122,162,255,.06) 0%, transparent 60%);
}
.sidebar-current-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sidebar-current-label {
  font-size: calc(10px * var(--text-scale, 1));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-faint);
}
.sidebar-current-badge {
  font-family: var(--mono);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--accent-border);
}
.sidebar-current-preview {
  font-size: calc(12px * var(--text-scale, 1));
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-current-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Toggle button */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid transparent;
  background: var(--bg);
  color: var(--text-dim);
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--sans);
}
.sidebar-toggle:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.sidebar-toggle.open {
  color: var(--accent);
  background: var(--accent-soft);
  border-bottom-color: var(--accent-border);
}
.sidebar-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-chevron {
  transition: transform .25s ease;
}
.sidebar-toggle.open .sidebar-chevron {
  transform: rotate(180deg);
}

/* Similar items list */
.sidebar-list {
  max-height: calc(100vh - 340px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: sidebarSlide .2s ease-out;
}
@keyframes sidebarSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s;
}
.sidebar-item:last-child { border-bottom: 0; }
.sidebar-item:hover {
  background: var(--bg-hover);
}
.sidebar-item:active {
  background: var(--accent-soft);
}

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

.sidebar-item-text {
  font-size: calc(12px * var(--text-scale, 1));
  color: var(--text-dim);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-item:hover .sidebar-item-text {
  color: var(--text);
}

.sidebar-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: calc(12px * var(--text-scale, 1));
  font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .app { padding: 8px; padding-bottom: 76px; }
  .q-card { padding: 16px; }
  .q-text { font-size: calc(15px * var(--text-scale, 1)); }
  .q-opt { padding: 10px; font-size: calc(14px * var(--text-scale, 1)); }
  .header { padding: 6px 0 8px; }
}

/* Landscape phone */
@media (max-height: 500px) {
  .bottom-nav { padding: 4px 12px; }
  .nav-btn { width: 38px; height: 38px; }
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
  position: relative;
  width: 40px; height: 22px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.toggle-switch.on {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.toggle-switch .thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all .2s;
}
.toggle-switch.on .thumb {
  left: 20px;
  background: var(--accent);
}

/* Marked indicator */
.q-marked { 
  position: absolute;
  top: 12px; right: 12px;
}
.mark-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-faint);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .15s;
}
.mark-btn.marked {
  border-color: var(--hint);
  color: var(--hint);
  background: var(--hint-soft);
}

/* ===== SETTINGS / TEXT SCALE ===== */
.icon-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: all .2s;
}
.icon-btn:hover,
.icon-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  z-index: 1000;
  width: 240px;
  animation: fadeInUp .2s ease-out;
}
.settings-label {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.settings-row .scale-min {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
}
.settings-row .scale-max {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-faint);
}
.settings-row input[type=range] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 6px;
}
.settings-value {
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin-top: 8px;
}
