/* ==========================================================================
   Scoriko Component & Layout Styles — 100% Token-Driven (tokens.css)
   Zero hardcoded brand hex colors: every component inherits --brand-*,
   --bg-*, --surface, --border*, --text*, --status-*, and --font-* tokens.
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
  background: var(--bg-canvas);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  margin: 0;
  letter-spacing: var(--tracking-tight);
  line-height: 1.18;
  color: var(--text);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: var(--font-sans);
}

button {
  cursor: pointer;
}

:is(button, a, input, select, [tabindex]):focus-visible {
  outline: 2.5px solid var(--brand-accent-soft);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.app-main {
  flex: 1;
  padding-bottom: 72px;
}

/* ==========================================================================
   Buttons, Pills & Inputs
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform 0.14s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.btn-sm {
  padding: 7px 14px;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--brand-primary);
  color: var(--brand-contrast);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-primary) 26%, transparent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-primary-hover);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary) 30%, transparent);
}

.btn-soft {
  background: var(--brand-tint);
  color: var(--brand-ink);
  border-color: var(--brand-border);
}

.btn-soft:hover:not(:disabled) {
  background: var(--brand-soft);
  border-color: var(--brand-accent);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--brand-accent);
  color: var(--brand-primary);
  background: var(--brand-tint);
}

.btn-dark {
  background: var(--brand-primary);
  color: var(--brand-contrast);
}

.btn-dark:hover:not(:disabled) {
  background: var(--brand-primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text);
}

.btn-danger-outline {
  background: var(--surface);
  color: var(--status-danger);
  border-color: var(--status-danger-border);
}

.btn-danger-outline:hover:not(:disabled) {
  background: var(--status-danger-tint);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.pill-brand {
  background: var(--brand-primary);
  color: var(--brand-contrast);
}

.pill-brand-soft {
  background: var(--brand-tint);
  color: var(--brand-ink);
  border: 1px solid var(--brand-border);
}

.pill-accent {
  background: var(--brand-accent);
  color: var(--brand-contrast);
}

.pill-steel-soft {
  background: var(--tone-steel-bg);
  color: var(--tone-steel-ink);
  border: 1px solid var(--tone-steel-border);
}

.pill-sky-soft {
  background: var(--tone-sky-bg);
  color: var(--tone-sky-ink);
  border: 1px solid var(--tone-sky-border);
}

.pill-success-soft {
  background: var(--status-success-tint);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}

.pill-warning {
  background: var(--status-warning);
  color: var(--status-warning-contrast);
}

.pill-warning-soft {
  background: var(--status-warning-tint);
  color: var(--status-warning-ink);
  border: 1px solid var(--status-warning-border);
}

.pill-neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.pill-danger-soft {
  background: var(--status-danger-tint);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

.input {
  width: 100%;
  padding: 11px 14px;
  font-size: var(--text-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.input::placeholder {
  color: var(--text-muted);
}

/* ==========================================================================
   Top Navigation Bars
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.brand-wordmark {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.32rem;
  letter-spacing: -0.04em;
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.nav-link {
  padding: 8px 12px;
  border-radius: var(--radius-full);
  font-size: 0.87rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.nav-link.active {
  background: var(--brand-primary);
  color: var(--brand-contrast);
}

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

.track-switcher-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.track-switcher-pill:hover {
  border-color: var(--brand-accent);
  background: var(--brand-tint);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: var(--brand-contrast);
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Onboarding Step Indicator */
.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.step-bar-track {
  width: 190px;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.step-bar-fill {
  height: 100%;
  width: 50%;
  background: var(--brand-primary);
  border-radius: var(--radius-full);
}

/* Exam Cockpit HUD Navbar */
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.hud-divider {
  width: 1px;
  height: 22px;
  background: var(--border-strong);
}

.hud-paper-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

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

.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.hud-mark-pos {
  color: var(--status-success);
}

.hud-mark-neg {
  color: var(--status-danger);
}

.hud-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: var(--radius-full);
  background: var(--status-warning);
  color: var(--status-warning-contrast);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.84rem;
}

.hud-timer.low-time {
  background: var(--status-danger);
  color: var(--status-danger-contrast);
}

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

/* ==========================================================================
   Screen 1 — Multi-Product Landing & Login
   ========================================================================== */

.landing-section {
  padding: 44px 0 60px;
  background:
    radial-gradient(circle at 10% 15%, color-mix(in srgb, var(--brand-accent) 9%, transparent), transparent 48%),
    radial-gradient(circle at 90% 85%, color-mix(in srgb, var(--brand-primary) 7%, transparent), transparent 46%),
    var(--bg);
  min-height: calc(100vh - 128px);
  display: flex;
  align-items: center;
}

.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(340px, 0.86fr);
  gap: 48px;
  align-items: center;
}

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--brand-ink);
  margin-bottom: 16px;
}

.landing-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: var(--tracking-display);
  line-height: 1.09;
  margin-bottom: 16px;
}

.landing-subtitle {
  font-size: var(--text-md);
  color: var(--text-secondary);
  max-width: 550px;
  line-height: 1.62;
  margin-bottom: 26px;
}

.pillar-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pillar-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 17px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

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

.pillar-card.pillar-brand {
  background: var(--brand-tint);
  border-color: var(--brand-border);
}

.pillar-card.pillar-steel {
  background: var(--tone-steel-bg);
  border-color: var(--tone-steel-border);
}

.pillar-card.pillar-sky {
  background: var(--tone-sky-bg);
  border-color: var(--tone-sky-border);
}

.pillar-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.pillar-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  margin-bottom: 2px;
}

.pillar-desc {
  font-size: 0.87rem;
  color: var(--text-secondary);
}

/* Login Card */
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 30px;
  box-shadow: var(--shadow-md);
}

.login-header {
  text-align: center;
  margin-bottom: 22px;
}

.login-title {
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.google-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.google-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-xs);
}

.divider-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.divider-line::before,
.divider-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.login-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Screen 2 — Post-Login Track Selection (Interactive Bento Grid)
   ========================================================================== */

.tracks-section {
  padding: 36px 0 116px;
}

.tracks-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 30px;
}

.tracks-title {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.tracks-subtitle {
  font-size: 0.98rem;
  color: var(--text-secondary);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
}

.track-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 24px 24px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1.5px solid var(--border);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
  box-shadow: var(--shadow-xs);
}

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

.track-card.selected {
  border: 2px solid var(--brand-primary);
  background: var(--brand-tint);
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--brand-primary) 26%, transparent);
}

.track-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.track-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.track-card.selected .track-icon-box {
  background: var(--surface);
  border-color: var(--brand-border);
}

.track-icon-box.icon-steel {
  background: var(--tone-steel-bg);
  border-color: var(--tone-steel-border);
}

.track-icon-box.icon-sky {
  background: var(--tone-sky-bg);
  border-color: var(--tone-sky-border);
}

.track-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.track-check {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: var(--brand-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.track-card-desc {
  font-size: 0.91rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.exam-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.exam-mini-chip {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Sticky Bottom Confirmation Bar */
.sticky-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-top);
}

.sticky-action-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sticky-summary {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.sticky-summary strong {
  color: var(--text);
}

/* ==========================================================================
   Screen 3 — Kerala PSC Previous Year Papers Hub
   ========================================================================== */

.page-header-band {
  background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg-canvas) 100%);
  border-bottom: 1px solid var(--border);
  padding: 26px 0 24px;
  margin-bottom: 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  min-width: 0;
}

.breadcrumb button,
.breadcrumb a,
.breadcrumb-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-size: inherit;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
}

.breadcrumb button:hover,
.breadcrumb a:hover,
.breadcrumb-link:hover {
  color: var(--brand-accent);
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}

.hub-title {
  font-size: clamp(1.65rem, 2.8vw, 2.1rem);
  font-weight: 800;
  margin-bottom: 7px;
}

.hub-subtitle {
  font-size: 0.94rem;
  color: var(--text-secondary);
  max-width: 600px;
}

.kpi-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 17px;
  min-width: 108px;
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.kpi-value {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--brand-primary);
  line-height: 1.2;
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

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

.filter-pill {
  padding: 8px 15px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--brand-accent);
  color: var(--text);
}

.filter-pill.active {
  background: var(--brand-primary);
  color: var(--brand-contrast);
  border-color: var(--brand-primary);
}

.search-wrap {
  position: relative;
  min-width: 240px;
  flex: 0 1 280px;
}

.search-wrap .input {
  padding-left: 36px;
  border-radius: var(--radius-full);
  padding-top: 9px;
  padding-bottom: 9px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.exam-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.exam-track-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.exam-track-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-border);
  box-shadow: var(--shadow-sm);
}

.exam-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

.exam-card-meta {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 10px;
}

.progress-block {
  margin-top: 4px;
}

.progress-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  transition: width 0.25s ease;
}

.progress-caption {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==========================================================================
   Screen 4 — Year-wise Question Paper Selector
   ========================================================================== */

.summary-accent-strip {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-end;
}

.accent-bar-line {
  width: 280px;
  height: 5px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-primary) 48%, var(--brand-accent) 48%, var(--brand-accent) 78%, var(--border) 78%, var(--border) 100%);
}

.summary-accent-text {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.paper-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.paper-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.paper-row-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-sm);
}

.paper-row-card.featured {
  border-color: var(--brand-accent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--brand-primary) 10%, transparent);
}

.paper-row-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.year-badge {
  min-width: 76px;
  height: 52px;
  border-radius: 11px;
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-weight: 800;
  font-size: 1.18rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--brand-border);
}

.paper-info {
  min-width: 0;
}

.paper-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.32;
}

.paper-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.paper-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ==========================================================================
   Screen 5 — Live Exam Cockpit
   ========================================================================== */

.cockpit-wrapper {
  padding: 24px 0 48px;
}

.cockpit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  align-items: start;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}

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

.review-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.review-toggle-btn.marked {
  background: var(--status-warning-tint);
  border-color: var(--status-warning);
  color: var(--status-warning-ink);
}

.toggle-switch {
  width: 32px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  position: relative;
  transition: background-color 0.15s ease;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface-elevated);
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease;
}

.review-toggle-btn.marked .toggle-switch {
  background: var(--status-warning);
}

.review-toggle-btn.marked .toggle-switch::after {
  transform: translateX(14px);
}

@keyframes swipeInNext {
  from { opacity: 0.7; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes swipeInPrev {
  from { opacity: 0.7; transform: translateX(-22px); }
  to { opacity: 1; transform: translateX(0); }
}

.question-card.swipe-next {
  animation: swipeInNext 0.18s ease-out;
}

.question-card.swipe-prev {
  animation: swipeInPrev 0.18s ease-out;
}

.question-stem {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 20px;
}

.question-stem-wrap {
  margin-bottom: 20px;
}

.stem-head-tight {
  margin-bottom: 12px;
}

.stem-structured-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.stem-list-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-ink);
  letter-spacing: 0.01em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.stem-list-row {
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.48;
  color: var(--text);
}

.stem-list-row.has-marker {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.stem-marker {
  font-weight: 700;
  color: var(--brand-ink);
  flex-shrink: 0;
}

.stem-marker-text {
  flex: 1;
  min-width: 0;
}

.stem-match-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
  padding: 2px 0;
}

.stem-match-row.is-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.stem-match-col {
  min-width: 0;
  overflow-wrap: break-word;
}

.stem-tail-prompt {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
}

.stem-preline {
  white-space: pre-line;
}

.question-cancelled-banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--status-warning-tint);
  border: 1px solid var(--status-warning-border);
  color: var(--status-warning-ink);
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.options-stack {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 22px;
}

.option-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.option-row:hover {
  border-color: var(--brand-accent);
  background: var(--bg-subtle);
}

.option-row.selected {
  border: 2px solid var(--brand-primary);
  background: var(--brand-tint);
}

.option-row.correct-reveal {
  border: 2px solid var(--status-success);
  background: var(--status-success-tint);
}

.option-row.wrong-reveal {
  border: 2px solid var(--status-danger);
  background: var(--status-danger-tint);
}

.option-row-left {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.option-badge {
  width: 31px;
  height: 31px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.option-row.selected .option-badge {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-contrast);
}

.option-row.correct-reveal .option-badge {
  background: var(--status-success);
  border-color: var(--status-success);
  color: var(--status-success-contrast);
}

.option-row.wrong-reveal .option-badge {
  background: var(--status-danger);
  border-color: var(--status-danger);
  color: var(--status-danger-contrast);
}

.option-text {
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

.option-status-icon {
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.option-status-icon.brand { color: var(--brand-primary); }
.option-status-icon.ok { color: var(--status-success); }
.option-status-icon.bad { color: var(--status-danger); }

.practice-feedback {
  padding: 13px 16px;
  border-radius: 12px;
  border-left: 4px solid var(--status-success);
  background: var(--status-success-tint);
  margin-bottom: 20px;
  font-size: 0.89rem;
}

.practice-feedback.wrong {
  border-left-color: var(--status-danger);
  background: var(--status-danger-tint);
}

.question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.question-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Right Sticky Question Palette */
.palette-card {
  position: sticky;
  top: 86px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.palette-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.palette-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.palette-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-brand { background: var(--brand-accent); }
.dot-warning { background: var(--status-warning); }
.dot-muted { background: var(--border-strong); }
.dot-danger { background: var(--status-danger); }

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 332px;
  overflow-y: auto;
  padding: 2px 2px 4px;
  margin-bottom: 14px;
}

.palette-btn {
  height: 38px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.palette-btn:hover {
  border-color: var(--brand-accent);
}

.palette-btn.answered {
  background: var(--brand-tint);
  color: var(--brand-ink);
  border-color: var(--brand-border);
}

.palette-btn.marked {
  background: var(--status-warning);
  color: var(--status-warning-contrast);
}

.palette-btn.current {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-contrast);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.palette-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.kbd-hint {
  margin-top: 10px;
  font-size: 0.73rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Screen 6 — Results, Score Breakdown & Rank Leaderboard
   ========================================================================== */

.results-section {
  padding-top: 26px;
  padding-bottom: 60px;
}

.results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.results-kicker {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.results-title {
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 800;
}

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

.metrics-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  position: relative;
}

.metric-card.metric-brand {
  background: var(--brand-tint);
  border-color: var(--brand-border);
}

.metric-card.metric-warning {
  background: var(--status-warning-tint);
  border-color: var(--status-warning-border);
}

.metric-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 7px;
  letter-spacing: -0.02em;
}

.metric-value-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.metric-foot {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.metric-trophy {
  position: absolute;
  top: 13px;
  right: 14px;
  color: var(--status-warning);
  display: flex;
}

.results-split,
.results-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.96fr);
  gap: 18px;
  align-items: start;
}

.analytics-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.panel-sub {
  font-size: 0.81rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.breakdown-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 114px;
  gap: 16px;
  align-items: center;
}

.segmented-bar {
  display: flex;
  height: 18px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg-subtle);
  gap: 2px;
  margin-bottom: 14px;
}

.seg-correct { background: var(--brand-accent); }
.seg-wrong { background: var(--status-danger); }
.seg-skipped { background: var(--border-strong); }

.breakdown-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.8rem;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-top: 4px;
  flex-shrink: 0;
}

.legend-val {
  font-weight: 700;
  color: var(--text);
}

.legend-val.pos { color: var(--brand-primary); }
.legend-val.neg { color: var(--status-danger); }

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Subject-wise Accuracy Bars */
.subject-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subject-row {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

.subject-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-pct {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
}

/* Leaderboard Table */
.lb-table {
  width: 100%;
  border-collapse: collapse;
}

.lb-table th {
  text-align: left;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 8px 10px;
  border-bottom: 1px solid var(--border);
}

.lb-table td {
  padding: 11px 8px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}

.lb-table tr:last-child td {
  border-bottom: none;
}

.lb-num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.medal-1 { color: var(--medal-gold); }
.medal-2 { color: var(--medal-silver); }
.medal-3 { color: var(--medal-bronze); }

.lb-user-pin {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--brand-tint);
  border: 1.5px solid var(--brand-primary);
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 70px 64px 50px;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--brand-ink);
}

.lb-footnote {
  margin-top: 12px;
  text-align: center;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Review Answers List */
.review-section {
  margin-top: 24px;
}

.review-card-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 17px 19px;
  min-width: 0;
  overflow-x: clip;
}

.review-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.review-q-stem {
  font-weight: 600;
  font-size: 0.96rem;
  margin-bottom: 12px;
  line-height: 1.48;
}

.review-opts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.review-opt-box {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-opt-box.is-correct {
  background: var(--status-success-tint);
  border-color: var(--status-success);
  font-weight: 600;
}

.review-opt-box.is-wrong {
  background: var(--status-danger-tint);
  border-color: var(--status-danger);
  font-weight: 600;
}

/* ==========================================================================
   Companion Modules
   ========================================================================== */

.companion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.kids-game-card {
  background: var(--surface);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.kids-prompt {
  font-size: 1.9rem;
  font-weight: 800;
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--brand-tint);
  color: var(--brand-ink);
  margin: 14px 0 18px;
}

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

.kids-choice-btn {
  padding: 15px;
  font-size: 1.18rem;
  font-weight: 700;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: all 0.14s ease;
}

.kids-choice-btn:hover {
  border-color: var(--brand-accent);
  background: var(--brand-tint);
}

/* ==========================================================================
   Modals, Footer & Mobile-First Components
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--scrim);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-size: 1.24rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.modal-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.modal-stat {
  padding: 11px 10px;
  border-radius: 11px;
  background: var(--bg-subtle);
  text-align: center;
}

.modal-stat-num {
  font-size: 1.22rem;
  font-weight: 800;
}

.modal-stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.feedback-form-group {
  margin-bottom: 12px;
}

.feedback-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.feedback-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-sm);
}

.feedback-input:focus {
  outline: 2px solid var(--brand-border);
  border-color: var(--brand-primary);
}

.feedback-textarea {
  resize: vertical;
  min-height: 76px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.wip-coming-soon-card {
  max-width: 560px;
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-style: solid;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.wip-coming-soon-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-soft, #ECF8FF);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.wip-coming-soon-title {
  margin: 0;
  font-size: 1.35rem;
}

.wip-coming-soon-desc {
  max-width: 440px;
  margin: 0 auto 8px;
}

.wip-coming-soon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}

.mobile-bottom-nav,
.mobile-exam-dock {
  display: none;
}

.sheet-backdrop {
  align-items: flex-end;
  padding: 0;
}

.bottom-sheet {
  max-width: 560px;
  border-radius: 22px 22px 0 0;
  padding: 14px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  margin: 0 auto 14px;
}

.palette-grid-sheet {
  max-height: 48vh;
  grid-template-columns: repeat(5, 1fr);
}

.palette-grid-sheet .palette-btn {
  height: 44px;
  min-height: 44px;
}

.bottom-sheet .btn-sm {
  min-height: 44px;
}

/* ==========================================================================
   Responsive Breakpoints (Mobile-First Polish + Tablet + Desktop)
   ========================================================================== */

@media (max-width: 1024px) {
  .landing-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .exam-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cockpit-grid {
    grid-template-columns: 1fr;
  }
  .palette-card {
    display: none;
  }
  .cockpit-wrapper {
    padding: 12px 0 calc(116px + env(safe-area-inset-bottom, 0px));
  }
  .question-footer {
    display: none;
  }
  .mobile-exam-dock {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1.25fr;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 65;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-top);
  }
  .mobile-exam-dock .btn {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 0.88rem;
  }
  .metrics-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .results-split,
  .results-analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    overflow-x: clip;
  }
  .container {
    padding: 0 16px;
  }
  .app-main {
    padding-bottom: 36px;
  }
  body.has-mobile-bottom-nav .app-main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  body.has-mobile-bottom-nav .site-footer {
    display: none;
  }

  /* Native-App Mobile Bottom Navigation Bar */
  .mobile-bottom-nav:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 20px rgba(11, 25, 44, 0.07);
  }

  .mobile-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    min-height: 48px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 11px;
    transition: background-color 0.14s ease, color 0.14s ease;
  }

  .mobile-tab-btn.active {
    color: var(--brand-primary);
    background: var(--brand-tint);
  }

  .mobile-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-tab-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  /* Compact Mobile Top Navbars */
  .nav-inner {
    min-height: 56px;
    gap: 8px;
  }
  .brand-wordmark {
    font-size: 1.2rem;
  }
  .nav-links {
    display: none;
  }
  .nav-actions {
    gap: 6px;
  }
  .track-switcher-pill {
    padding: 6px 10px;
    font-size: 0.76rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .navbar .btn-sm {
    min-height: 44px;
    padding: 8px 12px;
  }
  .user-pill {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 2px;
    border: none;
    background: transparent;
  }
  .user-pill > span:not(.avatar-circle) {
    display: none;
  }
  .link-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .breadcrumb button {
    min-height: 44px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
  }

  /* Onboarding 2-Row Compact Header */
  .onboarding-nav {
    flex-wrap: wrap;
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .onboarding-nav .step-indicator {
    order: 3;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-top: 6px;
    border-top: 1px solid var(--border);
  }
  .onboarding-nav .step-bar-track {
    width: 110px;
  }

  /* Screen 1 Landing Mobile */
  .landing-section {
    padding: 18px 0 36px;
    min-height: auto;
  }
  .landing-grid {
    gap: 20px;
  }
  .landing-title {
    font-size: 2rem;
    margin-bottom: 10px;
  }
  .landing-subtitle {
    font-size: 0.92rem;
    margin-bottom: 16px;
  }
  .pillar-card {
    padding: 12px 14px;
    gap: 12px;
  }
  .pillar-icon {
    width: 38px;
    height: 38px;
  }
  .login-card {
    padding: 22px 18px;
    border-radius: var(--radius-md);
  }
  .login-title {
    font-size: 1.4rem;
  }
  .google-btn,
  .input,
  .btn-lg {
    min-height: 46px;
  }

  /* Screen 2 Track Selection Mobile */
  .tracks-section {
    padding: 20px 0 148px;
  }
  .tracks-header {
    margin-bottom: 18px;
  }
  .tracks-title {
    font-size: 1.55rem;
  }
  .tracks-subtitle {
    font-size: 0.9rem;
  }
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .track-card {
    padding: 18px 16px;
    border-radius: var(--radius-md);
  }
  .track-card-title {
    font-size: 1.12rem;
  }
  .track-icon-box {
    width: 44px;
    height: 44px;
  }
  .sticky-action-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .sticky-summary {
    font-size: 0.82rem;
    text-align: center;
  }
  .sticky-action-inner .btn {
    width: 100%;
    min-height: 48px;
  }

  /* Screen 3 & 4 Mobile */
  .page-header-band {
    padding: 16px 0;
    margin-bottom: 16px;
  }
  .hub-header-row {
    gap: 12px;
  }
  .hub-title {
    font-size: 1.48rem;
  }
  .hub-subtitle {
    font-size: 0.88rem;
  }
  .kpi-strip {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .kpi-box {
    min-width: 0;
    padding: 10px 6px;
  }
  .kpi-value {
    font-size: 1.06rem;
  }
  .kpi-label {
    font-size: 0.7rem;
  }
  .summary-accent-strip {
    align-items: flex-start;
    width: 100%;
  }
  .accent-bar-line {
    width: 100%;
  }
  .toolbar-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }
  .filter-pills {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .filter-pills::-webkit-scrollbar {
    display: none;
  }
  .filter-pill {
    flex-shrink: 0;
    min-height: 44px;
    padding: 8px 14px;
    font-size: 0.82rem;
  }
  .search-wrap {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .exam-cards-grid,
  .companion-grid,
  .review-opts-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .exam-track-card {
    padding: 17px 15px;
  }
  .exam-track-card .btn {
    min-height: 44px;
  }
  .paper-row-card {
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    padding: 15px;
  }
  .paper-row-left {
    align-items: flex-start;
    gap: 12px;
  }
  .year-badge {
    min-width: 58px;
    height: 44px;
    font-size: 1.02rem;
  }
  .paper-title {
    font-size: 0.96rem;
  }
  .paper-meta-line {
    font-size: 0.78rem;
    gap: 6px;
  }
  .paper-row-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .paper-row-actions .btn {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    font-size: 0.85rem;
  }

  /* Screen 5 Exam Cockpit — Ultra-Clean 2-Row Mobile HUD */
  .hud-bar {
    gap: 7px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
  .hud-left {
    gap: 8px;
    flex: 1;
    min-width: 0;
  }
  .hud-left .brand-lockup {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
  .hud-left .brand-wordmark,
  .hud-divider {
    display: none;
  }
  .hud-paper-title {
    font-size: 0.78rem;
    line-height: 1.25;
    max-width: none;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .hud-center {
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    gap: 6px;
    flex-wrap: nowrap;
  }
  .hud-chip {
    padding: 4px 9px;
    font-size: 0.74rem;
  }
  .hud-timer {
    padding: 4px 9px;
    font-size: 0.75rem;
  }
  .hud-right {
    gap: 6px;
  }
  .hud-right .btn-sm {
    min-height: 44px;
    padding: 8px 11px;
    font-size: 0.8rem;
  }
  .cockpit-wrapper {
    padding: 0 0 calc(108px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }
  .question-card {
    padding: 16px 16px 24px;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    touch-action: pan-y;
  }
  .question-card-top {
    margin-bottom: 13px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .question-card-top .pill {
    max-width: 100%;
  }
  .review-toggle-btn {
    min-height: 44px;
    padding: 6px 12px;
    font-size: 0.78rem;
    gap: 7px;
    flex-shrink: 0;
  }
  .question-stem {
    font-size: 1.04rem;
    line-height: 1.48;
    margin-bottom: 16px;
  }
  .options-stack {
    gap: 9px;
    margin-bottom: 10px;
  }
  .option-row {
    padding: 12px 13px;
    min-height: 52px;
    gap: 10px;
  }
  .option-text {
    font-size: 0.92rem;
  }
  .swipe-hint-mobile {
    margin-top: 12px;
    text-align: center;
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 500;
  }

  /* Screen 6 Results & Rank Leaderboard Mobile */
  .results-section {
    padding-top: 16px;
    padding-bottom: 36px;
  }
  .results-header {
    gap: 12px;
    margin-bottom: 16px;
  }
  .results-title {
    font-size: 1.32rem;
  }
  .results-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }
  .results-actions .btn-mode-learn-solid {
    grid-column: 1 / -1;
    order: -1;
    min-height: 46px;
  }
  .results-actions .btn-ghost {
    grid-column: 1 / -1;
  }
  .results-actions .btn {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    font-size: 0.84rem;
  }
  .metrics-grid-4 {
    gap: 10px;
    margin-bottom: 14px;
  }
  .metric-card {
    padding: 13px 10px;
  }
  .metric-value {
    font-size: 1.42rem;
  }
  .metric-value-sub {
    font-size: 0.9rem;
  }
  .metric-foot {
    font-size: 0.73rem;
  }
  .panel-card {
    padding: 16px;
  }
  .breakdown-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .breakdown-layout > :first-child {
    width: 100%;
  }
  .breakdown-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .legend-item {
    font-size: 0.73rem;
  }
  .subject-row {
    grid-template-columns: 1fr auto;
    row-gap: 5px;
    column-gap: 10px;
  }
  .subject-row .progress-track {
    grid-column: 1 / -1;
    order: 3;
    margin-bottom: 0;
  }
  .lb-table th:last-child,
  .lb-table td:last-child {
    display: none;
  }
  .lb-table th,
  .lb-table td {
    padding: 9px 5px;
    font-size: 0.81rem;
  }
  .lb-user-pin {
    grid-template-columns: 66px minmax(0, 1fr) 56px 50px;
    padding: 11px 10px;
    font-size: 0.81rem;
  }
  .lb-user-pin > :last-child {
    display: none;
  }
  .modal-card {
    padding: 20px 18px;
  }
  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .modal-actions .btn {
    width: 100%;
    min-height: 44px;
  }
}

/* ============================================================================
   PYQ Intelligence Strip, Cutoff Sparkline, Syllabus Drawer & Cutoff Simulator
   ============================================================================ */
.track-intel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.cutoff-trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.trend-label {
  font-weight: 600;
  color: var(--text);
}

.trend-range {
  font-size: 0.78rem;
  color: var(--brand-primary);
  font-weight: 600;
}

.sparkline-svg {
  display: block;
}

.btn-sm {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 0.84rem;
}

.btn-xs {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 0.78rem;
}

.cutoff-inline-tag {
  font-weight: 600;
  color: var(--brand-primary);
}

.paper-intel-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.dna-mini-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.dna-mini-bar {
  display: flex;
  width: 64px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.dna-seg {
  display: block;
  height: 100%;
}

.dna-caption {
  font-size: 0.76rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intel-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.intel-chip-yield {
  background: var(--brand-tint);
  border-color: var(--brand-border);
  color: var(--brand-primary);
}

.cutoff-disclaimer {
  margin-top: 12px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  opacity: 0.85;
}

/* Syllabus & Pattern Drift Modal */
.modal-card-wide {
  max-width: 640px;
  width: min(94vw, 640px);
  max-height: 86vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-accent);
  margin-bottom: 4px;
}

.drift-callout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  margin-bottom: 16px;
}

.drift-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-primary);
}

.drift-text {
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.45;
}

.syllabus-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.syllabus-row {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.syllabus-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.syllabus-mod-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.syllabus-mod-topics {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.syllabus-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.syllabus-pct {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand-primary);
}

/* Would You Have Cleared? Simulator */
.cutoff-sim-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.cutoff-sim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.cutoff-sim-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.cutoff-sim-verdict {
  font-size: 0.8rem;
  font-weight: 600;
}

.cutoff-sim-verdict.pos {
  color: var(--status-success);
}

.cutoff-sim-verdict.warn {
  color: var(--status-warning);
}

.cutoff-sim-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: visible;
}

.cutoff-sim-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
}

.cutoff-sim-marker {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--status-warning);
  transform: translateX(-50%);
}

@media (max-width: 640px) {
  .syllabus-row-top {
    flex-direction: column;
    gap: 8px;
  }
  .syllabus-row-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Interactive Cutoff Trend Modal */
.cutoff-trend-btn {
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cutoff-trend-btn:hover {
  border-color: var(--brand-accent);
  background: var(--brand-tint);
}

.trend-chevron {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.cutoff-chart-wrap {
  padding: 12px 10px 6px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.cutoff-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-axis-text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-secondary);
}

.chart-axis-text.active {
  fill: var(--brand-primary);
  font-weight: 700;
}

.chart-val-text {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  fill: var(--brand-primary);
}

.cutoff-selected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  margin-bottom: 12px;
}

.cutoff-selected-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.cutoff-selected-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin: 2px 0;
}

.cutoff-selected-mark {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.cutoff-table-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.cutoff-table-row {
  display: grid;
  grid-template-columns: 46px 104px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
}

.cutoff-table-row.active {
  border-color: var(--brand-accent);
  background: var(--brand-tint);
}

.cutoff-row-yr {
  font-weight: 700;
  color: var(--brand-primary);
}

.cutoff-row-qp {
  color: var(--text-secondary);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cutoff-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cutoff-row-val {
  text-align: right;
  font-weight: 700;
  color: var(--brand-primary);
}

@media (max-width: 640px) {
  .cutoff-selected-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .cutoff-selected-card .btn {
    width: 100%;
  }
  .cutoff-table-row {
    grid-template-columns: 42px 86px minmax(0, 1fr) 48px;
    gap: 6px;
    padding: 7px 8px;
  }
}

/* ==========================================================================
   PWA Full-Page Install Prompt, Status Banners & Standalone Polish
   ========================================================================== */
html.pwa-standalone {
  overscroll-behavior-y: none;
}

.pwa-nav-install-btn {
  border-color: var(--brand-border);
  color: var(--brand-ink);
  background: var(--brand-tint);
  font-weight: 600;
}

.pwa-nav-install-btn:hover {
  border-color: var(--brand-accent);
  background: var(--brand-soft);
}

@media (min-width: 961px) {
  .pwa-nav-install-btn {
    display: none;
  }
}

.pwa-install-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(7, 16, 29, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  animation: pwaFadeIn 0.2s ease-out;
}

.pwa-install-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--surface-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 26px 26px;
  box-shadow: 0 24px 64px rgba(7, 16, 29, 0.28);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: pwaSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-install-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pwa-install-close:hover {
  background: var(--border);
  color: var(--text);
}

.pwa-install-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.pwa-install-app-icon {
  display: inline-flex;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(12, 74, 110, 0.24);
  margin-bottom: 4px;
}

.pwa-install-title {
  margin: 0;
  font-size: 1.48rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.pwa-install-subtitle {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 38ch;
}

.pwa-benefit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.pwa-benefit-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-tint);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pwa-benefit-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pwa-benefit-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.pwa-benefit-desc {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.pwa-ios-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
}

.pwa-ios-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--brand-ink);
}

.pwa-ios-step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand-primary);
  color: var(--brand-contrast);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pwa-ios-step-icon {
  flex-shrink: 0;
  display: inline-flex;
  color: var(--brand-primary);
}

.pwa-install-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}

.pwa-install-primary {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.pwa-install-dismiss {
  width: 100%;
  min-height: 44px;
}

.pwa-install-footnote {
  margin: 0;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.pwa-status-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1100;
  max-width: calc(100vw - 24px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(7, 16, 29, 0.22);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
}

body.has-mobile-bottom-nav .pwa-status-banner {
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.pwa-status-offline {
  background: var(--status-warning-tint);
  border-color: var(--status-warning-border);
  color: var(--status-warning-ink);
}

.pwa-status-update {
  background: var(--surface-elevated);
  border-color: var(--brand-border);
  color: var(--text);
}

.pwa-status-toast {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-contrast);
}

@keyframes pwaFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pwaSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .pwa-install-overlay {
    padding: 0;
    align-items: stretch;
    background: var(--surface);
  }
  .pwa-install-card {
    max-width: none;
    min-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    justify-content: space-between;
    padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .pwa-install-close {
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 16px;
  }
  .pwa-install-title {
    font-size: 1.42rem;
  }
}

.practice-explanation {
  white-space: pre-line;
  margin-top: 6px;
  line-height: 1.55;
}
.review-explanation {
  white-space: pre-line;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-alt, #f8fafc);
  border-left: 3px solid var(--brand, #0284c7);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted, #475569);
}


/* Decoupled Status Bar & Neutral Readable Explanation Card */
.practice-feedback-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.practice-status-bar {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.practice-status-bar.is-ok {
  background: var(--status-success-tint);
  color: #065f46;
  border-left: 4px solid var(--status-success);
}

.practice-status-bar.is-wrong {
  background: var(--status-danger-tint);
  color: #991b1b;
  border-left: 4px solid var(--status-danger);
}

.practice-explanation-card,
.review-explanation-card {
  background: transparent;
  border: none;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  padding: 18px 0 4px;
  margin-top: 14px;
  color: #0f172a;
}

.review-explanation-card {
  margin-top: 16px;
}

.expl-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.expl-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-primary, #0284c7);
}

.expl-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.97rem;
  line-height: 1.8;
  color: #1e293b;
}

.expl-para {
  margin: 0;
}

.expl-step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.expl-step-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
  margin-top: 2px;
}

.expl-step-text {
  flex: 1;
  color: #1e293b;
}

.expl-bullet {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-left: 10px;
}

.expl-bullet-dot {
  color: var(--brand-primary, #0284c7);
  font-weight: 700;
}

.expl-bullet-text {
  flex: 1;
}

.expl-note {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.84rem;
  line-height: 1.5;
}

/* Line-by-Line Alternating Math Operations & Key Facts Panel */
.expl-ops {
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.expl-op-row {
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.expl-op-row:nth-child(even) {
  background: #f1f5f9;
}

.expl-op-row:last-child {
  border-bottom: none;
}

.expl-op-row.is-result {
  background: #ecfdf5;
  border-top: 1px solid #a7f3d0;
}

.expl-op-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.expl-op-row.is-result .expl-op-label {
  color: #047857;
}

.expl-op-content {
  font-size: 0.94rem;
  line-height: 1.55;
  color: #0f172a;
  overflow-x: auto;
}

.expl-op-content .katex-display {
  margin: 4px 0 2px;
  text-align: left;
  overflow-x: auto;
  overflow-y: hidden;
}

.expl-op-content .katex {
  font-size: 1.02em;
}

.expl-facts-box {
  margin-top: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.expl-facts-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0369a1;
  margin-bottom: 7px;
}

.expl-facts-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #334155;
}

.expl-fact-item strong {
  color: #0f172a;
}

/* Strict Mobile Containment for KaTeX Display Equations */
.question-card,
.practice-feedback-wrap,
.practice-explanation-card,
.review-explanation-card,
.expl-ops,
.expl-op-row {
  min-width: 0;
  max-width: 100%;
}

.expl-op-content {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.expl-op-content .katex-display,
.practice-explanation-card .katex-display,
.review-explanation-card .katex-display,
.scert-unit-card .katex-display {
  margin: 4px 0 2px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  font-size: 0.94em;
  -webkit-overflow-scrolling: touch;
}

.practice-explanation-card .expl-body,
.practice-explanation-card .expl-para,
.review-explanation-card .expl-body,
.review-explanation-card .expl-para {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* ==========================================================================
   Analytics Explanation Feedback Bar & Footer Privacy Opt-Out Toggle
   ========================================================================== */
.expl-feedback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle, rgba(15, 23, 42, 0.12));
  font-size: 0.8125rem;
  color: var(--text-muted, #64748b);
}

.expl-feedback-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.expl-feedback-btn {
  appearance: none;
  border: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.14));
  background: transparent;
  color: var(--text-secondary, #334155);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.expl-feedback-btn:hover {
  background: var(--surface-subtle, rgba(14, 165, 233, 0.08));
}

.expl-feedback-btn.active {
  background: var(--brand-soft, rgba(14, 165, 233, 0.14));
  border-color: var(--brand-primary, #0284c7);
  color: var(--brand-primary, #0284c7);
}

.footer-meta-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-analytics-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.16));
  color: var(--text-muted, #64748b);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}

.footer-analytics-toggle:hover {
  color: var(--text-primary, #0f172a);
}

/* Reusable SVG Concept Diagrams & Compare Tables */
.expl-diagram-card {
  margin: 10px 0 6px;
  padding: 10px 10px 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.expl-diagram-card svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.expl-diagram-caption {
  margin-top: 6px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
}

.expl-table-wrap {
  margin: 2px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
}

.expl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.55;
}

.expl-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f1f5f9;
  color: #0c4a6e;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.expl-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: top;
}

.expl-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.expl-table tr:last-child td {
  border-bottom: none;
}

@media (max-width: 640px) {
  .expl-table {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .expl-table th,
  .expl-table td {
    padding: 8px 8px;
    white-space: normal;
    overflow-wrap: break-word;
  }
}

/* Bilingual Language Toggle & Controls */
.question-card-meta-left,
.question-card-controls-right,
.review-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}

.lang-segmented {
  display: inline-flex;
  align-items: center;
  background: var(--surface-alt, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.lang-seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.lang-seg-btn.active {
  background: var(--surface, #ffffff);
  color: var(--text, #0f172a);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.lang-seg-btn:not(.active):hover {
  color: var(--text, #0f172a);
}

.lang-fallback-pill {
  font-size: 11px;
  opacity: 0.75;
}

/* Reading & Malayalam Font Settings Modal */
.settings-modal-card {
  max-width: 520px;
}

.settings-section {
  margin-top: 14px;
}

.settings-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.settings-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.settings-hint {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  margin: 2px 0 8px;
}

.ml-font-grid {
  display: grid;
  gap: 8px;
}

.ml-font-card {
  width: 100%;
  text-align: left;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.ml-font-card:hover {
  border-color: var(--brand, #0f766e);
}

.ml-font-card.active {
  background: var(--surface, #ffffff);
  border-color: var(--brand, #0f766e);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.14);
}

.ml-font-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.ml-font-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.ml-font-active-badge {
  font-size: 10.5px;
  padding: 2px 7px;
}

.ml-font-preview {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text, #0f172a);
  margin: 2px 0 4px;
}

.ml-font-tagline {
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.ml-font-anek {
  font-family: 'Anek Malayalam', sans-serif;
}

.ml-font-manjari {
  font-family: 'Manjari', sans-serif;
}

.ml-font-noto-sans {
  font-family: 'Noto Sans Malayalam', sans-serif;
}

.ml-font-noto-serif {
  font-family: 'Noto Serif Malayalam', serif;
}



/* ==========================================================================
   Daily Current Affairs — Hub Banner, Scrollable Calendar Strip & Quiz Cards
   ========================================================================== */
.ca-hub-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-tint) 0%, var(--surface) 75%);
  border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-xs);
}

.ca-hub-banner-main {
  min-width: 0;
  flex: 1;
}

.ca-hub-banner-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--brand-ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.ca-hub-banner-title {
  margin: 0 0 4px;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
  letter-spacing: var(--tracking-tight);
}

.ca-hub-banner-sub {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.45;
}

.ca-hub-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ca-page-container {
  padding-top: 14px;
  padding-bottom: 48px;
}

.ca-calendar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}

.ca-calendar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ca-calendar-month {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.ca-calendar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.btn-xs {
  padding: 4px 9px;
  font-size: var(--text-xs);
  border-radius: var(--radius-xs);
}

.ca-date-input {
  height: 27px;
  padding: 0 7px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  max-width: 122px;
}

.ca-strip-shell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ca-strip-arrow {
  flex-shrink: 0;
  width: 28px;
  height: 48px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ca-strip-arrow:hover {
  background: var(--brand-tint);
  color: var(--brand-ink);
  border-color: var(--brand-border);
}

.ca-date-strip {
  display: flex;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 2px 1px;
  flex: 1;
  scrollbar-width: none;
}

.ca-date-strip::-webkit-scrollbar {
  display: none;
}

.ca-date-pill {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ca-date-pill:hover {
  border-color: var(--brand-border);
  background: var(--brand-tint);
  transform: translateY(-1px);
}

.ca-date-pill.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-contrast);
  box-shadow: var(--shadow-xs);
}

.ca-date-tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.1;
}

.ca-date-pill.active .ca-date-tag {
  color: var(--brand-contrast);
  opacity: 0.9;
}

.ca-date-num-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ca-date-num {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}

.ca-date-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-accent);
  flex-shrink: 0;
}

.ca-date-pill.completed .ca-date-dot {
  background: var(--status-success);
}

.ca-date-pill.active .ca-date-dot {
  background: var(--brand-contrast);
}

.ca-body-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ca-digest-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ca-digest-meta {
  flex: 1;
  min-width: 240px;
}

.ca-digest-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ca-digest-title {
  margin: 0 0 6px;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
  letter-spacing: var(--tracking-tight);
}

.ca-digest-summary {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

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

.ca-progress-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ca-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.ca-category-pills {
  margin-bottom: 2px;
}

.ca-questions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ca-question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ca-q-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ca-q-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ca-q-source {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.ca-options-list {
  gap: 8px;
}

.option-row.ca-opt-correct {
  border-color: var(--status-success-border);
  background: var(--status-success-tint);
  color: var(--text);
}

.option-row.ca-opt-correct .option-badge {
  background: var(--status-success);
  color: var(--status-success-contrast);
  border-color: var(--status-success);
}

.option-row.ca-opt-wrong {
  border-color: var(--status-danger-border);
  background: var(--status-danger-tint);
  color: var(--text);
}

.option-row.ca-opt-wrong .option-badge {
  background: var(--status-danger);
  color: var(--status-danger-contrast);
  border-color: var(--status-danger);
}

.pill-success-soft {
  background: var(--status-success-tint);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}

.pill-danger-soft {
  background: var(--status-danger-tint);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

@media (max-width: 640px) {
  .ca-page-header-band {
    padding: 14px 0 12px;
  }

  .ca-page-header-band .hub-subtitle {
    display: none;
  }

  .ca-hub-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .ca-hub-banner-actions {
    width: 100%;
  }

  .ca-hub-banner-actions .btn {
    flex: 1;
  }

  .ca-strip-arrow {
    display: none;
  }

  .ca-date-input {
    max-width: 106px;
    padding: 0 5px;
    font-size: 11px;
  }

  .ca-date-pill {
    min-width: 52px;
    padding: 6px 7px;
  }

  .ca-question-card {
    padding: 16px;
  }
}

/* ============================================================================
   Study Hub Revamp, Illustrated Exams/Subjects, Topic Explorer, SCERT &
   Minimal Question Screen Icon Controls (Clean Precision)
   ============================================================================ */
a.brand-lockup,
a.nav-link,
a.mobile-tab-btn,
a.btn,
a.ca-date-pill,
a.ca-hub-banner-title-link,
a.study-illus-card,
a.study-tile-brand,
a.study-tile-surface,
a.study-perf-card,
a.study-list-row,
a.study-book-card,
a.study-search-hit,
a.study-sec-link,
a.crumb-link,
a.nav-icon-btn {
  text-decoration: none;
}

.nav-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: transparent;
  appearance: none;
  cursor: pointer;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-icon-btn:hover,
.nav-icon-btn.active {
  background: var(--bg-subtle);
  color: var(--text);
}

.nav-notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-warning);
  border: 1.5px solid var(--surface);
}

/* Minimal Icon-Only Question Navigation Controls */
.q-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.12s ease;
}

.q-icon-btn:hover:not(:disabled) {
  border-color: var(--brand-accent);
  background: var(--brand-tint);
  color: var(--brand-primary);
}

.q-icon-btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-contrast);
}

.q-icon-btn-primary:hover:not(:disabled) {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  color: var(--brand-contrast);
}

.q-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.q-footer-counter {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.mobile-exam-dock {
  justify-content: space-between;
  align-items: center;
}

/* Compact Daily CA Calendar Strip */
.ca-calendar-card {
  padding: 10px 14px;
  margin-bottom: 14px;
}

.ca-calendar-top {
  margin-bottom: 8px;
}

.ca-date-pill {
  min-width: 68px;
  padding: 6px 10px;
}

.ca-hub-banner-title-link {
  color: inherit;
  display: block;
}

.ca-hub-banner-title-link:hover .ca-hub-banner-title {
  color: var(--brand-primary);
}

/* Study Hub Home Header & Global Search */
.study-home-header {
  padding: 20px 0 18px;
}

.study-home-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.study-home-intro {
  flex: 1 1 320px;
  min-width: 0;
}

.study-search-shell {
  position: relative;
  width: 380px;
  max-width: 100%;
  flex: 0 1 380px;
}

.study-search-wrap {
  width: 100%;
}

.study-search-input {
  width: 100%;
}

.study-search-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: grid;
  gap: 2px;
}

.study-search-drop[hidden] {
  display: none;
}

.study-search-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-xs);
  color: var(--text);
}

.study-search-hit:hover {
  background: var(--bg-subtle);
}

.study-search-hit-title {
  font-size: 0.84rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-search-empty {
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.study-home-body {
  padding-top: 18px;
  padding-bottom: 42px;
}

.study-ca-banner {
  margin-bottom: 22px;
}

.study-home-2col {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr);
  gap: 26px;
  align-items: start;
}

.study-home-main,
.study-home-aside {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.study-home-aside {
  gap: 16px;
}

.study-section {
  min-width: 0;
}

.study-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.study-sec-head-sp {
  margin-top: 24px;
}

.study-sec-title {
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.study-sec-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-accent);
  white-space: nowrap;
}

.study-sec-link:hover {
  color: var(--brand-primary);
}

/* Illustrated Exam & Subject Cards (Illustration + Title ONLY) */
.study-illus-rail-or-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 769px) {
  .study-illus-rail-or-grid > :nth-child(n + 9) {
    display: none;
  }
}

.study-illus-grid-all {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.study-illus-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.study-illus-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-border);
  box-shadow: var(--shadow-sm);
}

.study-illus-art {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  overflow: hidden;
  flex-shrink: 0;
}

.study-illus-art-sm {
  width: 56px;
  height: 56px;
}

.study-illus-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.study-illus-name {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

/* Action Cards (SCERT / Mock Tests / PYQs / Notes) */
.study-quick-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.study-action-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.study-action-mb {
  margin-bottom: 22px;
}

.study-tile-brand,
.study-tile-surface {
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.study-tile-brand {
  background: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  color: var(--brand-contrast);
}

.study-tile-brand:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
}

.study-tile-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.study-tile-surface:hover,
.study-tile-surface.active {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-sm);
}

.study-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--brand-accent-soft);
}

.study-kicker.accent {
  color: var(--brand-accent);
}

.study-kicker.success {
  color: var(--status-success);
}

.study-tile-h {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.study-tile-sub {
  font-size: 0.78rem;
  margin-top: 3px;
  opacity: 0.88;
}

.study-tile-sub.muted {
  color: var(--text-secondary);
  opacity: 1;
}

/* Performance Sparkline Card */
.study-perf-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.study-perf-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-sm);
}

.study-perf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.study-perf-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text);
}

.study-perf-grid {
  display: grid;
  gap: 12px;
}

.study-sparkline-svg {
  display: block;
}

.study-perf-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.study-perf-kpi {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}

.study-perf-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand-primary);
}

.study-perf-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Clean Vertical Grouped Lists (Topics, Subtopics, Chapters, Notifications) */
.study-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.study-list-card-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.study-list-row {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.study-list-row:last-child {
  border-bottom: none;
}

.study-list-row:hover {
  background: var(--bg-subtle);
}

.study-list-row-text {
  min-width: 0;
  flex: 1;
}

.study-list-row-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.study-list-row-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Subject Page, Breadcrumb, SCERT Textbooks & Notes */
.study-page-pad {
  padding-top: 20px;
  padding-bottom: 42px;
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.crumb-link {
  color: var(--text-secondary);
  font-weight: 600;
}

.crumb-link:hover {
  color: var(--brand-primary);
}

.crumb-sep {
  opacity: 0.55;
}

.crumb-current {
  color: var(--text);
  font-weight: 700;
}

.study-subj-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.study-notes-card {
  margin-top: 16px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 15px 17px;
}

.study-notes-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--brand-ink);
  margin: 0 0 6px;
}

.study-notes-body {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

.study-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-ink);
}

.study-filter-row {
  margin-bottom: 16px;
}

.study-books-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.study-book-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.study-book-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-sm);
}

.study-book-spine {
  width: 50px;
  height: 64px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--brand-primary), var(--brand-accent));
  color: var(--brand-contrast);
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 4px solid rgba(255, 255, 255, 0.35);
}

.study-book-kicker {
  font-size: 0.6rem;
  font-weight: 700;
  opacity: 0.86;
}

.study-book-std {
  font-size: 0.76rem;
  font-weight: 800;
}

.study-book-cover {
  position: relative;
  width: 64px;
  height: 86px;
  border-radius: 5px 8px 8px 5px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid rgba(12, 74, 110, 0.14);
  box-shadow:
    -2px 0 0 rgba(12, 74, 110, 0.2),
    0 4px 10px rgba(15, 23, 42, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.study-book-cover::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(0, 0, 0, 0.18) 45%,
    rgba(255, 255, 255, 0.16) 75%,
    transparent 100%
  );
  z-index: 2;
  pointer-events: none;
}

.study-book-card:hover .study-book-cover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    -2px 0 0 rgba(12, 74, 110, 0.26),
    0 8px 16px rgba(12, 74, 110, 0.2);
}

.study-book-cover.hero {
  width: 82px;
  height: 110px;
  border-radius: 6px 10px 10px 6px;
  box-shadow:
    -3px 0 0 rgba(12, 74, 110, 0.22),
    0 8px 18px rgba(15, 23, 42, 0.18);
}

.study-book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.study-book-cover-badge {
  position: absolute;
  top: 5px;
  left: 7px;
  z-index: 3;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
  background: rgba(12, 74, 110, 0.88);
  backdrop-filter: blur(4px);
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1.25;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.study-book-cover.hero .study-book-cover-badge {
  top: 7px;
  left: 9px;
  font-size: 0.62rem;
  padding: 2px 7px;
}

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

.study-book-title {
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

.study-book-ml {
  font-size: 0.77rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.35;
}

.study-book-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.study-notifs-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 780px;
}

.study-notif-card {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.study-notif-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  max-width: 780px;
}

.study-notif-filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.study-notif-filter-btn:hover {
  border-color: var(--brand-border);
  color: var(--text);
}

.study-notif-filter-btn.is-active {
  background: var(--brand-tint);
  border-color: var(--brand-border);
  color: var(--brand-ink);
  font-weight: 700;
}

.study-notif-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.study-notif-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.study-notif-cat {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.study-notif-content .exam-card-title {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.study-notif-content .exam-card-meta {
  margin: 0;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.study-notif-title-link {
  color: inherit;
  text-decoration: none;
}

.study-notif-title-link:hover {
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.study-notif-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.study-notif-actions .btn {
  flex: 1 1 180px;
}

@media (max-width: 960px) {
  .study-home-2col {
    grid-template-columns: 1fr;
  }

  .study-illus-grid-all {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .study-home-header {
    padding: 14px 0 12px;
  }

  .study-home-intro {
    display: none;
  }

  .study-search-shell {
    width: 100%;
    flex: 1 1 100%;
  }

  .study-illus-rail-or-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .study-illus-rail-or-grid::-webkit-scrollbar {
    display: none;
  }

  .study-illus-rail-or-grid .study-illus-card {
    flex: 0 0 108px;
    padding: 12px 8px;
  }

  .study-illus-art {
    width: 60px;
    height: 60px;
  }

  .study-illus-grid-all {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-action-3,
  .study-books-grid {
    grid-template-columns: 1fr;
  }

  .study-perf-grid {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
  }
}

.study-chapter-row {
  padding: 12px 16px;
}

.study-chapter-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

/* ============================================================================
   SCERT Chapter Study Page (Bilingual Notes, Timeline & Exam Table)
   ============================================================================ */
.study-chapter-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.scert-ch-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.scert-ch-kicker-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.scert-ch-lang {
  flex-shrink: 0;
}

.scert-ch-cta-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.scert-study-tabs {
  margin-bottom: 16px;
}

.scert-units-stack {
  display: grid;
  gap: 14px;
}

.scert-unit-card,
.scert-timeline-card,
.scert-recall-card,
.scert-table-card,
.scert-coming-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}

.scert-unit-title {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.32;
}

.scert-unit-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.62;
  color: var(--text-secondary);
}

.scert-unit-list li::marker {
  color: var(--brand-accent);
}

.scert-card-h {
  margin-bottom: 14px;
}

.scert-timeline-list {
  display: grid;
  gap: 0;
  border-left: 2px solid var(--brand-border);
  margin-left: 6px;
  padding-left: 16px;
}

.scert-timeline-row {
  position: relative;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.scert-timeline-row:last-child {
  border-bottom: none;
}

.scert-timeline-row::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 15px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 2px solid var(--surface);
}

.scert-timeline-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.scert-timeline-content {
  min-width: 0;
}

.scert-timeline-event {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

.scert-timeline-detail {
  margin-top: 3px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Subject-Adaptive Recall Deck (Formulas, Atlas, Articles, Pathways, Protocols, Rules) */
.scert-recall-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.scert-recall-head .scert-card-h {
  margin-bottom: 0;
}

.scert-recall-kind-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--brand-tint);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
}

.scert-recall-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scert-recall-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.scert-recall-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scert-recall-key {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--brand-tint);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.scert-recall-key--formulas {
  background: color-mix(in srgb, var(--brand-accent) 14%, var(--surface));
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-accent) 34%, var(--border));
}

.scert-recall-key--pathways {
  background: color-mix(in srgb, var(--success) 13%, var(--surface));
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 32%, var(--border));
}

.scert-recall-key--atlas {
  background: color-mix(in srgb, var(--warning) 14%, var(--surface));
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 32%, var(--border));
}

.scert-recall-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.38;
  overflow-wrap: break-word;
}

.scert-recall-formula {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  overflow-x: auto;
  text-align: center;
  font-size: 0.92rem;
}

.scert-recall-formula .katex-display {
  margin: 0.15em 0;
}

.scert-recall-detail {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.54;
  overflow-wrap: break-word;
}

/* Visual Diagrams Tab (Geography Maps & Biology Illustrated Diagrams) */
.scert-diagrams-section {
  display: grid;
  gap: 14px;
}

.scert-diagrams-head {
  margin-bottom: 0;
}

.scert-diagrams-stack {
  display: grid;
  gap: 16px;
}

.scert-diagram-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.scert-diagram-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.scert-diagram-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.scert-diagram-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.32;
}

.scert-diagram-zoom-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--brand-primary);
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  white-space: nowrap;
  flex-shrink: 0;
}

.scert-diagram-zoom-link:hover {
  background: color-mix(in srgb, var(--brand-accent) 18%, var(--surface));
}

.scert-diagram-frame {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px;
}

.scert-diagram-img {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  border-radius: 6px;
}

.scert-diagram-caption {
  display: grid;
  gap: 8px;
}

.scert-diagram-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.58;
  color: var(--text-secondary);
}

.scert-diagram-bullets {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  font-size: 0.84rem;
  line-height: 1.52;
  color: var(--text-secondary);
}

.scert-diagram-bullets li::marker {
  color: var(--brand-accent);
}

.scert-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.scert-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.scert-table th,
.scert-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: break-word;
}

.scert-table th {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-subtle);
}

.scert-td-strong {
  font-weight: 700;
  color: var(--text);
}

.scert-ch-footer {
  margin-top: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-tint) 75%, var(--surface)) 0%, var(--surface) 100%);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.scert-ch-footer-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text);
}

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

@media (max-width: 640px) {
  .scert-unit-card,
  .scert-timeline-card,
  .scert-recall-card,
  .scert-table-card {
    padding: 15px;
  }

  .scert-timeline-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .scert-recall-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .scert-table {
    font-size: 0.8rem;
  }

  .scert-table th,
  .scert-table td {
    padding: 8px 9px;
  }

  .scert-ch-kicker-row {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .scert-ch-kicker-pills .pill-neutral {
    display: none;
  }

  .scert-ch-cta-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .scert-ch-cta-bar .btn {
    width: 100%;
    justify-content: center;
    padding: 9px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .scert-ch-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .scert-ch-footer-actions .btn {
    flex: 1;
  }
}

/* ============================================================================
 * Bidirectional Cross-Links (Topic <-> SCERT Chapters & Question Source Footer)
 * ============================================================================ */

.study-crosslink-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.study-crosslink-thumb {
  width: 38px;
  height: 50px;
  border-radius: 4px 6px 6px 4px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(12, 74, 110, 0.14);
  box-shadow: -1.5px 0 0 rgba(12, 74, 110, 0.2), 0 2px 6px rgba(15, 23, 42, 0.12);
  background: var(--bg-subtle);
}

.study-crosslink-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.study-crosslink-copy {
  min-width: 0;
  flex: 1;
}

.study-crosslink-sub {
  font-size: 0.77rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.study-crosslink-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.scert-related-topics {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 7px;
  margin-top: 12px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.scert-related-topics::-webkit-scrollbar {
  display: none;
}

.scert-related-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-right: 2px;
  flex-shrink: 0;
  white-space: nowrap;
}

.study-topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--brand-primary);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.study-topic-chip:hover {
  border-color: var(--brand-accent);
  background: var(--brand-tint);
}

[data-theme="dark"] .study-topic-chip {
  color: #7dd3fc;
}

.expl-crosslink-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expl-source-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.expl-source-link {
  color: var(--brand-accent);
  font-weight: 700;
  text-decoration: none;
}

.expl-source-link:hover {
  text-decoration: underline;
}

.expl-topics-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.expl-topics-row::-webkit-scrollbar {
  display: none;
}

.expl-topic-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.expl-topic-chip:hover {
  border-color: var(--brand-accent);
  color: var(--brand-primary);
}

/* ============================================================================
   Custom Mock Builder — Progressive Disclosure + Topic-Count Blueprint + Wave
   ============================================================================ */
.cm-page-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cm-divider-heading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 4px;
}

.cm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.cm-heading {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.cm-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cm-seg-toggle {
  display: inline-flex;
  background: var(--surface-alt, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.cm-seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.cm-seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.cm-tab-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--surface-alt, #f1f5f9);
  border-radius: 12px;
  padding: 4px;
}

.cm-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cm-tab-btn.active {
  background: var(--surface);
  color: var(--brand-primary, #0284c7);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.cm-template-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cm-tpl-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt, #f8fafc);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.cm-tpl-chip.active {
  border-color: var(--brand-primary, #0284c7);
  background: rgba(2, 132, 199, 0.09);
}

.cm-tpl-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.cm-tpl-chip.active .cm-tpl-name {
  color: var(--brand-primary, #0284c7);
}

.cm-tpl-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cm-ready-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
}

.cm-ready-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text);
}

.cm-ready-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cm-start-btn {
  min-height: 44px;
  padding: 10px 20px;
  font-weight: 700;
  white-space: nowrap;
}

.cm-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 600;
}

.cm-customize-toggle {
  width: 100%;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--brand-primary, #0284c7);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.cm-customize-toggle:hover,
.cm-customize-toggle.is-open {
  background: rgba(2, 132, 199, 0.06);
  border-color: var(--brand-primary, #0284c7);
}

.cm-power-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.cm-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.cm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cm-section-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.cm-scale-group {
  display: flex;
  gap: 5px;
}

.cm-mini-btn {
  border: 1px solid var(--border);
  background: var(--surface-alt, #f8fafc);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.cm-mini-btn.active {
  border-color: var(--brand-primary, #0284c7);
  color: var(--brand-primary, #0284c7);
  background: rgba(2, 132, 199, 0.09);
}

.cm-mini-btn.is-muted {
  color: var(--text-muted);
}

.cm-stack-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: var(--surface-alt, #e2e8f0);
  overflow: hidden;
  display: flex;
  gap: 2px;
}

.cm-stack-seg {
  height: 100%;
  border-radius: 999px;
}

.cm-rows-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.cm-topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.cm-topic-row:last-child {
  border-bottom: none;
}

.cm-topic-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.cm-topic-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
}

.cm-topic-text {
  min-width: 0;
}

.cm-topic-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-topic-avail {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cm-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cm-step-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt, #f8fafc);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.cm-step-input {
  width: 44px;
  height: 30px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.cm-add-topic-btn {
  border: 1px solid var(--border);
  background: var(--surface-alt, #f8fafc);
  color: var(--brand-primary, #0284c7);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.cm-picker-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-alt, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cm-picker-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
}

.cm-picker-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cm-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.cm-picker-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.cm-picker-meta {
  font-size: 0.71rem;
  color: var(--text-muted);
}

.cm-picker-add {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-primary, #0284c7);
  flex-shrink: 0;
}

.cm-empty-rows {
  padding: 14px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cm-diff-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.cm-diff-preset-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 7px 4px;
  border-radius: 9px;
  cursor: pointer;
}

.cm-diff-preset-btn.active {
  border-color: var(--brand-primary, #0284c7);
  background: rgba(2, 132, 199, 0.1);
  color: var(--brand-primary, #0284c7);
}

.cm-wave-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt, #f8fafc);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cm-wave-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cm-wave-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
}

.cm-wave-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cm-wave-svg {
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
}

.cm-split-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cm-split-pill {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 7px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cm-split-pill strong {
  font-size: 0.96rem;
  font-weight: 800;
}

.cm-split-pill span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.cm-split-pill.is-easy strong { color: #15803d; }
.cm-split-pill.is-mod strong { color: #0369a1; }
.cm-split-pill.is-hard strong { color: #b91c1c; }

@media (max-width: 768px) {
  .cm-card {
    padding: 16px 14px;
  }
  .cm-power-panel {
    grid-template-columns: 1fr;
  }
  .cm-ready-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .cm-start-btn {
    width: 100%;
  }
  .cm-tab-btn {
    font-size: 0.76rem;
    padding: 8px 6px;
  }
}

.cm-wip-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 15px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.84rem;
  line-height: 1.55;
}

.cm-wip-text {
  flex: 1;
  min-width: 200px;
}

.cm-wip-cta {
  flex-shrink: 0;
}

/* ============================================================================
   Top Header Global Search, Gear Settings Icon & Compact Mobile CA Banner
   ============================================================================ */
.nav-desktop-search {
  flex: 0 1 250px;
  min-width: 170px;
  margin-left: auto;
  margin-right: 6px;
}

.nav-search-shell {
  position: relative;
  width: 100%;
  max-width: none;
}

.nav-search-wrap .nav-search-input {
  height: 36px;
  padding: 6px 12px 6px 34px;
  font-size: 0.82rem;
  border-radius: 999px;
}

.nav-search-shell .study-search-drop {
  width: max(100%, 310px);
  right: 0;
  left: auto;
  z-index: 60;
}

.nav-mobile-search-btn {
  display: none;
}

.nav-mobile-search-drawer {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 0 10px;
}

.nav-mobile-search-inner .study-search-drop {
  width: 100%;
  left: 0;
  right: 0;
}

@media (max-width: 960px) {
  .nav-desktop-search {
    display: none;
  }
  .nav-mobile-search-btn {
    display: inline-flex;
  }
  .study-home-header {
    display: none;
  }
}

@media (max-width: 640px) {
  .study-ca-banner {
    padding: 13px 14px;
    gap: 10px;
    margin-top: 10px;
  }
  .study-ca-banner .ca-hub-banner-eyebrow {
    font-size: 0.7rem;
    gap: 6px;
  }
  .study-ca-banner .ca-hub-banner-title {
    font-size: 0.96rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 2px 0 0;
  }
  .study-ca-banner .ca-hub-banner-sub {
    display: none;
  }
  .study-ca-banner .ca-hub-banner-actions {
    gap: 8px;
  }
  .study-ca-banner .ca-hub-banner-actions .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Learning Mode (Primary Colored CTA) vs Practice Exam (Plain White CTA)
   ========================================================================== */
.btn-mode-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 9px 15px;
  min-height: 48px;
  text-align: left;
  line-height: 1.2;
}

.mode-cta-title {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.mode-cta-sub {
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Primary Colored CTA — Learning Mode (Instant Answers USP) */
.btn-mode-learn,
.btn-mode-learn-solid {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  color: var(--brand-contrast);
  border-color: transparent;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand-accent) 30%, transparent);
}

.btn-mode-learn:hover:not(:disabled),
.btn-mode-learn-solid:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-primary-hover) 0%, var(--brand-primary) 100%);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand-primary) 34%, transparent);
}

.btn-mode-learn .mode-cta-sub {
  color: var(--brand-contrast);
  opacity: 0.88;
}

/* Secondary Plain White / Boring Button — Practice Exam */
.btn-mode-exam,
.btn-mode-exam-inline {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
  font-weight: 600;
}

.btn-mode-exam .mode-cta-title {
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-mode-exam .mode-cta-sub {
  color: var(--text-muted);
  font-weight: 400;
}

.btn-mode-exam:hover:not(:disabled),
.btn-mode-exam-inline:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-mode-exam:hover:not(:disabled) .mode-cta-title {
  color: var(--text);
}

.paper-view-result-btn {
  white-space: nowrap;
}

.cutoff-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mocks-card-actions {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.mocks-card-actions .btn-mode-cta {
  width: 100%;
  align-items: center;
  text-align: center;
  padding: 9px 10px;
}

.hud-mode-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  white-space: nowrap;
}

/* Learning Mode Instant Answer Verdict Strip */
.instant-verdict-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 10px;
  border: 1px solid transparent;
}

.instant-verdict-bar.is-correct {
  background: var(--status-success-tint);
  border-color: var(--status-success-border);
  color: var(--status-success);
}

.instant-verdict-bar.is-wrong {
  background: var(--status-danger-tint);
  border-color: var(--status-danger-border);
  color: var(--status-danger);
}

/* Learning Mode 3-card Summary Grid */
.metrics-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 720px) {
  .metrics-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .metrics-grid-3 > :first-child {
    grid-column: 1 / -1;
  }
  .cutoff-modal-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
  }
  .cutoff-modal-actions .btn-mode-cta {
    width: 100%;
    align-items: center;
    text-align: center;
    padding: 8px 10px;
  }
}

@media (max-width: 640px) {
  .paper-row-actions {
    grid-template-columns: 1.32fr 1fr;
    gap: 8px;
  }
  .paper-row-actions .btn-mode-cta {
    align-items: center;
    text-align: center;
    padding: 8px 8px;
    min-height: 50px;
  }
  .paper-row-actions .mode-cta-title {
    font-size: 0.84rem;
  }
  .paper-row-actions .mode-cta-sub {
    font-size: 0.68rem;
  }
  .paper-row-actions.has-result .paper-view-result-btn {
    grid-column: 1 / -1;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  .hud-mode-pill {
    font-size: 0.7rem;
    padding: 3px 8px;
  }
}

/* ============================================================================
   Exam Track Dossier, Career Snapshot Strip & Empirical Difficulty Bell Curve
   ============================================================================ */
.exam-detail-header-band {
  padding: 14px 0 12px;
  margin-bottom: 12px;
}

.exam-hero-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-role-hook {
  margin-top: 0;
  max-width: 72ch;
  font-size: 0.86rem;
  line-height: 1.42;
}

.exam-inline-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.exam-inline-meta-item.mono {
  color: var(--brand-primary);
  font-weight: 800;
}

.exam-inline-sep {
  color: var(--border-strong);
}

.exam-snapshot-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.exam-snap-cell {
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.exam-snap-cell + .exam-snap-cell {
  border-left: 1px solid var(--border);
}

.exam-snap-kicker {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.exam-snap-val {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.exam-snap-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-papers-intel-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.exam-papers-intel-bar .cutoff-trend-pill {
  padding: 6px 10px;
  gap: 6px;
  text-decoration: none;
  border-radius: 10px;
}

.exam-toolbar-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exam-syllabus-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-tint);
  border-color: var(--brand-border);
  color: var(--brand-ink);
  font-weight: 700;
}

.exam-lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.exam-lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
}

.exam-lang-btn.active {
  background: var(--brand-primary);
  color: var(--brand-contrast);
}

.exam-view-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  max-width: 440px;
}

.exam-view-tabs-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.exam-view-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 700;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.exam-view-tab.active {
  background: var(--surface);
  color: var(--brand-primary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.exam-tab-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-ink);
}

.exam-guide-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 2px;
  padding-bottom: 36px;
}

.exam-dossier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: var(--shadow-xs);
}

.exam-dossier-card .cm-wave-box {
  border-radius: 10px;
}

.exam-dossier-card .cm-split-pill {
  border-radius: 8px;
}

.modal-card .exam-dossier-card {
  border: none;
  padding: 0;
  box-shadow: none;
  background: transparent;
  gap: 10px;
}

.exam-bell-modal-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.exam-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.exam-card-kicker {
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-accent);
  margin-bottom: 2px;
}

.exam-dossier-card .exam-card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

.exam-bell-svg {
  width: 100%;
  height: auto;
  display: block;
}

.cm-split-btn {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.cm-split-btn:hover:not(:disabled) {
  border-color: var(--brand-accent);
}

.cm-split-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.cm-split-btn.is-selected.is-easy {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
}

.cm-split-btn.is-selected.is-mod {
  border-color: #0284c7;
  background: var(--brand-tint);
}

.cm-split-btn.is-selected.is-hard {
  border-color: #dc2626;
  background: var(--status-danger-tint);
}

.exam-sample-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 2px;
}

.exam-sample-q-box {
  padding: 10px 11px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-accent);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.exam-sample-q-box.is-easy { border-left-color: #16a34a; }
.exam-sample-q-box.is-mod { border-left-color: #0284c7; }
.exam-sample-q-box.is-hard { border-left-color: #dc2626; }

.exam-sample-q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.exam-sample-q-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--brand-primary);
}

.exam-sample-q-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.exam-sample-q-stem {
  margin: 0;
  font-size: 0.81rem;
  line-height: 1.46;
  color: var(--text);
}

.exam-sample-q-subj {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.exam-strategy-callout {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-accent);
}

.exam-strategy-tag {
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-accent);
}

.exam-drift-callout {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--status-warning-tint);
  border: 1px solid var(--status-warning-border);
  border-left: 3px solid var(--status-warning);
}

.exam-drift-tag {
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--status-warning-ink);
}

.exam-strategy-text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.46;
  color: var(--text);
}

.exam-peer-ladder {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.exam-peer-ladder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.exam-peer-track {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
}

.exam-peer-rail {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.35), rgba(2, 132, 199, 0.35), rgba(220, 38, 38, 0.35));
}

.exam-peer-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--border-strong);
}

.exam-peer-dot.is-current {
  width: 14px;
  height: 14px;
  background: var(--brand-primary);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--brand-accent);
  z-index: 2;
}

.exam-peer-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.71rem;
  color: var(--text-muted);
}

.exam-peer-legend strong {
  color: var(--brand-primary);
  font-weight: 800;
}

.exam-subj-diff-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exam-subj-diff-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exam-subj-diff-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.81rem;
}

.exam-subj-diff-name {
  font-weight: 700;
  color: var(--text);
}

.exam-subj-diff-val {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.exam-subj-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.exam-subj-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.exam-subj-bar-fill.is-easy { background: #16a34a; }
.exam-subj-bar-fill.is-mod { background: var(--brand-accent); }
.exam-subj-bar-fill.is-hard { background: #dc2626; }

.exam-vibe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exam-duty-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-duty-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}

.exam-duty-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-accent);
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  padding: 2px 6px;
  flex-shrink: 0;
  margin-top: 1px;
}

.exam-duty-text {
  font-size: 0.85rem;
  line-height: 1.48;
  color: var(--text);
}

.exam-employers-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.exam-employers-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-muted);
}

.exam-employers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exam-employer-chip {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 6px;
}

.exam-salary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.exam-salary-box {
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.exam-salary-box.is-primary {
  background: var(--brand-tint);
  border-color: var(--brand-border);
}

.exam-salary-num {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.exam-salary-box.is-primary .exam-salary-num {
  color: var(--brand-primary);
}

.exam-perks-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.exam-ladder-list {
  display: flex;
  flex-direction: column;
  padding-top: 4px;
}

.exam-ladder-step {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.exam-ladder-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 24px;
  flex-shrink: 0;
}

.exam-ladder-node {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exam-ladder-step.is-entry .exam-ladder-node {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-contrast);
}

.exam-ladder-line {
  width: 2px;
  flex: 1;
  min-height: 18px;
  background: var(--border);
  margin: 3px 0;
}

.exam-ladder-body {
  flex: 1;
  padding-bottom: 13px;
  min-width: 0;
}

.exam-ladder-step:last-child .exam-ladder-body {
  padding-bottom: 2px;
}

.exam-ladder-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.exam-ladder-role {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.exam-ladder-yr {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-accent);
  white-space: nowrap;
}

.exam-ladder-mode {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.exam-elig-grid {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.exam-elig-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  padding: 9px 11px;
  font-size: 0.81rem;
  background: var(--bg-canvas);
}

.exam-elig-row + .exam-elig-row {
  border-top: 1px solid var(--border);
}

.exam-elig-label {
  font-weight: 700;
  color: var(--text-muted);
}

.exam-elig-val {
  color: var(--text);
  line-height: 1.42;
}

.exam-stage-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}

.exam-ribbon-node {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.exam-ribbon-top {
  display: flex;
  align-items: center;
  gap: 4px;
}

.exam-ribbon-step {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--brand-primary);
  color: var(--brand-contrast);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exam-ribbon-node.is-qualifying .exam-ribbon-step {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.exam-ribbon-connector {
  flex: 1;
  height: 2px;
  background: var(--border-strong);
}

.exam-ribbon-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.exam-ribbon-fmt {
  font-size: 0.65rem;
  color: var(--brand-accent);
  line-height: 1.2;
}

.exam-stage-notes {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.exam-stage-note-row {
  display: flex;
  gap: 6px;
  font-size: 0.77rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.exam-stage-note-idx {
  color: var(--brand-accent);
  font-weight: 800;
  flex-shrink: 0;
}

.exam-cycle-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exam-notif-timeline {
  display: flex;
  flex-direction: column;
  padding-top: 2px;
}

.exam-notif-step {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.exam-notif-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 44px;
  flex-shrink: 0;
}

.exam-notif-yr {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.exam-notif-step.is-active .exam-notif-yr {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-contrast);
}

.exam-notif-card {
  flex: 1;
  min-width: 0;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exam-notif-step:last-child .exam-notif-card {
  margin-bottom: 0;
}

.exam-notif-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.exam-notif-cat {
  font-size: 0.81rem;
  font-weight: 800;
  color: var(--text);
}

.exam-notif-dates {
  font-size: 0.73rem;
  color: var(--brand-accent);
  font-weight: 600;
}

.exam-notif-note {
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.exam-next-cycle-note {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-ink);
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 8px 11px;
}

.exam-guide-footer-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 2px;
}

.exam-guide-footer-cta .btn {
  width: 100%;
  font-size: 0.82rem;
  padding: 10px 10px;
  text-decoration: none;
  justify-content: center;
}

[data-mode="dark"] .cm-wave-box {
  background: var(--bg-subtle);
}

[data-mode="dark"] .exam-view-tab.active {
  background: var(--surface-elevated);
  border-color: var(--brand-border);
}

[data-mode="dark"] .cm-split-pill.is-easy strong { color: #4ade80; }
[data-mode="dark"] .cm-split-pill.is-mod strong { color: #38bdf8; }
[data-mode="dark"] .cm-split-pill.is-hard strong { color: #f87171; }

@media (max-width: 640px) {
  .exam-detail-header-band {
    padding: 11px 0 11px;
    margin-bottom: 10px;
  }
  .exam-detail-header-band .hub-title {
    font-size: 1.38rem;
    line-height: 1.2;
  }
  .exam-snap-cell {
    padding: 8px 7px;
  }
  .exam-snap-val {
    font-size: 0.75rem;
  }
  .exam-snap-sub {
    font-size: 0.66rem;
  }
  .exam-papers-intel-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .exam-papers-intel-bar .cutoff-trend-pill {
    width: 100%;
    justify-content: space-between;
    padding: 7px 10px;
    font-size: 0.76rem;
  }
  .exam-salary-num {
    font-size: 0.83rem;
  }
  .exam-elig-row {
    grid-template-columns: 72px 1fr;
  }
  .exam-guide-footer-cta {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Concept Tagging — Tag Explorer Counts & Practice Mode Similar Questions
   ============================================================================ */
.study-list-row-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.study-topic-count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  white-space: nowrap;
}

.similar-tags-card {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.similar-tags-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--brand-primary);
}

.similar-tags-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.similar-tags-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.similar-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.similar-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--brand-tint);
  color: var(--brand-primary);
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  max-width: 100%;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.similar-tag-chip:hover {
  border-color: var(--brand-accent);
  background: var(--brand-primary);
  color: var(--brand-contrast);
}

.similar-tag-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.similar-tag-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(12, 74, 110, 0.1);
  color: inherit;
  flex-shrink: 0;
}

.similar-tag-chip:hover .similar-tag-count {
  background: rgba(255, 255, 255, 0.22);
}

[data-mode="dark"] .similar-tags-card {
  background: var(--surface-elevated, var(--surface));
}

[data-mode="dark"] .similar-tag-chip {
  background: rgba(2, 132, 199, 0.14);
  border-color: rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
}

[data-mode="dark"] .similar-tag-chip:hover {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #082f49;
}

[data-mode="dark"] .similar-tag-count {
  background: rgba(125, 211, 252, 0.16);
}

/* ── Viral Share Triggers & Modal Sheet ─────────────────────────────────── */
.exam-hero-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.study-hero-copy {
  flex: 1;
  min-width: 0;
}
.share-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.share-trigger-btn:hover {
  color: var(--brand-accent);
  border-color: var(--brand-border);
  background: var(--brand-tint);
}
.home-share-banner {
  margin-top: 28px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.home-share-copy {
  min-width: 0;
}
.home-share-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.home-share-sub {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.home-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .home-share-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
  .home-share-btn {
    justify-content: center;
    width: 100%;
  }
}
.share-icon-only-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.share-icon-only-btn:hover {
  color: var(--brand-accent);
  background: var(--brand-tint);
}
.question-card-meta-right,
.ca-q-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.q-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.q-share-btn:hover {
  opacity: 1;
  color: var(--brand-accent);
  background: var(--brand-tint);
}
.ca-q-highlight {
  border-color: var(--brand-accent) !important;
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.share-modal-backdrop {
  z-index: 1200;
}
.share-modal-card {
  max-width: 440px;
  width: calc(100% - 24px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.share-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.share-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.share-modal-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.share-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.share-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.share-mode-btn.active {
  background: var(--surface);
  color: var(--brand-ink);
  box-shadow: var(--shadow-sm);
}
.share-preview-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-preview-img {
  width: 100%;
  height: auto;
  max-height: 52vh;
  object-fit: contain;
  display: block;
  transition: opacity 0.18s ease;
}
.share-preview-loading {
  position: absolute;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.share-status-toast {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.share-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.share-primary-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.share-secondary-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.share-secondary-row > * {
  flex: 1;
  justify-content: center;
  text-align: center;
}


/* ============================================================================
   SEO Directory Dialog ("Other Exams" Footer Trigger) & CA Cross-Links
   ============================================================================ */
.directory-dialog {
  width: min(860px, calc(100vw - 24px));
  max-height: min(84vh, 720px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.directory-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.directory-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: min(84vh, 720px);
}

.directory-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.directory-dialog-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.directory-dialog-sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.directory-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 18px 20px 22px;
  overflow-y: auto;
}

.directory-section-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-accent);
}

.directory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.directory-exam-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.directory-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.35;
}

.directory-link:hover {
  color: var(--brand-accent);
  text-decoration: underline;
}

.directory-sublinks {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.directory-sublinks .directory-link {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.directory-sublinks .directory-link:hover {
  color: var(--brand-accent);
}

.ca-related-subjects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

@media (max-width: 640px) {
  .directory-dialog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 14px 16px 18px;
  }
}

/* Paper card title row + top-right compact Share button */
.paper-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.paper-title-row .paper-title {
  flex: 1 1 auto;
  min-width: 0;
}

.paper-card-share-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  margin-top: -2px;
}

.paper-card-share-btn:hover {
  color: var(--brand-primary);
  background: var(--brand-tint);
}
