/* ========================================================
   BookNook Web — Main Stylesheet
   Dark‑themed, responsive, Shosetsu‑inspired aesthetic
   ======================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --card:         #21262d;
  --card-hover:   #2d333b;
  --border:       #30363d;
  --accent:       #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: #a78bfa;
  --text:         #e6edf3;
  --text-muted:   #8b949e;
  --text-dim:     #656d76;
  --success:      #3fb950;
  --warning:      #d29922;
  --danger:       #f85149;
  --info:         #58a6ff;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 4px 24px rgba(0,0,0,.4);
  --transition:   .18s ease;
  --sidebar-w:    220px;
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:   Georgia, 'Times New Roman', serif;
  --font-mono:    'Fira Code', 'Courier New', monospace;
}

/* Light reader theme */
[data-reader-theme="light"] {
  --reader-bg:    #ffffff;
  --reader-text:  #1a1a1a;
  --reader-link:  #7c3aed;
}
[data-reader-theme="sepia"] {
  --reader-bg:    #f4ecd8;
  --reader-text:  #3b2f2f;
  --reader-link:  #7c5c2e;
}
[data-reader-theme="dark"] {
  --reader-bg:    #0d1117;
  --reader-text:  #e6edf3;
  --reader-link:  #a78bfa;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button { cursor: pointer; font-family: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
}

ul, ol { list-style: none; }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Sidebar ---------- */
.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .93rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover {
  background: var(--card);
  color: var(--text);
  text-decoration: none;
}
.nav-item.active {
  background: rgba(124,58,237,.18);
  color: var(--accent-light);
}
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: .72rem;
  font-weight: 600;
}

/* ---------- Top Bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  padding: 4px 8px;
}

/* ---------- Page Content ---------- */
.page {
  padding: 24px;
  flex: 1;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  border: none;
  transition: background var(--transition), transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

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

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--card-hover); }

.btn-danger {
  background: rgba(248,81,73,.15);
  color: var(--danger);
  border: 1px solid rgba(248,81,73,.3);
}
.btn-danger:hover { background: rgba(248,81,73,.25); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--card); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-lg { padding: 11px 22px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- Form Controls ---------- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .87rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: .93rem;
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}
.form-select { cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }

.search-bar {
  position: relative;
  flex: 1;
}
.search-bar .search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-bar .form-input { padding-left: 36px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--accent); }

/* Novel Cover Cards */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.novel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
}
.novel-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.novel-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--surface);
  display: block;
}
.novel-cover-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, var(--card-hover) 0%, var(--surface) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-dim);
}
.novel-info { padding: 10px 10px 12px; }
.novel-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.novel-author {
  font-size: .78rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.novel-source-badge {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  color: var(--accent-light);
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.novel-progress-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 0 var(--radius);
}

/* ---------- Tags & Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-accent  { background: rgba(124,58,237,.2); color: var(--accent-light); }
.badge-success { background: rgba(63,185,80,.15); color: var(--success); }
.badge-warning { background: rgba(210,153,34,.15); color: var(--warning); }
.badge-danger  { background: rgba(248,81,73,.15);  color: var(--danger); }
.badge-info    { background: rgba(88,166,255,.15); color: var(--info); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: .9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent-light); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: translateY(10px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-header h3 { flex: 1; font-size: 1rem; font-weight: 600; }
.modal-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 1.2rem; padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ---------- Toast Notifications ---------- */
#toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  max-width: 360px;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: .88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow);
  animation: toast-in .2s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }
@keyframes toast-in { from { transform: translateX(20px); opacity:0; } to { transform: none; opacity:1; } }

/* ---------- Progress ---------- */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
}
.progress-bar-fill.success { background: var(--success); }

/* ---------- Browse Page ---------- */
.browse-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.source-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.source-tab-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 500;
  transition: all var(--transition);
}
.source-tab-btn:hover { color: var(--text); border-color: var(--accent); }
.source-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Novel Detail Page ---------- */
.novel-hero {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  align-items: flex-start;
}
.novel-hero-cover {
  width: 160px;
  min-width: 160px;
  border-radius: var(--radius);
  aspect-ratio: 2/3;
  object-fit: cover;
  border: 1px solid var(--border);
}
.novel-hero-cover-placeholder {
  width: 160px;
  min-width: 160px;
  aspect-ratio: 2/3;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: var(--text-dim);
}
.novel-hero-info h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}
.novel-hero-author {
  color: var(--text-muted);
  margin-bottom: 10px;
  font-size: .93rem;
}
.novel-hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.novel-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.novel-desc {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: .93rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.novel-desc.expanded { -webkit-line-clamp: unset; }

/* Chapter list */
.chapter-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 400px;
  overflow-y: auto;
}
.chapter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.chapter-item:hover { background: var(--card-hover); }
.chapter-item.current { background: rgba(124,58,237,.15); }
.chapter-item.read { color: var(--text-dim); }
.chapter-item-title {
  flex: 1;
  font-size: .88rem;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chapter-item-date { font-size: .75rem; color: var(--text-dim); flex-shrink: 0; }
.chapter-checkbox { flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }

/* ---------- Reader Page ---------- */
.reader-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--reader-bg, var(--bg));
  color: var(--reader-text, var(--text));
}
.reader-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.reader-topbar.hidden { transform: translateY(-100%); }
.reader-title {
  flex: 1;
  font-size: .93rem;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.reader-body {
  flex: 1;
  padding: 32px var(--reader-margin, 20px);
  max-width: min(800px, 100%);
  margin: 0 auto;
  width: 100%;
}
.reader-body h1, .reader-body h2, .reader-body h3 {
  margin: 1.5em 0 .6em;
  line-height: 1.3;
}
.reader-body p {
  margin-bottom: 1em;
  line-height: var(--reader-line-height, 1.8);
}
.reader-body img { max-width: 100%; height: auto; margin: 1em auto; border-radius: var(--radius-sm); }
.reader-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  bottom: 0;
}

/* Reader Settings Panel */
.reader-settings-panel {
  position: fixed;
  top: 0; right: 0;
  width: 300px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  z-index: 200;
  transform: translateX(100%);
  transition: transform var(--transition);
}
.reader-settings-panel.open { transform: translateX(0); }

/* Epub viewer */
#epub-viewer {
  width: 100%;
  height: calc(100vh - 60px);
  border: none;
}

/* ---------- Downloads Page ---------- */
.download-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.download-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.download-item-title { flex: 1; font-size: .9rem; font-weight: 500; }
.download-status {
  font-size: .78rem;
  padding: 2px 8px;
  border-radius: 999px;
}
.download-status.pending  { background: rgba(139,148,158,.12); color: var(--text-muted); }
.download-status.active   { background: rgba(88,166,255,.15);  color: var(--info); }
.download-status.done     { background: rgba(63,185,80,.15);   color: var(--success); }
.download-status.error    { background: rgba(248,81,73,.15);   color: var(--danger); }
.download-status.retrying { background: rgba(210,153,34,.15);  color: var(--warning); }

/* ---------- Settings Page ---------- */
.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.settings-section-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-section-body { padding: 18px; }
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-info { flex: 1; }
.settings-row-label { font-size: .9rem; font-weight: 500; }
.settings-row-desc  { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 4px; top: 4px;
  background: var(--text);
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Color swatches */
.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition), transform .1s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: var(--accent-light); }

/* ---------- Loading / Empty States ---------- */
.loading-spinner {
  display: inline-block;
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.empty-state p  { font-size: .9rem; max-width: 320px; margin: 0 auto 20px; }

.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-pulse { 0%,100% { background-position: 0% 0%; } 50% { background-position: 100% 0%; } }

/* ---------- Chip / Filter ---------- */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-chip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .82rem;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-chip:hover  { border-color: var(--accent); color: var(--text); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Divider ---------- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ---------- Overlay Sidebar (Mobile) ---------- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-220px);
    width: 220px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .sidebar-overlay.visible { display: block; }

  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }

  .novel-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .page { padding: 16px; }
  .topbar { padding: 12px 16px; }

  .novel-hero { flex-direction: column; }
  .novel-hero-cover,
  .novel-hero-cover-placeholder { width: 120px; min-width: 120px; }

  .reader-settings-panel { width: 100%; }
}

@media (max-width: 480px) {
  .novel-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .browse-toolbar { flex-direction: column; align-items: stretch; }
  .modal { max-height: 95vh; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ---------- Chapter export select ---------- */
.export-all-none {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  font-size: .85rem;
}

/* Active state for toggle buttons (theme selector, etc.) */
.btn-secondary.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
