@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   MGIT PYQ Hub — Modern Academic Theme
   Modern, soft typography powered by Plus Jakarta Sans and Inter
   ========================================================================== */

:root {
  --bg-top: #f8fafc;
  --bg-bottom: #edf2f7;
  --surface-card: #ffffff;
  --surface-muted: #f8fafc;
  --border-subtle: #e2e8f0;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;

  --brand-navy: #1e3a8a;
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --brand-surface: #eff6ff;

  --accent-green: #15803d;
  --accent-green-bg: #f0fdf4;
  --accent-amber: #b45309;
  --accent-amber-bg: #fefce8;

  --whatsapp-green: #15803d;
  --whatsapp-hover: #166534;

  --font-serif: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-dialog: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
}

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

body {
  font-family: var(--font-sans);
  background: radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.08) 0px, transparent 45%), radial-gradient(at 90% 15%, rgba(168, 85, 247, 0.07) 0px, transparent 45%), radial-gradient(at 50% 75%, rgba(59, 130, 246, 0.07) 0px, transparent 50%), #f8fafc;
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-subtle);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
}

.brand-seal {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.2;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-tour-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-blue);
  border: 1px solid #bfdbfe;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.2s ease;
}

.top-tour-btn:hover {
  background-color: var(--brand-navy);
  color: #ffffff;
  border-color: var(--brand-navy);
  transform: translateY(-1px);
}

.top-drive-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--brand-surface);
  color: var(--brand-blue);
  border: 1px solid #bfdbfe;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  min-height: 40px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.top-drive-btn:hover {
  background-color: #dbeafe;
  border-color: #93c5fd;
}

.top-admin-btn,
.top-admin-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  background-color: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.top-admin-btn:hover,
.top-admin-icon-btn:hover {
  background-color: #f1f5f9;
  color: #1e3a8a;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

/* ==========================================================================
   Main Layout & Welcome Banner
   ========================================================================== */

.main-container {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
  flex: 1;
}

.welcome-section {
  text-align: center;
  padding: 34px 16px 26px;
  margin-bottom: 26px;
}

.welcome-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-navy);
  margin-bottom: 12px;
}

.welcome-badge-pill i {
  color: #f59e0b;
}

.welcome-heading {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 10px;
  letter-spacing: -0.4px;
}

.gemini-title-gradient {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 45%, #7c3aed 75%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-desc {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   Subjects Section (2 Columns Grid Layout)
   ========================================================================== */

.subjects-section {
  margin-bottom: 36px;
}

.section-title-wrap {
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 720px) {
  .subjects-grid {
    grid-template-columns: 1fr;
  }
}

.subject-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--sub-accent, #cbd5e1);
  border-left: 6px solid var(--sub-accent, #2563eb);
  border-radius: 16px;
  padding: 20px 18px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--sub-accent, #2563eb);
  opacity: 0.6;
}

.subject-card[data-subject="DM"] { --sub-accent: #2563eb; --sub-bg: #eff6ff; }
.subject-card[data-subject="COA"] { --sub-accent: #059669; --sub-bg: #ecfdf5; }
.subject-card[data-subject="OOPJ"] { --sub-accent: #d97706; --sub-bg: #fffbeb; }
.subject-card[data-subject="DBMS"] { --sub-accent: #7c3aed; --sub-bg: #f5f3ff; }
.subject-card[data-subject="SE"] { --sub-accent: #0284c7; --sub-bg: #f0f9ff; }
.subject-card[data-subject="ES"] { --sub-accent: #16a34a; --sub-bg: #f0fdf4; }
.subject-card[data-subject="IE"] { --sub-accent: #e11d48; --sub-bg: #fff1f2; }

.subject-card:hover {
  border-color: var(--sub-accent);
  background: linear-gradient(135deg, #ffffff 0%, var(--sub-bg) 100%);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.08), 0 4px 14px -2px var(--sub-accent);
}

.subject-card:focus-visible {
  outline: 2px solid var(--sub-accent, #2563eb);
  outline-offset: 2px;
}

/* Large Subject Icon */
.subject-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.subject-info {
  flex: 1;
  min-width: 0;
}

.subject-short-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 2px;
}

.subject-full-title {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 8px;
}

.subject-meta-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
}

.subject-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-main);
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

/* ==========================================================================
   Subject Detail Section (Two Division Boxes: Notes & PYQs)
   ========================================================================== */

.detail-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 38px;
}

.btn-back:hover {
  background-color: var(--surface-muted);
}

.detail-subject-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-navy);
}

.two-divisions-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.division-box {
  background-color: var(--surface-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-subtle);
  position: relative;
}

.division-box.notes-division {
  border: 2.5px solid #3b82f6;
  border-top: 6px solid #1d4ed8;
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.08);
}

.division-box.pyqs-division {
  border: 2.5px solid #10b981;
  border-top: 6px solid #047857;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.08);
}

.division-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 16px;
}

.division-box.notes-division .division-box-header {
  border-bottom-color: #dbeafe;
}

.division-box.pyqs-division .division-box-header {
  border-bottom-color: #d1fae5;
}

.division-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-navy);
}

.division-header-title i {
  font-size: 18px;
  color: var(--brand-blue);
}

.division-box.pyqs-division .division-header-title i {
  color: #059669;
}

.division-header-title h4 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}

.btn-contribute {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  color: var(--brand-blue);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}

.btn-contribute:hover {
  background-color: var(--brand-surface);
  border-color: #bfdbfe;
}

/* Division Controls (Dropdown for Notes) */
.division-controls {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  padding: 12px 14px;
  border-radius: 12px;
}

.control-label {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e40af;
}

.form-select {
  padding: 8px 12px;
  border: 1.5px solid #93c5fd;
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-sans);
  min-width: 220px;
  cursor: pointer;
  font-weight: 600;
}

.form-select:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Notes Content Items */
.notes-content-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-item-card {
  border: 1.5px solid #bfdbfe;
  border-left: 5px solid #2563eb;
  border-radius: var(--radius-md);
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background-color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.04);
  transition: all 0.2s ease;
}

.note-info {
  flex: 1;
  min-width: 0;
}

.note-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 3px;
}

.note-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.note-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.note-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--brand-blue);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}

.note-open-btn:hover {
  background-color: var(--brand-surface);
}

.empty-state-box {
  padding: 32px 16px;
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: #fafbfc;
}

.empty-state-icon {
  font-size: 28px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-state-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   PYQ Division & Filters (Year Checkboxes & Part A/B)
   ========================================================================== */

.pyq-filters-container {
  background-color: #f0fdf4;
  border: 2px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.05);
}

.filter-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: #065f46;
}

.year-checkboxes-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.15s ease;
  font-weight: 600;
}

.checkbox-label:hover {
  border-color: #10b981;
}

.checkbox-label:has(input:checked) {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.15);
}

.checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #059669;
  cursor: pointer;
}

.pyq-count-banner {
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
  padding: 8px 12px;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  border: 1.5px solid #a7f3d0;
  border-left: 4px solid #059669;
}

.part-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.part-buttons {
  display: inline-flex;
  background-color: #ffffff;
  border: 1.5px solid #a7f3d0;
  border-radius: 20px;
  padding: 3px;
}

.part-btn {
  background: none;
  border: none;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.part-btn.active {
  background-color: #059669;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

/* Questions Listing Cards */
.pyq-questions-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.question-item-card {
  border: 1.5px solid #cbd5e1;
  border-left: 5px solid #2563eb;
  border-radius: 14px;
  padding: 16px 18px;
  background-color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  position: relative;
}

.question-item-card.part-a-card {
  border-color: #fde68a;
  border-left: 5px solid #d97706;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf5 100%);
}

.question-item-card.part-b-card {
  border-color: #ddd6fe;
  border-left: 5px solid #7c3aed;
  background: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
}

.question-item-card.repeated-card {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
}

.question-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.question-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.question-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.q-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.2px;
}

.q-badge.unit {
  background-color: var(--surface-muted);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.q-badge.part-a {
  background-color: #fef3c7;
  color: #92400e;
}

.q-badge.part-b {
  background-color: #e0e7ff;
  color: #3730a3;
}

.q-badge.recurrence {
  background-color: #dcfce7;
  color: #166534;
}

.question-years-tag {
  font-size: 12px;
  color: var(--text-light);
}

.question-text-preview {
  font-size: 14.5px;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 10px;
}

.question-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--brand-blue);
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.click-cue {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

/* ==========================================================================
   Bottom Divisions (WhatsApp Feedback & Made by Amaan)
   ========================================================================== */

.bottom-footer {
  margin-top: 40px;
  padding: 24px 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.footer-division {
  text-align: center;
  width: 100%;
}

.whatsapp-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background-color: var(--whatsapp-green);
  border: 1.5px solid #166534;
  color: #ffffff;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.2);
  transition: all 0.15s ease;
  min-height: 44px;
}

.whatsapp-link:hover {
  background-color: var(--whatsapp-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(21, 128, 61, 0.28);
}

.attribution-division {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
}

.attribution-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px; /* thickness of the purplish bluish pink outline */
  border-radius: 9999px;
  background: linear-gradient(135deg, #9333ea 0%, #3b82f6 50%, #ec4899 100%);
  box-shadow: 0 3px 12px rgba(147, 51, 234, 0.22), 0 2px 6px rgba(59, 130, 246, 0.16);
  transition: all 0.22s ease-in-out;
}

.attribution-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.3), 0 3px 8px rgba(147, 51, 234, 0.25);
}

.attribution-text {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.35px;
  padding: 6px 18px;
  border-radius: 9999px;
  background-color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ==========================================================================
   Floating Gemini AI Button
   ========================================================================== */

.floating-gemini-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #ffffff;
  color: var(--brand-navy);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  z-index: 1000;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.floating-gemini-btn:hover {
  background-color: #fafbfc;
  border-color: #94a3b8;
}

.gemini-sparkle-icon {
  color: var(--brand-blue);
}

/* ==========================================================================
   Modals & Dialogs
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
  backdrop-filter: blur(2px);
}

.modal-dialog {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-dialog);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-dialog.small-dialog {
  max-width: 480px;
}

.modal-dialog.large-dialog {
  max-width: 760px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: #fafbfc;
}

.modal-header-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.modal-dialog-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--brand-navy);
  color: #ffffff;
}

.modal-badge.secondary {
  background-color: #e0e7ff;
  color: #3730a3;
}

.modal-badge.tertiary {
  background-color: var(--surface-muted);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  line-height: 1.6;
}

.modal-question-text {
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 18px;
  line-height: 1.5;
}

.modal-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .modal-details-grid {
    grid-template-columns: 1fr;
  }
}

.detail-card {
  background-color: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.detail-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.detail-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

/* Exam Tip Box */
.modal-tip-box {
  background-color: #fefce8;
  border: 1px solid #fde047;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 20px;
}

.tip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #854d0e;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tip-content {
  font-size: 13.5px;
  color: #713f12;
  line-height: 1.45;
}

.modal-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-action-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--brand-navy);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  min-height: 40px;
}

.btn-action-primary:hover {
  background-color: #1e40af;
}

.btn-secondary-flat {
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary-flat:hover {
  background-color: var(--surface-muted);
}

.modal-footer-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.guideline-lead {
  font-size: 14.5px;
  font-weight: 600;
  color: #1e3a8a;
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.guideline-sub {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* Forms in Upload Modal */
.contrib-form, .admin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 480px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.form-input {
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-family: var(--font-sans);
  background-color: #ffffff;
  color: var(--text-main);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-blue);
}

.file-picker-box {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  background-color: #fafbfc;
  cursor: pointer;
}

.file-picker-box:hover {
  border-color: #94a3b8;
  background-color: #f1f5f9;
}

.picker-icon {
  font-size: 28px;
  color: var(--brand-blue);
  margin-bottom: 6px;
}

.picker-main {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.picker-sub {
  font-size: 12px;
  color: var(--text-light);
}

.selected-files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.selected-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background-color: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.file-del-btn {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 14px;
}

/* Admin Dashboard Elements */
.admin-login-notice {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.admin-top-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.admin-stat-card {
  background-color: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-navy);
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
}

.moderation-section {
  margin-top: 10px;
}

.moderation-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 10px;
}

.moderation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.moderation-table th, .moderation-table td {
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.moderation-table th {
  background-color: var(--surface-muted);
  font-weight: 600;
  color: var(--text-main);
}

.mod-action-btn {
  padding: 4px 8px;
  font-size: 11.5px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.mod-action-btn.approve {
  background-color: #dcfce7;
  color: #166534;
}

.mod-action-btn.reject {
  background-color: #fee2e2;
  color: #991b1b;
  margin-left: 4px;
}

.empty-queue-msg {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: 14px;
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
}

.admin-footer-bar {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

/* Gemini Modal */
.gemini-intro-text {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.gemini-prompt-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.prompt-chip {
  background-color: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 16px;
  cursor: pointer;
}

.prompt-chip:hover {
  background-color: var(--brand-surface);
  border-color: #bfdbfe;
  color: var(--brand-blue);
}

/* ==============================================================
   Full Google Gemini Assistant App Styling
   ============================================================== */

.gemini-app-layout {
  max-width: 1040px;
  width: 96%;
  height: 88vh;
  max-height: 840px;
  display: flex;
  flex-direction: row;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(226, 232, 240, 0.9);
  overflow: hidden;
  background: #ffffff;
}

/* Sidebar Drawer */
.gemini-sidebar {
  width: 260px;
  min-width: 260px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 14px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gemini-sidebar-top {
  margin-bottom: 12px;
}

.btn-new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13.5px;
  color: #1e3a8a;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.btn-new-chat:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.gemini-history-section {
  flex: 1;
  overflow-y: auto;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
}

.gemini-history-section::-webkit-scrollbar {
  width: 4px;
}

.gemini-history-section::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.history-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
  padding: 0 6px 8px;
}

.btn-clear-all-history {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
}

.btn-clear-all-history:hover {
  color: #dc2626;
  background: #fee2e2;
}

.gemini-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gemini-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  gap: 8px;
}

.gemini-history-item,
.history-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  box-sizing: border-box;
}

.gemini-history-item span,
.history-item-btn .chat-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

.history-item-btn i.fa-message {
  font-size: 13px;
  color: #64748b;
  flex-shrink: 0;
}

.gemini-history-item:hover,
.history-item-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.gemini-history-item.active,
.history-item-btn.active {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1e3a8a;
  font-weight: 600;
}

.history-item-btn.active i.fa-message {
  color: #2563eb;
}

.btn-del-history,
.btn-del-chat {
  background: none;
  border: none;
  outline: none;
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s;
  padding: 3px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gemini-history-item:hover .btn-del-history,
.history-item-btn:hover .btn-del-chat {
  opacity: 1;
}

.btn-del-history:hover,
.btn-del-chat:hover {
  color: #dc2626;
  background-color: #fee2e2;
}

.gemini-sidebar-footer {
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.gemini-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

/* Chat Workspace */
.gemini-chat-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #ffffff;
  position: relative;
}

.gemini-workspace-header {
  padding: 12px 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}

.gemini-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gemini-icon-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gemini-icon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.gemini-workspace-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.gemini-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
}

.gemini-live-pill i {
  font-size: 8px;
  animation: liveBlink 1.6s infinite;
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.gemini-stream-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: #fafbfc;
  position: relative;
}

/* Welcome Landing Screen */
.gemini-welcome-screen {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  text-align: center;
}

.gemini-welcome-sparkle {
  margin-bottom: 12px;
}

.gemini-greet-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.gemini-shimmer-text {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 35%, #7c3aed 70%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gemini-greet-sub {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
  max-width: 520px;
  line-height: 1.5;
}

.gemini-prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 680px;
  width: 100%;
}

@media (max-width: 640px) {
  .gemini-prompt-grid {
    grid-template-columns: 1fr;
  }
}

.gemini-prompt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.gemini-prompt-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
}

.gemini-prompt-card .card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.gemini-prompt-card .card-icon.coa { background: #e0f2fe; color: #0284c7; }
.gemini-prompt-card .card-icon.dbms { background: #fef3c7; color: #d97706; }
.gemini-prompt-card .card-icon.dm { background: #fee2e2; color: #dc2626; }
.gemini-prompt-card .card-icon.oopj { background: #dcfce7; color: #16a34a; }
.gemini-prompt-card .card-icon.se { background: #f3e8ff; color: #9333ea; }

.gemini-prompt-card .card-text {
  display: flex;
  flex-direction: column;
}

.gemini-prompt-card .card-text strong {
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 2px;
}

.gemini-prompt-card .card-text span {
  font-size: 11.5px;
  color: #64748b;
}

/* Active Chat Stream */
.gemini-chat-output {
  flex: 1;
  overflow-y: auto;
  border: none;
  border-radius: 0;
  padding: 20px 24px;
  background-color: #fafbfc;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.gemini-chat-output::-webkit-scrollbar {
  width: 6px;
}

.gemini-chat-output::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* User Message */
.user-msg {
  align-self: flex-end;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
  padding: 10px 18px;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 82%;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
  word-break: break-word;
  font-weight: 500;
}

.user-msg img.msg-attached-img {
  display: block;
  max-width: 180px;
  max-height: 140px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* AI Message Card */
.ai-msg {
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.7;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
  word-break: break-word;
}

.ai-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.ai-avatar-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 13px;
  color: #1e3a8a;
}

.ai-model-tag {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.ai-msg-body {
  font-size: 14px;
  line-height: 1.75;
  color: #1e293b;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  min-width: 0;
}

/* Bold and Larger Headlines in AI Response */
.ai-msg-body h1, .gemini-h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 18px 0 10px 0;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.ai-msg-body h2, .gemini-h2 {
  font-size: 1.15rem;
  font-weight: 750;
  color: #1e293b;
  margin: 16px 0 8px 0;
  line-height: 1.38;
}

.ai-msg-body h3, .gemini-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3a8a;
  margin: 14px 0 6px 0;
  line-height: 1.4;
}

.ai-msg-body h4, .gemini-h4 {
  font-size: 0.96rem;
  font-weight: 700;
  color: #334155;
  margin: 12px 0 4px 0;
}

.ai-msg-body strong {
  font-weight: 700;
  color: #0f172a;
}

.ai-msg-body p {
  margin: 8px 0;
}

.ai-msg-body hr, .gemini-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 16px 0;
}

.ai-msg-body ul, .gemini-list {
  padding-left: 20px;
  margin: 8px 0;
}

.ai-msg-body ol, .gemini-ordered-list {
  padding-left: 22px;
  margin: 8px 0;
}

.ai-msg-body li, .gemini-li {
  margin-bottom: 5px;
  line-height: 1.65;
}

/* Tables inside AI Response - Strictly contained with horizontal scroll */
.gemini-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  display: block;
}

.gemini-table, .ai-msg-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
  min-width: 320px;
}

.ai-msg-body th, .gemini-table th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  text-align: left;
}

.ai-msg-body td, .gemini-table td {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.ai-msg-body tr:nth-child(even) td {
  background: #f8fafc;
}

/* Code Blocks inside AI Response */
.gemini-code-block {
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  margin: 14px 0;
  background: #0f172a;
  border: 1px solid #334155;
  overflow: hidden;
  box-sizing: border-box;
}

.gemini-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.gemini-copy-btn {
  background: transparent;
  border: 1px solid #475569;
  border-radius: 5px;
  color: #cbd5e1;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.gemini-copy-btn:hover {
  background: #334155;
  color: #ffffff;
}

.gemini-code-block pre, .ai-msg-body pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  max-width: 100%;
  white-space: pre;
  font-size: 12.5px;
  line-height: 1.6;
  color: #f8fafc;
  font-family: 'Fira Code', 'JetBrains Mono', Consolas, monospace;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.gemini-inline-code, .ai-msg-body code:not(pre code) {
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: 'Fira Code', 'JetBrains Mono', Consolas, monospace;
  border: 1px solid #e2e8f0;
  word-break: break-word;
}

/* Math blocks inside AI Response */
.gemini-math-block {
  overflow-x: auto;
  padding: 6px 0;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}


.ai-msg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
  margin-top: 6px;
  font-size: 12px;
}

.btn-copy-response {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy-response:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.ai-verified-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #15803d;
  font-size: 11.5px;
  font-weight: 600;
}

/* Modern Input Container (Gemini Mobile/Web style) */
.gemini-input-container {
  padding: 12px 20px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gemini-image-preview-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}

.image-preview-card {
  position: relative;
  display: inline-block;
}

.image-preview-card img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.btn-remove-preview {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #ffffff;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.preview-note {
  font-size: 12px;
  color: #1e3a8a;
  font-weight: 500;
}

.gemini-modern-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 32px;
  padding: 6px 8px 6px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.gemini-modern-input-bar:focus-within {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.gemini-tool-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.gemini-tool-btn:hover {
  background: #e2e8f0;
  color: #1e3a8a;
}

.gemini-tool-btn.listening {
  color: #ef4444;
  background: #fee2e2;
  animation: micPulse 1.2s infinite;
}

@keyframes micPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.15); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.gemini-text-field {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  outline: none;
  padding: 6px 4px;
}

.gemini-submit-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.gemini-submit-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

.gemini-legal-caption {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  margin-top: 2px;
}

/* Animated Rotating Placeholder Wrap */
.gemini-input-field-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.gemini-input-field-wrap .gemini-text-field {
  width: 100%;
  position: relative;
  z-index: 2;
  background: transparent;
}

.animated-placeholder-track {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: opacity 0.25s ease;
}

.animated-placeholder-text {
  font-size: 13.5px;
  color: #94a3b8;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: inline-block;
  will-change: transform, opacity;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

/* Suggestions Collapsible Container & Small Rectangular Window */
.gemini-suggestions-container {
  width: 100%;
  max-width: 520px;
  margin: 10px auto 0;
  display: flex;
  flex-direction: column;
}

.btn-toggle-suggestions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-suggestions:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

.suggestions-btn-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.toggle-chevron {
  font-size: 11px;
  transition: transform 0.25s ease;
}

.btn-toggle-suggestions.collapsed .toggle-chevron {
  transform: rotate(-90deg);
}

.gemini-suggestions-scroll-box {
  margin-top: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gemini-suggestions-scroll-box.collapsed {
  display: none;
}

.compact-scroll-window {
  max-height: 155px;
  overflow-y: auto;
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  scrollbar-width: thin;
}

.compact-scroll-window .gemini-prompt-card {
  padding: 8px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.compact-scroll-window .gemini-prompt-card:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.compact-scroll-window .card-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compact-scroll-window .card-text strong {
  font-size: 12.5px;
  display: block;
  line-height: 1.25;
}

.compact-scroll-window .card-text span {
  font-size: 11px;
  color: #64748b;
  line-height: 1.2;
}

/* Sidebar Close Button */
.btn-close-sidebar {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-close-sidebar:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Prominent Clean Modal Close Button */
.btn-gemini-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-gemini-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.06);
}

/* Mobile Sidebar Drawer */
@media (max-width: 820px) {
  .gemini-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 250;
    transform: translateX(-100%);
    box-shadow: 4px 0 25px rgba(15, 23, 42, 0.2);
  }

  .gemini-sidebar.open {
    transform: translateX(0);
  }

  .btn-close-sidebar {
    display: flex;
  }
}


/* ==============================================================
   Interactive Onboarding Spotlight Tour Styling
   ============================================================== */

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.01);
  z-index: 9980;
  pointer-events: auto;
}

.tour-spotlight {
  position: fixed;
  z-index: 9990;
  pointer-events: none;
  background: transparent;
  border: 3px solid #3b82f6;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.74), 0 0 25px rgba(59, 130, 246, 0.65), inset 0 0 10px rgba(59, 130, 246, 0.2);
  transition: top 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              left 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.22s ease;
}

.tour-tooltip {
  position: fixed;
  z-index: 9999;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  padding: 20px 22px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35), 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: tourSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.tour-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tour-step-badge {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tour-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.tour-close-btn:hover {
  color: #0f172a;
}

.tour-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.tour-desc {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 16px;
}

.tour-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.btn-tour-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tour-primary:hover {
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-tour-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tour-secondary:hover:not(:disabled) {
  background: #f1f5f9;
  color: #1e293b;
}

.btn-tour-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-msg {
  background-color: var(--text-main);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  box-shadow: var(--shadow-dialog);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

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

/* ==========================================================================
   Admin Portal Page & Dashboard Styles
   ========================================================================== */

.admin-page-body {
  background: linear-gradient(180deg, #f7f9fa 0%, #edf1f5 100%);
  min-height: 100vh;
}

.auth-gate-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 16px;
}

.auth-gate-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-dialog);
  text-align: center;
}

.auth-gate-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 8px;
}

.auth-gate-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.auth-gate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.admin-banner-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-subtle);
}

.admin-heading {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 4px;
}

.admin-sub {
  font-size: 13.5px;
  color: var(--text-muted);
}

.pipeline-badge-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}

.status-pill i {
  font-size: 7px;
}

.status-pill.green {
  background-color: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.status-pill.blue {
  background-color: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.status-pill.purple {
  background-color: #f5f3ff;
  color: #5b21b6;
  border-color: #ddd6fe;
}

/* KPI Grid */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-subtle);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-icon.blue { background-color: #eff6ff; color: #2563eb; }
.kpi-icon.navy { background-color: #e0e7ff; color: #1e3a8a; }
.kpi-icon.amber { background-color: #fef3c7; color: #b45309; }
.kpi-icon.green { background-color: #dcfce7; color: #15803d; }

.kpi-info {
  flex: 1;
  min-width: 0;
}

.kpi-number {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.1;
  display: block;
}

.kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: block;
  margin: 2px 0;
}

.kpi-hint {
  font-size: 11.5px;
  color: var(--text-light);
  display: block;
}

/* Admin Section Boxes */
.admin-section-box {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-subtle);
}

.admin-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-box-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-total {
  font-size: 12px;
  font-weight: 600;
  background-color: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.badge-pending {
  font-size: 12px;
  font-weight: 700;
  background-color: #fef3c7;
  color: #92400e;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-data-table th, .admin-data-table td {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.admin-data-table th {
  background-color: var(--surface-muted);
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.admin-data-table td code {
  font-size: 11.5px;
  background-color: var(--surface-muted);
  padding: 2px 5px;
  border-radius: 3px;
}

/* Distribution Grid */
.distribution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 820px) {
  .distribution-grid {
    grid-template-columns: 1fr;
  }
}

.dist-card {
  background-color: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.dist-card-title {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.dist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}

.dist-lbl {
  color: var(--text-muted);
}

.dist-val {
  color: var(--text-main);
  font-weight: 600;
}

/* Pipelines Grid */
.pipelines-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 820px) {
  .pipelines-grid {
    grid-template-columns: 1fr;
  }
}

.pipeline-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  background-color: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pipeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pipeline-header h5 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-navy);
}

.pipeline-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.pipeline-desc code {
  font-size: 11.5px;
  color: var(--brand-blue);
  word-break: break-all;
}

.pipeline-actions {
  margin-top: auto;
  padding-top: 10px;
}

.btn-pipeline-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-blue);
  text-decoration: none;
}

.btn-pipeline-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Refined Soft Typography & Bottom PYQ Contribute Styling
   ========================================================================== */

/* Bottom Subtle Contribute in PYQs */
.pyq-bottom-contribute {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-subtle);
}

.btn-contribute-subtle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-contribute-subtle:hover {
  background-color: var(--brand-surface);
  color: var(--brand-navy);
  border-color: var(--brand-blue);
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.12);
}

.btn-contribute-subtle i {
  font-size: 11px;
  color: var(--brand-blue);
}

/* Direct PDF Badge on Question Cards */
.direct-pdf-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: #f1f5f9;
  color: var(--brand-navy);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.direct-pdf-badge:hover {
  background-color: var(--brand-navy);
  color: #ffffff;
  border-color: var(--brand-navy);
}

/* Soft Human Typography for Contribution Modals */
.guideline-soft-banner {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.guideline-soft-lead {
  font-size: 14.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
  line-height: 1.5;
}

.guideline-soft-sub {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 12px;
}

.guideline-soft-note {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #2563eb;
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 500;
}

/* Gemini Status Bar & Optional Key Drawer */
.gemini-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background-color: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.gemini-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #166534;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #16a34a;
  display: inline-block;
  box-shadow: 0 0 0 2px #dcfce7;
}

.btn-api-key-toggle {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-blue);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-api-key-toggle:hover {
  background-color: #eff6ff;
  text-decoration: underline;
}

.btn-action-primary.small, .btn-secondary-flat.small {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 34px;
}

/* ==========================================================================
   Two-Step Mode Selection Screen (Notes vs PYQs)
   ========================================================================== */

.mode-selector-wrapper {
  margin: 10px 0 30px;
}

.mode-selector-intro {
  margin-bottom: 20px;
}

.mode-selector-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 6px;
}

.mode-selector-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.mode-choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .mode-choices-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.mode-choice-card {
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.22s ease-in-out;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
}

.mode-choice-card.notes-card {
  border: 2px solid #93c5fd;
  border-left: 6px solid #2563eb;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

.mode-choice-card.notes-card:hover {
  border-color: #2563eb;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.15);
  transform: translateY(-2px);
}

.mode-choice-card.pyqs-card {
  border: 2px solid #86efac;
  border-left: 6px solid #16a34a;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.mode-choice-card.pyqs-card:hover {
  border-color: #16a34a;
  box-shadow: 0 10px 25px rgba(22, 163, 74, 0.15);
  transform: translateY(-2px);
}

.mode-choice-card:active {
  transform: scale(0.985);
}

.mode-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.notes-icon {
  background-color: #eff6ff;
  color: #2563eb;
}

.pyqs-icon {
  background-color: #f0fdf4;
  color: #16a34a;
}

.mode-card-content {
  flex-grow: 1;
}

.mode-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.mode-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.mode-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: #f1f5f9;
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.mode-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-blue);
  transition: color 0.15s ease;
}

.mode-choice-card:hover .mode-card-action {
  color: var(--brand-blue-hover);
}

.mode-card-action i {
  transition: transform 0.2s ease;
}

.mode-choice-card:hover .mode-card-action i {
  transform: translateX(4px);
}

/* ==========================================================================
   Mode Switcher Bar (Breadcrumb / Switch Bar)
   ========================================================================== */

.mode-switcher-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding: 10px 14px;
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-left: 5px solid var(--brand-navy);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  flex-wrap: wrap;
}

.mode-switch-btn {
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--text-muted);
  padding: 7px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  min-height: 38px;
}

.mode-switch-btn:hover {
  background-color: #eff6ff;
  color: var(--brand-blue);
  border-color: #93c5fd;
}

.mode-switch-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-tab-btn {
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  min-height: 38px;
}

.mode-tab-btn:hover {
  background-color: #f1f5f9;
  color: var(--brand-navy);
  border-color: #94a3b8;
}

.mode-tab-btn.active {
  background-color: var(--brand-navy);
  color: #ffffff;
  border-color: var(--brand-navy);
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
}

/* Bottom Subtle Contribute in Notes */
.notes-bottom-contribute {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-subtle);
}

/* Empty Notes State */
.empty-notes-card {
  text-align: center;
  padding: 40px 20px;
  background-color: #ffffff;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 10px 0;
}

.empty-notes-card i.empty-icon {
  font-size: 40px;
  color: #94a3b8;
  margin-bottom: 12px;
  display: inline-block;
}

.empty-notes-card h5 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 6px;
}

.empty-notes-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ==========================================================================
   Mobile-First Optimization & Decongestion (Max-Width: 640px & 480px)
   ========================================================================== */

@media (max-width: 640px) {
  /* Prevent horizontal scrolling and improve baseline touch spacing */
  html, body {
    overflow-x: hidden;
  }

  .main-container {
    padding: 14px 12px 90px; /* 90px bottom pad prevents floating button overlap */
  }

  /* Header Compactness */
  .site-header {
    padding: 10px 12px;
  }

  .header-inner {
    gap: 8px;
    align-items: center;
  }

  .logo-title {
    font-size: 15px;
    letter-spacing: -0.2px;
  }

  .logo-icon-wrap {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .btn-top-drive,
  .header-actions .btn-guide,
  .header-actions .btn-admin-login {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 34px;
    border-radius: 18px;
  }

  /* Welcome Hero Banner */
  .welcome-hero {
    padding: 16px 14px;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
  }

  .welcome-hero h1 {
    font-size: 1.28rem;
    line-height: 1.35;
    margin-bottom: 6px;
  }

  .welcome-hero p {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  /* Subjects Grid on Phone */
  .subjects-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .subject-card {
    padding: 14px 14px;
    border-radius: var(--radius-md);
  }

  .subject-header {
    margin-bottom: 8px;
  }

  .subject-title {
    font-size: 1.05rem;
    line-height: 1.35;
  }

  .subject-meta-list {
    gap: 6px;
    margin-top: 10px;
  }

  .subject-meta-item {
    font-size: 11.5px;
    padding: 3px 8px;
  }

  /* Subject Detail Header */
  .subject-detail-header {
    padding: 14px 12px;
    margin-bottom: 16px;
  }

  .subject-detail-title-group h2 {
    font-size: 1.25rem;
  }

  .btn-back-subjects {
    padding: 6px 12px;
    font-size: 12.5px;
    min-height: 36px;
  }

  /* Mode Choices (Notes vs PYQs cards) */
  .mode-choices-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mode-choice-card {
    padding: 16px 14px;
  }

  .mode-card-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
    margin-bottom: 12px;
  }

  .mode-card-title {
    font-size: 1.05rem;
  }

  .mode-card-desc {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  /* Mode Switcher Bar */
  .mode-switcher-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
  }

  .mode-switch-btn {
    width: 100%;
    justify-content: center;
  }

  .mode-switch-tabs {
    width: 100%;
    display: flex;
  }

  .mode-tab-btn {
    flex: 1;
    justify-content: center;
    text-align: center;
    padding: 7px 10px;
    font-size: 12.5px;
  }

  /* Divisions Box */
  .division-box {
    padding: 14px 12px;
    border-radius: var(--radius-md);
  }

  .division-box-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 10px;
  }

  .division-box-header .btn-contribute {
    width: 100%;
    justify-content: center;
  }

  /* PYQ Filters on Mobile */
  .pyq-filters-container {
    padding: 12px;
    margin-bottom: 16px;
  }

  .filter-search-box {
    margin-bottom: 10px;
  }

  .filter-search-input {
    font-size: 13.5px;
    min-height: 40px;
  }

  .filter-checkboxes-row {
    gap: 6px;
    flex-wrap: wrap;
  }

  .checkbox-label {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 16px;
  }

  .part-segmented-control {
    width: 100%;
    display: flex;
    margin-top: 10px;
  }

  .part-segmented-btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 7px 6px;
    font-size: 12px;
    min-height: 36px;
  }

  /* Question Item Cards on Mobile */
  .questions-list {
    gap: 12px;
  }

  .question-item-card {
    padding: 14px 12px;
    border-radius: var(--radius-md);
  }

  .question-card-top {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
  }

  .question-badge-part {
    font-size: 11px;
    padding: 2px 7px;
  }

  .question-meta-chips {
    font-size: 11px;
    gap: 5px;
  }

  .question-text-content {
    font-size: 13.5px;
    line-height: 1.55;
    margin-bottom: 12px;
  }

  .question-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
  }

  .btn-ask-gemini,
  .btn-pyq-paper-link {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 38px;
    font-size: 12.5px;
  }

  /* Note Item Cards on Mobile */
  .note-item-card {
    padding: 12px 10px;
  }

  .note-item-title {
    font-size: 13.5px;
  }

  .btn-note-open {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 36px;
  }

  /* Bottom Footer */
  .bottom-footer {
    margin-top: 28px;
    padding: 18px 12px;
  }

  .whatsapp-link {
    width: 100%;
    font-size: 13.5px;
    padding: 10px 16px;
  }

  /* Floating Gemini Button */
  .floating-gemini-btn {
    bottom: 16px;
    right: 14px;
    padding: 8px 14px;
    font-size: 12.5px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
  }

  .floating-gemini-btn span {
    font-size: 12px;
  }

  /* Gemini AI Assistant Modal Fullscreen / Sheet on Phone */
  #geminiModal.modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  #geminiModal .gemini-app-layout {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .gemini-chat-workspace {
    width: 100%;
    height: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .gemini-workspace-header {
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
  }

  .gemini-workspace-title {
    font-size: 14px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .gemini-stream-body {
    padding: 10px 12px;
    overflow-x: hidden;
  }

  .gemini-welcome-screen {
    padding: 14px 8px;
  }

  .gemini-greet-title {
    font-size: 1.45rem;
    margin-bottom: 4px;
  }

  .gemini-greet-sub {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  .ai-msg {
    padding: 12px 14px;
    border-radius: 12px;
    max-width: 100%;
    min-width: 0;
  }

  .ai-msg-body {
    font-size: 13.5px;
    max-width: 100%;
    min-width: 0;
  }

  .gemini-input-container {
    padding: 8px 10px 12px;
    background: #ffffff;
  }

  .gemini-modern-input-bar {
    padding: 4px 6px 4px 10px;
    gap: 6px;
    border-radius: 28px;
  }

  .gemini-tool-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .gemini-submit-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
}

/* Extra Compact Phones (iPhone SE, Androids <= 480px) */
@media (max-width: 480px) {
  .site-header {
    padding: 8px 10px;
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .brand-group {
    min-width: 0;
    flex-shrink: 1;
    gap: 7px;
  }

  .brand-seal {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 13px;
  }

  .brand-name {
    font-size: 13.5px;
    white-space: nowrap;
  }

  .brand-sub {
    display: none; /* Hide subtitle on tiny screens to guarantee single-line header */
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .top-drive-btn {
    padding: 5px 8px;
    font-size: 11.5px;
    height: 32px;
    border-radius: 7px;
    white-space: nowrap;
  }

  .top-admin-btn,
  .top-admin-icon-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    font-size: 12.5px;
    border-radius: 7px;
  }

  .welcome-section {
    padding: 16px 12px 14px;
  }

  .welcome-heading {
    font-size: 1.25rem;
  }

  .welcome-desc {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .subject-card {
    padding: 12px 12px;
  }

  .subject-title {
    font-size: 0.98rem;
  }
}





/* ==========================================================================
   5 CHAPTER ACCORDIONS & MODERN PYQ UI (CH 1 – CH 5)
   ========================================================================== */

.division-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-toggle-all-accordions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #ffffff;
  color: #1e3a8a;
  border: 1.5px solid #bfdbfe;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-all-accordions:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.btn-subject-drive-papers {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff !important;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.2);
  transition: all 0.2s ease;
}

.btn-subject-drive-papers:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

/* PYQ Instant Search Box */
.pyq-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.pyq-search-box .search-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  font-size: 14px;
  pointer-events: none;
}

.pyq-search-input {
  width: 100%;
  padding: 10px 38px 10px 38px;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pyq-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.pyq-search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.pyq-search-clear:hover {
  color: #475569;
}

/* Filter Rows */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.year-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.year-pill-btn {
  background-color: #ffffff;
  color: var(--text-main);
  border: 1.5px solid #cbd5e1;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.year-pill-btn:hover {
  border-color: #059669;
  background-color: #f0fdf4;
}

.year-pill-btn.active {
  background-color: #059669;
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(5, 150, 105, 0.25);
}

.part-btn.repeated-filter-btn {
  background-color: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.part-btn.repeated-filter-btn:hover {
  background-color: #ffe4e6;
  border-color: #fda4af;
}

.part-btn.repeated-filter-btn.active {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  border-color: #be123c;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(225, 29, 72, 0.25);
}

/* 5 Chapter Accordions Container */
.chapter-accordions-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

/* Individual Chapter Accordion Card */
.chapter-accordion-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter-accordion-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.chapter-accordion-card.open {
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
}

/* Chapter Accordion Header */
.chapter-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background-color: #ffffff;
  cursor: pointer;
  user-select: none;
  gap: 12px;
  transition: background-color 0.15s ease;
}

.chapter-accordion-card.open .chapter-accordion-header {
  background-color: #f8fafc;
  border-bottom: 1.5px solid #e2e8f0;
}

.chapter-accordion-header:hover {
  background-color: #f1f5f9;
}

.ch-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.ch-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.ch-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ch-unit-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ch-count-badge {
  display: inline-flex;
  align-items: center;
  background-color: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
}

.ch-breakdown-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ch-sub-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.ch-sub-tag.short {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.ch-sub-tag.long {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.ch-sub-tag.rep {
  background-color: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.ch-chevron {
  color: #64748b;
  font-size: 13px;
  transition: transform 0.25s ease;
}

.chapter-accordion-card.open .ch-chevron {
  transform: rotate(180deg);
  color: #2563eb;
}

/* Chapter Accordion Body */
.chapter-accordion-body {
  padding: 16px 18px;
  background-color: #ffffff;
}

/* Section Header inside Chapter */
.chapter-part-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1.5px solid #f1f5f9;
}

.chapter-part-section-title:first-child {
  margin-top: 0;
}

.chapter-part-section-title i {
  color: #2563eb;
}

/* Question Item Card Improvements */
.question-item-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: all 0.15s ease;
}

.question-item-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.question-item-card.part-a-card {
  border-left: 4px solid #10b981;
}

.question-item-card.part-b-card {
  border-left: 4px solid #2563eb;
}

.question-item-card.repeated-card {
  border-color: #fed7aa;
  background: linear-gradient(to right, #fffaf5, #ffffff);
}

.question-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.q-badge.q-num {
  background-color: #0f172a;
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
}

.q-badge.topic {
  background-color: #f1f5f9;
  color: #334155;
  font-weight: 600;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.question-text-preview {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-main);
  margin: 10px 0;
  word-break: break-word;
}

.question-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.footer-left-proof {
  display: flex;
  align-items: center;
  gap: 8px;
}

.direct-pdf-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: #f8fafc;
  color: #1e3a8a !important;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  transition: all 0.15s ease;
}

.direct-pdf-badge:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8 !important;
}

.footer-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-card-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1.5px solid transparent;
}

.btn-card-tips {
  background-color: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

.btn-card-tips:hover {
  background-color: #f1f5f9;
  color: #1e293b;
  border-color: #94a3b8;
}

.btn-card-ai {
  background: linear-gradient(135deg, #1e40af 0%, #4338ca 50%, #7c3aed 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 1px 3px rgba(67, 56, 202, 0.25);
}

.btn-card-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(67, 56, 202, 0.35);
}

/* Mobile responsive for Chapter Accordions */
@media (max-width: 640px) {
  .division-header-actions {
    width: 100%;
    margin-top: 8px;
  }

  .btn-toggle-all-accordions,
  .btn-subject-drive-papers {
    flex: 1;
    justify-content: center;
    font-size: 11.5px;
    padding: 5px 8px;
  }

  .chapter-accordion-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .ch-unit-title {
    font-size: 13.5px;
    white-space: normal;
  }

  .ch-header-right {
    gap: 6px;
  }

  .ch-breakdown-tags {
    display: none; /* Hide sub breakdown pills on mobile to avoid clutter */
  }

  .chapter-accordion-body {
    padding: 12px 10px;
  }

  .question-item-card {
    padding: 12px 10px;
  }

  .question-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .footer-left-proof,
  .footer-right-actions {
    width: 100%;
  }

  .direct-pdf-badge,
  .btn-card-action {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   UI Cleanup (2026) — solid surfaces, compact filters, less glassmorphism
   ========================================================================== */

body {
  background: #f6f8fb;
}

.site-header {
  background-color: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.subject-card {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--sub-accent, #2563eb);
  border-radius: 12px;
  box-shadow: var(--shadow-subtle);
}

.subject-card::before {
  display: none;
}

.subject-card:hover {
  background: #ffffff;
  border-color: var(--sub-accent, #2563eb);
  border-left-color: var(--sub-accent, #2563eb);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.subject-card[data-subject="DM"],
.subject-card[data-subject="COA"],
.subject-card[data-subject="OOPJ"],
.subject-card[data-subject="DBMS"],
.subject-card[data-subject="SE"],
.subject-card[data-subject="ES"],
.subject-card[data-subject="IE"] {
  background: #ffffff;
}

.gemini-title-gradient {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--brand-navy);
}

.question-item-card {
  border: 1px solid var(--border-subtle);
  border-left: 4px solid #2563eb;
  border-radius: 10px;
  box-shadow: none;
}

.question-item-card.part-a-card {
  background: #ffffff;
  border-color: var(--border-subtle);
  border-left-color: #d97706;
}

.question-item-card.part-b-card {
  background: #ffffff;
  border-color: var(--border-subtle);
  border-left-color: #7c3aed;
}

.question-item-card.repeated-card {
  box-shadow: none;
}

.question-item-card:hover {
  transform: none;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-subtle);
}

.bottom-footer {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
}

.attribution-box {
  background: var(--border-subtle);
  box-shadow: none;
}

.attribution-box:hover {
  transform: none;
  box-shadow: none;
}

/* --- Compact PYQ search + filter toolbar --- */
.pyq-filters-container {
  position: relative;
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  gap: 10px;
  box-shadow: var(--shadow-subtle);
}

.pyq-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pyq-toolbar .pyq-search-box {
  flex: 1 1 auto;
  min-width: 0;
}

.pyq-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 9px 14px;
  background-color: #ffffff;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pyq-filter-toggle:hover,
.pyq-filter-toggle.active {
  border-color: var(--brand-blue);
  background-color: var(--brand-surface);
  color: var(--brand-blue);
}

.pyq-filter-toggle.active {
  border-color: var(--brand-blue);
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background-color: var(--brand-blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.pyq-filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--surface-muted);
}

.pyq-filter-panel[hidden] {
  display: none;
}

.filter-group {
  min-width: 0;
}

.filter-group-title {
  margin-bottom: 8px;
  color: var(--text-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  background-color: #ffffff;
  border: 1px solid #d7dee8;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.filter-option:hover {
  border-color: #94a3b8;
}

.filter-option:has(input:checked) {
  background-color: var(--brand-surface);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  font-weight: 600;
}

.filter-option input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--brand-blue);
  cursor: pointer;
}

.filter-empty {
  color: var(--text-light);
  font-size: 12.5px;
  font-style: italic;
}

.filter-group-note {
  margin: 7px 0 0;
  color: var(--text-light);
  font-size: 11.5px;
  line-height: 1.4;
}

.filter-panel-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle);
}

.filter-panel-actions .btn-secondary-flat,
.filter-panel-actions .btn-action-primary {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 12.5px;
}

.pyq-count-banner {
  padding: 7px 10px;
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--brand-blue);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}

@media (max-width: 720px) {
  .pyq-toolbar {
    flex-wrap: wrap;
  }

  .pyq-toolbar .pyq-search-box {
    flex: 1 1 100%;
  }

  .pyq-filter-toggle {
    width: 100%;
  }

  .pyq-filter-panel {
    grid-template-columns: 1fr;
  }

  .filter-panel-actions {
    justify-content: stretch;
  }

  .filter-panel-actions button {
    flex: 1;
  }
}

/* ---------------------------------------------------------------
   Editor view (admin.html) + contribution hand-off
   --------------------------------------------------------------- */
.audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.audit-search {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 420px;
}

.audit-toggle {
  padding: 6px 10px;
}

.audit-hint {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.audit-table td {
  vertical-align: middle;
}

.audit-row-flag {
  background-color: #fffaf3;
}

.audit-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #b45309;
  font-size: 12px;
  font-weight: 600;
}

.audit-ok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #047857;
  font-size: 12px;
  font-weight: 600;
}

.audit-muted {
  color: var(--text-light);
  font-size: 12px;
}

.dist-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.dist-bar-track {
  height: 7px;
  border-radius: 999px;
  background-color: #eef2f7;
  overflow: hidden;
}

.dist-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.dist-value {
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.editor-note-sub {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* Contribution WhatsApp hand-off */
.contrib-handoff {
  text-align: center;
  padding: 6px 4px 2px;
}

.handoff-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 50%;
  background-color: #e8f8ee;
  color: #128c4a;
  font-size: 22px;
}

.handoff-title {
  margin: 0 0 6px;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 700;
}

.handoff-text {
  max-width: 46ch;
  margin: 0 auto 10px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.handoff-note {
  max-width: 46ch;
  margin: 0 auto 14px;
  padding: 8px 10px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  background-color: var(--surface-muted);
  color: var(--text-main);
  font-size: 12px;
  word-break: break-word;
}

.handoff-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.handoff-actions .btn-secondary-flat,
.handoff-actions .btn-action-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 14px;
  font-size: 12.5px;
  text-decoration: none;
}

.handoff-done {
  width: 100%;
}

@media (max-width: 640px) {
  .dist-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dist-bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Printed-semester honesty badge (Drive folders contain some IV/V-sem papers) */
.q-badge.semester-off {
  background-color: #fef2f2;
  color: #9a3412;
  border: 1px solid #fed7aa;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.q-badge.semester-off i {
  font-size: 10px;
}

.modal-badge.quaternary {
  background-color: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}


/* ==========================================================================
   Rating Popup (45-second Activity Timer)
   ========================================================================== */

#ratingPopup {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  #ratingPopup {
    transition: none;
  }
}

.rating-popup-card {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 12px 40px -8px rgba(15, 23, 42, 0.14), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  max-width: 280px;
  text-align: center;
}

.rating-popup-icon {
  font-size: 28px;
  color: #f59e0b;
  margin-bottom: 10px;
}

.rating-popup-msg {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 16px;
  line-height: 1.4;
}

.rating-popup-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.rating-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.rating-btn-primary:hover {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.rating-btn-primary:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.rating-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  background: #f8fafc;
  color: var(--text-muted);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rating-btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.rating-btn-secondary:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  #ratingPopup {
    bottom: 90px;
    right: 12px;
    left: 12px;
  }
  .rating-popup-card {
    max-width: 100%;
  }
}

/* ==========================================================================
   AI Error Fallback UI
   ========================================================================== */

.ai-error-fallback {
  margin-top: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-md);
}

.ai-fallback-msg {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.45;
}

.ai-fallback-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.15s ease;
}

.ai-fallback-copy-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-main);
}

.ai-fallback-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-fallback-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
  flex: 1;
  justify-content: center;
  min-width: 160px;
}

.ai-fallback-btn.chatgpt-btn {
  background: #0a0a0a;
  color: #ffffff;
  border-color: #0a0a0a;
}

.ai-fallback-btn.chatgpt-btn:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-fallback-btn.gemini-btn {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f4ff 100%);
  color: #1e40af;
  border-color: #bfdbfe;
}

.ai-fallback-btn.gemini-btn:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.ai-fallback-btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .ai-fallback-btns {
    flex-direction: column;
  }
  .ai-fallback-btn {
    min-width: 100%;
  }
}

/* ==========================================================================
   Header Actions Alignment Refinement
   ========================================================================== */

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.top-drive-btn {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .header-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .brand-name {
    font-size: 16px;
  }
  .brand-sub {
    font-size: 11px;
  }
  .brand-seal {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }
  .top-drive-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 34px;
    gap: 6px;
  }
  .top-admin-btn,
  .top-admin-icon-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    font-size: 13px;
  }
  .header-actions {
    gap: 6px;
  }
}

@media (max-width: 360px) {
  .top-drive-btn-text {
    display: none;
  }
  .top-drive-btn {
    padding: 6px 8px;
    min-height: 34px;
  }
}
