:root {
  --bg: #faf9f6; --surface: #ffffff; --surface-2: #f1f5f9;
  --text: #1a1a1a; --text-soft: #6b6b6b; --border: #e5e5e5;
  --accent: #D96B00; --accent-soft: #fdf0e3;
  --primary: #D96B00;
  --shadow: 0 4px 20px rgba(0,0,0,0.04); --shadow-lg: 0 15px 40px rgba(0,0,0,0.08);
  --glow: rgba(217,107,0,0.15); --shadow-glow: 0 8px 32px rgba(217,107,0,0.15);
  --radius: 14px; --font: 'Inter', sans-serif;
  --gs1: #2563eb; --gs2: #059669; --gs3: #d97706; --gs4: #7c3aed;
  --opt1: #db2777; --opt2: #ea580c;
  --surface-glass: rgba(250, 249, 246, 0.8);
}
body.dark-mode {
  --bg: #0a0a0f;
  --surface: #14141e;
  --surface-2: #1c1c2a;
  --text: #f0f0f5;
  --text-soft: #a0a0b8;
  --border: #2a2a3e;
  --shadow: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 15px 40px rgba(0,0,0,0.6);
  --accent-soft: #2a1a3a;
  --surface-glass: rgba(20, 20, 30, 0.85);
  --gs1: #60a5fa; --gs2: #34d399; --gs3: #fbbf24; --gs4: #a78bfa;
  --opt1: #f472b6; --opt2: #fb923c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.3s ease;
}

body.dark-mode {
  background: radial-gradient(ellipse at 50% 0%, #1a1a2e 0%, #0a0a0f 70%);
}

/* The dotted page texture was removed (calmer page; text sits on a plain surface). */
body::before {
  display: none !important;
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: -1;
  pointer-events: none;
}
body.dark-mode::before {
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
}
button { cursor: pointer; font: inherit; }

/* Buttons */
.btn-primary { background: var(--accent); color: white; border: none; padding: 12px 24px; border-radius: 10px; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; transition: all 0.2s; box-shadow: 0 4px 12px rgba(217, 107, 0, 0.2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(217, 107, 0, 0.3); }
.btn-secondary { background: transparent; border: 1px solid var(--border); padding: 12px 24px; border-radius: 10px; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: all 0.2s; color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-clear { background: transparent; border: 1px solid var(--border); padding: 12px 24px; border-radius: 10px; font-weight: 600; color: var(--text-soft); cursor: pointer; }
.btn-clear:hover { border-color: #DC2626; color: #DC2626; }
.theme-toggle { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 10px; cursor: pointer; transition: all 0.2s; font-size: 14px; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Layout & Sidebar */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  transition: background 0.3s ease, border-color 0.3s ease;
}
body.dark-mode .sidebar {
  background: rgba(20, 20, 30, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-logo { font-size: 22px; font-weight: 900; letter-spacing: -0.04em; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.logo-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.nav-title { font-size: 12px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 12px 10px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}
.nav-btn:hover { background: var(--bg); color: var(--text); }
.nav-btn.active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(217,107,0,0.2); }
body.dark-mode .nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
body.dark-mode .nav-btn.active {
  background: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(217, 107, 0, 0.3);
}

.sidebar-bottom { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-soft); text-align: center; }

/* Content */
.content { overflow-y: auto; padding: 0 40px 60px; }
.topbar { padding: 30px 0 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 30px; }
.topbar h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.topbar p { font-size: 14px; color: var(--text-soft); margin-top: 4px; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }

/* Dashboard & Forms */
.dashboard-section, .workspace-section { display: none; animation: fadeIn 0.4s ease; }
.dashboard-section.active, .workspace-section.active { display: block; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 25px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
body.dark-mode .stat-card:hover { border-color: var(--accent); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
.stat-label { font-size: 14px; color: var(--text-soft); font-weight: 600; margin-bottom: 10px; }
.stat-value { font-size: 36px; font-weight: 800; color: var(--accent); margin-bottom: 5px; }
.stat-note { font-size: 13px; color: var(--text-soft); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  transition: all 0.2s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-number { font-size: 13px; color: var(--accent); font-weight: 800; margin-bottom: 20px; }

/* Filters */
.filter-bar-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label { font-size: 13px; font-weight: 700; color: var(--text-soft); }
select, input { padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--font); font-size: 14px; background: var(--bg); color: var(--text); outline: none; }
select:focus, input:focus { border-color: var(--accent); }
.filter-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 5px; }

/* Custom Multi-Select Filter Controls */
.multiselect-container {
  position: relative;
  width: 100%;
}
.multiselect-btn {
  width: 100%;
  height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  outline: none;
  gap: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}
.multiselect-btn:focus, .multiselect-btn.active {
  border-color: var(--accent);
}
.multiselect-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.multiselect-arrow {
  font-size: 12px;
  color: var(--text-soft);
  transition: transform 0.2s ease;
}
.multiselect-container.open .multiselect-arrow {
  transform: rotate(180deg);
}
.multiselect-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  min-width: 280px;
  max-width: 380px;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 10px;
  max-height: 320px;
  flex-direction: column;
  box-sizing: border-box;
}
.multiselect-container.open .multiselect-dropdown {
  display: flex;
}
.multiselect-search {
  margin-bottom: 6px;
}
.multiselect-search input {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}
.multiselect-actions {
  display: flex;
  justify-content: space-between;
  padding: 4px 2px 8px 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.multiselect-act-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.multiselect-act-btn:hover {
  background: var(--accent-soft);
}
.multiselect-options {
  overflow-y: auto;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.multiselect-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #111111;
  user-select: none;
  line-height: 1.4;
}
body.dark-mode .multiselect-option {
  color: #ffffff;
}
.multiselect-option:hover {
  background: var(--bg);
}
.multiselect-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

/* Bank Items */
.bank-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.2s ease;
}
.bank-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.bank-question { font-size: 16px; font-weight: 700; margin-bottom: 12px; line-height: 1.5; }
.tags { display: flex; gap: 8px; margin-bottom: 15px; }
.tag { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); color: var(--text-soft); }
.bank-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Buttons for Bank Items */
.btn-study { background: var(--surface); border: 1px solid var(--border); color: var(--text-soft); border-radius: 10px; padding: 8px 16px; font-size: 13px; font-weight: 600; transition: all 0.2s; display: flex; align-items: center; gap: 6px; }
.btn-study:hover { background: var(--bg); border-color: var(--text-soft); transform: translateY(-2px); }
.btn-study.active-bookmark { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.btn-study.active-revised { background: #e6f4ea; color: #188038; border-color: #188038; }
.btn-add-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--text-soft); transition: all 0.2s; }
.btn-add-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-direct-pdf { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--text-soft); transition: all 0.2s; }
.btn-direct-pdf:hover { border-color: #dc2626; color: #dc2626; background: #fee2e2; }
.btn-ai-answer { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 8px 16px; font-weight: 700; font-size: 13px; transition: all 0.2s; display: flex; align-items: center; gap: 6px; }
.btn-ai-answer:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }

/* QCAB List */
.q-item { display: flex; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid var(--border); }
.q-text { font-size: 15px; font-weight: 600; }
.btn-generate { width: 100%; margin-top: 20px; background: var(--accent); color: white; border: none; padding: 15px; border-radius: 10px; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn-generate:disabled { background: var(--border); color: var(--text-soft); cursor: not-allowed; }

/* Create Question Form */
.create-form { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 30px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.create-form label { font-weight: 700; margin-bottom: 6px; display: block; color: var(--text-soft); }
.create-form textarea { resize: vertical; min-height: 120px; }
.marks-row { display: flex; gap: 10px; flex-wrap: wrap; }
.marks-btn { padding: 11px 24px; border: 2px solid var(--border); border-radius: 11px; background: var(--surface-2); font-weight: 800; transition: all 0.2s; }
.marks-btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.checkbox-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Gradients */
.grad-1 { background: #D96B00; color: white; border: none; }
.grad-2 { background: #3b82f6; color: white; border: none; }
.grad-3 { background: #10b981; color: white; border: none; }
.grad-4 { background: #8b5cf6; color: white; border: none; }
.grad-5 { background: #f59e0b; color: white; border: none; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 10001; display: none; justify-content: center; align-items: center; }
/* The AI model picker can be opened from inside the question-details modal (z-index 10005), so it must sit above it. */
#ai-model-modal.active { z-index: 10010; }
.modal-overlay.active { display: flex; }
.modal-content { background: var(--surface); border-radius: 16px; width: 90%; max-width: 500px; padding: 25px; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
.modal-close { background: transparent; border: none; font-size: 20px; cursor: pointer; color: var(--text-soft); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.model-option { display: block; width: 100%; margin-bottom: 10px; padding: 15px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.analyzer-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 10000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
.analyzer-modal-overlay.active { display: flex; }
.analyzer-content { background: var(--bg); width: 95%; height: 90vh; border-radius: 20px; padding: 30px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.analyzer-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 20px; }
.analyzer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.analyzer-capsule { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-radius: 10px; margin-bottom: 10px; cursor: pointer; font-weight: 700; font-size: 16px; }

/* Syllabus Modal */
.syllabus-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 10002; display: none; justify-content: center; align-items: center; }
.syllabus-modal-overlay.active { display: flex; }
.syllabus-modal-content { background: var(--bg); width: 90%; max-width: 800px; height: 80vh; border-radius: 20px; padding: 30px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.syllabus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 20px; }
.syllabus-menu-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; cursor: pointer; }
.syllabus-menu-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.syllabus-modal-header, .syllabus-modal-body { margin-bottom: 20px; }
.syllabus-modal-close { background: transparent; border: none; font-size: 20px; cursor: pointer; color: var(--text-soft); }
.back-btn { background: transparent; border: 1px solid var(--border); padding: 8px 16px; border-radius: 8px; margin-bottom: 15px; cursor: pointer; }

/* Toast */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #1e293b; color: #ffffff; border: 1px solid #334155; padding: 12px 24px; border-radius: 30px; opacity: 0; transition: opacity 0.3s, transform 0.3s; z-index: 10005; font-weight: 600; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-10px); }

/* Mobile Responsive / Workspace */
.mobile-nav { display: none !important; }
.mobile-menu-backdrop { display: none !important; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    display: flex;
    position: fixed;
    z-index: 200;
    left: 0; top: 0; bottom: 0;
    width: 250px;
    background: var(--surface);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    flex-direction: column;
    gap: 30px;
    padding: 24px 16px;
    border-right: 1px solid var(--border);
  }
  body.dark-mode .sidebar { background: rgba(20, 20, 30, 0.92); }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-nav { display: flex !important; align-items: center; justify-content: space-between; padding: 20px; position: sticky; top: 0; background: var(--bg); z-index: 100; border-bottom: 1px solid var(--border); }
  .hamburger { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); }
  .content { padding: 20px 20px 100px; }
  .stats-row { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .filter-actions { flex-direction: column; }
  .mobile-menu-backdrop { display: block !important; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 150; opacity: 0; pointer-events: none; }
  .mobile-menu-backdrop.active { opacity: 1; pointer-events: auto; }
  .multiselect-dropdown {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    box-sizing: border-box;
  }
}

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

/* Curated Approach Section Styles */
.curated-approach-section { gap: 10px; }
.curated-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; font-size: 11px; font-weight: 600; color: #b45309; background: #fef3c7; border: 1px solid #fde68a; border-radius: 6px; text-transform: none; letter-spacing: normal; }
body.dark-mode .curated-badge { color: #fde68a; background: rgba(180, 83, 9, 0.25); border-color: rgba(245, 158, 11, 0.4); }

.ai-draft-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; font-size: 11px; font-weight: 600; color: #4338ca; background: #e0e7ff; border: 1px solid #c7d2fe; border-radius: 6px; text-transform: none; letter-spacing: normal; }
body.dark-mode .ai-draft-badge { color: #a5b4fc; background: rgba(67, 56, 202, 0.25); border-color: rgba(129, 140, 248, 0.4); }

.ai-draft-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-left: 4px solid #10b981; border-radius: 8px; font-size: 13px; color: var(--text); }
body.dark-mode .ai-draft-card { background: rgba(16, 40, 25, 0.6); border-color: rgba(34, 197, 94, 0.35); border-left-color: #10b981; }

.ai-draft-gap-callout { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; background: #fff1f2; border: 1px solid #fecdd3; border-left: 3px solid #e11d48; border-radius: 6px; margin-top: 4px; }
body.dark-mode .ai-draft-gap-callout { background: rgba(75, 15, 25, 0.5); border-color: rgba(225, 29, 72, 0.4); border-left-color: #f43f5e; }
.ai-draft-gap-title { font-size: 11px; font-weight: 800; color: #be123c; text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; gap: 5px; }
body.dark-mode .ai-draft-gap-title { color: #fda4af; }
.ai-draft-gap-body { font-size: 12.5px; font-weight: 500; line-height: 1.45; color: var(--text); }

/* Reference Notes Section Styles */
.ref-note-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.ref-note-item[open] { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); }
.ref-note-summary { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; user-select: none; background: var(--surface-2); list-style: none; }
.ref-note-summary::-webkit-details-marker { display: none; }
.ref-note-summary::before { content: "►"; display: inline-block; margin-right: 6px; font-size: 10px; color: var(--accent); transition: transform 0.2s ease; float: left; margin-top: 2px; }
.ref-note-item[open] .ref-note-summary::before { transform: rotate(90deg); }
.ref-note-heading { font-weight: 600; color: var(--text); line-height: 1.4; font-size: calc(13px * var(--text-scale, 1)); }
.ref-note-chapter { font-size: calc(11px * var(--text-scale, 1)); font-weight: 500; color: var(--text-soft); }
.ref-note-content { padding: 12px 14px; font-size: calc(12.5px * var(--text-scale, 1)) !important; line-height: 1.6; color: var(--text); white-space: pre-wrap; background: var(--surface); border-top: 1px solid var(--border); }
.ref-notes-more { margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--text-soft); font-style: italic; text-align: right; }

.curated-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: #fffbe3; border: 1px solid #fcd34d; border-left: 4px solid #f59e0b; border-radius: 8px; font-size: 13px; color: var(--text); }
body.dark-mode .curated-card { background: rgba(45, 35, 15, 0.6); border-color: rgba(245, 158, 11, 0.35); border-left-color: #f59e0b; }

.curated-field { display: flex; flex-direction: column; gap: 4px; }
.curated-field-label { font-size: 11px; font-weight: 800; color: #b45309; text-transform: uppercase; letter-spacing: 0.04em; }
body.dark-mode .curated-field-label { color: #fcd34d; }

.curated-field-value { font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--text); }
.curated-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.5; }

.curated-map-grid { display: flex; flex-direction: column; gap: 6px; background: rgba(255, 255, 255, 0.6); padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(245, 158, 11, 0.25); }
body.dark-mode .curated-map-grid { background: rgba(20, 20, 25, 0.4); border-color: rgba(245, 158, 11, 0.2); }
.curated-map-item { font-size: 13px; line-height: 1.4; }

.curated-linked-header { border-bottom: 1px dashed rgba(245, 158, 11, 0.4); padding-bottom: 8px; margin-bottom: 2px; }
.curated-link-meta { display: flex; flex-direction: column; gap: 4px; }
.curated-rel-badge { display: inline-block; width: fit-content; padding: 2px 7px; font-size: 10px; font-weight: 700; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.03em; }
.curated-rel-badge.rel-same { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
body.dark-mode .curated-rel-badge.rel-same { background: rgba(21, 128, 61, 0.25); color: #86efac; border-color: rgba(34, 197, 94, 0.3); }
.curated-rel-badge.rel-related { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
body.dark-mode .curated-rel-badge.rel-related { background: rgba(3, 105, 161, 0.25); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.3); }

.curated-link-qtext { font-size: 12px; line-height: 1.4; color: var(--text); }
.curated-why-caption { font-size: 11px; font-style: italic; color: var(--text-soft); display: flex; align-items: center; gap: 4px; }

/* Dynamic Text Size Scaling System */
:root {
  --text-scale: 1;
}
body[data-text-size="sm"] { --text-scale: 0.9; }
body[data-text-size="md"] { --text-scale: 1.0; }
body[data-text-size="lg"] { --text-scale: 1.15; }
body[data-text-size="xl"] { --text-scale: 1.30; }

.modal-q-text { font-size: calc(18px * var(--text-scale, 1)) !important; }
.bank-question { font-size: calc(16px * var(--text-scale, 1)) !important; }
.q-text { font-size: calc(15px * var(--text-scale, 1)) !important; }
.blueprint-directive { font-size: calc(13px * var(--text-scale, 1)) !important; }
.blueprint-target { font-size: calc(12px * var(--text-scale, 1)) !important; }
.blueprint-step-card { font-size: calc(13px * var(--text-scale, 1)) !important; }
.curated-card { font-size: calc(13px * var(--text-scale, 1)) !important; }
.ai-draft-card { font-size: calc(13px * var(--text-scale, 1)) !important; }
.curated-field-value { font-size: calc(13px * var(--text-scale, 1)) !important; }
.curated-list { font-size: calc(13px * var(--text-scale, 1)) !important; }
.same-theme-text { font-size: calc(14px * var(--text-scale, 1)) !important; }
.modal-accordion-panel { font-size: calc(13px * var(--text-scale, 1)) !important; }
.modal-note-box, .drawer-note-box { font-size: calc(14px * var(--text-scale, 1)) !important; }

/* Tag Chips */
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; border: 1px solid transparent; }
.tag-chip-paper { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.tag-chip-marks { color: #188038; background: #e6f4ea; border-color: #188038; }
.tag-chip-year { color: #1e40af; background: #eff6ff; border-color: #1e40af; }
.tag-chip-theme { color: #6b21a8; background: #f3e8ff; border-color: #6b21a8; }
.tag-chip-subtopic { color: #0284c7; background: #e0f2fe; border-color: #0284c7; }

body.dark-mode .tag-chip-paper { color: #fed7aa; background: #451a03; border-color: #78350f; }
body.dark-mode .tag-chip-marks { color: #86efac; background: #052e16; border-color: #14532d; }
body.dark-mode .tag-chip-year { color: #cbd5e1; background: #1e293b; border-color: #334155; }
body.dark-mode .tag-chip-theme { color: #d8b4fe; background: #3b0764; border-color: #7e22ce; }
body.dark-mode .tag-chip-subtopic { color: #7dd3fc; background: #075985; border-color: #0284c7; }

/* ================================================================
   PYQ BANK - cleaner cards + tabbed detail modal  (pq- prefix)
   Uses the existing design tokens only (colors, Inter font, orange accent).
   ================================================================ */

/* ---- result bar + status pills ---- */
.pq-resultbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pq-count { font-size: 14px; color: var(--text-soft); }
.pq-count strong { color: var(--text); }
.pq-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pq-pill { background: transparent; border: 1px solid var(--border); color: var(--text-soft); border-radius: 999px; padding: 5px 13px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.pq-pill:hover { border-color: var(--accent); color: var(--text); }
.pq-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- bank card ---- */
.pq-card-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
.pq-paper { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 5px; }
.pq-meta-txt { color: var(--text-soft); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.pq-meta-txt i { font-size: 11px; opacity: .8; }
.pq-flag { color: var(--accent); font-size: 12px; margin-left: auto; }
.pq-flag + .pq-flag { margin-left: 0; }
.pq-flag-ok { color: #188038; }
body.dark-mode .pq-flag-ok { color: #86efac; }
.pq-crumb { font-size: 12px; color: var(--text-soft); margin: 0 0 14px; display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.pq-unit { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); overflow: hidden; font-weight: 600; color: var(--text); }
.pq-unit-label { display: inline-flex; align-items: center; padding: 4px 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); border-right: 1px solid var(--border); }
.pq-unit-no { display: inline-flex; align-items: center; padding: 4px 9px; font-size: 12px; font-weight: 800; color: #fff; background: var(--accent); font-variant-numeric: tabular-nums; }
.pq-unit-name { display: inline-flex; align-items: center; padding: 4px 11px; line-height: 1.35; min-width: 0; }
.pq-crumb-sep { display: inline-flex; align-items: center; color: var(--accent); opacity: .7; font-size: 10px; }
.pq-theme { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 9px; border: 1px solid rgba(217,107,0,.28); background: var(--accent-soft); color: var(--accent); font-weight: 700; line-height: 1.35; }
.pq-theme i { font-size: 10px; }
.pq-crumb-more { margin-left: 2px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; }
body.dark-mode .pq-unit { background: #0d0d0d; border-color: #2a2a2a; }
body.dark-mode .pq-theme { background: rgba(217,107,0,.14); border-color: rgba(217,107,0,.4); color: #ffb366; }
@media (max-width: 560px) {
  .pq-crumb { gap: 6px; }
  .pq-unit { width: 100%; }
  .pq-crumb-sep { display: none; }
}
.pq-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.pq-spacer { flex: 1; }
.pq-btn { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-family: inherit; transition: all .15s; }
.pq-btn:hover { background: var(--surface-2); border-color: var(--accent); }
.pq-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.pq-btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.pq-icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; transition: all .15s; }
.pq-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.pq-icon-btn.active-bookmark { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.pq-icon-btn.active-revised { color: #188038; border-color: #188038; background: rgba(24,128,56,.1); }
body.dark-mode .pq-icon-btn.active-revised { color: #86efac; border-color: #14532d; background: rgba(34,197,94,.12); }

/* ---- modal header nav ---- */
.pq-nav-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.pq-nav-btn:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.pq-nav-btn:disabled { opacity: .35; cursor: default; }
.pq-nav-count { font-size: 12px; font-weight: 700; color: var(--text-soft); min-width: 52px; text-align: center; }

/* ---- modal head ---- */
.pq-modal-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: -8px; }
.connections-modal-body > .pq-crumb { margin: -6px 0 0; }
.pq-history-strip { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; width: 100%; text-align: left; font-family: inherit; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; cursor: pointer; color: var(--text); }
.pq-history-strip:hover { border-color: var(--accent); }
.pq-history-label { font-size: 12px; font-weight: 700; color: var(--text-soft); display: inline-flex; align-items: center; gap: 7px; }
.pq-history-years { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.pq-year-dot { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-soft); background: var(--surface); }
.pq-year-dot.now { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- tabs ---- */
.pq-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); position: sticky; top: -20px; margin: 0 -24px; padding: 0 24px; background: var(--surface); z-index: 5; overflow-x: auto; scrollbar-width: none; }
.pq-tabs::-webkit-scrollbar { display: none; }
.pq-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-soft); font-family: inherit; font-size: 13px; font-weight: 700; padding: 12px 12px 10px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; margin-bottom: -1px; }
.pq-tab:hover { color: var(--text); }
.pq-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.pq-tab-count { font-size: 11px; font-weight: 800; background: var(--surface-2); color: var(--text-soft); padding: 1px 7px; border-radius: 999px; }
.pq-tab.active .pq-tab-count { background: var(--accent-soft); color: var(--accent); }
.pq-panel { display: none; flex-direction: column; gap: 16px; }
.pq-panel.active { display: flex; }
.pq-panel .modal-section { border-top: none; padding-top: 0; }

/* ---- approach ---- */
.pq-flow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pq-flow-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: calc(12.5px * var(--text-scale, 1)); font-weight: 600; color: var(--text); }
.pq-flow-num { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.pq-fold { border: 1px dashed var(--border); border-radius: 10px; padding: 9px 12px; }
.pq-fold summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--text-soft); display: flex; align-items: center; gap: 7px; list-style: none; }
.pq-fold summary::-webkit-details-marker { display: none; }
.pq-fold summary::after { content: '+'; margin-left: auto; font-size: 16px; line-height: 1; }
.pq-fold[open] summary::after { content: '\2212'; }
.pq-fold-note { font-weight: 500; font-size: 11px; opacity: .8; }

/* ---- judgments ---- */
.pq-j-holding { font-size: calc(13px * var(--text-scale, 1)); line-height: 1.6; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--accent); padding: 9px 12px; border-radius: 0 8px 8px 0; margin-bottom: 10px; }
.pq-j-facts { display: grid; grid-template-columns: 70px 1fr; gap: 6px 10px; margin: 0; font-size: calc(12.5px * var(--text-scale, 1)); line-height: 1.5; }
.pq-j-facts dt { font-weight: 800; color: var(--text-soft); text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; padding-top: 2px; }
.pq-j-facts dd { margin: 0; color: var(--text); }

/* ---- misc ---- */
.pq-empty { text-align: center; color: var(--text-soft); padding: 28px 10px; }
.pq-empty i { font-size: 22px; opacity: .5; margin-bottom: 8px; }
.pq-empty p { margin: 0; font-size: 14px; }
.pq-note-label { font-size: 12px; font-weight: 800; color: var(--text-soft); text-transform: uppercase; letter-spacing: .05em; }
.pq-panel[data-panel="notes"] .modal-note-box { min-height: 180px; }

/* ---- sticky action bar ---- */
.pq-actionbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }

@media (max-width: 600px) {
  .pq-card-actions .pq-btn { flex: 1 1 auto; justify-content: center; }
  .pq-card-actions .pq-spacer { display: none; }
  .pq-actionbar { padding: 10px 12px; }
  .pq-actionbar .pq-btn { flex: 1 1 auto; justify-content: center; }
  .pq-actionbar .pq-spacer { display: none; }
  .pq-tabs { margin: 0 -16px; padding: 0 16px; }
  .pq-pills { width: 100%; }
}

/* keep the modal from jumping in height when switching tabs */
.connections-modal-body { min-height: min(460px, 55vh); }
.pq-modal-meta .pq-meta-txt { font-size: 13px; }

/* children of the scrolling modal body must never be squashed (tabs collapsed to 1px on phones) */
.connections-modal-body > * { flex-shrink: 0; }
@media (max-width: 600px) { .pq-tabs { top: -16px; } }

/* ================================================================
   v2: Bookmarks / Revision toolbars, GS skeleton, dashboard, motion
   ================================================================ */

/* ---- toolbars (Bookmarks + Revision) ---- */
.pq-toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.pq-toolbar-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.pq-field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.pq-field > span { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft); }
.pq-field select, .pq-field input { height: 40px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; padding: 0 12px; font-family: inherit; font-size: 13.5px; width: 100%; }
.pq-field select:focus, .pq-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pq-field-grow { flex: 1 1 240px; position: relative; flex-direction: row; align-items: center; }
.pq-field-grow > i { position: absolute; left: 13px; color: var(--text-soft); font-size: 13px; pointer-events: none; }
.pq-field-grow input { padding-left: 36px; }
.pq-pill-n { font-weight: 800; margin-left: 4px; opacity: .8; }
.pq-pill-danger { margin-left: auto; color: #b3261e; border-color: transparent; }
.pq-pill-danger:hover { border-color: #b3261e; color: #b3261e; }
body.dark-mode .pq-pill-danger { color: #f2b8b5; }
.pq-due { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-soft); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.pq-due.now { background: var(--accent-soft); color: var(--accent); }
.pq-icon-btn.pq-icon-danger:hover { color: #b3261e; border-color: #b3261e; background: transparent; }
body.dark-mode .pq-icon-btn.pq-icon-danger:hover { color: #f2b8b5; border-color: #f2b8b5; }

/* ---- progress meter in the result bar ---- */
.pq-progress { display: inline-flex; align-items: center; gap: 8px; margin-left: 14px; font-size: 12px; font-weight: 700; color: var(--text-soft); }
.pq-progress-bar { width: 84px; height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; display: inline-block; }
.pq-progress-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* ---- GS answer skeleton ---- */
.pq-skel { gap: 12px; }
.pq-skel-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; text-transform: none; letter-spacing: 0; }
.pq-skel-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.pq-skel-meta span + span::before { content: '·'; margin-right: 14px; color: var(--text-soft); font-weight: 400; }
.pq-skel-wants { margin: 0; font-size: calc(13.5px * var(--text-scale, 1)); line-height: 1.6; color: var(--text); }
.pq-skel-asks { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.pq-skel-asks ol { margin: 6px 0 0; padding-left: 20px; font-size: calc(13px * var(--text-scale, 1)); line-height: 1.55; }
.pq-skel-label { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-soft); }
.pq-skel-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; position: relative; }
.pq-skel-step { position: relative; padding: 0 0 16px 38px; }
.pq-skel-step:last-child { padding-bottom: 0; }
.pq-skel-step::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.pq-skel-step:last-child::before { display: none; }
.pq-skel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pq-skel-head b { font-size: calc(14px * var(--text-scale, 1)); color: var(--text); }
.pq-skel-num { position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.pq-skel-words { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--text-soft); background: var(--surface-2); padding: 2px 9px; border-radius: 999px; }
.pq-skel-step ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: calc(13px * var(--text-scale, 1)); line-height: 1.55; color: var(--text); }
.pq-skel-step ul.pq-skel-body { list-style: none; padding-left: 0; counter-reset: pqb; }
.pq-skel-step ul.pq-skel-body li { counter-increment: pqb; position: relative; padding: 7px 10px 7px 34px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.pq-skel-step ul.pq-skel-body li::before { content: counter(pqb); position: absolute; left: 10px; top: 7px; width: 18px; height: 18px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.pq-skel-hooks { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.pq-skel-hookrow { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.pq-skel-hookrow > .pq-skel-label { min-width: 92px; }
.pq-skel-hookrow > div { display: flex; flex-wrap: wrap; gap: 6px; }
.pq-hook { font-size: 12px; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px 10px; }
.pq-skel-scope { font-size: 12.5px; line-height: 1.5; color: var(--text-soft); }
.pq-skel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pq-skel-tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }
.pq-skel-tips i { color: var(--accent); margin-right: 6px; }
.pq-skel-foot { font-size: 11.5px; color: var(--text-soft); border-top: 1px dashed var(--border); padding-top: 10px; }

/* ---- dashboard: progress + due ---- */
.pq-dash { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; margin: 0 0 20px; }
.pq-dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.pq-dash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.pq-dash-head h3 { font-size: 15px; font-weight: 800; margin: 0; color: var(--text); }
.pq-dash-head span, .pq-dash-head a { font-size: 12.5px; font-weight: 700; color: var(--text-soft); text-decoration: none; }
.pq-dash-head a { color: var(--accent); }
.pq-bar-row { display: grid; grid-template-columns: 56px 1fr 72px; align-items: center; gap: 12px; width: 100%; background: none; border: none; padding: 6px 4px; border-radius: 8px; cursor: pointer; font-family: inherit; color: var(--text); text-align: left; }
.pq-bar-row:hover { background: var(--surface-2); }
.pq-bar-label { font-size: 12.5px; font-weight: 700; }
.pq-bar-track { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; display: block; }
.pq-bar-track i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.pq-bar-n { font-size: 12.5px; font-weight: 800; text-align: right; }
.pq-bar-n small { font-weight: 600; color: var(--text-soft); }
.pq-due-row { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; border-top: 1px solid var(--border); padding: 10px 2px; cursor: pointer; font-family: inherit; color: var(--text); text-align: left; }
.pq-due-row:first-of-type { border-top: none; }
.pq-due-row:hover .pq-due-q { color: var(--accent); }
.pq-due-q { flex: 1; font-size: 13px; font-weight: 600; line-height: 1.4; }
.pq-due-row > i { color: var(--text-soft); font-size: 11px; }
.pq-dash-empty { margin: 0; font-size: 13px; color: var(--text-soft); line-height: 1.55; }
@media (max-width: 900px) { .pq-dash { grid-template-columns: 1fr; } }

/* ---- keyboard hint ---- */
.pq-kbd-hint { font-size: 11.5px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pq-kbd-hint kbd { font-family: inherit; font-size: 10.5px; font-weight: 700; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface-2); color: var(--text); margin-left: 6px; }
@media (max-width: 760px) { .pq-kbd-hint { display: none; } }

/* ---- motion (all of it switched off for people who ask for less) ---- */
@keyframes pqRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pqPop { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pqFade { from { opacity: 0; } to { opacity: 1; } }
.bank-item.pq-card { animation: pqRise .38s cubic-bezier(.2,.8,.2,1) both; transition: border-color .18s, box-shadow .18s, transform .18s; }
.bank-item.pq-card:nth-child(2) { animation-delay: .03s; } .bank-item.pq-card:nth-child(3) { animation-delay: .06s; }
.bank-item.pq-card:nth-child(4) { animation-delay: .09s; } .bank-item.pq-card:nth-child(5) { animation-delay: .12s; }
.bank-item.pq-card:nth-child(n+6) { animation-delay: .15s; }
.bank-item.pq-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.connections-modal-overlay.active .connections-modal-content { animation: pqPop .24s cubic-bezier(.2,.8,.2,1); }
.pq-panel.active { animation: pqFade .22s ease; }
.pq-btn:active, .pq-icon-btn:active, .pq-pill:active { transform: scale(.96); }
.pq-btn:focus-visible, .pq-icon-btn:focus-visible, .pq-pill:focus-visible, .pq-tab:focus-visible, .pq-bar-row:focus-visible, .pq-due-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .bank-item.pq-card, .connections-modal-overlay.active .connections-modal-content, .pq-panel.active { animation: none; }
  .pq-progress-bar i, .pq-bar-track i { transition: none; }
}

/* ================================================================
   Syllabus Progress tracker (syp- prefix)
   ================================================================ */
.syp-intro { margin: 0 0 18px; font-size: 14px; color: var(--text-soft); line-height: 1.55; max-width: 720px; }
.syp-loading { padding: 40px 0; text-align: center; color: var(--text-soft); }
.syp-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-bottom: 20px; }
.syp-ov { display: flex; flex-direction: column; gap: 6px; text-align: left; font-family: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: border-color .18s, box-shadow .18s, transform .18s; }
.syp-ov:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.syp-ov.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.syp-ov-all { background: var(--surface-2); }
.syp-ov-name { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-soft); }
.syp-ov-num b { font-size: 24px; font-weight: 800; }
.syp-ov-num small { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.syp-bar { display: flex; height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.syp-ov-all .syp-bar { background: var(--surface); }
.syp-seg { display: block; height: 100%; }
.syp-seg-studying { background: #f3c28e; }
.syp-seg-notes_ready { background: #ec9a45; }
.syp-seg-revision_1 { background: var(--accent); }
.syp-seg-revision_2 { background: #8a4300; }
body.dark-mode .syp-seg-studying { background: #6b4a26; }
body.dark-mode .syp-seg-revision_2 { background: #ffb36b; }
.syp-ov-sub { font-size: 11.5px; color: var(--text-soft); font-weight: 600; }
.syp-ov-sub em { color: var(--accent); font-style: normal; font-weight: 800; }
.syp-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); height: 40px; cursor: pointer; }
.syp-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.syp-count { font-size: 12.5px; color: var(--text-soft); font-weight: 600; }
.syp-paper { font-size: 20px; font-weight: 800; margin: 26px 0 10px; color: var(--text); }
.syp-group { display: flex; flex-direction: column; gap: 2px; margin: 18px 0 8px; padding-left: 12px; border-left: 3px solid var(--accent); }
.syp-group-title { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.syp-group-ref { font-size: 13px; line-height: 1.5; color: var(--text-soft); }
.syp-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr); gap: 12px 20px; align-items: start; transition: border-color .18s; }
.syp-row:hover, .syp-row.open { border-color: var(--accent); }
.syp-row[data-status="studying"] { border-left: 4px solid #f3c28e; }
.syp-row[data-status="notes_ready"] { border-left: 4px solid #ec9a45; }
.syp-row[data-status="revision_1"] { border-left: 4px solid var(--accent); }
.syp-row[data-status="revision_2"] { border-left: 4px solid #8a4300; }
body.dark-mode .syp-row[data-status="revision_2"] { border-left-color: #ffb36b; }
.syp-title { font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--text); }
.syp-ref { font-size: 12.5px; line-height: 1.5; color: var(--text-soft); margin-top: 3px; }
.syp-meta { display: flex; gap: 12px; align-items: center; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--text-soft); }
.syp-papertag { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 5px; }
.syp-due { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--accent); padding: 2px 8px; border-radius: 99px; vertical-align: middle; margin-left: 6px; }
.syp-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.syp-f { display: flex; flex-direction: column; gap: 4px; }
.syp-f > span { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft); }
.syp-f select, .syp-f input { height: 36px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 9px; padding: 0 10px; font-family: inherit; font-size: 13px; }
.syp-f select:focus, .syp-f input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body.dark-mode .syp-f input[type="date"] { color-scheme: dark; }
.syp-actions { display: flex; gap: 8px; margin-left: auto; }
.syp-actions .pq-btn[disabled] { opacity: .45; cursor: not-allowed; }
.syp-detail { grid-column: 1 / -1; border-top: 1px dashed var(--border); padding-top: 12px; }
.syp-detail[hidden] { display: none; }
.syp-res { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.syp-res-wide { grid-column: span 2; }
.syp-res-col h4 { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-soft); }
.syp-res-col p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text); }
.syp-small { font-size: 12px; color: var(--text-soft); }
.syp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.syp-chip { font-size: 12px; font-weight: 700; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px 10px; }
a.syp-chip:hover { border-color: var(--accent); color: var(--accent); }
.syp-chip-plain { font-weight: 600; }
.syp-jlist { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.syp-jlist a { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--border); }
.syp-jlist a:hover { color: var(--accent); border-color: var(--accent); }
.syp-jlist small { color: var(--text-soft); font-weight: 600; }
.syp-none { font-size: 12.5px; color: var(--text-soft); }
.syp-note { margin: 12px 0 0; font-size: 11.5px; color: var(--text-soft); }
@media (max-width: 860px) {
  .syp-row { grid-template-columns: 1fr; }
  .syp-actions { margin-left: 0; width: 100%; }
  .syp-actions .pq-btn { flex: 1; justify-content: center; }
  .syp-f { flex: 1 1 130px; }
  .syp-f select, .syp-f input { width: 100%; }
  .syp-res-wide { grid-column: auto; }
}

.syp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: -8px 0 18px; font-size: 12px; font-weight: 600; color: var(--text-soft); }
.syp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.syp-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.syp-legend-note { margin-left: auto; font-weight: 500; }

/* ================================================================
   Mains Topic Hub (th- prefix)
   ================================================================ */
.th-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.th-nav { display: inline-flex; align-items: center; gap: 8px; }
.th-nav-n { font-size: 12px; font-weight: 700; color: var(--text-soft); min-width: 58px; text-align: center; }
.pq-icon-btn[disabled] { opacity: .35; cursor: default; }
.th-head { margin-bottom: 20px; }
.th-kicker { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.th-title { font-size: clamp(22px, 3vw, 30px); font-weight: 800; line-height: 1.25; margin: 0 0 8px; color: var(--text); }
.th-ref { margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: var(--text-soft); max-width: 820px; }
.th-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.th-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.th-side { display: flex; flex-direction: column; gap: 18px; }
.th-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.th-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.th-card-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
.th-card-head span, .th-src { font-size: 12.5px; font-weight: 700; color: var(--text-soft); text-decoration: none; }
a.th-src { color: var(--accent); display: inline-block; margin-top: 6px; }
a.th-src:hover { text-decoration: underline; }
.th-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.th-stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.th-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.th-stats b { display: block; font-size: 15px; font-weight: 800; color: var(--text); line-height: 1.3; }
.th-stats small { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-soft); }
.th-years { display: flex; align-items: flex-end; gap: 4px; height: 64px; margin-bottom: 14px; padding: 0 2px; }
.th-year { flex: 1 1 0; min-width: 12px; max-width: 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.th-year i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 4px; }
.th-year b { font-size: 9.5px; font-weight: 700; color: var(--text-soft); }
.th-themes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.th-themes h4 { margin: 0; }
.th-theme { font-size: 12px; font-weight: 600; color: var(--text); background: var(--accent-soft); border-radius: 8px; padding: 3px 10px; }
.th-theme b { color: var(--accent); }
.th-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.th-qlist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.th-q { display: flex; flex-direction: column; gap: 5px; width: 100%; text-align: left; font-family: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.th-q:hover { border-color: var(--accent); background: var(--surface-2); }
.th-q-top { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--text-soft); }
.th-q-year { color: var(--accent); font-weight: 800; }
.th-q-flags { margin-left: auto; display: inline-flex; gap: 8px; font-size: 11.5px; color: var(--accent); }
.th-q-flags .th-ok { color: #188038; }
body.dark-mode .th-q-flags .th-ok { color: #86efac; }
.th-q-text { font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.th-sub { margin-bottom: 14px; }
.th-sub:last-child { margin-bottom: 0; }
.th-sub h4, .th-h4 { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-soft); }
.th-h4 { margin-top: 14px; }
.th-none { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-soft); }
.th-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.th-chips-sub { margin-top: 6px; }
.th-angles { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--text); }
.th-small { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-soft); }
.th-notes { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.th-note { width: 100%; text-align: left; font-family: inherit; font-size: 12.5px; line-height: 1.5; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.th-note:hover { border-color: var(--accent); }
.th-note b { color: var(--accent); margin-right: 4px; }
.th-go { margin-top: 4px; }

/* Topic Hub start panel (no topic selected) */
.th-start { max-width: 780px; }
.th-start-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px; min-height: 50px; }
.th-start-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.th-start-search i { color: var(--text-soft); font-size: 15px; }
.th-start-search input { flex: 1; border: 0; background: transparent; color: var(--text); font: 500 15px inherit; font-family: inherit; padding: 12px 0; outline: none; }
.th-start-hint { margin: 10px 2px 18px; font-size: 13px; line-height: 1.6; color: var(--text-soft); }
.th-start-hint a { color: var(--accent); font-weight: 700; }
.th-start-list { display: flex; flex-direction: column; gap: 6px; }
.th-start-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font-family: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.th-start-item:hover { border-color: var(--accent); background: var(--surface-2); }
.th-start-tag { flex: 0 0 auto; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 3px 8px; }
.th-start-label { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.th-start-n { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--text-soft); }
.th-start-item i { color: var(--text-soft); font-size: 12px; }
@media (max-width: 560px) { .th-start-item { flex-wrap: wrap; } .th-start-label { flex: 1 1 100%; order: 3; } }
@media (max-width: 980px) { .th-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .th-stats { grid-template-columns: 1fr 1fr; } .th-stats-4 { grid-template-columns: 1fr 1fr; } .th-controls .syp-f { flex: 1 1 130px; } .th-controls .syp-f select, .th-controls .syp-f input { width: 100%; } }

/* ---- Overview: first-run welcome + continue studying / quick actions ---- */
.wk-welcome { position: relative; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 16px; padding: 26px 28px; margin-bottom: 22px; box-shadow: var(--shadow); }
.wk-welcome-close { position: absolute; top: 12px; right: 14px; background: transparent; border: 0; font-size: 24px; line-height: 1; color: var(--text-soft); cursor: pointer; }
.wk-welcome-close:hover { color: var(--text); }
.wk-welcome-kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.wk-welcome h2 { font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0 0 10px; }
.wk-welcome-lede { color: var(--text-soft); font-size: 14.5px; max-width: 720px; margin: 0 0 18px; }
.wk-welcome-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.wk-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-soft); }
.wk-field em { font-style: normal; font-weight: 600; opacity: .85; }
.wk-field select, .wk-field input { min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: 600 14px inherit; font-family: inherit; min-width: 220px; }
.wk-steps { margin: 0 0 20px; padding-left: 22px; color: var(--text); font-size: 14px; line-height: 1.7; }
.wk-steps a { color: var(--accent); font-weight: 700; }
.wk-welcome-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.wk-overview { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; margin: 0 0 22px; }
.wk-ov-card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.wk-ov-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wk-ov-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
.wk-ov-head i { color: var(--accent); margin-right: 8px; }
.wk-recent { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wk-recent-item { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; text-align: left; font-family: inherit; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: border-color .15s; }
.wk-recent-item:hover { border-color: var(--accent); }
.wk-recent-tag { flex: 0 0 auto; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 3px 7px; }
.wk-recent-body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.wk-recent-body b { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-recent-body small { font-size: 11.5px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-recent-item i { color: var(--text-soft); font-size: 12px; }
.wk-ov-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.wk-action { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; min-height: 78px; text-align: left; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.wk-action:hover { border-color: var(--accent); background: var(--surface); }
.wk-action i { color: var(--accent); font-size: 17px; }
.wk-empty { margin: 0; font-size: 13px; line-height: 1.6; color: var(--text-soft); }
@media (max-width: 900px) { .wk-overview { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .wk-recent-body b, .wk-recent-body small {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}
@media (max-width: 480px) {
  .wk-welcome { padding: 20px 18px; }
  .wk-welcome-row { gap: 12px; }
  .wk-field, .wk-field select, .wk-field input { min-width: 0; max-width: 100%; }
  .wk-ov-actions { grid-template-columns: minmax(0, 1fr); }
}

/* ================================================================
   Study Library (lib- prefix): saved material across resource types
   ================================================================ */
.lib-types-host { margin: -4px 0 14px; }
.lib-types { margin-bottom: 4px; }
.lib-other { margin-top: 8px; }
.lib-h { font-size: 15px; font-weight: 800; margin: 22px 0 10px; color: var(--text); }
.lib-title { color: var(--text); text-decoration: none; font-weight: 700; }
a.lib-title:hover { color: var(--accent); text-decoration: underline; }
.lib-q { margin-bottom: 8px; }
.lib-note { font-size: 13px; line-height: 1.55; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 8px 12px; margin: 0 0 12px; }
.lib-note b { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-right: 6px; }
.lib-note-full { white-space: pre-wrap; font-size: 13.5px; }
.lib-export { margin-top: 2px; }
.lib-export-row { display: flex; gap: 8px; flex-wrap: wrap; }
a.pq-btn { text-decoration: none; }
@media (max-width: 600px) { .lib-export-row .pq-btn { flex: 1 1 100%; justify-content: center; } }

/* ================================================================
   Polish pass (UI audit, priority 1)
   --accent-ink is the orange for anything with WHITE text on it. #D96B00 on white is 3.47:1, below the 4.5:1 WCAG AA
   minimum for normal text; #A84B00 is 5.72:1. The brighter --accent stays for borders, icons, links on dark and tints.
   ================================================================ */
:root { --accent-ink: #D96B00; }                   /* restored to the original brand orange (the audit had darkened it to #A84B00) */
body.dark-mode { --accent-ink: #D96B00; }
