:root {
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --primary: #0f172a;
  --primary-accent: #2563eb;
  --primary-accent-hover: #1d4ed8;
  --primary-accent-light: #eff6ff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --tag-year: #fef2f2;
  --tag-year-text: #b91c1c;
  --tag-year-border: #fecaca;
  --static-bg: #fffbeb;
  --static-border: #fde68a;
  --static-text: #92400e;
  --phase-header-bg: #f1f5f9;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Uniform Card Design System */
  --card-border: 1.5px solid #e2e8f0;
  --card-border-hover: #cbd5e1;
  --card-radius: 12px;
  --card-padding: 1.05rem 1.2rem;
  --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --card-shadow-hover: 0 8px 20px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --card-transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.18s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Sidebar Drawer */
#sidebar {
  width: 320px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 28px rgba(15, 23, 42, 0.08);
}

#sidebar.active {
  transform: translateX(0);
}

.sidebar-header {
  padding: 1.25rem;
  background: var(--primary);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-header .sub-heading {
  font-size: 0.75rem;
  color: #94a3b8;
  display: block;
  margin-top: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.icon-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-list {
  list-style: none;
  padding: 0.75rem 0;
  overflow-y: auto;
  flex: 1;
}

.sidebar-list a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: #334155;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar-list a:hover {
  background: var(--primary-accent-light);
  border-left-color: var(--primary-accent);
  color: var(--primary-accent);
}

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: none;
}

#overlay.active {
  display: block;
}

/* Main Container - Edge-to-Edge Full Screen (Zero Leftout Space) */
#main-container {
  flex: 1;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 1rem 1.5rem;
}

@media (min-width: 1280px) {
  #main-container {
    padding: 1.15rem 2rem;
  }
}

@media (min-width: 1600px) {
  #main-container {
    padding: 1.25rem 2.5rem;
  }
}

/* Header & Sticky Top Deck */
.top-deck {
  position: sticky;
  top: 0.75rem;
  z-index: 900;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.15rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.deck-left, .deck-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}

.brand-badge svg {
  color: #38bdf8;
}

.btn-tool {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.btn-tool-primary {
  background: var(--primary-accent);
  color: #ffffff;
  border-color: var(--primary-accent);
}

.btn-tool-primary:hover {
  background: var(--primary-accent-hover);
  border-color: var(--primary-accent-hover);
}

.subject-select-wrapper select {
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.subject-select-wrapper select:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-box {
  flex: 1;
  min-width: 260px;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.88rem;
  background: #f8fafc;
  transition: all 0.15s;
}

.search-box input:focus {
  background: #ffffff;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Filter Chips */
.filter-chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.chip:hover {
  background: #f1f5f9;
  color: var(--text);
}

.chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Topic Sections */
.topic-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 8rem;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--border);
}

.section-title-left {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-title-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-mock-start {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.4);
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
}

.btn-mock-start:hover {
  background: linear-gradient(135deg, #172554 0%, #1d4ed8 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38);
  transform: translateY(-1px);
}

.btn-mock-start:active {
  transform: translateY(0);
}

.mock-badge-pill {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sidebar-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
}

.sidebar-item-row a {
  flex: 1;
}

.sidebar-mock-btn {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.sidebar-mock-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.section-count-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-accent);
  background: var(--primary-accent-light);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

/* High Yield Exam Facts Box */
.exam-static-box {
  background: var(--static-bg);
  border: 1.5px solid var(--static-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  margin-bottom: 1.35rem;
  box-shadow: var(--card-shadow);
  transition: var(--card-transition);
}

.exam-static-box:hover {
  box-shadow: var(--card-shadow-hover);
}

.exam-static-box h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--static-text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.static-facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.65rem;
}

.static-fact-item {
  background: rgba(255, 255, 255, 0.85);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(253, 230, 138, 0.8);
  font-size: 0.84rem;
  color: #78350f;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.static-fact-label {
  font-weight: 800;
  color: #92400e;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.static-fact-val {
  font-weight: 500;
  color: #451a03;
}

/* Phase Separators */
.phase-separator {
  margin: 2rem 0 1.15rem 0;
  padding: 0.6rem 1rem;
  background: var(--phase-header-bg);
  border-left: 4px solid var(--primary-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.phase-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--primary);
}

.phase-dates {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Cards Grid - Full-Width Responsive Tile Matrix */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.35rem;
  width: 100%;
  align-items: stretch;
}

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 3px 8px -2px rgba(15, 23, 42, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid #f1f5f9;
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin: 0;
}

.card-timeline {
  font-size: 0.75rem;
  font-weight: 750;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.card-body {
  flex: 1;
}

.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.865rem;
  color: #334155;
  line-height: 1.38;
}

.bullet-list li {
  position: relative;
  padding: 0.14rem 0.4rem 0.14rem 1.15rem;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.bullet-list li:hover {
  background-color: #f8fafc;
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.5rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2563eb;
  opacity: 0.75;
}

.bullet-list li strong,
.bullet-list li .point-heading {
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin-right: 0.25rem;
  display: inline;
}

body.dark-mode .bullet-list li strong,
body.dark-mode .bullet-list li .point-heading {
  color: #f8fafc;
}

/* Inline Bullet Dot Separator */
.pt-sep {
  display: inline-block;
  color: #94a3b8;
  font-size: 0.72rem;
  line-height: 1;
  margin: 0 0.35rem;
  vertical-align: middle;
  opacity: 0.75;
  user-select: none;
}

/* Keyword Emphasis: Underline instead of colour background highlight */
.kw {
  font-weight: 700;
  color: #0f172a;
  background: transparent !important;
  padding: 0 1px !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: #d97706;
  display: inline;
  font-size: inherit;
  letter-spacing: -0.005em;
  margin: 0 0.05rem;
}

.kw:hover {
  text-decoration-color: #b45309;
}

body.dark-mode .kw {
  color: #f8fafc !important;
  text-decoration-color: #facc15 !important;
}

/* Dedicated Mint / Emerald Hint Box from Reference Screenshot */
.card-hint-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3.5px solid #10b981;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  margin-top: 0.65rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: #065f46;
  font-size: 0.825rem;
  line-height: 1.45;
  font-weight: 500;
}

.card-hint-box .hint-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
  line-height: 1;
}

.card-hint-box .hint-text {
  flex: 1;
}

.card-hint-box strong {
  font-weight: 750;
  color: #047857;
  margin-right: 0.25rem;
}

/* Deep-dive link / action box */
.card-deepdive-action {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3.5px solid #2563eb;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  margin-top: 0.45rem;
  font-size: 0.825rem;
  font-weight: 650;
  color: #1d4ed8;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-deepdive-action:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

/* Clickable Deep-Dive Links */
.link-term, .deep-link {
  color: #2563eb !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  text-decoration-style: dotted !important;
  text-underline-offset: 3px !important;
  cursor: pointer !important;
  padding: 1px 4px !important;
  border-radius: 4px !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

.link-term:hover, .deep-link:hover {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  text-decoration-style: solid !important;
}

.card-media img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s;
}

.card-media img:hover {
  opacity: 0.92;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.empty-state p {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 440px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  animation: modalPop 0.18s ease-out;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.term-modal-box {
  max-width: 560px;
}

.modal-header {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.term-modal-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.term-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary-accent);
  letter-spacing: 0.06em;
}

.modal-body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  font-size: 0.9rem;
}

.detail-point {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
}

.detail-label {
  font-weight: 700;
  min-width: 110px;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.media-choice-tabs {
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: #334155;
}

.modal-footer {
  padding: 0.95rem 1.35rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.btn-flat {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
}

.btn-flat:hover {
  color: var(--text);
}

/* Print Specific */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  #sidebar, #overlay, .top-deck, .modal-backdrop {
    display: none !important;
  }
  #main-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .topic-section {
    margin-bottom: 2rem;
  }
  .cards-grid {
    display: block !important;
  }
  .card {
    border: 1px solid #777777 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 0.85rem;
    padding: 0.85rem;
  }
  .card-timeline {
    background: transparent !important;
    border: 1px solid #555555;
    color: #000000 !important;
  }
  .kw {
    background: transparent !important;
    border: none !important;
    font-weight: bold;
    text-decoration: underline;
  }
  .link-term, .deep-link {
    color: #000000 !important;
    text-decoration: none !important;
    font-weight: bold;
  }
}

@media (max-width: 768px) {
  #main-container {
    padding: 0.75rem 0.85rem;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }
  .deck-left, .deck-right {
    justify-content: space-between;
  }
  .search-box {
    max-width: 100%;
  }
}

/* =========================================================================
   MOCK TEST SYSTEM STYLES
   ========================================================================= */

.mock-select-modal-box {
  max-width: 720px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.mock-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.35rem;
}

.mock-modal-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.3;
}

.mock-modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.mock-sets-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.mock-set-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.mock-set-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.mock-set-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mock-set-header-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mock-set-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.mock-set-tag {
  font-size: 0.72rem;
  background: #f1f5f9;
  color: #475569;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.mock-set-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mock-set-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.mock-set-btn-start {
  background: var(--primary-accent);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mock-set-btn-start:hover {
  background: var(--primary-accent-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Exam Workspace (Full Room View) */
.mock-exam-backdrop {
  z-index: 1300;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mock-exam-window {
  width: 98%;
  max-width: 1240px;
  height: 92vh;
  background: #ffffff;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mock-exam-top {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

.mock-exam-top-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mock-exam-subject {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.mock-exam-top-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
}

.mock-exam-top-center {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mock-timer-pill {
  background: #1e293b;
  border: 1px solid #334155;
  color: #38bdf8;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mock-timer-pill.urgent {
  background: #450a0a;
  border-color: #991b1b;
  color: #f87171;
  animation: pulse-urgent 1s infinite alternate;
}

@keyframes pulse-urgent {
  from { opacity: 0.85; transform: scale(1); }
  to { opacity: 1; transform: scale(1.03); }
}

.mock-exam-top-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-submit-exam {
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-submit-exam:hover {
  background: #15803d;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4);
}

.btn-exit-exam {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-exit-exam:hover {
  color: #ffffff;
  background: #1e293b;
}

.mock-exam-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  flex: 1;
  overflow: hidden;
  background: #f8fafc;
}

.mock-question-area {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  background: #ffffff;
  border-right: 1px solid var(--border);
}

.mock-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.mock-q-number {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  background: #f1f5f9;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
}

.mock-q-marks {
  font-size: 0.8rem;
  font-weight: 700;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.mock-q-text {
  font-size: 1.12rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.mock-options-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.mock-option-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.mock-option-card:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.mock-option-card.selected {
  border-color: var(--primary-accent);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.mock-option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-weight: 800;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.mock-option-card.selected .mock-option-letter {
  background: var(--primary-accent);
  border-color: var(--primary-accent);
  color: #ffffff;
}

.mock-option-label {
  font-size: 0.96rem;
  font-weight: 500;
  color: #1e293b;
  flex: 1;
}

.mock-bottom-actions {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mock-action-group-left, .mock-action-group-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-mock-nav {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.btn-mock-nav:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-mock-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-mock-review {
  background: #fdf4ff;
  color: #86198f;
  border: 1px solid #f0abfc;
}

.btn-mock-review:hover {
  background: #fae8ff;
  border-color: #e879f9;
}

.btn-mock-save {
  background: var(--primary-accent);
  color: #ffffff;
  border-color: var(--primary-accent);
}

.btn-mock-save:hover {
  background: var(--primary-accent-hover);
  border-color: var(--primary-accent-hover);
}

/* Question Palette Sidebar */
.mock-palette-area {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: #f8fafc;
  overflow-y: auto;
}

.mock-palette-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mock-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
  background: #ffffff;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.73rem;
  color: #475569;
  font-weight: 600;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-dot.answered { background: #16a34a; }
.legend-dot.review { background: #9333ea; }
.legend-dot.unanswered { background: #ea580c; }
.legend-dot.unvisited { background: #e2e8f0; border: 1px solid #cbd5e1; }

.mock-palette-buttons-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.palette-btn {
  aspect-ratio: 1;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}

.palette-btn:hover {
  transform: scale(1.06);
  border-color: #64748b;
}

.palette-btn.current {
  box-shadow: 0 0 0 2.5px #2563eb !important;
  font-weight: 900;
}

.palette-btn.answered {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}

.palette-btn.unanswered {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.palette-btn.review {
  background: #faf5ff;
  border-color: #d8b4fe;
  color: #7e22ce;
}

.palette-btn.review.answered {
  background: #9333ea;
  border-color: #7e22ce;
  color: #ffffff;
}

/* Scorecard & Solution Review */
.mock-scorecard-container {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100%;
  padding: 1.5rem 2rem;
  background: #f8fafc;
}

.scorecard-hero {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.scorecard-left {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.scorecard-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  width: fit-content;
}

.scorecard-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.scorecard-stats-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-width: 100px;
}

.stat-pill-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.stat-pill-val {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--primary);
}

.stat-pill-val.green { color: #16a34a; }
.stat-pill-val.red { color: #dc2626; }
.stat-pill-val.blue { color: #2563eb; }

.scorecard-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn-score-retake {
  background: var(--primary-accent);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-score-retake:hover {
  background: var(--primary-accent-hover);
}

.btn-score-switch {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-score-switch:hover {
  background: #f1f5f9;
}

.solution-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.solution-filter-bar h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

.solution-chips {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.solution-chip {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.solution-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.solutions-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.solution-item-card {
  background: var(--card-bg, #ffffff);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  transition: var(--card-transition);
}

.solution-item-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
}

.solution-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.solution-badge-correct {
  background: #dcfce7;
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.solution-badge-wrong {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.solution-badge-skipped {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.solution-q-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.solution-options-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sol-opt {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sol-opt.correct-answer {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
  font-weight: 700;
}

.sol-opt.user-wrong {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
  text-decoration: line-through;
}

.solution-explanation-box {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.86rem;
  color: #1e3a8a;
  line-height: 1.5;
}

.solution-explanation-box strong {
  color: #1d4ed8;
  font-weight: 800;
}

@media (max-width: 900px) {
  .mock-exam-body {
    grid-template-columns: 1fr;
  }
  .mock-palette-area {
    border-top: 1px solid var(--border);
    max-height: 200px;
  }
}

/* =========================================================================
   Dual Organization Switcher Banner (Battles Timeline vs Groupings)
   ========================================================================= */
.battle-view-switch-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.04) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
}

.battle-switch-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.battle-switch-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.battle-switch-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.battle-switch-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: #cbd5e1;
}

.battle-switch-btn.active {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  border-color: #b45309;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
}

/* =========================================================================
   Vertical Interactive Visual Timeline Scroll View
   ========================================================================= */

.visual-timeline-container {
  position: relative;
  width: 100%;
  margin-top: 1rem;
}

/* --- Sticky Era Scrubber & Controls Bar --- */
.timeline-controls-bar {
  position: sticky;
  top: 64px;
  z-index: 25;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.timeline-scrubber-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 0.65rem;
  scrollbar-width: thin;
}

.timeline-scrubber-pills::-webkit-scrollbar {
  height: 4px;
}

.timeline-scrubber-pills::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.timeline-era-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.42rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.timeline-era-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: #cbd5e1;
}

.timeline-era-btn.active {
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.timeline-era-btn:not(.era-ancient):not(.era-sultanate):not(.era-mughal):not(.era-british):not(.era-modern).active {
  background: #0f172a;
  border-color: #0f172a;
}

.timeline-era-btn.era-ancient.active {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-color: #b45309;
}

.timeline-era-btn.era-sultanate.active {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-color: #047857;
}

.timeline-era-btn.era-mughal.active {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  border-color: #6d28d9;
}

.timeline-era-btn.era-british.active {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-color: #b91c1c;
}

.timeline-era-btn.era-modern.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #0369a1;
}

.era-btn-count {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 800;
}

.timeline-era-btn.active .era-btn-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.timeline-subcontrols {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.timeline-search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
  display: flex;
  align-items: center;
}

.timeline-search-box svg {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.timeline-search-box input {
  width: 100%;
  padding: 0.45rem 2.2rem 0.45rem 2.25rem;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-main, #f8fafc);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.timeline-search-box input:focus {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #ffffff;
}

.timeline-clear-btn {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-clear-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

.btn-timeline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-timeline-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: #cbd5e1;
}

/* --- Empty Search State --- */
.timeline-empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.timeline-empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.timeline-empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.timeline-empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.timeline-reset-btn {
  background: var(--primary, #2563eb);
  color: #ffffff;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* --- The Vertical Spine Track --- */
.timeline-track {
  position: relative;
  padding: 1rem 0 4rem 0;
  width: 100%;
}

.timeline-central-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, 
    #d97706 0%, 
    #059669 22%, 
    #7c3aed 48%, 
    #dc2626 74%, 
    #0284c7 100%
  );
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.25);
  z-index: 1;
}

/* --- Era Milestone Gates --- */
.timeline-era-gate {
  position: relative;
  z-index: 5;
  margin: 3rem auto 2.25rem auto;
  max-width: 860px;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  transition: all 0.2s ease;
}

.timeline-era-gate.gate-ancient {
  border-left: 6px solid #d97706;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-card) 60%);
}

.timeline-era-gate.gate-sultanate {
  border-left: 6px solid #059669;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-card) 60%);
}

.timeline-era-gate.gate-mughal {
  border-left: 6px solid #7c3aed;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, var(--bg-card) 60%);
}

.timeline-era-gate.gate-british {
  border-left: 6px solid #dc2626;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, var(--bg-card) 60%);
}

.timeline-era-gate.gate-modern {
  border-left: 6px solid #0284c7;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, var(--bg-card) 60%);
}

.era-gate-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.era-gate-icon {
  font-size: 2.2rem;
  line-height: 1;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.04);
}

.era-gate-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.era-gate-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

.era-gate-dates {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  letter-spacing: 0.02em;
}

.era-gate-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 650px;
}

.era-gate-stat {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-main, #f1f5f9);
  color: var(--text);
  white-space: nowrap;
}

/* --- Battle Nodes & Alternate Layout --- */
.timeline-node-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  margin-bottom: 2rem;
  align-items: flex-start;
}

/* Desktop Alternating Split */
@media (min-width: 860px) {
  .timeline-node-wrapper.node-left {
    justify-content: flex-start;
  }
  .timeline-node-wrapper.node-left .timeline-card {
    width: calc(50% - 42px);
    margin-right: auto;
  }

  .timeline-node-wrapper.node-right {
    justify-content: flex-end;
  }
  .timeline-node-wrapper.node-right .timeline-card {
    width: calc(50% - 42px);
    margin-left: auto;
  }

  .timeline-spine-pin {
    position: absolute;
    left: 50%;
    top: 1.25rem;
    transform: translate(-50%, 0);
  }
}

/* Node Spine Pin & Pulse Animation */
.timeline-spine-pin {
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  cursor: default;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.timeline-spine-pin:hover {
  transform: translate(-50%, 0) scale(1.15);
}

.timeline-spine-pin {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--primary, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 5;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.35);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  cursor: pointer;
}

.timeline-spine-pin:hover {
  transform: translateX(-50%) scale(1.15);
}

.timeline-spine-pin.pin-ancient {
  border-color: #d97706;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.35);
}

.timeline-spine-pin.pin-sultanate {
  border-color: #059669;
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.35);
}

.timeline-spine-pin.pin-mughal {
  border-color: #7c3aed;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.35);
}

.timeline-spine-pin.pin-british {
  border-color: #dc2626;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.35);
}

.timeline-spine-pin.pin-modern {
  border-color: #0284c7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.35);
}

.spine-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid inherit;
  opacity: 0;
  pointer-events: none;
  animation: spinePulseRing 3s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes spinePulseRing {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.4);
    opacity: 0;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* --- Interactive Minimal Timeline Battle Card --- */
.timeline-minimal-card {
  position: relative;
  background: var(--card-bg, #ffffff);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  transition: var(--card-transition);
  z-index: 4;
  cursor: pointer;
  user-select: none;
}

.timeline-minimal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--card-border-hover);
}

.timeline-minimal-card:active {
  transform: translateY(-1px);
}

.tm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.tm-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tm-year-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.tm-year-pill.pill-ancient {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.tm-year-pill.pill-sultanate {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.tm-year-pill.pill-mughal {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.tm-year-pill.pill-british {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.tm-year-pill.pill-modern {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.tm-category-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-main, #f1f5f9);
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border, #e2e8f0);
}

.tm-action-arrow {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-minimal-card:hover .tm-action-arrow {
  background: #2563eb;
  color: #ffffff;
  transform: translateX(2px);
}

.tm-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text, #1e293b);
  margin: 0 0 0.6rem 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.timeline-minimal-card:hover .tm-card-title {
  color: var(--primary, #2563eb);
}

.tm-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.tm-info-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.tm-info-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.tm-info-val {
  color: var(--text, #1e293b);
  word-break: break-word;
}

.tm-info-val.tm-vs {
  font-weight: 600;
  color: var(--text, #1e293b);
}

.tm-info-val.tm-winner {
  font-weight: 700;
  color: #065f46;
  background: rgba(5, 150, 105, 0.08);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
  line-height: 1.35;
}

.timeline-hint-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  white-space: nowrap;
}

/* --- Legacy Timeline Battle Card (For compatibility) --- */
.timeline-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 4;
}

.timeline-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.timeline-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.timeline-badge-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.timeline-year-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.timeline-year-pill.pill-ancient {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.timeline-year-pill.pill-sultanate {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.timeline-year-pill.pill-mughal {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.timeline-year-pill.pill-british {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.timeline-year-pill.pill-modern {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.timeline-category-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-main, #f1f5f9);
  color: var(--text-muted);
}

.timeline-era-indicator {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-card-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
  margin: 0.35rem 0 0.65rem 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.timeline-card-title.has-deepdive {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: color 0.15s ease;
}

.timeline-card-title.has-deepdive:hover {
  color: var(--primary, #2563eb);
}

.deepdive-arrow-icon {
  color: var(--primary, #2563eb);
  opacity: 0.6;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.timeline-card-title.has-deepdive:hover .deepdive-arrow-icon {
  opacity: 1;
  transform: translate(2px, -2px);
}

.timeline-meta-box {
  background: var(--bg-main, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.65rem;
  font-size: 0.83rem;
  line-height: 1.45;
}

.timeline-parties, .timeline-location {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.timeline-location {
  margin-bottom: 0;
}

.parties-badge, .location-badge {
  font-weight: 700;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.parties-text, .location-text {
  color: var(--text);
  font-weight: 500;
}

.timeline-outcome-box {
  background: rgba(37, 99, 235, 0.05);
  border-left: 3.5px solid var(--primary, #2563eb);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
}

.outcome-label {
  font-weight: 800;
  color: #1d4ed8;
  margin-right: 0.35rem;
}

.outcome-val {
  font-weight: 600;
}

.timeline-significance-body {
  border-top: 1px dashed var(--border);
  padding-top: 0.65rem;
  margin-bottom: 0.75rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text);
}

.timeline-significance-body.compact-hidden {
  display: none;
}

.significance-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #b45309;
  margin-bottom: 0.35rem;
}

.significance-text {
  margin: 0;
  color: var(--text);
}

.timeline-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
  margin-top: 0.5rem;
}

.btn-timeline-deepdive {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
}

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

.timeline-exam-verified {
  font-size: 0.74rem;
  font-weight: 600;
  color: #059669;
}

.timeline-index-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* --- Floating Quick Era Scrubber Dock --- */
.timeline-floating-dock {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.6rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 140px;
}

.floating-dock-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.dock-btn {
  background: var(--bg-main, #f8fafc);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.32rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dock-btn:hover {
  background: var(--bg-card-hover);
  border-color: #94a3b8;
  transform: translateX(-2px);
}

.dock-divider {
  height: 1px;
  background: var(--border);
  margin: 0.15rem 0;
}

.dock-btn.dock-top {
  text-align: center;
  justify-content: center;
  background: var(--primary, #2563eb);
  color: #ffffff;
  border-color: var(--primary, #2563eb);
}

.dock-btn.dock-top:hover {
  background: #1d4ed8;
  transform: none;
}

/* --- Mobile / Tablet Responsiveness for Visual Timeline --- */
@media (max-width: 859px) {
  .timeline-central-spine {
    left: 20px;
    transform: none;
  }

  .timeline-era-gate {
    margin-left: 44px;
    max-width: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }

  .era-gate-stat {
    align-self: flex-start;
  }

  .timeline-node-wrapper {
    margin-left: 44px;
    width: calc(100% - 44px);
    margin-bottom: 1.5rem;
  }

  .timeline-card {
    width: 100% !important;
    margin: 0 !important;
  }

  .timeline-spine-pin {
    position: absolute;
    left: -24px;
    top: 1rem;
    transform: translate(-50%, 0);
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .timeline-spine-pin:hover {
    transform: translate(-50%, 0) scale(1.1);
  }

  .timeline-floating-dock {
    bottom: 0.75rem;
    right: 0.75rem;
    width: 125px;
    padding: 0.4rem;
    transform: scale(0.9);
    transform-origin: bottom right;
  }
}

@media (max-width: 520px) {
  .timeline-controls-bar {
    top: 56px;
    padding: 0.6rem;
  }

  .timeline-search-box {
    min-width: 100%;
  }

  .timeline-floating-dock {
    display: none; /* Hide floating dock on small mobile screens to keep view clean */
  }
}

/* =========================================================================
   BATTLES TABULAR VIEW & UNIFIED VIEW SWITCHER
   ========================================================================= */

.battles-master-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  margin-top: 0.5rem;
}

/* Unified View Switcher Bar */
.battles-view-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: var(--radius-md, 12px);
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.battles-nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.battles-nav-badge {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary, #0f172a);
}

.battles-view-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.battles-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, #cbd5e1);
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.battles-pill-btn:hover {
  background: #f1f5f9;
  color: var(--primary, #0f172a);
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.battles-pill-btn.active {
  background: var(--primary, #0f172a);
  color: #ffffff;
  border-color: var(--primary, #0f172a);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.2);
}

/* Battles Table Controls (Search + Filters) */
.battles-table-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.table-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.table-search-wrapper svg {
  position: absolute;
  left: 0.85rem;
  color: #94a3b8;
  pointer-events: none;
}

.table-search-wrapper input {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 2.4rem;
  font-size: 0.88rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: var(--radius-sm, 8px);
  background: #f8fafc;
  color: var(--text, #1e293b);
  transition: all 0.2s ease;
}

.table-search-wrapper input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary-accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.table-search-clear {
  position: absolute;
  right: 0.75rem;
  background: #e2e8f0;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.table-search-clear:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.table-filter-pills-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.table-filter-pills-row .filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  margin-right: 0.25rem;
}

.table-filter-pill {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--border, #e2e8f0);
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.table-filter-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.table-filter-pill.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
  box-shadow: 0 2px 4px rgba(30, 41, 59, 0.15);
}

/* Battles Data Table Layout */
.battles-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.battles-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.88rem;
}

.battles-data-table thead th,
.commissions-data-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  white-space: nowrap;
  z-index: 2;
}

.battles-data-table thead th:first-child {
  border-top-left-radius: var(--radius-md, 12px);
}

.battles-data-table thead th:last-child {
  border-top-right-radius: var(--radius-md, 12px);
}

/* Table Rows & Cells */
.battle-table-row {
  border-bottom: 1px solid var(--border, #e2e8f0);
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.battle-table-row:last-child {
  border-bottom: none;
}

.battle-table-row:hover {
  background-color: #f8fafc;
}

.battle-table-row td {
  padding: 0.75rem 0.85rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.45;
}

/* Year Badge */
.table-year-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.badge-ancient {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-sultanate {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.badge-mughal {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.badge-british {
  background: #fce7f3;
  color: #9d174d;
  border: 1px solid #fbcfe8;
}

.badge-modern {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Battle Name & Location Subtitle */
.table-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.table-battle-name {
  font-weight: 700;
  color: var(--primary, #0f172a);
  font-size: 0.9rem;
}

.table-location-sub {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 500;
}

/* Combatants (VS) */
.table-vs-text {
  font-weight: 600;
  color: #334155;
  font-size: 0.86rem;
}

/* Winner & Result */
.table-winner-text {
  font-weight: 700;
  color: #065f46;
  font-size: 0.85rem;
}

/* Reason / Turning Point Minimal Keywords */
.table-reason-text {
  font-size: 0.83rem;
  color: #475569;
  line-height: 1.4;
}

/* Details Action Button */
.btn-table-action {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--primary-accent, #2563eb);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-table-action:hover {
  background: var(--primary-accent, #2563eb);
  color: #ffffff;
  border-color: var(--primary-accent, #2563eb);
  transform: translateY(-1px);
}

/* Thematic Group Header Row - Clean Minimal Style */
.table-group-header-row td {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  padding: 0.65rem 0.95rem !important;
  border-top: 1px solid var(--border, #e2e8f0) !important;
  border-bottom: 1px solid var(--border, #e2e8f0) !important;
}

.table-group-header-row.high-yield-header td {
  background: #fffbeb !important;
  border-top: 1px solid #fef3c7 !important;
  border-bottom: 1px solid #fef3c7 !important;
}

.group-header-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.group-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.group-header-icon {
  font-size: 1.15rem;
}

.group-header-title,
.group-header-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a !important;
  letter-spacing: 0.2px;
}

.table-group-header-row.high-yield-header .group-header-title,
.table-group-header-row.high-yield-header .group-header-name {
  color: #92400e !important;
}

.group-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: #ffffff !important;
  color: #475569 !important;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  text-transform: uppercase;
}

.table-group-header-row.high-yield-header .group-count-badge {
  background: #fef08a !important;
  color: #713f12 !important;
  border-color: #fde047;
}

.group-header-desc,
.group-header-summary {
  font-size: 0.78rem;
  color: #64748b !important;
  font-weight: 500;
}

.table-group-header-row.high-yield-header .group-header-desc,
.table-group-header-row.high-yield-header .group-header-summary {
  color: #b45309 !important;
}

/* Empty Table State */
.table-empty-box {
  padding: 3rem 1.5rem;
  text-align: center;
  background: #ffffff;
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: var(--radius-md, 12px);
}

.table-empty-box h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.35rem;
}

.table-empty-box p {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .battles-view-nav-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .battles-view-pills {
    width: 100%;
  }

  .battles-pill-btn {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.78rem;
    padding: 0.4rem 0.6rem;
  }
}

/* =========================================================================
   BATTLES TABLE: TREATY COLUMN & STYLES
   ========================================================================= */
.td-treaty {
  max-width: 320px;
  font-size: 0.83rem;
  line-height: 1.45;
}

.table-treaty-box {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.table-treaty-box.is-treaty {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  color: #1e3a8a;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.table-treaty-box.is-treaty:hover {
  background: rgba(37, 99, 235, 0.11);
  border-color: rgba(37, 99, 235, 0.32);
}

.table-treaty-box.is-none {
  color: var(--text-muted, #64748b);
  font-style: italic;
  padding: 0.2rem 0;
}

.treaty-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.table-treaty-text {
  word-break: break-word;
}

/* =========================================================================
   HISTORIC TREATIES MASTER CATALOG (संधियां)
   ========================================================================= */
.treaties-catalog-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.treaty-group-section {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 1.35rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.treaty-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border, #e2e8f0);
}

.treaty-group-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text, #1e293b);
}

.treaty-count-pill {
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-main, #f1f5f9);
  color: var(--primary, #2563eb);
  padding: 0.22rem 0.7rem;
  border-radius: 9999px;
  border: 1px solid var(--border, #e2e8f0);
}

.treaty-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.1rem;
}

.treaty-card {
  background: var(--card-bg, #ffffff);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: var(--card-shadow);
  transition: var(--card-transition);
}

.treaty-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--card-border-hover);
}

.treaty-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
}

.treaty-year-badge {
  font-weight: 800;
  color: #1e3a8a;
  background: #dbeafe;
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.treaty-war-context {
  font-weight: 600;
  color: var(--text-muted, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.treaty-card-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  line-height: 1.35;
}

.treaty-parties-row {
  font-size: 0.82rem;
  line-height: 1.45;
}

.treaty-label {
  font-weight: 700;
  color: var(--text-muted, #64748b);
  margin-right: 0.25rem;
}

.treaty-parties-text {
  color: var(--text, #1e293b);
  font-weight: 500;
}

.treaty-provisions-box {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
  margin-top: auto;
}

.treaty-provisions-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: #b45309;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}

.treaty-provisions-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text, #1e293b);
}

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

/* =========================================================================
   TOPIC HEADING: REVISION TRACKER & PROGRESS BAR
   ========================================================================= */
.revision-tracker-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-revision-tracker {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 9px;
  padding: 0.38rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  cursor: pointer;
  min-width: 180px;
  text-align: left;
  transition: all 0.16s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.btn-revision-tracker:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.14);
  transform: translateY(-1px);
}

.btn-revision-tracker:active {
  transform: scale(0.98);
}

.rev-btn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.rev-icon {
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
}

.rev-title {
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--text, #1e293b);
  flex: 1;
}

.rev-status-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
}

.rev-status-tag.in-progress {
  background: #dbeafe;
  color: #1e40af;
}

.rev-status-tag.mastered {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.rev-progress-track {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.rev-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.btn-revision-reset {
  background: #f8fafc;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 6px;
  color: #64748b;
  font-size: 0.85rem;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-revision-reset:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Sidebar Revision Progress Badge */
.sidebar-rev-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background: #dbeafe;
  color: #1e40af;
  margin-left: auto;
}

.sidebar-rev-badge.mastered {
  background: #d1fae5;
  color: #065f46;
}

/* =========================================================================
   COMMISSIONS & COMMITTEES TABLE & BADGES
   ========================================================================= */

.commissions-data-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.commission-table-row {
  cursor: pointer;
  transition: all 0.15s ease;
}

.commission-table-row:hover {
  background: #f1f5f9 !important;
}

.comm-cat-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.comm-cat-badge.badge-famine { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.comm-cat-badge.badge-education { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.comm-cat-badge.badge-civil { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.comm-cat-badge.badge-police { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.comm-cat-badge.badge-currency { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.comm-cat-badge.badge-agri { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.comm-cat-badge.badge-labor { background: #fdf4ff; color: #a21caf; border: 1px solid #f0abfc; }
.comm-cat-badge.badge-princely { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.comm-cat-badge.badge-const { background: #f8fafc; color: #334155; border: 1px solid #cbd5e1; }
.comm-cat-badge.badge-employ { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.comm-cat-badge.badge-general { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.comm-pyq-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 4px;
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #facc15;
}

/* =========================================================================
   INC SESSIONS (1885–1950) STYLES
   ========================================================================= */

.inc-memory-filters-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.inc-memory-filter-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  cursor: pointer;
}

.inc-memory-filter-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.inc-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.inc-filter-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.inc-filter-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
}

.inc-filter-summary {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
}

.inc-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.inc-group-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.inc-session-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.inc-session-badge.high-yield {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

