/* Design System for UPSC Practice Platform
 * 
 * Brand Identity:
 * - Serious, Calm, Academic, Examiner-like
 * - No hype, no buzzwords
 * - Muted colors, readable typography
 * - White space, calm layout
 */

/* ==========================================
   Color Palette (Muted, Academic)
   ========================================== */

:root {
  --primary-color: #2c3e50;      /* Dark blue-gray - serious, academic */
  --secondary-color: #495057;    /* Medium gray - calm, neutral */
  --accent-color: #6c757d;       /* Light gray - subtle */
  --success-color: #28a745;      /* Muted green - not neon */
  --danger-color: #dc3545;       /* Muted red - not bright */
  --light-bg: #f8f9fa;           /* Very light gray - calm background */
  --border-color: #dee2e6;       /* Subtle borders */
}

/* ==========================================
   Typography (Readable, Textbook-like)
   ========================================== */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--primary-color);
  line-height: 1.6;
  font-size: 1rem;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 500; /* Not too bold, not too light */
  color: var(--primary-color);
  line-height: 1.3;
}

.lead {
  font-weight: 400;
  color: var(--secondary-color);
}

/* ==========================================
   Buttons (Calm, Not Flashy)
   ========================================== */

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #1a252f;
  border-color: #1a252f;
}

.btn-outline-secondary {
  border-color: var(--accent-color);
  color: var(--secondary-color);
  font-weight: 500;
}

.btn-outline-secondary:hover {
  background-color: var(--light-bg);
  border-color: var(--accent-color);
  color: var(--secondary-color);
}

/* ==========================================
   Cards (Clean, Minimal)
   ========================================== */

.card {
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ==========================================
   Sections (White Space, Calm)
   ========================================== */

.section-block {
  margin-bottom: 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 3rem;
}

.hero-section {
  padding: 4rem 0;
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
}

/* ==========================================
   Step Cards (Process Flow)
   ========================================== */

.step-card {
  padding: 1.5rem;
  background-color: #ffffff;
  border-left: 3px solid var(--accent-color);
  border-radius: 0.25rem;
}

.step-card:hover {
  background-color: var(--light-bg);
  transition: background-color 0.2s ease;
}

/* ==========================================
   CTA Section (Calm, Not Pushy)
   ========================================== */

.cta-section {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

/* ==========================================
   Sidebar Navigation (ChatGPT-style)
   ========================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 220px;
  background-color: #ffffff;
  color: #2c3e50;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width 0.3s ease, transform 0.3s ease;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed {
  width: 60px;
}

/* On mobile, sidebar is always overlay (floating) */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    z-index: 1001; /* Higher than overlay */
    width: 240px; /* Reduced width on mobile */
    top: 56px; /* Below mobile navbar */
    height: calc(100vh - 56px);
  }

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

  /* On mobile, always show full width (ignore collapsed state) */
  .sidebar.collapsed {
    width: 240px;
  }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  min-height: 60px;
  transition: padding 0.3s ease;
}

.sidebar.collapsed .sidebar-header {
  padding: 12px;
  justify-content: center;
  position: relative;
}

.sidebar.collapsed .sidebar-brand {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-collapse-toggle {
  position: absolute;
  right: 8px;
}

.sidebar-brand {
  color: #2c3e50;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.sidebar-brand:hover {
  color: #1a252f;
  text-decoration: none;
}

.sidebar-brand-text {
  color: inherit;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-collapse-toggle {
  background: transparent;
  border: none;
  color: #2c3e50;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.sidebar-collapse-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.sidebar-collapse-toggle i {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-section {
  margin-bottom: 24px;
}

/* Collapsible nav groups (Prelims, Mains, …) */
.sidebar-section-toggle {
  align-items: center;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 8px;
  justify-content: space-between;
  margin: 0;
  padding: 8px 16px 4px;
  text-align: left;
  width: 100%;
}

.sidebar-section-toggle:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.sidebar-section-toggle:focus {
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px rgba(44, 62, 80, 0.2);
  outline: none;
}

.sidebar-section--expandable .sidebar-section-title {
  flex: 1;
  margin: 0;
  margin-bottom: 0;
  padding: 0;
}

.sidebar-section-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  opacity: 0.65;
  transition: transform 0.15s ease;
}

.sidebar-section-panel[hidden] {
  display: none !important;
}

/* Desktop icon rail: section headers hidden; links stay visible (panels forced open in JS) */
.sidebar.collapsed .sidebar-section--expandable .sidebar-section-toggle {
  display: none;
}

.sidebar.collapsed .sidebar-section--expandable .sidebar-section-panel,
.sidebar.collapsed .sidebar-section--expandable .sidebar-section-panel[hidden] {
  display: block !important;
}

/* ==========================================
   Prelims Public Pages
   ========================================== */

:root {
  --prelims-ink: #172033;
  --prelims-muted: #6a7283;
  --prelims-soft: #eef2f7;
  --prelims-line: #d8dfeb;
  --prelims-paper: #fffdf8;
  --prelims-accent: #0f6cbd;
  --prelims-accent-deep: #0b4f8a;
  --prelims-gold: #c78a2c;
  --prelims-section-gap: 1.5rem;
  --prelims-card-radius: 18px;
  --prelims-card-padding: 1rem;
  --prelims-heading-size: clamp(1.2rem, 1.8vw, 1.55rem);
}

.prelims-shell {
  background:
    radial-gradient(circle at top left, rgba(15, 108, 189, 0.10), transparent 28rem),
    linear-gradient(180deg, #fffdf9 0%, #f6f8fc 100%);
  color: var(--prelims-ink);
  min-height: calc(100vh - 64px);
  padding: 2rem 0 4rem;
}

.prelims-shell .container {
  max-width: 1180px;
}

.prelims-home-topbar {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0.9rem;
}

.prelims-home-topbar__item {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: 12px;
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0.65rem;
}

.prelims-home-topbar__item span {
  color: var(--prelims-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.prelims-home-topbar__item strong {
  color: var(--prelims-ink);
  font-size: 1rem;
  line-height: 1;
}

.prelims-kicker {
  color: var(--prelims-accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 0.9rem;
  text-transform: uppercase;
}

.prelims-hero,
.prelims-year-hero,
.prelims-subject-hero,
.prelims-answer-card,
.prelims-panel,
.prelims-list-card,
.prelims-mini-card,
.prelims-year-card,
.prelims-subject-card,
.prelims-question-nav__link,
.prelims-related-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(216, 223, 235, 0.95);
  box-shadow: 0 18px 50px rgba(27, 39, 60, 0.06);
}

.prelims-hero {
  border-radius: calc(var(--prelims-card-radius) + 10px);
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  margin-bottom: var(--prelims-section-gap);
  overflow: hidden;
  padding: 1.35rem;
}

.prelims-hero__title,
.prelims-year-hero__title,
.prelims-subject-hero__title,
.prelims-answer-card__title,
.prelims-section__title,
.prelims-panel__title {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  letter-spacing: -0.02em;
}

.prelims-hero__title {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.96;
  margin: 0 0 1rem;
  max-width: 11ch;
}

.prelims-hero__body,
.prelims-year-hero__body,
.prelims-subject-hero__body,
.prelims-empty-state,
.prelims-explanation__body,
.prelims-mini-card__meta,
.prelims-list-card__topline,
.prelims-list-card__footer,
.prelims-question-row__meta,
.prelims-year-card__meta,
.prelims-subject-card__count,
.prelims-stat__label,
.prelims-question-nav__label {
  color: var(--prelims-muted);
}

.prelims-hero__body {
  font-size: 1.08rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  max-width: 60ch;
}

.prelims-hero__stats,
.prelims-subject-hero__aside {
  background: linear-gradient(180deg, rgba(15, 108, 189, 0.06) 0%, rgba(199, 138, 44, 0.08) 100%);
  border-radius: 24px;
  padding: 1.25rem;
}

.prelims-stat {
  border-bottom: 1px solid rgba(216, 223, 235, 0.8);
  padding: 0.9rem 0;
}

.prelims-stat:first-child {
  padding-top: 0;
}

.prelims-stat:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.prelims-stat__value {
  color: var(--prelims-ink);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.3rem;
}

.prelims-hero__actions,
.prelims-section__head,
.prelims-question-nav,
.prelims-pagination__inner,
.prelims-mini-card,
.prelims-list-card__footer,
.prelims-year-hero,
.prelims-subject-hero {
  align-items: center;
  display: flex;
  gap: 0.9rem;
  justify-content: space-between;
}

.prelims-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 600;
  justify-content: center;
  line-height: 1.2;
  padding: 0.8rem 1.2rem;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.prelims-button:hover {
  transform: translateY(-1px);
}

.prelims-button--primary {
  background: var(--prelims-accent);
  color: #fff;
}

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

.prelims-button--secondary,
.prelims-pagination__button--ghost,
.prelims-pagination__button,
.prelims-button--tiny {
  background: #fff;
  border-color: var(--prelims-line);
  color: var(--prelims-ink);
}

.prelims-button--tiny {
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.55rem 0.9rem;
  text-align: center;
}

.prelims-button--full {
  width: 100%;
}

.prelims-inline-link {
  color: var(--prelims-accent-deep);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.prelims-inline-link:hover {
  color: var(--prelims-accent);
}

.prelims-section {
  margin-top: var(--prelims-section-gap);
}

.prelims-home-actions {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.prelims-home-actions__item {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: 16px;
  color: var(--prelims-ink);
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  text-decoration: none;
}

.prelims-home-actions__item strong {
  font-size: 0.98rem;
}

.prelims-home-actions__item span {
  color: var(--prelims-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.prelims-quick-links {
  display: grid;
  gap: 0.55rem;
}

.prelims-quick-link {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: 14px;
  color: var(--prelims-ink);
  display: grid;
  gap: 0.1rem;
  padding: 0.6rem 0.7rem;
  text-decoration: none;
}

.prelims-quick-link__label {
  color: var(--prelims-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.prelims-quick-link__value {
  font-size: 0.95rem;
  font-weight: 700;
}

.prelims-section__title {
  font-size: var(--prelims-heading-size);
  margin: 0;
}

.prelims-year-grid,
.prelims-subject-grid {
  display: grid;
  gap: 1rem;
}

.prelims-year-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.prelims-subject-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.prelims-year-card,
.prelims-subject-card {
  border-radius: 24px;
  color: var(--prelims-ink);
  overflow: hidden;
  padding: 1.2rem 1.1rem;
  position: relative;
  text-decoration: none;
}

.prelims-year-card::before,
.prelims-subject-card::before {
  background: linear-gradient(135deg, rgba(15, 108, 189, 0.12), rgba(199, 138, 44, 0.08));
  content: "";
  inset: 0;
  position: absolute;
}

.prelims-year-card > *,
.prelims-subject-card > * {
  position: relative;
}

.prelims-year-card__year {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.prelims-subject-card__title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.prelims-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.prelims-tag-cloud__item {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--prelims-line);
  border-radius: 999px;
  display: inline-flex;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
}

.prelims-two-column,
.prelims-content-grid,
.prelims-answer-layout {
  display: grid;
  gap: var(--prelims-section-gap);
}

.prelims-two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prelims-content-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.7fr);
}

.prelims-answer-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
}

.prelims-stack {
  display: grid;
  gap: 0.85rem;
}

.prelims-mini-card,
.prelims-panel,
.prelims-list-card,
.prelims-answer-card,
.prelims-year-hero,
.prelims-subject-hero {
  border-radius: var(--prelims-card-radius);
  padding: var(--prelims-card-padding);
}

.prelims-panel__label,
.prelims-explanation__label {
  color: var(--prelims-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.prelims-panel__title {
  font-size: var(--prelims-heading-size);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.prelims-panel--compact {
  border-radius: 14px;
  padding: 0.6rem 0.85rem;
}

.prelims-panel--full {
  width: 100%;
}

.prelims-panel__inline {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  line-height: 1.2;
}

.prelims-panel__inline strong {
  font-size: 0.98rem;
}

.prelims-panel__inline span {
  color: var(--prelims-muted);
  font-size: 0.86rem;
}

.prelims-question-list {
  display: grid;
  gap: 1rem;
}

.prelims-question-row {
  border-bottom: 1px solid rgba(216, 223, 235, 0.85);
  padding-bottom: 1rem;
}

.prelims-question-row:last-child {
  border-bottom: none;
}

.prelims-question-row__title,
.prelims-list-card__title {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.32rem;
  line-height: 1.35;
  margin: 0.2rem 0 0;
}

.prelims-question-row__title a,
.prelims-list-card__title a,
.prelims-related-card {
  color: var(--prelims-ink);
  text-decoration: none;
}

.prelims-question-row__title a:hover,
.prelims-list-card__title a:hover {
  color: var(--prelims-accent-deep);
}

/* Utility-focused variants for /prelims/:year */
.prelims-subject-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.prelims-subject-card--compact {
  border-radius: 16px;
  padding: 0.8rem 0.85rem;
}

.prelims-subject-card--compact .prelims-subject-card__title {
  font-size: 0.96rem;
  line-height: 1.25;
  margin-bottom: 0.35rem;
}

.prelims-subject-card--compact .prelims-subject-card__count {
  font-size: 0.8rem;
}

.prelims-subject-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.prelims-subject-badge {
  --badge-bg: #fff;
  --badge-border: var(--prelims-line);
  --badge-text: var(--prelims-ink);
  align-items: center;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  color: var(--badge-text);
  display: inline-flex;
  font-size: 0.88rem;
  gap: 0.55rem;
  line-height: 1;
  padding: 0.5rem 0.7rem 0.5rem 0.85rem;
  text-decoration: none;
}

.prelims-subject-badge:hover {
  border-color: color-mix(in srgb, var(--badge-border) 70%, #111 30%);
  color: color-mix(in srgb, var(--badge-text) 80%, #111 20%);
}

.prelims-subject-badge.is-selected {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--badge-border) 65%, #111 35%);
}

.prelims-subject-badge.is-selected .prelims-subject-badge__count {
  background: color-mix(in srgb, var(--badge-border) 18%, #fff 82%);
  color: var(--badge-text);
}

.prelims-subject-badge.is-static {
  cursor: default;
}

.prelims-subject-badge.is-static:hover {
  border-color: var(--badge-border);
  color: var(--badge-text);
}

.prelims-subject-badge__name {
  font-weight: 600;
}

.prelims-subject-badge__count {
  align-items: center;
  background: color-mix(in srgb, var(--badge-border) 12%, #fff 88%);
  border-radius: 999px;
  color: var(--badge-text);
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 700;
  min-width: 1.8rem;
  justify-content: center;
  padding: 0.22rem 0.42rem;
}

.prelims-question-list--utility {
  gap: 0.75rem;
}

.prelims-question-row--utility {
  border: 1px solid rgba(216, 223, 235, 0.9);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.7);
}

.prelims-question-row--utility .prelims-question-row__meta {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.prelims-question-row--utility .prelims-question-row__title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0.35rem 0 0;
}

.prelims-list-card--utility {
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
}

.prelims-list-card__topline--utility {
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.55rem;
}

.prelims-list-card__title--utility {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
}

.prelims-list-card--utility .prelims-list-card__footer {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(216, 223, 235, 0.85);
}

.prelims-list-card__topline {
  display: flex;
  font-size: 0.84rem;
  font-weight: 600;
  justify-content: space-between;
  letter-spacing: 0.02em;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
}

.prelims-answer-card__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.prelims-answer-card__eyebrow span {
  background: var(--prelims-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.8rem;
  text-transform: uppercase;
}

.prelims-answer-card__eyebrow .prelims-subject-chip {
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  text-transform: none;
}

.prelims-answer-card__title {
  font-size: clamp(1.3rem, 1.9vw, 1.8rem);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.prelims-answer-card__title p:last-child {
  margin-bottom: 0;
}

.prelims-answer-options {
  display: grid;
  gap: 0.9rem;
}

.prelims-answer-option {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--prelims-line);
  border-radius: 20px;
  display: grid;
  gap: 1rem;
  grid-template-columns: 48px minmax(0, 1fr);
  text-align: left;
  padding: 1rem;
  width: 100%;
}

.prelims-answer-option:hover {
  border-color: rgba(15, 108, 189, 0.45);
}

.prelims-answer-option__key {
  align-items: center;
  background: var(--prelims-soft);
  border-radius: 14px;
  display: flex;
  font-size: 1rem;
  font-weight: 700;
  height: 48px;
  justify-content: center;
}

.prelims-answer-option__correct {
  color: #0f6cbd;
  display: none;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.prelims-answer-option.is-selected {
  border-color: rgba(15, 108, 189, 0.65);
  box-shadow: 0 0 0 2px rgba(15, 108, 189, 0.12);
}

.prelims-answer-option.is-user-correct {
  background: rgba(20, 153, 84, 0.09);
  border-color: rgba(20, 153, 84, 0.65);
}

.prelims-answer-option.is-correct-answer {
  background: rgba(20, 153, 84, 0.09);
  border-color: rgba(20, 153, 84, 0.65);
}

.prelims-answer-option.is-user-incorrect {
  background: rgba(220, 53, 69, 0.08);
  border-color: rgba(220, 53, 69, 0.55);
}

.prelims-answer-option.is-correct-answer .prelims-answer-option__correct {
  display: block;
}

.prelims-answer-checker {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.prelims-answer-checker__status {
  color: var(--prelims-ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.prelims-explanation {
  border-top: 1px solid rgba(216, 223, 235, 0.85);
  margin-top: 1.6rem;
  padding-top: 1.4rem;
}

.prelims-explanation.is-hidden {
  display: none;
}

.prelims-explanation__body p:last-child {
  margin-bottom: 0;
}

.prelims-question-nav {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.75rem;
}

.prelims-question-nav--utility {
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.prelims-question-nav__link {
  border-radius: 14px;
  color: var(--prelims-ink);
  display: block;
  padding: 0.75rem 0.85rem;
  text-decoration: none;
}

.prelims-question-nav__link--utility {
  border: 1px solid var(--prelims-line);
  border-radius: 14px;
  box-shadow: none;
  padding: 0.8rem 0.9rem;
}

.prelims-question-nav__link--utility.is-disabled {
  background: #f7f9fc;
  color: #9aa5b5;
}

.prelims-question-nav__link--next {
  text-align: right;
}

.prelims-question-nav__title {
  display: block;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1rem;
  line-height: 1.35;
  margin-top: 0.3rem;
}

.prelims-related-card {
  border-radius: 14px;
  display: block;
  padding: 0.75rem 0.85rem;
}

.prelims-breadcrumb {
  align-items: center;
  color: var(--prelims-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.92rem;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

.prelims-breadcrumb a {
  color: var(--prelims-accent-deep);
  text-decoration: none;
}

.prelims-pagination {
  margin-top: 1.4rem;
}

.prelims-pagination__inner {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--prelims-line);
  border-radius: 999px;
  padding: 0.55rem;
}

.prelims-pagination__button,
.prelims-pagination__status {
  border-radius: 999px;
  padding: 0.75rem 1rem;
}

.prelims-pagination__button {
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.prelims-pagination__button--disabled {
  background: #f3f5f9;
  border: 1px solid #e6ebf3;
  color: #99a3b2;
}

.prelims-pagination__status {
  color: var(--prelims-muted);
  font-size: 0.92rem;
}

@media (max-width: 991px) {
  .prelims-hero,
  .prelims-two-column,
  .prelims-content-grid,
  .prelims-answer-layout {
    grid-template-columns: 1fr;
  }

  .prelims-hero__title {
    max-width: none;
  }
}

@media (max-width: 767px) {
  .prelims-shell {
    padding-top: 1rem;
  }

  .prelims-home-topbar {
    gap: 0.45rem;
    margin-bottom: 0.6rem;
  }

  .prelims-home-topbar__item {
    padding: 0.45rem 0.55rem;
  }

  .prelims-hero,
  .prelims-year-hero,
  .prelims-subject-hero,
  .prelims-answer-card,
  .prelims-panel,
  .prelims-list-card {
    border-radius: 14px;
    padding: 0.85rem;
  }

  .prelims-question-nav {
    grid-template-columns: 1fr;
  }

  .prelims-hero__actions,
  .prelims-section__head,
  .prelims-year-hero,
  .prelims-subject-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .prelims-home-actions {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .prelims-home-actions__item {
    padding: 0.75rem 0.85rem;
  }

  .prelims-pagination__inner {
    align-items: center;
    border-radius: 14px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
    padding: 0.45rem;
  }

  .prelims-pagination__button {
    min-width: 96px;
    padding: 0.55rem 0.85rem;
  }

  .prelims-pagination__status {
    order: 3;
    padding: 0.35rem 0.65rem;
    text-align: center;
    width: 100%;
  }

  .prelims-kicker {
    font-size: 0.68rem;
    margin-bottom: 0.45rem;
  }

  .prelims-section {
    margin-top: 1rem;
  }

  .prelims-section__title {
    font-size: clamp(1.05rem, 5vw, 1.25rem);
  }

  .prelims-list-card__topline {
    font-size: 0.72rem;
    margin-bottom: 0.45rem;
  }
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  padding: 8px 16px;
  margin-bottom: 4px;
  white-space: nowrap;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu-item {
  margin: 0;
}

.sidebar-menu-link {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: #2c3e50;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, padding 0.3s ease;
  font-size: 0.9rem;
  border-radius: 0;
  gap: 12px;
  position: relative;
}

.sidebar.collapsed .sidebar-menu-link {
  padding: 10px;
  justify-content: center;
}

/* Tooltip for collapsed sidebar items */
.sidebar.collapsed .sidebar-menu-link::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  margin-left: 12px;
  padding: 6px 10px;
  background-color: #2c3e50;
  color: #ffffff;
  font-size: 0.875rem;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed .sidebar-menu-link:hover::after {
  opacity: 1;
}

.sidebar-menu-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  opacity: 0.8;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-menu-link i {
  width: auto;
}

.sidebar-menu-link span {
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-menu-link span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-menu-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a252f;
  text-decoration: none;
}

.sidebar-menu-link.active {
  background-color: rgba(44, 62, 80, 0.1);
  color: #2c3e50;
  font-weight: 500;
}

.sidebar-menu-link.active i {
  opacity: 1;
}

.sidebar-section-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background-color: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.875rem;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-user-details {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-user {
  justify-content: flex-start;
  padding: 12px 8px;
  position: relative;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-height: auto;
}

.sidebar.collapsed .sidebar-user-info {
  justify-content: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar.collapsed .sidebar-user-avatar {
  margin: 0 auto;
}

.sidebar.collapsed .sidebar-user-actions {
  position: static;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  margin-top: 0.5rem;
  display: flex;
}

.sidebar.collapsed .sidebar-user-signout,
.sidebar.collapsed .sidebar-user-action {
  position: static;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  box-sizing: border-box;
}

.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sidebar-user-action,
.sidebar-user-signout {
  color: #2c3e50;
  padding: 6px;
  border-radius: 4px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.sidebar-user-action:hover,
.sidebar-user-signout:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a252f;
  text-decoration: none;
}

.sidebar-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}

.sidebar-auth-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  color: #2c3e50;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sidebar-auth-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
  color: #1a252f;
  text-decoration: none;
}

.sidebar-auth-link-primary {
  background-color: rgba(44, 62, 80, 0.1);
  border-color: rgba(44, 62, 80, 0.3);
}

.sidebar-auth-link-primary:hover {
  background-color: rgba(44, 62, 80, 0.15);
}

/* --------------------------------------------------------------------------
   Public site header (guests): Prelims + Mains tracks
   -------------------------------------------------------------------------- */
.public-nav {
  background: linear-gradient(180deg, #fffcf7 0%, #f4f6fb 100%);
  border-bottom: 1px solid rgba(23, 32, 51, 0.09);
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 4px 24px rgba(27, 39, 60, 0.06);
}

.public-nav__bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  min-height: 3.75rem;
  padding-bottom: 0.55rem;
  padding-top: 0.55rem;
}

.public-nav__brand {
  align-items: center;
  color: #172033;
  display: inline-flex;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.public-nav__brand:hover {
  color: #0f6cbd;
}

.public-nav__brand-textstack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.06rem;
  line-height: 1.15;
}

.public-nav__brand-text {
  font-size: 1.05rem;
}

.public-nav__brand-tagline {
  color: #6a7283;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.public-nav__brand-mark {
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
  height: 1.65rem;
  object-fit: contain;
  width: 1.65rem;
}

.public-nav__toggle {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 10px;
  cursor: pointer;
  display: none;
  margin-left: auto;
  padding: 0.45rem 0.55rem;
}

.public-nav__toggle-bars {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 0 / 1.15rem 2px,
    linear-gradient(currentColor, currentColor) no-repeat 0 6px / 1.15rem 2px,
    linear-gradient(currentColor, currentColor) no-repeat 0 12px / 1.15rem 2px;
  color: #172033;
  display: block;
  height: 14px;
  opacity: 0.85;
  width: 1.15rem;
}

.public-nav__collapse {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  min-width: 0;
}

.public-nav__hub-panel {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(23, 32, 51, 0.09);
  border-radius: 14px;
  box-shadow: 0 2px 14px rgba(27, 39, 60, 0.05);
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  min-width: 0;
  padding: 0.32rem 0.55rem 0.32rem 0.45rem;
}

.public-nav__hub-divider {
  align-self: stretch;
  background: rgba(23, 32, 51, 0.1);
  flex-shrink: 0;
  margin: 0 0.1rem;
  width: 1px;
}

.public-nav__tracks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.public-nav__track {
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 12px;
  color: #3d4a5c;
  display: block;
  flex: 1 1 auto;
  line-height: 1.15;
  min-width: 0;
  padding: 0.38rem 0.65rem 0.42rem;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
}

.public-nav__track:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 108, 189, 0.28);
  color: #172033;
}

.public-nav__track-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.public-nav__track-sub {
  color: #6a7283;
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  margin-top: 0.12rem;
}

.public-nav__track--prelims.public-nav__track--active {
  background: rgba(15, 108, 189, 0.1);
  border-color: rgba(15, 108, 189, 0.45);
  box-shadow: 0 2px 12px rgba(15, 108, 189, 0.12);
  color: #0b4f8a;
}

.public-nav__track--prelims.public-nav__track--active .public-nav__track-sub {
  color: rgba(11, 79, 138, 0.75);
}

.public-nav__track--mains.public-nav__track--active {
  background: rgba(44, 62, 80, 0.1);
  border-color: rgba(44, 62, 80, 0.35);
  box-shadow: 0 2px 12px rgba(44, 62, 80, 0.1);
  color: #2c3e50;
}

.public-nav__track--mains.public-nav__track--active .public-nav__track-sub {
  color: rgba(44, 62, 80, 0.72);
}

/* Mains marketing links inside hub panel (hidden on Prelims routes) */
.public-nav__mains-cluster {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 0;
}

.public-nav__links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.public-nav__link {
  align-items: center;
  border-radius: 999px;
  color: #4d5870;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 600;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.public-nav__link i {
  font-size: 0.95rem;
  opacity: 0.88;
}

.public-nav__link:hover {
  background: rgba(23, 32, 51, 0.06);
  color: #172033;
}

.public-nav__link--active {
  background: rgba(23, 32, 51, 0.1);
  color: #172033;
}

.public-nav__account {
  margin-left: auto;
}

.public-nav__account-btn {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(23, 32, 51, 0.14);
  border-radius: 999px;
  color: #2c3e50;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 600;
  gap: 0.4rem;
  padding: 0.38rem 0.85rem 0.38rem 0.65rem;
}

.public-nav__account-btn:hover {
  border-color: rgba(15, 108, 189, 0.35);
  color: #0b4f8a;
}

.public-nav__account-btn::after {
  margin-left: 0.2rem;
}

.public-nav__dropdown {
  border-radius: 12px;
  border: 1px solid rgba(23, 32, 51, 0.1);
  box-shadow: 0 12px 40px rgba(27, 39, 60, 0.12);
  font-size: 0.9rem;
  margin-top: 0.35rem;
  min-width: 13rem;
  padding: 0.35rem;
}

@media (min-width: 992px) {
  .public-nav__collapse.collapse {
    display: flex !important;
    visibility: visible !important;
  }
}

@media (max-width: 991px) {
  .public-nav__toggle {
    display: inline-flex;
  }

  .public-nav__collapse {
    align-items: stretch;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.98) 0%, #f0f3fa 100%);
    border-top: 1px solid rgba(23, 32, 51, 0.08);
    flex-basis: 100%;
    flex-direction: column;
    gap: 1rem;
    margin: 0 -0.75rem;
    order: 3;
    padding: 1rem 1.25rem 1.1rem;
  }

  .public-nav__tracks {
    flex-direction: column;
  }

  .public-nav__track {
    min-width: 0;
  }

  .public-nav__hub-panel {
    align-items: stretch;
    flex-direction: column;
    padding: 0.55rem 0.65rem;
    width: 100%;
  }

  .public-nav__hub-divider {
    height: 1px;
    margin: 0.2rem 0;
    width: 100%;
  }

  .public-nav__mains-cluster {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .public-nav__links {
    border-top: none;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0;
    width: 100%;
  }

  .public-nav__links li {
    width: 100%;
  }

  .public-nav__link {
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    width: 100%;
  }

  .public-nav__account {
    border-top: 1px solid rgba(23, 32, 51, 0.08);
    margin-left: 0;
    padding-top: 0.85rem;
    width: 100%;
  }

  .public-nav__account-btn {
    justify-content: center;
    width: 100%;
  }

  .public-nav__dropdown {
    width: 100%;
  }
}

/* Main Content Wrapper */
.main-content-wrapper {
  min-height: 100vh;
  padding-top: 20px;
}

.main-content-wrapper--public {
  padding-top: 12px;
}

/* Public homepage — one visual hub (matches nav / Prelims shell tone) */
.public-hub {
  background:
    radial-gradient(circle at 18% 0%, rgba(15, 108, 189, 0.09), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(199, 138, 44, 0.08), transparent 36%),
    linear-gradient(180deg, #fffdf9 0%, #f4f7fc 52%, #f0f4fa 100%);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-bottom: 2.5rem;
}

.public-hub-hero__kicker {
  color: #0f6cbd;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.public-hub-hero__title {
  color: #172033;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.85rem, 4.2vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 1rem;
}

.public-hub-hero__lead {
  color: #4d5870;
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.btn-public-hub {
  border-radius: 999px;
  font-weight: 600;
  border-width: 1px;
}

.btn-public-hub--prelims {
  background: linear-gradient(180deg, #1178c4 0%, #0f6cbd 100%);
  border-color: rgba(11, 79, 138, 0.35);
  color: #fff;
}

.btn-public-hub--prelims:hover {
  background: linear-gradient(180deg, #0d65a8 0%, #0b4f8a 100%);
  color: #fff;
}

.btn-public-hub--mains {
  background: linear-gradient(180deg, #34495e 0%, #2c3e50 100%);
  border-color: rgba(26, 37, 47, 0.45);
  color: #fff;
}

.btn-public-hub--mains:hover {
  background: linear-gradient(180deg, #2c3c4d 0%, #1f2d3a 100%);
  color: #fff;
}

.home-product-hub {
  margin-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.home-product-hub__title {
  color: #172033;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  text-align: center;
}

.home-product-hub__subtitle {
  color: #6a7283;
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0 auto 1.75rem;
  max-width: 36rem;
  text-align: center;
}

.home-product-hub__grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  max-width: 920px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .home-product-hub__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.home-product-card {
  backdrop-filter: blur(6px);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(27, 39, 60, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.35rem 1.35rem 1.25rem;
  position: relative;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.home-product-card:hover {
  border-color: rgba(15, 108, 189, 0.35);
  box-shadow: 0 22px 56px rgba(27, 39, 60, 0.11);
  text-decoration: none;
  transform: translateY(-2px);
}

.home-product-card--mains:hover {
  border-color: rgba(44, 62, 80, 0.3);
  box-shadow: 0 22px 56px rgba(27, 39, 60, 0.11);
  transform: translateY(-2px);
}

.home-product-card--prelims {
  background: rgba(255, 255, 255, 0.92);
  border-left: 3px solid #0f6cbd;
}

.home-product-card--mains {
  background: rgba(255, 255, 255, 0.92);
  border-left: 3px solid #2c3e50;
}

.home-product-card__badge {
  align-self: flex-start;
  background: rgba(23, 32, 51, 0.07);
  border-radius: 999px;
  color: #4d5870;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
  padding: 0.2rem 0.55rem;
  text-transform: uppercase;
}

.home-product-card__name {
  color: #172033;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
}

.home-product-card__desc {
  color: #4d5870;
  flex: 1 1 auto;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.home-product-card__meta {
  color: #0b4f8a;
  font-size: 0.86rem;
  margin-bottom: 1rem;
}

.home-product-card__meta--muted {
  color: #6a7283;
}

.home-product-card__meta-sep {
  margin: 0 0.25rem;
  opacity: 0.6;
}

.home-product-card__cta {
  align-items: center;
  color: #0f6cbd;
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 700;
  gap: 0.35rem;
  margin-top: auto;
}

a.home-product-card:hover .home-product-card__cta {
  color: #0b4f8a;
}

.home-product-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.home-product-card__btn {
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.home-product-card__btn--primary {
  background: #2c3e50;
  border: 1px solid transparent;
  color: #fff;
}

.home-product-card__btn--primary:hover {
  background: #1a252f;
  color: #fff;
}

.home-product-card__btn--secondary {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(216, 223, 235, 0.98);
  color: #2c3e50;
}

.home-product-card__btn--secondary:hover {
  border-color: #0f6cbd;
  color: #0b4f8a;
}

@media (max-width: 767px) {
  .public-hub-hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .public-hub-hero__actions .btn {
    width: 100%;
  }
}

.main-content-wrapper-with-sidebar {
  margin-left: 220px;
  transition: margin-left 0.3s ease;
}

/* On mobile, main content never shifts */
@media (max-width: 768px) {
  .main-content-wrapper-with-sidebar {
    margin-left: 0 !important;
  }
}

.main-content-wrapper .alert {
  margin: 0 20px 20px 20px;
  border-radius: 4px;
}

/* Top navbar styling (for non-logged-in users) */
.navbar {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 500;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  color: #2c3e50;
  text-decoration: none;
}

.navbar-brand:hover {
  color: #1a252f;
}

.nav-link {
  display: flex;
  align-items: center;
}

.nav-link.active {
  font-weight: 500;
}

.nav-link i {
  font-size: 1rem;
}

/* Public navbar dropdown */
.navbar .dropdown-menu {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 0.5rem;
}

.navbar .dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem;
  transition: background-color 0.2s ease;
}

.navbar .dropdown-item:hover {
  background-color: #f8f9fa;
}

.navbar .dropdown-item i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Hide overlay on desktop */
@media (min-width: 769px) {
  .sidebar-overlay {
    display: none !important;
  }
}

/* ==========================================
   Mobile Top Navbar
   ========================================== */

.mobile-navbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1002;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px 0 0;
}

.mobile-navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 0;
  padding-left: 0;
}

.mobile-navbar-brand {
  color: #000000;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.mobile-navbar-brand:hover {
  color: #1a1a1a;
  text-decoration: none;
}

.mobile-navbar-toggle {
  background: transparent;
  border: none;
  color: #2c3e50;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  margin: 0;
  outline: none;
}

.mobile-navbar-toggle:focus {
  outline: none;
  box-shadow: none;
}

.mobile-navbar-toggle:active {
  outline: none;
}

.mobile-navbar-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.mobile-navbar-toggle i {
  font-size: 1.25rem;
}

.mobile-navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-navbar-icon-link {
  background: transparent;
  border: none;
  color: #2c3e50;
  text-decoration: none;
  padding: 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  font-size: 1.25rem;
}

.mobile-navbar-icon-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a252f;
  text-decoration: none;
}

.mobile-navbar-icon-link.active {
  color: #2c3e50;
  background-color: rgba(44, 62, 80, 0.1);
}

.mobile-navbar-account-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.mobile-navbar-account {
  position: relative;
}

.mobile-navbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1003;
}

.mobile-navbar-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-navbar-dropdown-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-navbar-dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background-color: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
  overflow: hidden;
}

.mobile-navbar-dropdown-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.mobile-navbar-dropdown-email {
  font-size: 0.875rem;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-navbar-dropdown-divider {
  height: 1px;
  background-color: rgba(0, 0, 0, 0.1);
  margin: 4px 0;
}

.mobile-navbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #2c3e50;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.mobile-navbar-dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a252f;
  text-decoration: none;
}

.mobile-navbar-dropdown-item i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.mobile-navbar-dropdown-item-danger {
  color: #f87171;
}

.mobile-navbar-dropdown-item-danger:hover {
  background-color: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

/* Show mobile navbar only on mobile */
@media (max-width: 768px) {
  .mobile-navbar {
    display: block;
  }

  .main-content-wrapper-with-sidebar {
    padding-top: 76px; /* 56px navbar + 20px padding */
  }

  /* Hide old mobile toggle button */
  .sidebar-mobile-toggle {
    display: none !important;
  }
}

/* Hide mobile navbar on desktop */
@media (min-width: 769px) {
  .mobile-navbar {
    display: none;
  }
}

/* Mobile Menu Toggle Button */
.sidebar-mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1001;
  background-color: #202123;
  color: #ececf1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sidebar-mobile-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-mobile-toggle i {
  font-size: 1.25rem;
}

/* Responsive: Mobile - Additional mobile styles */
@media (max-width: 768px) {
  .sidebar-collapse-toggle {
    display: none; /* Hide collapse button on mobile */
  }

  .sidebar-mobile-toggle {
    display: block;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* Ensure sidebar sections are visible on mobile */
  .sidebar.collapsed .sidebar-section-title,
  .sidebar.collapsed .sidebar-menu-link span,
  .sidebar.collapsed .sidebar-brand-text,
  .sidebar.collapsed .sidebar-user-details {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
    height: auto !important;
  }

  .sidebar.collapsed .sidebar-menu-link {
    padding: 10px 16px !important;
    justify-content: flex-start !important;
  }

  .sidebar.collapsed .sidebar-header {
    padding: 12px 16px !important;
    justify-content: space-between !important;
  }

  .sidebar.collapsed .sidebar-user {
    padding: 12px 16px !important;
    justify-content: space-between !important;
    flex-direction: row !important;
  }

  .sidebar.collapsed .sidebar-user-actions {
    position: static !important;
    flex-direction: row !important;
  }

  .sidebar.collapsed .sidebar-user-signout,
  .sidebar.collapsed .sidebar-user-action {
    position: static !important;
  }
}

/* Scrollbar Styling for Sidebar */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   Footer (Minimal)
   ========================================== */

footer {
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
}

/* ==========================================
   Responsive Adjustments
   ========================================== */

@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .display-5 {
    font-size: 1.75rem;
  }
}

/* ==========================================
   Utility Classes
   ========================================== */

.text-academic {
  color: var(--primary-color);
}

.bg-academic {
  background-color: var(--light-bg);
}

/* ==========================================
   Devise Forms (Academic, Clean)
   ========================================== */

.devise-form-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
}

.devise-card {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
}

.form-control-lg {
  border-color: var(--border-color);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control-lg:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.1);
}

.form-label {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-text {
  font-size: 0.875rem;
  color: var(--accent-color);
  margin-top: 0.25rem;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-label {
  font-size: 0.95rem;
  color: var(--secondary-color);
}

/* Devise error messages */
.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.alert-danger h6 {
  color: #721c24;
  font-weight: 500;
}

/* Devise links */
.devise-links a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.devise-links a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Remove any distracting animations */
* {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0.2s;
}

/* ==========================================
   Answer Annotation Viewer
   ========================================== */

.page-wrapper {
  position: relative;
  margin-bottom: 32px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.answer-page-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.annotation-layer {
  position: absolute;
  inset: 0;
  pointer-events: none; /* Default: no pointer events */
  top: 16px;
  left: 16px;
  right: 16px;
  bottom: 16px;
}

/* Buttons and highlights should be clickable */
.annotation-layer button,
.annotation-layer .ocr-highlight {
  pointer-events: auto;
}

.ocr-highlight {
  position: absolute;
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Section highlights - Light colors */
.ocr-highlight-introduction {
  background: rgba(59, 130, 246, 0.15); /* Light blue */
  border: 2px solid rgba(59, 130, 246, 0.4);
}

.ocr-highlight-introduction:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.6);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.ocr-highlight-body {
  background: rgba(34, 197, 94, 0.15); /* Light green */
  border: 2px solid rgba(34, 197, 94, 0.4);
}

.ocr-highlight-body:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.6);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.ocr-highlight-conclusion {
  background: rgba(168, 85, 247, 0.15); /* Light purple */
  border: 2px solid rgba(168, 85, 247, 0.4);
}

.ocr-highlight-conclusion:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.6);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(168, 85, 247, 0.3);
}

/* Feedback highlights - Dark colors */
.ocr-highlight-strength {
  background: rgba(22, 163, 74, 0.4); /* Dark green */
  border: 2px solid rgba(22, 163, 74, 0.7);
}

.ocr-highlight-strength:hover {
  background: rgba(22, 163, 74, 0.5);
  border-color: rgba(22, 163, 74, 0.9);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(22, 163, 74, 0.4);
}

.ocr-highlight-weakness {
  background: rgba(220, 38, 38, 0.4); /* Dark red */
  border: 2px solid rgba(220, 38, 38, 0.7);
}

.ocr-highlight-weakness:hover {
  background: rgba(220, 38, 38, 0.5);
  border-color: rgba(220, 38, 38, 0.9);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.4);
}

/* Default highlight (fallback) */
.ocr-highlight-default {
  background: rgba(0, 180, 0, 0.25);
  border: 2px solid #0a8f08;
}

.ocr-highlight-default:hover {
  background: rgba(0, 200, 0, 0.35);
  border-color: #06a804;
  z-index: 10;
}

/* Tooltip styles */
.ocr-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  max-width: 300px;
}

.ocr-tooltip-content {
  background: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ocr-tooltip-block-id {
  font-weight: bold;
  margin-bottom: 4px;
  color: #4ade80;
}

.ocr-tooltip-text {
  line-height: 1.4;
  word-wrap: break-word;
}

/* Color legend styles */
.annotation-legend {
  border: 1px solid #dee2e6;
}

.legend-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid;
  flex-shrink: 0;
}

.legend-swatch-introduction {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
}

.legend-swatch-body {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
}

.legend-swatch-conclusion {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
}

.legend-swatch-strength {
  background: rgba(22, 163, 74, 0.4);
  border-color: rgba(22, 163, 74, 0.7);
}

.legend-swatch-weakness {
  background: rgba(220, 38, 38, 0.4);
  border-color: rgba(220, 38, 38, 0.7);
}

/* Comment button styles */
.annotation-comment-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  font-weight: bold;
}

.annotation-comment-btn-strength {
  background: #16a34a; /* Green-600 */
  color: white;
  border-color: #15803d; /* Green-700 */
}

.annotation-comment-btn-strength:hover {
  background: #15803d; /* Darker green */
  transform: scale(1.15);
  box-shadow: 0 5px 12px rgba(22, 163, 74, 0.5);
}

.annotation-comment-btn-weakness {
  background: #dc2626; /* Red-600 */
  color: white;
  border-color: #b91c1c; /* Red-700 */
}

.annotation-comment-btn-weakness:hover {
  background: #b91c1c; /* Darker red */
  transform: scale(1.15);
  box-shadow: 0 5px 12px rgba(220, 38, 38, 0.5);
}

/* Active highlight (shown on button click) */
.ocr-highlight-active {
  animation: highlightPulse 0.3s ease;
}

@keyframes highlightPulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Feedback modal styles */
.feedback-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.feedback-modal-content {
  background: white;
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.feedback-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feedback-modal-header-strength {
  background: rgba(22, 163, 74, 0.1);
  border-bottom-color: rgba(22, 163, 74, 0.3);
}

.feedback-modal-header-weakness {
  background: rgba(220, 38, 38, 0.1);
  border-bottom-color: rgba(220, 38, 38, 0.3);
}

.feedback-modal-header h6 {
  margin: 0;
  font-weight: 600;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .page-wrapper {
    padding: 8px;
    margin-bottom: 16px;
  }

  .annotation-layer {
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .ocr-tooltip {
    max-width: 250px;
  }

  .annotation-legend {
    font-size: 0.875rem;
  }

  .legend-swatch {
    width: 20px;
    height: 20px;
  }

  .annotation-comment-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .feedback-modal-content {
    max-width: 90%;
    max-height: 90vh;
  }
}

/* ==========================================
   Exam tests catalog (/exam/tests)
   ========================================== */

.exam-tests-shell {
  background:
    radial-gradient(circle at top left, rgba(15, 108, 189, 0.1), transparent 28rem),
    linear-gradient(180deg, #fffdf9 0%, #f6f8fc 100%);
  color: var(--prelims-ink);
  min-height: calc(100vh - 64px);
  padding: 2rem 0 4rem;
}

.exam-tests-container {
  max-width: 1180px;
}

.exam-tests-hero {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: calc(var(--prelims-card-radius) + 10px);
  box-shadow: 0 18px 50px rgba(27, 39, 60, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  margin-bottom: var(--prelims-section-gap);
  padding: 1.35rem 1.5rem;
}

.exam-tests-kicker {
  color: var(--prelims-accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.exam-tests-title {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 0.75rem;
}

.exam-tests-lead {
  color: var(--prelims-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0;
  max-width: 52ch;
}

.exam-tests-hero__links {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.exam-tests-hero__link {
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.exam-tests-hero__link:not(.exam-tests-hero__link--muted) {
  background: var(--prelims-accent);
  border: 1px solid transparent;
  color: #fff;
}

.exam-tests-hero__link:not(.exam-tests-hero__link--muted):hover {
  background: var(--prelims-accent-deep);
  transform: translateY(-1px);
}

.exam-tests-hero__link--muted {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(216, 223, 235, 0.95);
  color: var(--prelims-ink);
}

.exam-tests-hero__link--muted:hover {
  border-color: var(--prelims-accent);
  color: var(--prelims-accent-deep);
}

.exam-tests-section {
  margin-bottom: 2rem;
}

.exam-tests-section__title {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: var(--prelims-heading-size);
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
}

.exam-tests-catalog-grid {
  align-items: start;
  display: grid;
  gap: 1.35rem 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .exam-tests-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.exam-tests-catalog {
  margin-bottom: 0;
  min-width: 0;
}

.exam-tests-catalog__head {
  border-bottom: 1px solid rgba(216, 223, 235, 0.95);
  margin-bottom: 0.5rem;
  padding-bottom: 0.45rem;
}

.exam-tests-catalog__title {
  border-bottom: none;
  color: var(--prelims-ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  padding-bottom: 0;
}

.exam-tests-catalog__below {
  display: flex;
  justify-content: flex-start;
}

.exam-tests-catalog__below--after-list {
  box-sizing: border-box;
  display: flex;
  margin-bottom: 0;
  margin-top: 0.75rem;
  width: 100%;
}

.exam-tests-catalog__below--after-list .exam-tests-catalog__all {
  align-items: center;
  background: #fff;
  border: 2px solid var(--prelims-ink);
  border-radius: var(--prelims-card-radius);
  box-shadow: 0 4px 18px rgba(23, 32, 51, 0.08);
  box-sizing: border-box;
  color: var(--prelims-ink);
  display: flex;
  font-size: 0.9rem;
  font-weight: 600;
  gap: 0.45rem;
  justify-content: center;
  line-height: 1.2;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.exam-tests-catalog__below--after-list .exam-tests-catalog__all:hover {
  background: var(--prelims-ink);
  border-color: var(--prelims-ink);
  box-shadow: 0 8px 28px rgba(23, 32, 51, 0.18);
  color: #fff;
  transform: translateY(-1px);
}

.exam-tests-catalog__below--after-list .exam-tests-catalog__all:active {
  transform: translateY(0);
}

.exam-tests-catalog__below--after-list .exam-tests-catalog__all-count {
  background: rgba(23, 32, 51, 0.1);
  color: var(--prelims-ink);
}

.exam-tests-catalog__below--after-list .exam-tests-catalog__all:hover .exam-tests-catalog__all-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.exam-tests-catalog .exam-tests-section--nested:last-of-type {
  margin-bottom: 0;
}

.exam-tests-catalog__all-count {
  align-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 1.5rem;
  padding: 0.12rem 0.45rem;
  text-align: center;
}

.exam-tests-catalog__empty {
  color: var(--prelims-muted);
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
}

.exam-tests-back {
  margin-bottom: 0.75rem;
}

.exam-tests-back__link {
  color: var(--prelims-accent-deep);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.exam-tests-back__link:hover {
  color: var(--prelims-accent);
  text-decoration: underline;
}

.exam-tests-back__chev {
  margin-right: 0.2rem;
}

.exam-tests-hero--compact {
  margin-bottom: 1.25rem;
  padding: 1rem 1.2rem;
}

.exam-tests-title--catalog {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
}

.exam-tests-empty__link {
  color: var(--prelims-accent-deep);
  display: inline-block;
  font-weight: 600;
  margin-top: 0.75rem;
  text-decoration: none;
}

.exam-tests-empty__link:hover {
  color: var(--prelims-accent);
  text-decoration: underline;
}

.exam-tests-section--nested {
  margin-bottom: 1.35rem;
}

.exam-tests-section--nested:last-child {
  margin-bottom: 0;
}

.exam-tests-section__title--sub {
  color: var(--prelims-muted);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.exam-tests-list {
  display: grid;
  gap: 0.85rem;
}

.exam-tests-pagination {
  margin-bottom: 0.25rem;
  margin-top: 2rem;
}

.exam-tests-pagination--attempts-history {
  margin-top: 1.35rem;
}

.exam-test-card {
  align-items: stretch;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-left: 3px solid var(--prelims-accent);
  border-radius: var(--prelims-card-radius);
  box-shadow: 0 12px 36px rgba(27, 39, 60, 0.07);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem 1.15rem 1rem 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.exam-test-card:hover {
  border-color: rgba(15, 108, 189, 0.28);
  box-shadow: 0 16px 44px rgba(27, 39, 60, 0.09);
}

.exam-test-card__body {
  flex: 1 1 auto;
  min-width: 0;
}

.exam-test-card__title {
  color: var(--prelims-ink);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin: 0 0 0.55rem;
}

.exam-test-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.exam-test-card__chip {
  background: rgba(15, 108, 189, 0.07);
  border-radius: 999px;
  color: var(--prelims-muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.28rem 0.55rem;
  white-space: nowrap;
}

.exam-test-card__chip--accent {
  background: rgba(199, 138, 44, 0.14);
  color: #8a5a12;
}

.exam-test-card__score {
  border-top: 1px solid rgba(216, 223, 235, 0.85);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: baseline;
  margin: 0.7rem 0 0;
  padding-top: 0.65rem;
}

.exam-test-card__score-label {
  color: var(--prelims-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exam-test-card__score-value {
  color: var(--prelims-ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.exam-test-card__action {
  align-self: center;
  flex: 0 0 auto;
}

.exam-test-card__cta {
  align-items: center;
  border-radius: 999px;
  border-style: solid;
  border-width: 1px;
  display: inline-flex;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  justify-content: center;
  line-height: 1.2;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.exam-test-card__cta:active {
  transform: translateY(0);
}

/* Continue — brand blue */
.exam-test-card__cta--continue {
  background: var(--prelims-accent);
  border-color: transparent;
  color: #fff;
}

.exam-test-card__cta--continue:hover {
  background: var(--prelims-accent-deep);
  color: #fff;
  transform: translateY(-1px);
}

/* View result — teal */
.exam-test-card__cta--result {
  background: #0d6b63;
  border-color: transparent;
  color: #fff;
}

.exam-test-card__cta--result:hover {
  background: #09564f;
  color: #fff;
  transform: translateY(-1px);
}

/* Reattempt — warm amber */
.exam-test-card__cta--reattempt {
  background: #b8771a;
  border-color: rgba(0, 0, 0, 0.12);
  color: #fff;
}

.exam-test-card__cta--reattempt:hover {
  background: #9a6314;
  color: #fff;
  transform: translateY(-1px);
}

/* View test — slate */
.exam-test-card__cta--view {
  background: #3d4f63;
  border-color: transparent;
  color: #fff;
}

.exam-test-card__cta--view:hover {
  background: #2c3b4a;
  color: #fff;
  transform: translateY(-1px);
}

.exam-test-card__cta-chevron {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.92;
}

.exam-test-card__actions-stack {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 7.5rem;
}

.exam-test-card__cta--ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--prelims-muted);
  min-height: 2.35rem;
}

.exam-test-card__cta--ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--prelims-ink);
  transform: none;
}

.exam-test-card__pending-result {
  color: var(--prelims-muted);
  font-size: 0.84rem;
  font-style: italic;
  margin: 0.55rem 0 0;
}

.exam-tests-empty {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: var(--prelims-card-radius);
  box-shadow: 0 18px 50px rgba(27, 39, 60, 0.06);
  color: var(--prelims-muted);
  padding: 2rem 1.5rem;
  text-align: center;
}

.exam-tests-empty p {
  margin: 0;
}

/* Exam test show (/exam/tests/:id) */
.exam-test-show-breadcrumb {
  align-items: baseline;
  color: var(--prelims-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.88rem;
  gap: 0.35rem 0.5rem;
  margin-bottom: 1rem;
}

.exam-test-show-breadcrumb__sep {
  color: var(--prelims-line);
  user-select: none;
}

.exam-test-show-breadcrumb__link {
  color: var(--prelims-accent-deep);
  font-weight: 600;
  text-decoration: none;
}

.exam-test-show-breadcrumb__link:hover {
  color: var(--prelims-accent);
  text-decoration: underline;
}

.exam-test-show-breadcrumb__current {
  color: var(--prelims-ink);
  font-weight: 600;
  max-width: 100%;
  min-width: 0;
}

.exam-test-show-hero {
  align-items: start;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-left: 3px solid var(--prelims-accent);
  border-radius: calc(var(--prelims-card-radius) + 6px);
  box-shadow: 0 18px 50px rgba(27, 39, 60, 0.06);
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
  margin-bottom: 1.35rem;
  padding: 1.35rem 1.4rem;
}

.exam-test-show-hero__title {
  color: var(--prelims-ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.55rem, 3.5vw, 2.15rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.exam-test-show-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.exam-test-show-chips li {
  background: rgba(15, 108, 189, 0.07);
  border-radius: 999px;
  color: var(--prelims-muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.28rem 0.55rem;
}

.exam-test-show-window {
  color: var(--prelims-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0.85rem 0 0;
  max-width: 58ch;
}

.exam-test-show-stat {
  background: linear-gradient(180deg, rgba(15, 108, 189, 0.08) 0%, rgba(199, 138, 44, 0.1) 100%);
  border: 1px solid rgba(216, 223, 235, 0.9);
  border-radius: 18px;
  padding: 1.1rem 1.15rem;
}

.exam-test-show-stat__label {
  color: var(--prelims-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

.exam-test-show-stat__value {
  color: var(--prelims-ink);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.35rem;
}

.exam-test-show-stat__meta {
  color: var(--prelims-muted);
  font-size: 0.85rem;
  margin: 0;
}

.exam-test-show-panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: var(--prelims-card-radius);
  box-shadow: 0 12px 40px rgba(27, 39, 60, 0.05);
  margin-bottom: 1.35rem;
  padding: 1.15rem 1.25rem;
}

.exam-test-show-panel__title {
  color: var(--prelims-ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.exam-test-show-panel__body {
  color: var(--prelims-ink);
  font-size: 0.98rem;
  line-height: 1.65;
}

.exam-test-show-panel__body p {
  margin: 0 0 0.75rem;
}

.exam-test-show-panel__body p:last-child {
  margin-bottom: 0;
}

.exam-test-show-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exam-test-show-actions__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.exam-test-show-cta {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 600;
  gap: 0.4rem;
  justify-content: center;
  line-height: 1.2;
  min-height: 2.75rem;
  padding: 0.6rem 1.15rem;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.exam-test-show-cta--primary {
  background: var(--prelims-accent);
  border: 1px solid transparent;
  color: #fff;
}

.exam-test-show-cta--primary:hover {
  background: var(--prelims-accent-deep);
  color: #fff;
  transform: translateY(-1px);
}

.exam-test-show-cta--secondary {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(216, 223, 235, 0.95);
  color: var(--prelims-ink);
}

.exam-test-show-cta--secondary:hover {
  border-color: var(--prelims-accent);
  color: var(--prelims-accent-deep);
}

.exam-test-show-cta--ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--prelims-muted);
}

.exam-test-show-cta--ghost:hover {
  color: var(--prelims-accent-deep);
}

.exam-test-show-cta__chev {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.95;
}

.exam-test-show-hint {
  color: var(--prelims-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
  max-width: 52ch;
}

.exam-test-show-flag {
  background: rgba(199, 138, 44, 0.12);
  border: 1px solid rgba(199, 138, 44, 0.35);
  border-radius: var(--prelims-card-radius);
  color: #6b4a10;
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 0.85rem 1rem;
}

/* Exam attempt report (/exam/attempts/:id/report) */
.exam-attempt-report__hero {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
  justify-content: space-between;
  margin-bottom: 1.35rem;
}

.exam-attempt-report__hero-main {
  flex: 1 1 240px;
  min-width: 0;
}

.exam-attempt-report__score-card {
  background: linear-gradient(145deg, rgba(15, 108, 189, 0.1), rgba(27, 39, 60, 0.05));
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: var(--prelims-card-radius);
  flex-shrink: 0;
  min-width: 10rem;
  padding: 1rem 1.15rem;
}

.exam-attempt-report__score-label {
  color: var(--prelims-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

.exam-attempt-report__score-value {
  color: var(--prelims-ink);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

.exam-attempt-report__score-max {
  color: var(--prelims-muted);
  font-size: 1.05rem;
  font-weight: 600;
}

.exam-attempt-report__score-meta {
  color: var(--prelims-accent-deep);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0.35rem 0 0;
}

.exam-attempt-report__score-rank {
  color: var(--prelims-ink);
  font-size: 0.88rem;
  line-height: 1.4;
  margin: 0.65rem 0 0;
}

.exam-attempt-report__score-rank-hint {
  color: var(--prelims-muted);
  font-size: 0.78rem;
  line-height: 1.4;
  margin: 0.25rem 0 0;
}

.exam-attempt-report__metric-note {
  border-top: 1px dashed rgba(216, 223, 235, 0.9);
  color: var(--prelims-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0.55rem 0 0;
  padding-top: 0.5rem;
}

.exam-attempt-report__metric-note code {
  background: rgba(15, 24, 40, 0.06);
  border-radius: 4px;
  font-size: 0.74rem;
  padding: 0.05rem 0.3rem;
}

.exam-attempt-report__metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  margin-bottom: 1.5rem;
}

.exam-attempt-report__metric {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: var(--prelims-card-radius);
  padding: 0.85rem 1rem;
}

.exam-attempt-report__metric-label {
  color: var(--prelims-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 0.4rem;
  text-transform: uppercase;
}

.exam-attempt-report__metric-value {
  color: var(--prelims-ink);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
}

.exam-attempt-report__metric-hint {
  color: var(--prelims-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0.35rem 0 0;
}

.exam-attempt-report__section {
  margin-bottom: 1.35rem;
}

.exam-attempt-report__section-lead {
  color: var(--prelims-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 1rem;
  max-width: 52rem;
}

.exam-attempt-report__section-lead--tight {
  margin-bottom: 0.65rem;
}

.exam-attempt-report__table--leaderboard {
  min-width: 28rem;
}

.exam-attempt-report__leaderboard-tr--you {
  background: rgba(15, 108, 189, 0.09);
  box-shadow: inset 3px 0 0 #0f6cbd;
}

.exam-attempt-report__leaderboard-tr--you td {
  font-weight: 600;
}

.exam-attempt-report__th-you,
.exam-attempt-report__td-you {
  text-align: center;
  white-space: nowrap;
  width: 3.5rem;
}

.exam-attempt-report__td-you {
  color: #0b4f8a;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Attempt report — time distribution chart (SVG) */
.report-time-chart {
  margin-bottom: 1rem;
}

.report-time-chart__toolbar {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.report-time-chart__hint {
  color: var(--prelims-muted);
  flex: 1 1 12rem;
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0;
  max-width: 36rem;
}

.report-time-chart__fullscreen {
  background: rgba(15, 108, 189, 0.1);
  border: 1px solid rgba(15, 108, 189, 0.35);
  border-radius: 6px;
  color: #0b4f8a;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
}

.report-time-chart__fullscreen:hover {
  background: rgba(15, 108, 189, 0.16);
}

.report-time-chart__scroll {
  -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-radius: var(--prelims-card-radius);
  box-shadow: 0 8px 28px rgba(27, 39, 60, 0.04);
  margin-bottom: 0.85rem;
  overflow: auto;
  padding: 0.5rem 0.35rem 0.15rem;
}

.report-time-chart__scroll:fullscreen {
  align-items: flex-start;
  background: #fff;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  justify-content: flex-start;
  overflow: auto;
  padding: 1rem 1rem 1.5rem;
}

.report-time-chart__scroll:fullscreen .report-time-chart__svg {
  flex-shrink: 0;
  margin: 0;
  max-height: none;
}

/* IE / legacy fullscreen alias */
.report-time-chart__scroll:-webkit-full-screen {
  overflow: auto;
}

.report-time-chart__svg {
  display: block;
  height: auto;
  margin: 0;
  max-height: none;
  max-width: none;
  min-width: 0;
  vertical-align: top;
  width: auto;
}

.report-time-chart__grid {
  stroke: rgba(15, 24, 40, 0.07);
  stroke-width: 1;
}

.report-time-chart__axis-text {
  fill: var(--prelims-muted);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 9px;
}

.report-time-chart__x-label {
  fill: #64748b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 8px;
}

.report-time-chart__x-title {
  fill: var(--prelims-muted);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 10px;
  font-weight: 600;
}

.report-time-bar--tracked.report-time-bar--correct {
  fill: #15803d;
}

.report-time-bar--tracked.report-time-bar--wrong {
  fill: #b91c1c;
}

.report-time-bar--tracked.report-time-bar--skipped {
  fill: #475569;
}

.report-time-bar--untracked.report-time-bar--correct {
  fill: rgba(21, 128, 61, 0.15);
  stroke: #15803d;
  stroke-width: 0.85;
}

.report-time-bar--untracked.report-time-bar--wrong {
  fill: rgba(185, 28, 28, 0.15);
  stroke: #b91c1c;
  stroke-width: 0.85;
}

.report-time-bar--untracked.report-time-bar--skipped {
  fill: rgba(71, 85, 105, 0.15);
  stroke: #475569;
  stroke-width: 0.85;
}

.report-time-chart__line {
  pointer-events: none;
}

.report-time-chart__mark-dot {
  fill: #b45309;
  stroke: #fff;
  stroke-width: 0.45;
}

.report-time-chart__legend {
  color: var(--prelims-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 0.65rem 1.1rem;
  line-height: 1.35;
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
}

.report-time-chart__legend-line {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

.report-time-legend-swatch {
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
  height: 0.65rem;
  margin-right: 0.3rem;
  vertical-align: middle;
  width: 0.65rem;
}

.report-time-legend-swatch--correct {
  background: #15803d;
}

.report-time-legend-swatch--wrong {
  background: #b91c1c;
}

.report-time-legend-swatch--skipped {
  background: #475569;
}

.report-time-legend-swatch--untracked {
  background: rgba(71, 85, 105, 0.15);
  border: 1px solid #475569;
}

.report-time-legend-line {
  background: linear-gradient(90deg, rgba(51, 65, 85, 0.35), rgba(51, 65, 85, 0.9));
  border-radius: 1px;
  display: inline-block;
  height: 3px;
  margin-right: 0.35rem;
  width: 1.4rem;
}

.report-time-chart__insights {
  background: rgba(15, 108, 189, 0.06);
  border: 1px solid rgba(15, 108, 189, 0.18);
  border-radius: var(--prelims-card-radius);
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.report-time-chart__insights-title {
  color: var(--prelims-ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

.report-time-chart__insights-list {
  color: var(--prelims-ink);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
  padding-left: 1.1rem;
}

.report-time-chart__insights-list li {
  margin-bottom: 0.35rem;
}

.report-time-chart__insights-list li:last-child {
  margin-bottom: 0;
}

.exam-attempt-report__table-wrap {
  border-radius: var(--prelims-card-radius);
  box-shadow: 0 12px 36px rgba(27, 39, 60, 0.05);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.exam-attempt-report__table {
  background: rgba(255, 255, 255, 0.95);
  border-collapse: collapse;
  border: 1px solid rgba(216, 223, 235, 0.95);
  font-size: 0.88rem;
  min-width: 36rem;
  width: 100%;
}

.exam-attempt-report__table th,
.exam-attempt-report__table td {
  border-bottom: 1px solid rgba(216, 223, 235, 0.75);
  padding: 0.55rem 0.65rem;
  text-align: left;
}

.exam-attempt-report__table thead th {
  background: rgba(15, 108, 189, 0.07);
  color: var(--prelims-ink);
  font-weight: 700;
  white-space: nowrap;
}

.exam-attempt-report__table tbody th {
  font-weight: 600;
  max-width: 14rem;
}

.exam-attempt-report__th-num,
.exam-attempt-report__td-num {
  text-align: right;
  white-space: nowrap;
}

.exam-attempt-report__table-footnote {
  color: var(--prelims-muted);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0.45rem 0 0;
}

@media (max-width: 767px) {
  .exam-attempt-report__metrics {
    grid-template-columns: 1fr;
  }

  .exam-attempt-report__score-card {
    width: 100%;
  }
}

/* Exam attempts history (/exam/attempts) */
.exam-attempts-history-block {
  margin-bottom: 1.5rem;
}

.exam-attempts-history-heading {
  color: var(--prelims-ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem;
}

.exam-attempts-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.exam-attempts-history-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(216, 223, 235, 0.95);
  border-left: 3px solid var(--prelims-accent);
  border-radius: var(--prelims-card-radius);
  box-shadow: 0 12px 36px rgba(27, 39, 60, 0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.85rem 0.85rem;
}

.exam-attempts-history-row__main {
  flex: 1 1 200px;
  min-width: 0;
}

.exam-attempts-history-row__title {
  color: var(--prelims-ink);
  display: block;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.exam-attempts-history-row__meta {
  align-items: baseline;
  color: var(--prelims-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.86rem;
  gap: 0 0.25rem;
  line-height: 1.4;
}

.exam-attempts-history-row__meta-primary,
.exam-attempts-history-row__meta-secondary {
  min-width: 0;
}

.exam-attempts-history-row__cta {
  align-items: center;
  align-self: center;
  background: var(--prelims-accent);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 600;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.9rem;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.exam-attempts-history-row__cta:hover {
  background: var(--prelims-accent-deep);
  color: #fff;
  transform: translateY(-1px);
}

.exam-attempts-history-row__actions {
  align-items: center;
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.exam-attempts-history-row__cta--report {
  background: #fff;
  border: 1px solid rgba(15, 108, 189, 0.55);
  color: var(--prelims-accent-deep);
}

.exam-attempts-history-row__cta--report:hover {
  background: rgba(15, 108, 189, 0.08);
  color: var(--prelims-accent-deep);
  transform: translateY(-1px);
}

.exam-attempts-history-row__cta--review {
  background: #0d6b63;
}

.exam-attempts-history-row__cta--review:hover {
  background: #09564f;
  color: #fff;
}

.exam-test-show-actions--attempts-index {
  margin-top: 1.75rem;
}

.exam-attempts-history-row__pending {
  align-self: center;
  color: var(--prelims-muted);
  font-size: 0.84rem;
  font-style: italic;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .exam-tests-shell {
    min-height: 0;
    padding: 0.65rem 0 1.75rem;
  }

  .exam-tests-back {
    margin-bottom: 0.5rem;
  }

  .exam-tests-hero--compact .exam-tests-kicker {
    font-size: 0.68rem;
    margin-bottom: 0.35rem;
  }

  .exam-tests-hero--compact .exam-tests-title,
  .exam-tests-hero--compact .exam-tests-title--catalog {
    font-size: 1.35rem;
    letter-spacing: -0.03em;
    line-height: 1.12;
    margin-bottom: 0.4rem;
  }

  .exam-tests-hero--compact .exam-tests-lead {
    font-size: 0.88rem;
    line-height: 1.5;
    max-width: none;
  }

  .exam-tests-hero {
    border-radius: 16px;
    flex-direction: column;
    padding: 1rem 1.05rem;
  }

  .exam-tests-hero.exam-tests-hero--compact {
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.85rem;
  }

  .exam-tests-hero__links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  .exam-tests-hero__link {
    flex: 1 1 auto;
    min-width: min(100%, 140px);
    padding: 0.65rem 0.85rem;
  }

  .exam-tests-catalog-grid {
    gap: 1.5rem;
  }

  .exam-tests-catalog__below--after-list {
    margin-top: 0.85rem;
  }

  .exam-tests-catalog__below--after-list .exam-tests-catalog__all {
    border-radius: 12px;
    min-height: 3rem;
  }

  .exam-tests-catalog__title {
    font-size: 1.28rem;
  }

  .exam-tests-list {
    gap: 1rem;
  }

  .exam-test-card {
    flex-direction: column;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 1rem 1rem 1rem 0.85rem;
  }

  .exam-test-card__title {
    font-size: 1.02rem;
  }

  .exam-test-card__chips {
    gap: 0.3rem;
  }

  .exam-test-card__chip {
    font-size: 0.74rem;
    white-space: normal;
  }

  .exam-test-card__action {
    align-self: stretch;
    width: 100%;
  }

  .exam-test-card__actions-stack {
    min-width: 0;
    width: 100%;
  }

  .exam-test-card__cta {
    border-radius: 12px;
    min-height: 3rem;
    width: 100%;
  }

  .exam-test-card__score {
    flex-direction: column;
    gap: 0.15rem;
  }

  .exam-test-show-hero {
    border-radius: 16px;
    grid-template-columns: 1fr;
    padding: 1rem 1.05rem 1rem 0.95rem;
  }

  .exam-test-show-stat {
    max-width: none;
  }

  .exam-test-show-breadcrumb__current {
    flex: 1 1 100%;
  }

  .exam-test-show-actions__row {
    flex-direction: column;
  }

  .exam-test-show-cta {
    border-radius: 12px;
    min-height: 3rem;
    width: 100%;
  }

  .exam-test-show-cta--ghost {
    order: 3;
  }

  .exam-attempts-history-block {
    margin-bottom: 1.15rem;
  }

  .exam-attempts-history-heading {
    font-size: 0.98rem;
    margin-bottom: 0.45rem;
  }

  .exam-attempts-history-list {
    gap: 0.45rem;
  }

  .exam-attempts-history-row {
    align-items: stretch;
    border-radius: 14px;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.75rem 0.8rem 0.75rem 0.72rem;
  }

  .exam-attempts-history-row__main {
    flex: 1 1 auto;
  }

  .exam-attempts-history-row__title {
    font-size: 0.95rem;
    hyphens: auto;
    line-height: 1.32;
    margin-bottom: 0.15rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .exam-attempts-history-row__meta {
    align-items: flex-start;
    flex-direction: column;
    font-size: 0.8rem;
    gap: 0.12rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .exam-attempts-history-row__meta-sep {
    display: none;
  }

  .exam-attempts-history-row__cta {
    border-radius: 12px;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0.5rem 1rem;
    text-align: center;
    width: 100%;
  }

  .exam-attempts-history-row__actions {
    align-self: stretch;
    flex-direction: column;
    width: 100%;
  }

  .exam-attempts-history-row__pending {
    font-size: 0.8rem;
    line-height: 1.35;
    padding: 0.35rem 0;
    text-align: center;
    white-space: normal;
  }

  .exam-tests-empty {
    padding: 1.25rem 1rem;
  }
}
