*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink:#0d0d0f; --ink-soft:#3a3a42; --muted:#8a8a9a;
  --line:#e4e4ec; --cream:#faf9f6; --paper:#ffffff;
  --gold:#c8933a; --gold-lt:#f0d98e; --teal:#0d6e6e;
  --teal-lt:#e6f4f4; --red:#c0392b; --red-lt:#fdecea;
  --green:#1a7a4a; --green-lt:#e8f5e9;
  --sidebar-bg:#0f0f15; --sidebar-w:220px;
  --admin-sidebar:#111118;
  --admin-sidebar-w:240px;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}
a { color: inherit; }
.font-display { font-family: 'Playfair Display', serif; }
.font-mono { font-family: 'DM Mono', monospace; }

/* Buttons */
.btn-primary, .btn-gold {
  background: var(--gold); border: none; padding: 9px 22px;
  font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 600;
  border-radius: 4px; cursor: pointer; color: var(--paper);
  text-decoration: none; display: inline-block; transition: background .2s;
}
.btn-primary:hover, .btn-gold:hover { background: #b07d28; }
.btn-teal {
  background: var(--teal); color: #fff; border: none; padding: 10px 22px;
  border-radius: 4px; font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
  font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-teal:hover { background: #0a5454; }
.btn-outline {
  border: 1.5px solid var(--ink); padding: 8px 20px;
  font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 600;
  border-radius: 4px; background: transparent; color: var(--ink);
  text-decoration: none; cursor: pointer; display: inline-block;
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 7px 16px; font-size: 0.8rem; border-radius: 4px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; display: inline-block; }
.btn-outline-sm { border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-soft); }
.btn-white { background: #fff; color: var(--ink); border: none; padding: 12px 28px; border-radius: 5px; font-weight: 700; text-decoration: none; display: inline-block; }
.btn-danger { background: var(--red); color: #fff; }
.btn-full { width: 100%; text-align: center; }

/* Badges */
.badge { font-size: 0.7rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; display: inline-block; }
.badge-active, .badge-success { background: var(--green-lt); color: var(--green); }
.badge-pending, .badge-warn { background: #fff8e1; color: #f57f17; }
.badge-inactive { background: var(--line); color: var(--muted); }
.badge-inter { background: #e8eaf6; color: #3949ab; }
.badge-matric { background: #e8eaf6; color: #3949ab; }
.badge-ai { background: var(--teal-lt); color: var(--teal); }
.badge-paid { background: var(--green-lt); color: var(--green); }
.badge-failed { background: var(--red-lt); color: var(--red); }

/* Public nav — same on all marketing pages */
.public-nav, .pub-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250,249,246,0.96); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); padding: 0 clamp(20px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between; height: 68px;
  overflow: visible;
}
.public-nav .nav-logo, .pub-nav .nav-logo {
  font-family: 'Playfair Display', serif; font-size: 1.45rem; font-weight: 900;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.public-nav .nav-logo span, .pub-nav .nav-logo span { color: var(--gold); }
.public-nav .nav-links, .pub-nav .nav-links {
  display: flex; gap: clamp(16px, 3vw, 32px); list-style: none; align-items: center; margin: 0; padding: 0;
}
.public-nav .nav-links a, .pub-nav .nav-links a {
  font-size: 0.88rem; font-weight: 500; color: var(--ink-soft); text-decoration: none; transition: color .2s;
}
.public-nav .nav-links a:hover, .pub-nav .nav-links a:hover { color: var(--ink); }
.public-nav .nav-links a.active, .pub-nav .nav-links a.active {
  color: var(--ink); font-weight: 700;
}
.public-nav .nav-cta, .pub-nav .nav-cta { display: flex; gap: 10px; align-items: center; }
.btn-nav-outline {
  border: 1.5px solid var(--ink); padding: 8px 18px; font-size: 0.85rem; font-weight: 600;
  border-radius: 5px; background: transparent; color: var(--ink); text-decoration: none;
}
.btn-nav-outline:hover { background: var(--ink); color: var(--paper); }
.btn-nav-primary {
  background: var(--gold); padding: 9px 20px; font-size: 0.85rem; font-weight: 600;
  border-radius: 5px; color: var(--paper); text-decoration: none;
}
.btn-nav-primary:hover { background: #b07d28; }
body.has-public-nav { padding-top: 68px; }
.nav-logo { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 900; color: var(--ink); text-decoration: none; }
.nav-logo span { color: var(--gold); }
.nav-links { display: flex; gap: 28px; list-style: none; align-items: center; }
.nav-links a { font-size: 0.85rem; font-weight: 500; color: var(--ink-soft); text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); font-weight: 700; }

/* Student app shell */
.app-shell { display: flex; min-height: 100vh; }
.student-sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg);
  position: fixed; height: 100vh; left: 0; top: 0; z-index: 50;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.s-brand { padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.s-logo { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 900; color: #fff; text-decoration: none; }
.s-logo span { color: var(--gold); }
.s-label { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.25); margin-top: 2px; }
.s-user { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.07); display: flex; align-items: center; gap: 10px; }
.s-avatar { width: 36px; height: 36px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 0.85rem; flex-shrink: 0; }
.s-uname { font-size: 0.83rem; font-weight: 600; color: rgba(255,255,255,0.8); }
.s-board { font-size: 0.7rem; color: rgba(255,255,255,0.3); }
.s-nav { padding: 16px 0; flex: 1; overflow-y: auto; }
.s-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  font-size: 0.83rem; font-weight: 500; color: rgba(255,255,255,0.45);
  text-decoration: none; border-left: 2px solid transparent; transition: all .2s;
}
.s-nav-item:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.04); }
.s-nav-item.active { color: #fff; border-left-color: var(--gold); background: rgba(200,147,58,0.1); }
.s-nav-item .ico { width: 18px; text-align: center; }
.s-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 20px; }
.s-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.07); }
.s-footer a { font-size: 0.78rem; color: rgba(255,255,255,0.3); text-decoration: none; display: block; margin-bottom: 6px; }
.s-footer a:hover { color: var(--gold); }
.app-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.app-topbar {
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 0 32px; height: 60px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 40;
}
.app-topbar h1 { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 900; }
.app-content { padding: 32px; flex: 1; }
.topbar-right { display: flex; gap: 12px; align-items: center; }
.quota-pill { display: flex; align-items: center; gap: 8px; background: var(--cream); border: 1.5px solid var(--line); border-radius: 20px; padding: 6px 14px; }
.quota-pill .label { font-size: 0.72rem; color: var(--muted); }
.quota-pill .val { font-family: 'DM Mono', monospace; font-size: 0.78rem; font-weight: 700; color: var(--gold); }
.btn-nav { padding: 8px 18px; background: var(--gold); border: none; border-radius: 4px; font-family: 'DM Sans', sans-serif; font-size: 0.82rem; font-weight: 700; color: #fff; cursor: pointer; text-decoration: none; }

/* Student welcome strip (all logged-in pages) */
.student-welcome {
  background: var(--ink); border-radius: 10px;
  padding: 28px 32px; margin-bottom: 28px;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px;
  position: relative; overflow: hidden;
}
.student-welcome::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,147,58,0.15), transparent 65%);
}
.student-welcome-inner { position: relative; z-index: 1; }
.student-welcome h2 {
  font-family: 'Playfair Display', serif; font-size: 1.45rem; font-weight: 900;
  color: #fff; line-height: 1.2; margin-bottom: 6px;
}
.student-welcome h2 em { font-style: italic; color: var(--gold); }
.student-welcome p { font-size: 0.85rem; color: rgba(255,255,255,0.45); max-width: 520px; line-height: 1.5; }
.student-welcome p strong { color: var(--gold-lt); font-weight: 600; }
.student-welcome-cta {
  position: relative; z-index: 1;
  background: #fff; color: var(--ink); border: none; padding: 12px 26px; border-radius: 5px;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.student-welcome-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.student-welcome-meta {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px;
}
.student-welcome-pill {
  font-size: 0.72rem; font-weight: 600; padding: 4px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Dashboard widgets */
.welcome-banner { /* alias */ }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.s-card-note { font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
.countdown-bar {
  background: linear-gradient(135deg, #fff8ed, #fef3d8); border: 1.5px solid var(--gold);
  border-radius: 8px; padding: 18px 22px; margin-bottom: 28px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.cd-icon { font-size: 1.5rem; }
.cd-text h4 { font-size: 0.88rem; font-weight: 700; margin-bottom: 2px; }
.cd-text p { font-size: 0.78rem; color: var(--muted); }
.cd-timer { margin-left: auto; font-family: 'DM Mono', monospace; font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.ai-generator { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 28px; }
.ai-gen-header { background: var(--teal); padding: 20px 28px; display: flex; align-items: center; gap: 14px; }
.ai-gen-header h3 { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; color: #fff; }
.ai-gen-header p { font-size: 0.78rem; color: rgba(255,255,255,0.55); margin-top: 2px; }
.ai-gen-body { padding: 28px; display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 16px; align-items: flex-end; }
.btn-gen { padding: 11px 24px; background: var(--teal); border: none; border-radius: 4px; font-size: 0.88rem; font-weight: 700; color: #fff; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn-gen:hover { background: #0a5454; }
.ai-free-note { margin: 0 28px 20px; background: var(--teal-lt); border-radius: 5px; padding: 10px 16px; font-size: 0.78rem; color: var(--teal); }
.panel-hdr a { font-size: 0.78rem; color: var(--gold); text-decoration: none; }
.hist-item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hist-item:last-child { border-bottom: none; }
.hist-icon { width: 36px; height: 36px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.ico-ai { background: var(--teal-lt); }
.ico-dl { background: #f3e5f5; }
.hist-info strong { font-size: 0.85rem; color: var(--ink); display: block; }
.hist-info small { font-size: 0.73rem; color: var(--muted); }
.hist-status { font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.sts-done { background: var(--teal-lt); color: var(--teal); }
.sts-pend { background: #fff3e0; color: #e65100; }
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .2s; text-decoration: none; color: inherit; }
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: #fafaf8; margin: 0 -24px; padding: 12px 24px; }
.s-badge-board { font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: rgba(200,147,58,0.12); color: var(--gold); flex-shrink: 0; }
.s-sub { font-size: 0.85rem; font-weight: 600; color: var(--ink); flex: 1; }
.s-year { font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--muted); }
.s-dl-btn { font-size: 0.75rem; font-weight: 600; color: var(--teal); background: var(--teal-lt); border: none; border-radius: 4px; padding: 5px 12px; cursor: pointer; }

/* Generate paper page */
.gen-steps {
  display: flex; align-items: center; gap: 0; margin-bottom: 28px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px;
}
.gen-step {
  flex: 1; display: flex; align-items: center; gap: 12px; position: relative;
}
.gen-step:not(:last-child)::after {
  content: ''; flex: 1; height: 2px; background: var(--line); margin: 0 12px; max-width: 48px;
}
.gen-step.done:not(:last-child)::after { background: var(--teal); }
.gen-step-num {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: var(--muted); flex-shrink: 0;
}
.gen-step.active .gen-step-num { border-color: var(--teal); background: var(--teal-lt); color: var(--teal); }
.gen-step.done .gen-step-num { border-color: var(--teal); background: var(--teal); color: #fff; }
.gen-step-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.gen-step.active .gen-step-label { color: var(--ink); }
.gen-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.gen-section {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 28px; margin-bottom: 20px;
}
.gen-section-hdr {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.gen-section-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--teal-lt);
  color: var(--teal); font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.gen-section-hdr h3 { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; }
.gen-section-hdr p { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.gen-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gen-type-card {
  border: 2px solid var(--line); border-radius: 8px; padding: 18px 16px; cursor: pointer;
  transition: all .2s; text-align: center;
}
.gen-type-card:hover { border-color: var(--teal); background: var(--teal-lt); }
.gen-type-card.active { border-color: var(--teal); background: var(--teal-lt); box-shadow: 0 0 0 1px var(--teal); }
.gen-type-card .ico { font-size: 1.5rem; margin-bottom: 8px; }
.gen-type-card strong { display: block; font-size: 0.88rem; margin-bottom: 4px; }
.gen-type-card span { font-size: 0.72rem; color: var(--muted); line-height: 1.35; display: block; }
.gen-diff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gen-diff-card {
  border: 2px solid var(--line); border-radius: 8px; padding: 16px; cursor: pointer; transition: all .2s;
}
.gen-diff-card:hover { border-color: var(--gold); }
.gen-diff-card.active { border-color: var(--gold); background: linear-gradient(135deg, #fff8ed, #fef3d8); }
.gen-diff-card strong { display: block; font-size: 0.9rem; margin-bottom: 4px; }
.gen-diff-card span { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }
.gen-diff-card .tag {
  display: inline-block; margin-top: 8px; font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold);
}
.gen-aside { position: sticky; top: 84px; }
.gen-preview {
  background: var(--ink); border-radius: 10px; padding: 24px; color: #fff; margin-bottom: 16px;
}
.gen-preview-subject { font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 900; margin-bottom: 4px; }
.gen-preview-subject em { color: var(--gold); font-style: italic; }
.gen-preview-meta { font-size: 0.78rem; color: rgba(255,255,255,0.45); margin-bottom: 16px; }
.gen-preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gen-preview-stat {
  background: rgba(255,255,255,0.06); border-radius: 6px; padding: 10px; text-align: center;
}
.gen-preview-stat .v { font-family: 'DM Mono', monospace; font-size: 0.95rem; font-weight: 700; color: var(--gold-lt); }
.gen-preview-stat .l { font-size: 0.65rem; color: rgba(255,255,255,0.35); margin-top: 2px; }
.gen-cost-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-bottom: 16px;
}
.gen-cost-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 10px 0; border-bottom: 1px solid var(--line); }
.gen-cost-row:last-child { border-bottom: none; font-weight: 700; font-size: 1rem; padding-top: 14px; }
.gen-trust { font-size: 0.78rem; color: var(--muted); line-height: 1.6; }
.gen-trust li { margin-bottom: 6px; list-style: none; padding-left: 20px; position: relative; }
.gen-trust li::before { content: '✓'; position: absolute; left: 0; color: var(--teal); font-weight: 700; }

@media (max-width: 1100px) {
  .ai-gen-body { grid-template-columns: 1fr 1fr; }
  .gen-layout { grid-template-columns: 1fr; }
  .gen-aside { position: static; }
}
@media (max-width: 768px) {
  .student-welcome { grid-template-columns: 1fr; text-align: left; }
  .student-welcome-cta { justify-self: start; }
  .stat-row, .gen-type-grid, .gen-diff-grid { grid-template-columns: 1fr; }
  .gen-steps { flex-direction: column; align-items: stretch; }
  .gen-step:not(:last-child)::after { display: none; }
}

/* Admin shell */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: var(--admin-sidebar-w); background: var(--admin-sidebar);
  position: fixed; height: 100vh; left: 0; top: 0; z-index: 50;
  display: flex; flex-direction: column; overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.sidebar-brand { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.sidebar-brand .logo { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 900; color: var(--paper); text-decoration: none; }
.sidebar-brand .logo span { color: var(--gold); }
.sidebar-brand small { display: block; font-size: 0.68rem; color: rgba(255,255,255,0.3); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }
.nav-section { padding: 16px 0 8px; }
.nav-section-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.25); padding: 0 20px; margin-bottom: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  font-size: 0.83rem; font-weight: 500; color: rgba(255,255,255,0.5);
  text-decoration: none; border-left: 2px solid transparent; transition: all .2s;
}
.nav-item:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.04); }
.nav-item.active { color: var(--paper); border-left-color: var(--gold); background: rgba(200,147,58,0.08); }
.nav-badge { margin-left: auto; background: var(--gold); color: var(--paper); font-size: 0.65rem; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.sidebar-account {
  margin-top: auto; padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.sidebar-logout {
  display: block; width: 100%; text-align: center;
  padding: 9px 14px; border-radius: 6px;
  font-size: 0.8rem; font-weight: 600;
  color: rgba(255,255,255,0.55); text-decoration: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  transition: background .2s, color .2s, border-color .2s;
}
.sidebar-logout:hover {
  color: #fff; background: rgba(192,57,43,0.15);
  border-color: rgba(192,57,43,0.35);
}
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; color: var(--paper); flex-shrink: 0; }
.user-info strong { font-size: 0.8rem; color: rgba(255,255,255,0.75); display: block; }
.user-info small { font-size: 0.68rem; color: rgba(255,255,255,0.3); }
.admin-main { margin-left: var(--admin-sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.admin-topbar {
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 0 36px; height: 60px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.page-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 900; }
.page-breadcrumb { font-size: 0.78rem; color: var(--muted); }
.admin-content { padding: 36px; flex: 1; }

/* Logged-in app footer (student + admin) */
.app-shell-footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 14px 32px;
}
.app-shell-footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 20px; max-width: 1400px;
}
.app-shell-footer-copy {
  font-size: 0.75rem; color: var(--muted); margin: 0;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.app-shell-footer-badge {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 2px 8px; border-radius: 20px;
  background: var(--cream); border: 1px solid var(--line); color: var(--ink-soft);
}
.admin-shell .app-shell-footer-badge {
  background: var(--teal-lt); border-color: rgba(13,110,110,0.2); color: var(--teal);
}
.app-shell-footer-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
}
.app-shell-footer-links a {
  font-size: 0.78rem; font-weight: 500; color: var(--muted); text-decoration: none;
}
.app-shell-footer-links a:hover { color: var(--ink); }

/* Cards & panels */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.panel-hdr, .panel-header { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.panel-hdr h3, .panel-header h3 { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; }
.panel-body { padding: 20px 24px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.s-card, .metric-card { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 20px; }
.s-card-label, .metric-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.s-card-val, .metric-value { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 900; line-height: 1; }
.s-card-note { font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Tables */
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 28px; }
.table-toolbar { padding: 16px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--cream); }
th { padding: 12px 20px; text-align: left; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); white-space: nowrap; }
td { padding: 14px 20px; font-size: 0.85rem; border-top: 1px solid var(--line); color: var(--ink-soft); vertical-align: middle; }
tr:hover td { background: #fafaf8; }
.action-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.act-btn {
  padding: 5px 12px; border-radius: 4px; font-size: 0.75rem; font-weight: 600;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-soft);
  text-decoration: none; cursor: pointer;
}
.section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.section-hdr h2 { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 900; }
.section-hdr p { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* Forms */
.form-field label, .gen-field label {
  display: block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px;
}
.form-field input, .form-field select, .form-field textarea,
.gen-field select, .gen-field input {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 4px;
  font-family: 'DM Sans', sans-serif; font-size: 0.85rem; color: var(--ink);
  background: var(--cream); outline: none;
}
.form-field input:focus, .form-field select:focus { border-color: var(--gold); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Account settings */
.settings-wrap { max-width: 1100px; margin: 0 auto; }
.settings-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px 24px; margin-bottom: 18px; flex-wrap: wrap;
}
.settings-eyebrow {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin-bottom: 8px;
}
.settings-header h2 {
  font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 900;
  line-height: 1.15; margin-bottom: 6px;
}
.settings-header p { font-size: 0.88rem; color: var(--muted); max-width: 560px; }
.settings-header-actions { display: flex; gap: 10px; align-items: center; }
.settings-layout { align-items: start; }
.settings-left-col { display: flex; flex-direction: column; gap: 18px; }

.settings-profile-card .panel-body { padding-top: 18px; }
.settings-identity { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.settings-avatar {
  width: 78px; height: 78px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--cream);
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.settings-avatar img,
.settings-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.settings-avatar-fallback {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), #e0b85c);
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(200,147,58,0.2);
}
.settings-identity-meta { min-width: 0; }
.settings-name { font-size: 1.05rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.settings-email { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.settings-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.settings-pill {
  font-size: 0.72rem; font-weight: 700; color: var(--ink-soft);
  padding: 5px 10px; border-radius: 999px;
  background: var(--cream); border: 1px solid var(--line);
}
.settings-pill strong { color: var(--gold); font-family: 'DM Mono', monospace; font-weight: 800; }

.avatar-uploader {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 14px; background: #fbfbf9;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.avatar-uploader-copy strong { display: block; font-size: 0.86rem; font-weight: 800; color: var(--ink); }
.avatar-uploader-copy p { font-size: 0.78rem; color: var(--muted); margin-top: 2px; max-width: 360px; }
.avatar-uploader-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.avatar-uploader-hint { font-size: 0.72rem; color: var(--muted); width: 100%; }
.avatar-uploader-hint[data-kind="error"] { color: var(--red); font-weight: 700; }
.avatar-uploader-hint[data-kind="success"] { color: var(--green); font-weight: 700; }

.settings-security-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding-top: 16px; margin-top: 16px; border-top: 1px dashed var(--line);
  color: var(--muted);
}
.settings-security-dot {
  width: 10px; height: 10px; border-radius: 999px; background: var(--green);
  box-shadow: 0 0 0 4px rgba(26,122,74,0.12);
  margin-top: 4px; flex-shrink: 0;
}
.settings-security-note strong { display: block; color: var(--ink); font-size: 0.86rem; }
.settings-security-note span { display: block; font-size: 0.78rem; margin-top: 2px; }

.settings-sections { display: flex; flex-direction: column; gap: 18px; }
.settings-actions-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px;
}
.settings-muted { font-size: 0.78rem; color: var(--muted); }
.settings-help { font-size: 0.78rem; color: var(--muted); margin-top: 12px; }

.settings-flash {
  padding: 12px 14px; border-radius: 10px; font-size: 0.86rem; margin-bottom: 4px;
}
.settings-flash--success { background: #e8f8f0; color: #1a6b42; border: 1px solid #b8e6cc; }
.settings-flash--error { background: #fdeeee; color: #9b2c2c; border: 1px solid #f5c2c2; }

.settings-ledger { display: grid; gap: 10px; }
.settings-ledger-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--cream);
}
.settings-ledger-row strong { display: block; font-size: 0.86rem; color: var(--ink); }
.settings-ledger-row small { display: block; font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.settings-ledger-amt { font-family: 'DM Mono', monospace; font-weight: 800; font-size: 0.92rem; }
.settings-ledger-amt.is-credit { color: var(--teal); }
.settings-ledger-amt.is-debit { color: #c0392b; }

.settings-checklist { display: grid; gap: 10px; }
.settings-check {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--cream);
  cursor: pointer;
}
.settings-check input { margin-top: 3px; accent-color: var(--teal); }
.settings-check strong { display: block; font-size: 0.86rem; color: var(--ink); }
.settings-check small { display: block; font-size: 0.74rem; color: var(--muted); margin-top: 2px; }

/* Screen-reader only */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Alerts */
.alert { border-radius: 8px; padding: 16px 20px; margin-bottom: 20px; display: flex; gap: 14px; align-items: flex-start; font-size: 0.85rem; }
.alert-info { background: var(--teal-lt); border: 1.5px solid rgba(13,110,110,0.2); color: var(--teal); }
.alert-warn { background: linear-gradient(135deg,#fff8ed,#fef3d8); border: 1.5px solid var(--gold); }
.alert-success { background: var(--green-lt); border: 1.5px solid rgba(26,122,74,0.25); color: var(--green); }
.alert-error { background: var(--red-lt); border: 1.5px solid rgba(192,57,43,0.25); color: var(--red); }

/* Page header (dark) */
.page-header { background: var(--ink); padding: 56px 60px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.page-header-inner { max-width: 1200px; margin: 0 auto; }
.breadcrumb { font-size: 0.78rem; color: rgba(255,255,255,0.35); margin-bottom: 16px; }
.breadcrumb a { color: rgba(255,255,255,0.35); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.page-header h1 { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 900; color: var(--paper); line-height: 1.1; margin-bottom: 10px; }
.page-header h1 em { font-style: italic; color: var(--gold); }
.page-header > .page-header-inner > p { font-size: 0.9rem; color: rgba(255,255,255,0.45); max-width: 560px; margin-bottom: 32px; }

/* MCQ exam */
.exam-bar {
  background: var(--ink); color: #fff; padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.exam-timer { font-family: 'DM Mono', monospace; font-size: 1.2rem; font-weight: 700; color: var(--gold-lt); }
.exam-layout { max-width: 900px; margin: 0 auto; padding: 32px 24px 80px; }
.mcq-card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 28px; margin-bottom: 20px; }
.mcq-q-num { font-family: 'DM Mono', monospace; font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; }
.mcq-question { font-size: 1.05rem; font-weight: 600; margin-bottom: 20px; line-height: 1.5; }
.mcq-options { display: flex; flex-direction: column; gap: 10px; }
.mcq-option {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: 6px; cursor: pointer; transition: all .2s;
}
.mcq-option:hover { border-color: var(--teal); background: var(--teal-lt); }
.mcq-option.selected { border-color: var(--teal); background: var(--teal-lt); }
.mcq-option.correct { border-color: var(--green); background: var(--green-lt); }
.mcq-option.wrong { border-color: var(--red); background: var(--red-lt); }
.mcq-option input { accent-color: var(--teal); margin-top: 3px; }
.exam-nav { display: flex; justify-content: space-between; margin-top: 24px; }
.q-palette { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.q-dot {
  width: 32px; height: 32px; border-radius: 4px; border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; cursor: pointer; background: var(--paper);
}
.q-dot.answered { background: var(--teal-lt); border-color: var(--teal); color: var(--teal); }
.q-dot.current { background: var(--gold); border-color: var(--gold); color: #fff; }

/* Results */
.score-hero {
  background: var(--ink); border-radius: 12px; padding: 48px; text-align: center;
  color: #fff; margin-bottom: 28px; position: relative; overflow: hidden;
}
.score-hero::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,147,58,0.2), transparent 65%);
}
.score-ring {
  width: 140px; height: 140px; border-radius: 50%;
  border: 6px solid var(--gold); display: flex; flex-direction: column;
  align-items: center; justify-content: center; margin: 0 auto 20px;
}
.score-ring .pct { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 900; color: var(--gold-lt); }
.score-ring small { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

/* Progress steps */
.steps-bar { display: flex; gap: 0; margin-bottom: 32px; }
.step-item { flex: 1; text-align: center; position: relative; }
.step-item::after {
  content: ''; position: absolute; top: 16px; left: 50%; width: 100%; height: 2px;
  background: var(--line); z-index: 0;
}
.step-item:last-child::after { display: none; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--paper); display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; margin: 0 auto 8px; position: relative; z-index: 1;
}
.step-item.done .step-circle { background: var(--teal); border-color: var(--teal); color: #fff; }
.step-item.active .step-circle { background: var(--gold); border-color: var(--gold); color: #fff; }
.step-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; }

/* Loading */
.loading-screen {
  min-height: calc(100vh - 60px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 40px;
}
.loader-ring {
  width: 64px; height: 64px; border: 4px solid var(--line);
  border-top-color: var(--teal); border-radius: 50%;
  animation: spin 1s linear infinite; margin-bottom: 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { width: 320px; max-width: 90%; height: 6px; background: var(--line); border-radius: 3px; margin-top: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--teal); border-radius: 3px; transition: width .3s; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--paper); border-radius: 10px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.3); }
.modal-header { padding: 24px 28px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 900; }
.modal-body { padding: 28px; }
.modal-footer { padding: 20px 28px; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: flex-end; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
.modal-lg { max-width: 640px; }

/* Admin list toolbar, filters, pagination */
.admin-list-toolbar {
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.admin-list-toolbar-left { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin-list-toolbar-right { font-size: 0.8rem; color: var(--muted); }
.admin-search {
  display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 4px; background: var(--cream); overflow: hidden;
}
.admin-search input {
  padding: 8px 12px; border: none; font-family: 'DM Sans', sans-serif; font-size: 0.82rem;
  outline: none; width: 200px; background: transparent;
}
.admin-search span { padding: 0 10px; color: var(--muted); font-size: 0.85rem; }
.admin-filter-select {
  padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 4px;
  font-family: 'DM Sans', sans-serif; font-size: 0.8rem; background: var(--paper); color: var(--ink-soft); outline: none;
}
.admin-filter-select:focus { border-color: var(--gold); }
.admin-list-footer {
  padding: 14px 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.admin-pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-page-btn {
  min-width: 36px; height: 36px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 4px;
  background: var(--paper); font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all .15s;
}
.admin-page-btn a { text-decoration: none; color: inherit; }
.admin-page-btn:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.admin-page-btn.active { background: var(--gold); border-color: var(--gold); color: var(--paper); }
.admin-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.admin-list-empty {
  display: none; padding: 40px 24px; text-align: center; color: var(--muted); font-size: 0.88rem;
}
.admin-list-empty.visible { display: block; }
.admin-list-empty strong { display: block; color: var(--ink); margin-bottom: 6px; font-size: 0.95rem; }
tr.admin-row-hidden { display: none; }

/* Admin dashboard */
.admin-attention-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px;
}
.admin-attention-card {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.admin-attention-card:hover { border-color: var(--gold); box-shadow: 0 4px 20px rgba(200,147,58,0.1); }
.admin-attention-card.urgent { border-color: rgba(192,57,43,0.35); background: var(--red-lt); }
.admin-attention-card.warn { border-color: rgba(245,127,23,0.35); background: #fff8e1; }
.admin-attention-icon { font-size: 1.35rem; flex-shrink: 0; }
.admin-attention-card strong { display: block; font-size: 0.88rem; color: var(--ink); margin-bottom: 4px; }
.admin-attention-card p { font-size: 0.78rem; color: var(--muted); margin: 0; line-height: 1.4; }
.admin-attention-card .go { margin-left: auto; font-size: 0.75rem; font-weight: 700; color: var(--teal); white-space: nowrap; }

.admin-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.admin-kpi {
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 22px 24px;
}
.admin-kpi-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.admin-kpi-val { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 900; line-height: 1; }
.admin-kpi-sub { font-size: 0.75rem; color: var(--muted); margin-top: 8px; }
.admin-kpi-sub.up { color: var(--green); }
.admin-kpi-sub.dn { color: var(--red); }
.admin-kpi-link { display: inline-block; margin-top: 10px; font-size: 0.78rem; font-weight: 600; color: var(--teal); text-decoration: none; }
.admin-kpi-link:hover { text-decoration: underline; }

.admin-dash-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; margin-bottom: 28px; }
.admin-quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.admin-action-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--cream); text-decoration: none; color: inherit; transition: all .2s;
}
.admin-action-card:hover { border-color: var(--gold); background: var(--paper); }
.admin-action-card .ico { font-size: 1.4rem; }
.admin-action-card strong { font-size: 0.88rem; color: var(--ink); }
.admin-action-card span { font-size: 0.75rem; color: var(--muted); }

.admin-queue-table td:first-child { font-family: 'DM Mono', monospace; font-size: 0.78rem; color: var(--muted); }
.admin-health-bars { display: flex; flex-direction: column; gap: 12px; }
.admin-health-row { display: flex; align-items: center; gap: 12px; font-size: 0.82rem; }
.admin-health-row label { width: 72px; font-weight: 600; color: var(--ink-soft); flex-shrink: 0; }
.admin-health-track { flex: 1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.admin-health-fill { height: 100%; background: var(--teal); border-radius: 4px; }
.admin-health-row span { width: 36px; text-align: right; font-family: 'DM Mono', monospace; font-size: 0.75rem; color: var(--muted); }

.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.dot-upload { background: var(--teal-lt); }
.dot-user { background: var(--green-lt); }
.dot-download { background: #e8eaf6; }
.dot-payment { background: #fff3e0; }
.activity-text strong { font-size: 0.85rem; font-weight: 600; color: var(--ink); display: block; }
.activity-text p { font-size: 0.78rem; color: var(--muted); margin: 2px 0 0; }
.activity-time { margin-left: auto; font-size: 0.72rem; color: var(--muted); font-family: 'DM Mono', monospace; white-space: nowrap; }

.metric-change { font-size: 0.75rem; margin-top: 6px; }
.change-up { color: var(--green); }
.change-dn { color: var(--red); }
.table-search input { padding: 7px 12px; border: none; font-size: 0.82rem; outline: none; width: 180px; }

@media (max-width: 1100px) {
  .admin-attention-strip, .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .admin-attention-strip, .admin-kpi-grid, .admin-quick-actions { grid-template-columns: 1fr; }
}

/* Prototype hub */
.proto-hero { background: var(--ink); padding: 80px 60px 60px; color: #fff; }
.proto-hero h1 { font-family: 'Playfair Display', serif; font-size: 3rem; font-weight: 900; margin-bottom: 12px; }
.proto-hero h1 em { color: var(--gold); font-style: italic; }
.proto-wrap { max-width: 1200px; margin: 0 auto; padding: 48px 60px 80px; }
.proto-section { margin-bottom: 48px; }
.proto-section h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 900; margin-bottom: 8px; padding-bottom: 12px; border-bottom: 2px solid var(--line); }
.proto-section > p { font-size: 0.85rem; color: var(--muted); margin-bottom: 20px; }
.proto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.proto-link {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  text-decoration: none; transition: all .2s;
}
.proto-link:hover { border-color: var(--gold); box-shadow: 0 4px 16px rgba(200,147,58,0.12); }
.proto-link .ico { font-size: 1.3rem; }
.proto-link strong { display: block; font-size: 0.88rem; color: var(--ink); }
.proto-link small { font-size: 0.72rem; color: var(--muted); }
.proto-tag { margin-left: auto; font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--teal-lt); color: var(--teal); }

/* Subjective */
.subj-q { border: 1px solid var(--line); border-radius: 8px; padding: 24px; margin-bottom: 20px; background: var(--paper); }
.subj-marks { font-family: 'DM Mono', monospace; font-size: 0.75rem; color: var(--gold); font-weight: 700; margin-bottom: 8px; }
.answer-area {
  margin-top: 16px; padding: 16px; background: var(--cream);
  border: 1px dashed var(--line); border-radius: 6px; min-height: 80px;
  font-size: 0.85rem; color: var(--muted);
}

/* Pricing cards inline */
.pricing-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.price-card { border: 1px solid var(--line); border-radius: 8px; padding: 24px; background: var(--paper); }
.price-card.featured { background: var(--ink); color: #fff; border-color: var(--ink); }
.price-card.featured .price-amt { color: #fff; }

@media (max-width: 1100px) {
  .stat-row, .metrics-grid, .two-col, .three-col, .form-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
/* Sidebar mobile behavior — see RESPONSIVE section at end of file */

/* ── Public site footer (index) ── */
.site-footer {
  background: #080809;
  padding: 60px 80px 40px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 32px;
}
.site-footer .footer-brand .nav-logo {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--paper);
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 900;
  text-decoration: none;
}
.site-footer .footer-brand .nav-logo span { color: var(--gold); }
.site-footer .footer-brand p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
  line-height: 1.7;
  max-width: 90%;
}
.site-footer .footer-social {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.site-footer .footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color .2s, border-color .2s, background .2s;
}
.site-footer .footer-social a:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(200, 147, 58, 0.08);
}
.site-footer .footer-social svg {
  width: 16px;
  height: 16px;
}
.site-footer .footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
}
.site-footer .footer-col ul { list-style: none; }
.site-footer .footer-col ul li { margin-bottom: 10px; }
.site-footer .footer-col ul li a {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color .2s;
}
.site-footer .footer-col ul li a:hover { color: var(--gold); }
.site-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer .footer-bottom p { font-size: 0.78rem; color: rgba(255,255,255,0.25); }
.site-footer .footer-links { display: flex; gap: 24px; }
.site-footer .footer-links a {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.25);
  text-decoration: none;
}
.site-footer .footer-links a:hover { color: rgba(255,255,255,0.5); }

/* Reusable nav dropdown (header & anywhere) */
.nav-dropdown { position: relative; list-style: none; }
.nav-dropdown-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 0.88rem; font-weight: 500;
  color: var(--ink-soft); transition: color .2s;
}
.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-dropdown-trigger,
.nav-dropdown.active .nav-dropdown-trigger { color: var(--ink); font-weight: 700; }
.nav-dropdown-chevron {
  display: inline-block; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .2s;
  margin-left: 2px;
}
.nav-dropdown.open .nav-dropdown-chevron { transform: rotate(-135deg) translateY(2px); }
.nav-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translateX(-50%);
  min-width: 280px; max-width: 320px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 16px 48px rgba(0,0,0,0.12);
  padding: 12px 0; z-index: 120;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-section-title {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); padding: 8px 16px 6px;
}
.nav-dropdown-item {
  display: block; padding: 10px 16px; text-decoration: none;
  transition: background .15s;
}
.nav-dropdown-item:hover { background: var(--cream); }
.nav-dropdown-item-label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.nav-dropdown-item-hint { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

/* Profile dropdown — logged-in public nav */
.nav-profile { position: relative; }
.nav-profile-trigger {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 5px; border: 1.5px solid var(--line);
  border-radius: 999px; background: var(--paper); cursor: pointer;
  font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.nav-profile-trigger:hover,
.nav-profile.open .nav-profile-trigger {
  border-color: rgba(200,147,58,0.45);
  box-shadow: 0 4px 18px rgba(200,147,58,0.12);
}
.nav-profile-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #e0b85c);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: #fff;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px rgba(200,147,58,0.35);
  flex-shrink: 0;
}
.nav-profile-meta { text-align: left; line-height: 1.2; }
.nav-profile-name {
  display: block; font-size: 0.82rem; font-weight: 700; color: var(--ink);
  max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-profile-board {
  display: block; font-size: 0.68rem; color: var(--muted); font-weight: 500;
  max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-profile-chevron {
  display: inline-block; width: 7px; height: 7px; margin-left: 2px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform .2s, border-color .2s;
  flex-shrink: 0;
}
.nav-profile.open .nav-profile-chevron {
  transform: rotate(-135deg) translateY(2px);
  border-color: var(--gold);
}
.nav-profile-menu {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  width: 300px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 56px rgba(13,13,15,0.14), 0 4px 12px rgba(13,13,15,0.06);
  overflow: hidden; z-index: 130;
  animation: navProfileIn .18s ease;
}
@keyframes navProfileIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.nav-profile.open .nav-profile-menu { display: block; }
.nav-profile-menu-head {
  background: linear-gradient(145deg, var(--ink) 0%, #1a1a24 100%);
  padding: 20px 18px 18px; display: flex; align-items: center; gap: 14px;
  position: relative; overflow: hidden;
}
.nav-profile-menu-head::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,147,58,0.2), transparent 70%);
}
.nav-profile-menu-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #e8c56a);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #fff;
  box-shadow: 0 4px 16px rgba(200,147,58,0.35);
  position: relative; z-index: 1;
}
.nav-profile-menu-name {
  font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700;
  color: #fff; position: relative; z-index: 1;
}
.nav-profile-menu-email {
  font-size: 0.74rem; color: rgba(255,255,255,0.45); margin-top: 2px;
  position: relative; z-index: 1;
}
.nav-profile-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border-bottom: 1px solid var(--line);
}
.nav-profile-stat {
  background: var(--cream); padding: 12px 16px; text-align: center;
}
.nav-profile-stat strong {
  display: block; font-family: 'DM Mono', monospace;
  font-size: 1.1rem; font-weight: 700; color: var(--gold); line-height: 1.2;
}
.nav-profile-stat span {
  display: block; font-size: 0.68rem; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px;
}
.nav-profile-menu-body { padding: 8px; }
.nav-profile-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--ink-soft);
  font-size: 0.86rem; font-weight: 500; transition: background .15s, color .15s;
}
.nav-profile-item:hover {
  background: var(--cream); color: var(--ink);
}
.nav-profile-item-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--cream); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 0.95rem;
  transition: background .15s;
}
.nav-profile-item:hover .nav-profile-item-icon { background: var(--teal-lt); }
.nav-profile-item-label { font-weight: 600; color: var(--ink); display: block; }
.nav-profile-item-hint { font-size: 0.7rem; color: var(--muted); display: block; margin-top: 1px; }
.nav-profile-item--highlight {
  background: linear-gradient(135deg, rgba(13,110,110,0.08), rgba(13,110,110,0.04));
  border: 1px solid rgba(13,110,110,0.12); margin-bottom: 4px;
}
.nav-profile-item--highlight .nav-profile-item-icon { background: var(--teal-lt); }
.nav-profile-menu-footer {
  padding: 8px 8px 10px; border-top: 1px solid var(--line);
}
.nav-profile-signout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px; border-radius: 8px;
  font-size: 0.84rem; font-weight: 600; color: var(--red);
  text-decoration: none; transition: background .15s;
}
.nav-profile-signout:hover { background: var(--red-lt); }
.nav-profile-signout svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Ad placement slots (AdSense / sponsors) */
.ad-slot {
  display: flex; flex-direction: column; align-items: center;
  margin: 24px auto; max-width: 100%;
}
.ad-slot-eyebrow {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin-bottom: 8px; width: 100%;
  text-align: center;
}
.ad-slot-inner {
  width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; padding: 20px 16px;
  background: repeating-linear-gradient(
    -45deg, var(--cream), var(--cream) 8px,
    var(--paper) 8px, var(--paper) 16px
  );
  border: 1.5px dashed var(--line); border-radius: 8px;
  min-height: 90px;
}
.ad-slot-dims { font-family: 'DM Mono', monospace; font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.ad-slot-note { font-size: 0.72rem; color: var(--muted); }
.ad-slot-code-hint { font-size: 0.65rem; color: var(--muted); opacity: 0.7; margin-top: 4px; }
.ad-leaderboard .ad-slot-inner { max-width: 728px; min-height: 90px; }
.ad-banner .ad-slot-inner { max-width: 970px; min-height: 90px; }
.ad-rectangle .ad-slot-inner { max-width: 300px; min-height: 250px; }
.ad-skyscraper .ad-slot-inner { max-width: 160px; min-height: 400px; margin: 0 auto; }
.ad-infeed .ad-slot-inner { max-width: 100%; min-height: 120px; }
.ad-mobile .ad-slot-inner { max-width: 320px; min-height: 50px; }
.ad-sticky-mobile {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 35;
  margin: 0; background: var(--paper); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.ad-sticky-mobile .ad-slot-inner { min-height: 50px; border: none; border-radius: 0; }
body:has(.ad-sticky-mobile) { padding-bottom: 56px; }
.ad-slot--flush { margin-left: 0; margin-right: 0; }
.ad-slot--sidebar { margin: 20px 0 0; }

/* Auth flow pages — keep full site footer visible below the card */
body.auth-flow-page {
  display: block;
  min-height: 100vh;
}
body.auth-flow-page.public-page-wrap {
  display: block;
  min-height: auto;
}
body.auth-flow-page .login-wrap,
body.auth-flow-page .verify-wrap,
body.auth-flow-page .page-wrap {
  flex: none;
  min-height: 0;
}
body.auth-flow-page .auth-layout {
  flex: none;
  min-height: auto;
}
body.auth-flow-page #site-footer-mount,
body.auth-flow-page .site-footer {
  position: relative;
  z-index: 5;
  width: 100%;
}
.auth-footer-minimal {
  position: relative; z-index: 5;
  text-align: center; padding: 20px 16px 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: var(--ink);
}
.auth-footer-minimal p {
  font-size: 0.75rem; color: rgba(255,255,255,0.25); margin-bottom: 10px;
}
.auth-footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px;
}
.auth-footer-links a {
  font-size: 0.78rem; color: rgba(255,255,255,0.4); text-decoration: none;
}
.auth-footer-links a:hover { color: var(--gold); }
body.auth-flow-page.register-flow .auth-footer-minimal {
  background: var(--cream); border-top-color: var(--line);
}
body.auth-flow-page.register-flow .auth-footer-minimal p,
body.auth-flow-page.register-flow .auth-footer-links a { color: var(--muted); }
body.auth-flow-page.register-flow .auth-footer-links a:hover { color: var(--ink); }

.public-page-wrap { display: flex; flex-direction: column; min-height: 100vh; }
body.auth-flow-page.public-page-wrap { min-height: auto; }
.public-page-wrap main, .public-page-wrap > .content-page { flex: 1; }
.public-page-wrap .page-header { padding-top: 68px; }
.public-page-wrap .content-page,
.public-page-wrap .legal { padding-top: 24px; }
.public-page-wrap .seo-hero { padding-top: 68px; }
.auth-with-public-nav .login-wrap,
.auth-with-public-nav .page-wrap,
.auth-with-public-nav .verify-wrap { padding-top: 24px; }
.auth-with-public-nav .bg-canvas { z-index: 0; }
.auth-with-public-nav #public-nav-mount { position: relative; z-index: 110; }
.auth-with-public-nav .login-wrap,
.auth-with-public-nav .verify-wrap { position: relative; z-index: 5; }

/* SEO past papers hub */
.seo-hero { background: var(--ink); padding: 56px 60px 48px; color: #fff; }
.seo-hero-inner { max-width: 1200px; margin: 0 auto; }
.seo-hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; line-height: 1.1; margin-bottom: 16px; }
.seo-hero h1 em { color: var(--gold); font-style: italic; }
.seo-hero .lead { font-size: 1rem; color: rgba(255,255,255,0.5); max-width: 720px; line-height: 1.7; margin-bottom: 28px; }
.seo-search { display: flex; max-width: 560px; border-radius: 6px; overflow: hidden; border: 1.5px solid rgba(255,255,255,0.15); }
.seo-search input { flex: 1; padding: 14px 18px; border: none; font-family: inherit; font-size: 0.95rem; outline: none; }
.seo-search button { padding: 14px 24px; background: var(--gold); border: none; color: #fff; font-weight: 700; cursor: pointer; }
.seo-body { max-width: 1200px; margin: 0 auto; padding: 48px 60px 60px; }
.seo-section { margin-bottom: 48px; }
.seo-section h2 { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 900; margin-bottom: 8px; }
.seo-section > p { font-size: 0.88rem; color: var(--muted); margin-bottom: 20px; }
.seo-link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.seo-link-grid a {
  display: block; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; text-decoration: none; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft);
  transition: all .2s;
}
.seo-link-grid a:hover { border-color: var(--gold); color: var(--ink); }
.seo-link-grid a small { display: block; font-size: 0.72rem; font-weight: 400; color: var(--muted); margin-top: 4px; }
.seo-faq { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.seo-faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.seo-faq details:last-child { border-bottom: none; }
.seo-faq summary { font-weight: 700; cursor: pointer; font-size: 0.95rem; }
.seo-faq p { font-size: 0.88rem; color: var(--muted); margin-top: 10px; line-height: 1.6; }

/* ── Landing page (index) ── */
.landing-hero {
  background: linear-gradient(135deg, var(--ink) 0%, #151520 50%, #0a2828 100%);
  color: #fff; padding: clamp(48px, 8vw, 88px) clamp(24px, 5vw, 64px);
  position: relative; overflow: hidden;
}
.landing-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 40%, rgba(200,147,58,0.12), transparent);
}
.landing-hero-inner {
  max-width: 1200px; margin: 0 auto; position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center;
}
.landing-ad-wrap {
  max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px);
}
.landing-ad-infeed { max-width: 800px; }
.landing-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold-lt); margin-bottom: 16px;
  display: inline-flex; align-items: center; gap: 10px;
}
.landing-eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--gold); }
.landing-hero h1 {
  font-family: 'Playfair Display', serif; font-size: clamp(2.4rem, 5vw, 3.75rem);
  font-weight: 900; line-height: 1.06; letter-spacing: -0.03em; margin-bottom: 20px;
}
.landing-hero h1 em { font-style: italic; color: var(--gold-lt); }
.landing-lead { font-size: 1.05rem; color: rgba(255,255,255,0.55); line-height: 1.7; margin-bottom: 28px; max-width: 520px; }
.landing-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.landing-cta-primary {
  background: var(--gold); color: #fff; padding: 15px 32px; font-weight: 700; font-size: 0.95rem;
  border-radius: 6px; text-decoration: none; box-shadow: 0 8px 28px rgba(200,147,58,0.35);
}
.landing-cta-primary:hover { background: #b07d28; }
.landing-cta-secondary {
  border: 1.5px solid rgba(255,255,255,0.35); color: #fff; padding: 14px 28px;
  font-weight: 600; border-radius: 6px; text-decoration: none;
}
.landing-cta-secondary:hover { background: rgba(255,255,255,0.08); border-color: #fff; }
.landing-trust { display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.8rem; color: rgba(255,255,255,0.4); }
.landing-trust span::before { content: '✓ '; color: var(--gold-lt); font-weight: 700; }
.landing-hero-card {
  background: var(--paper); border-radius: 12px; padding: 28px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45); color: var(--ink);
}
.landing-hero-card .badge-ai {
  display: inline-block; background: var(--gold); color: #fff; font-size: 0.68rem;
  font-weight: 700; padding: 4px 12px; border-radius: 20px; margin-bottom: 16px;
}
.badge-ai-icon { margin-right: 4px; }
.landing-stats-strip {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.landing-stat { padding: 28px 24px; text-align: center; border-right: 1px solid var(--line); }
.landing-stat:last-child { border-right: none; }
.landing-stat strong {
  font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 900;
  color: var(--ink); display: block; line-height: 1;
}
.landing-stat strong span { color: var(--gold); }
.landing-stat small { font-size: 0.78rem; color: var(--muted); margin-top: 6px; display: block; }
.landing-section {
  max-width: 1200px; margin: 0 auto; padding: clamp(48px, 6vw, 72px) clamp(24px, 5vw, 48px);
}
.landing-section-head { margin-bottom: 40px; max-width: 90%; }
.landing-label {
  font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--gold);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 10px;
}
.landing-section-head h2 {
  font-family: 'Playfair Display', serif; font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 900; line-height: 1.12; margin-bottom: 12px;
}
.landing-section-head p { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.65; }
.landing-steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.landing-step {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 24px 20px; transition: box-shadow .2s, border-color .2s;
}
.landing-step:hover { border-color: var(--gold); box-shadow: 0 8px 24px rgba(200,147,58,0.1); }
.landing-step-num { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 900; color: var(--line); }
.landing-step h3 { font-size: 0.95rem; font-weight: 700; margin: 12px 0 8px; }
.landing-step p { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }
.landing-dual {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.landing-dual-card {
  border-radius: 12px; padding: 32px; border: 1px solid var(--line);
  background: var(--paper); display: flex; flex-direction: column;
}
.landing-dual-card.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.landing-dual-card h3 { font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 900; margin-bottom: 10px; }
.landing-dual-icon { margin-right: 8px; }
.landing-dual-card p { font-size: 0.88rem; color: var(--muted); flex: 1; margin-bottom: 20px; line-height: 1.6; }
.landing-dual-card.dark p { color: rgba(255,255,255,0.5); }
.landing-boards {
  background: var(--ink); padding: clamp(48px, 6vw, 72px) clamp(24px, 5vw, 48px);
}
.landing-boards .landing-section-head h2, .landing-boards .landing-section-head p { color: #fff; }
.landing-boards .landing-section-head p { color: rgba(255,255,255,0.45); }
.landing-boards-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.landing-board-tile {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 22px; text-decoration: none; color: inherit;
  transition: background .2s, border-color .2s;
}
.landing-board-tile:hover { background: rgba(255,255,255,0.08); border-color: var(--gold); }
.landing-board-tile strong { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--gold-lt); display: block; }
.landing-board-tile span { font-size: 0.78rem; color: rgba(255,255,255,0.4); margin-top: 6px; display: block; line-height: 1.4; }
.landing-boards-grid--compact { margin-top: 28px; }
.landing-boards-grid--compact .landing-board-tile {
  background: var(--paper); border-color: var(--line);
}
.landing-boards-grid--compact .landing-board-tile:hover {
  background: var(--cream); border-color: var(--gold);
}
.landing-boards-grid--compact .landing-board-tile strong { color: var(--ink); }
.landing-boards-grid--compact .landing-board-tile span { color: var(--muted); }
.landing-features {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.landing-feat {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 28px; display: grid; grid-template-columns: auto 1fr; gap: 16px;
}
.landing-feat-icon {
  width: 48px; height: 48px; border-radius: 10px; background: var(--teal-lt);
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.landing-feat h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.landing-feat p { font-size: 0.84rem; color: var(--muted); line-height: 1.55; }
.landing-pricing {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.landing-price-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 32px 28px; position: relative;
}
.landing-price-card.popular { background: var(--ink); color: #fff; border-color: var(--ink); transform: scale(1.02); }
.landing-price-card .tag {
  position: absolute; top: -10px; left: 24px; background: var(--gold); color: #fff;
  font-size: 0.65rem; font-weight: 700; padding: 4px 12px; border-radius: 20px;
}
.landing-price-amt { font-family: 'Playfair Display', serif; font-size: 2.5rem; font-weight: 900; }
.landing-cta-final {
  background: linear-gradient(135deg, var(--teal), #0a5454);
  padding: 56px clamp(24px, 5vw, 48px); text-align: center; color: #fff;
}
.landing-cta-final h2 { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 900; margin-bottom: 12px; }
.landing-cta-final p { opacity: 0.75; margin-bottom: 28px; font-size: 0.95rem; }
.landing-cta-final a {
  display: inline-block; background: var(--cream); color: var(--teal);
  padding: 16px 40px; font-weight: 700; border-radius: 6px; text-decoration: none;
}

/* Scrolling testimonials */
.landing-testimonials {
  background: var(--ink);
  padding: 56px 0 64px;
  overflow: hidden;
  position: relative;
}
.landing-testimonials::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200,147,58,0.12), transparent 70%);
  pointer-events: none;
}
.landing-testimonials-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  position: relative; z-index: 1;
}
.landing-testimonials-head {
  text-align: center; max-width: 640px; margin: 0 auto 36px;
}
.landing-testimonials-head h2,
.landing-testimonials-head p { color: #fff; }
.landing-testimonials-head p { color: rgba(255,255,255,0.5); margin-top: 8px; }
.landing-testimonials-head .landing-label { color: var(--gold-lt); }
.landing-testimonials-rating {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  justify-content: center; margin-top: 18px;
  padding: 8px 18px; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.82rem; color: rgba(255,255,255,0.55);
}
.landing-testimonials-stars {
  color: var(--gold-lt); letter-spacing: 0.08em; font-size: 0.9rem;
}
.landing-testimonials-rating strong {
  font-family: 'DM Mono', monospace; font-size: 1rem; color: var(--gold-lt);
}

.testimonials-marquee {
  overflow: hidden;
  margin-bottom: 16px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.testimonials-marquee:last-child { margin-bottom: 0; }
.testimonials-track {
  display: flex; gap: 18px; width: max-content;
  animation: testimonials-scroll 52s linear infinite;
  will-change: transform;
}
.testimonials-marquee--rev .testimonials-track {
  animation-name: testimonials-scroll-rev;
  animation-duration: 58s;
}
.testimonials-marquee:hover .testimonials-track { animation-play-state: paused; }

@keyframes testimonials-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes testimonials-scroll-rev {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.testimonial-card {
  flex: 0 0 340px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 22px 22px 18px;
  backdrop-filter: blur(8px);
  transition: border-color .2s, background .2s, transform .2s;
}
.testimonial-card:hover {
  border-color: rgba(200,147,58,0.45);
  background: rgba(255,255,255,0.07);
  transform: translateY(-2px);
}
.testimonial-card--alt {
  background: rgba(13,110,110,0.12);
  border-color: rgba(13,110,110,0.25);
}
.testimonial-card--alt:hover {
  border-color: rgba(13,110,110,0.5);
  background: rgba(13,110,110,0.18);
}
.testimonial-stars {
  color: var(--gold-lt); font-size: 0.82rem; letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.testimonial-card blockquote {
  font-size: 0.9rem; line-height: 1.6; color: rgba(255,255,255,0.82);
  margin: 0 0 18px; font-style: normal;
}
.testimonial-card footer {
  display: flex; align-items: center; gap: 12px;
  padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08);
}
.testimonial-avatar {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #e0b85c);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800; color: #fff;
  box-shadow: 0 4px 14px rgba(200,147,58,0.25);
}
.testimonial-avatar--img {
  object-fit: cover; display: block; background: transparent;
}
.testimonial-card footer strong {
  display: block; font-size: 0.86rem; font-weight: 700; color: #fff;
}
.testimonial-card footer small {
  display: block; font-size: 0.72rem; color: rgba(255,255,255,0.42); margin-top: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .testimonials-track { animation: none; flex-wrap: wrap; width: 100%; justify-content: center; }
  .testimonials-marquee { -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .testimonial-card { flex: 1 1 300px; max-width: 360px; }
}

/* Past paper detail */
.pp-detail-hero { background: var(--ink); padding: 88px clamp(24px, 5vw, 48px) 36px; color: #fff; }
.pp-detail-hero-inner { max-width: 1280px; margin: 0 auto; }
.pp-detail-layout {
  max-width: 1280px; margin: 0 auto;
  padding: 32px clamp(24px, 5vw, 48px) 80px;
  display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start;
}
.pp-board-sidebar {
  position: sticky; top: 88px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  overflow-x: hidden; overflow-y: auto;
  max-height: calc(100vh - 100px);
  display: flex; flex-direction: column;
}
.pp-sidebar-header {
  background: var(--ink); color: #fff; padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pp-sidebar-header h3 {
  font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; margin-bottom: 4px;
}
.pp-sidebar-header p { font-size: 0.75rem; color: rgba(255,255,255,0.45); line-height: 1.4; }
.pp-sidebar-header .board-abbr {
  font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 900;
  color: var(--gold-lt); display: block; margin-bottom: 6px;
}
.pp-sidebar-count {
  display: inline-block; margin-top: 10px; font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(200,147,58,0.2); color: var(--gold-lt); padding: 4px 10px; border-radius: 20px;
}
.pp-sidebar-list { overflow: visible; flex: 1 1 auto; padding: 8px 0; min-height: 0; }
.pp-sidebar-item {
  display: block; padding: 14px 20px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--line); transition: background .15s;
}
.pp-sidebar-item:last-child { border-bottom: none; }
.pp-sidebar-item:hover { background: var(--cream); }
.pp-sidebar-item.active {
  background: var(--teal-lt); border-left: 3px solid var(--teal);
  padding-left: 17px;
}
.pp-sidebar-item .si-subject { font-size: 0.9rem; font-weight: 700; color: var(--ink); display: block; }
.pp-sidebar-item .si-meta {
  font-size: 0.75rem; color: var(--muted); margin-top: 4px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.pp-sidebar-item .si-year {
  font-family: 'DM Mono', monospace; font-size: 0.72rem; font-weight: 600;
  color: var(--teal); background: var(--teal-lt); padding: 2px 8px; border-radius: 20px;
}
.pp-sidebar-item.active .si-year { background: var(--teal); color: #fff; }
.pp-sidebar-footer {
  padding: 14px 18px; border-top: 1px solid var(--line); background: var(--cream);
  flex-shrink: 0;
}
.pp-board-sidebar .ad-slot--sidebar { flex-shrink: 0; }
.pp-sidebar-footer a {
  display: block; text-align: center; font-size: 0.82rem; font-weight: 700;
  color: var(--teal); text-decoration: none; padding: 10px;
  border-radius: 6px; border: 1.5px solid var(--line); background: var(--paper);
}
.pp-sidebar-footer a:hover { border-color: var(--teal); }
.pp-detail-main { min-width: 0; }
.pp-detail-body { padding: 0; max-width: none; }
.pp-meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.pp-meta-box { background: rgba(255,255,255,0.06); padding: 16px; border-radius: 8px; }
.pp-meta-box label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.35); }
.pp-meta-box strong { display: block; margin-top: 6px; font-size: 0.95rem; }
.pp-download-card {
  background: var(--paper); border: 2px solid var(--gold); border-radius: 12px;
  padding: 32px; margin: 32px 0; text-align: center;
}
.pp-download-card h2 { font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 900; margin-bottom: 8px; }
.btn-view-paper {
  font-size: 0.78rem; font-weight: 700; color: var(--teal); background: var(--teal-lt);
  border: none; border-radius: 4px; padding: 6px 14px; text-decoration: none; display: inline-block;
}
.btn-view-paper:hover { background: var(--teal); color: #fff; }
.paper-card { text-decoration: none; color: inherit; display: block; }
.paper-card-footer .btn-download { display: none; }

/* Past papers library — filter sidebar */
.library-layout {
  max-width: 1280px; margin: 0 auto;
  padding: 32px clamp(24px, 5vw, 48px) 64px;
  display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start;
}
.library-filters {
  position: sticky; top: 88px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  overflow-x: hidden; overflow-y: auto;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 100px);
}
.library-filters > form {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
}
.library-filters-head {
  background: var(--ink); color: #fff; padding: 22px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.library-filters-head h3 {
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 4px;
}
.library-filters-head p { font-size: 0.78rem; color: rgba(255,255,255,0.45); }
.library-filters-active {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(200,147,58,0.2); color: var(--gold-lt); padding: 5px 10px; border-radius: 20px;
}
.library-filters-body { overflow-y: auto; flex: 1; min-height: 0; padding: 8px 0; }
.library-filter-section {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.library-filter-section:last-of-type { border-bottom: none; }
.library-filter-section-title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.library-filter-section-title span {
  font-family: 'DM Mono', monospace; font-size: 0.65rem;
  color: var(--teal); background: var(--teal-lt); padding: 2px 8px; border-radius: 20px;
  text-transform: none; letter-spacing: 0;
}
.library-search-wrap { position: relative; }
.library-search-wrap input {
  width: 100%; padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--line); border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
  background: var(--cream); outline: none; transition: border-color .2s, box-shadow .2s;
}
.library-search-wrap input:focus {
  border-color: var(--gold); background: var(--paper);
  box-shadow: 0 0 0 3px rgba(200,147,58,0.12);
}
.library-search-wrap .search-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 0.95rem; color: var(--muted); pointer-events: none;
}
.library-select-wrap { position: relative; }
.library-select-wrap select {
  width: 100%; padding: 11px 36px 11px 14px;
  border: 1.5px solid var(--line); border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 500;
  color: var(--ink); background: var(--cream); outline: none;
  appearance: none; cursor: pointer; transition: border-color .2s;
}
.library-select-wrap select:focus { border-color: var(--teal); background: var(--paper); }
.library-select-wrap::after {
  content: '▾'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 0.75rem; pointer-events: none;
}
.library-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.library-chip {
  padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); background: var(--paper);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.library-chip:hover { border-color: var(--ink-soft); color: var(--ink); }
.library-chip.active {
  background: var(--teal-lt); border-color: var(--teal); color: var(--teal);
}
.library-chip.gold.active {
  background: rgba(200,147,58,0.12); border-color: var(--gold); color: var(--gold);
}
.library-check-list { display: flex; flex-direction: column; gap: 4px; }
.library-check-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; transition: background .15s;
  border: 1px solid transparent;
}
.library-check-row:hover { background: var(--cream); }
.library-check-row:has(input:checked) {
  background: var(--teal-lt); border-color: rgba(13,110,110,0.15);
}
.library-check-row input {
  width: 18px; height: 18px; accent-color: var(--teal); flex-shrink: 0; cursor: pointer;
}
.library-check-row .cr-label { flex: 1; font-size: 0.86rem; font-weight: 500; color: var(--ink-soft); }
.library-check-row:has(input:checked) .cr-label { color: var(--ink); font-weight: 600; }
.library-check-row .cr-count {
  font-family: 'DM Mono', monospace; font-size: 0.72rem; font-weight: 600;
  color: var(--muted); background: var(--cream); padding: 2px 8px; border-radius: 20px;
}
.library-check-row:has(input:checked) .cr-count { background: var(--paper); color: var(--teal); }
.library-year-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.library-filters-foot {
  padding: 16px 20px; border-top: 1px solid var(--line); background: var(--cream);
  display: flex; flex-direction: column; gap: 8px;
  flex-shrink: 0;
}
.library-filters > .ad-slot--sidebar { flex-shrink: 0; }
.library-filters-foot .btn-apply-filters {
  width: 100%; padding: 12px; background: var(--gold); border: none; border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 700; color: #fff;
  cursor: pointer; transition: background .2s;
}
.library-filters-foot .btn-apply-filters:hover { background: #b07d28; }
.library-filters-foot .btn-clear-filters {
  width: 100%; padding: 10px; background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 8px; font-size: 0.82rem; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: inherit;
}
.library-filters-foot .btn-clear-filters:hover { border-color: var(--ink); color: var(--ink); }

@media (max-width: 960px) {
  .library-layout { grid-template-columns: 1fr; }
  .library-filters { position: static; max-height: none; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — mobile & tablet (nothing removed, layouts adapt)
   ═══════════════════════════════════════════════════════════════ */

/* Public nav drawer */
.nav-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--line);
  border-radius: 8px; background: var(--paper); cursor: pointer;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-toggle-icon {
  display: block; width: 18px; height: 2px; background: var(--ink);
  position: relative; border-radius: 1px;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: ''; position: absolute; left: 0; width: 18px; height: 2px;
  background: var(--ink); border-radius: 1px; transition: transform .2s;
}
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }
body.public-nav-open .nav-toggle-icon { background: transparent; }
body.public-nav-open .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
body.public-nav-open .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); }

.nav-drawer { display: flex; align-items: center; gap: clamp(16px, 3vw, 32px); overflow: visible; }

/* Shell overlay + mobile bar (student / admin) */
.shell-overlay {
  display: none; position: fixed; inset: 0; z-index: 45;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(2px);
}
.shell-overlay.visible { display: block; }

.shell-mobile-bar {
  display: none; align-items: center; gap: 12px;
  padding: 0 16px; height: 56px;
  background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 42;
}
.shell-menu-toggle {
  width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--line);
  border-radius: 8px; background: var(--cream); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.shell-menu-icon {
  display: block; width: 18px; height: 2px; background: var(--ink); position: relative; border-radius: 1px;
}
.shell-menu-icon::before,
.shell-menu-icon::after {
  content: ''; position: absolute; left: 0; width: 18px; height: 2px;
  background: var(--ink); border-radius: 1px;
}
.shell-menu-icon::before { top: -6px; }
.shell-menu-icon::after { top: 6px; }
.shell-mobile-title {
  flex: 1; font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 900;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shell-mobile-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.shell-mobile-actions .quota-pill { padding: 4px 10px; }
.shell-mobile-actions .quota-pill .label { display: none; }

/* Auth — login / register (shared with inline page markup) */
.login-wrap {
  flex: 1; position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 24px);
}
.login-card {
  display: grid; grid-template-columns: minmax(280px, 340px) minmax(300px, 420px);
  width: 100%; max-width: 820px;
  background: var(--paper); border-radius: 12px; overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,0.55);
}
.card-left {
  background: linear-gradient(160deg, #111118 0%, #0a0a10 100%);
  padding: clamp(32px, 5vw, 48px) clamp(24px, 4vw, 40px);
  display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid rgba(255,255,255,0.07);
}
.card-right {
  padding: clamp(32px, 5vw, 52px) clamp(24px, 4vw, 48px);
  display: flex; flex-direction: column; justify-content: center;
}
.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.auth-layout {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr;
  min-height: 0;
}
.auth-left {
  background: var(--ink); padding: clamp(40px, 8vw, 80px) clamp(24px, 5vw, 60px);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-right {
  background: var(--paper); padding: clamp(32px, 6vw, 60px) clamp(24px, 5vw, 70px);
  display: flex; align-items: center; justify-content: center;
}
.auth-form-wrap { width: 100%; max-width: 440px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.social-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Tables scroll on small screens */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 560px; }

/* Page header tabs (past papers library) */
.filter-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
.filter-tab { flex-shrink: 0; white-space: nowrap; }

@media (max-width: 1100px) {
  .landing-hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .landing-stats-strip { grid-template-columns: repeat(2, 1fr); }
  .landing-stat:nth-child(2) { border-right: none; }
  .landing-steps, .landing-boards-grid, .landing-pricing { grid-template-columns: repeat(2, 1fr); }
  .landing-dual, .landing-features { grid-template-columns: 1fr; }
  .seo-body { padding: 40px 32px 48px; }
  .seo-hero { padding: 48px 32px 40px; }
  .site-footer { padding: 48px 40px 32px; }
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .site-footer .footer-brand { grid-column: 1 / -1; }
  .library-layout { grid-template-columns: 1fr; }
  .library-filters { position: static; max-height: none; }
  .pp-detail-layout { grid-template-columns: 1fr; }
  .pp-board-sidebar { position: static; max-height: none; order: 2; }
  .pp-detail-main { order: 1; }
}

@media (max-width: 900px) {
  .login-card { grid-template-columns: 1fr; max-width: 480px; }
  .card-left { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-left { min-height: auto; }
  .checkout-grid { grid-template-columns: 1fr !important; }
  .pricing-grid { grid-template-columns: 1fr !important; }
  .paper-hero { grid-template-columns: 1fr !important; }
  .meta-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .action-cards { grid-template-columns: 1fr !important; }
  .result-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .papers-top { flex-direction: column; align-items: stretch !important; }
  .papers-top > div { width: 100%; }
  .papers-top .search-bar { width: 100%; }
  .papers-top .search-bar input { flex: 1; min-width: 0; }
}

@media (max-width: 768px) {
  /* Public navigation — drawer */
  .nav-toggle { display: flex; }
  .public-nav { padding: 0 16px; height: 60px; }
  body.has-public-nav { padding-top: 60px; }
  .nav-drawer {
    display: none; position: fixed; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(250,249,246,0.98); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 16px 20px 24px; max-height: calc(100vh - 60px); overflow-y: auto;
    z-index: 99; box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  }
  body.public-nav-open .nav-drawer { display: flex; }
  .nav-drawer .nav-links {
    flex-direction: column; align-items: stretch; gap: 0; width: 100%;
  }
  .nav-drawer .nav-links li { width: 100%; }
  .nav-drawer .nav-links a {
    display: block; padding: 14px 0; font-size: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .nav-drawer .nav-cta {
    flex-direction: column; width: 100%; margin-top: 16px; gap: 10px;
  }
  .nav-drawer .nav-cta a {
    text-align: center; width: 100%; padding: 12px 20px;
  }
  .nav-drawer .nav-profile { width: 100%; }
  .nav-drawer .nav-profile-trigger {
    width: 100%; justify-content: flex-start; border-radius: 10px;
    padding: 10px 14px 10px 10px;
  }
  .nav-drawer .nav-profile-meta { flex: 1; }
  .nav-drawer .nav-profile-name,
  .nav-drawer .nav-profile-board { max-width: none; }
  .nav-drawer .nav-profile-menu {
    position: static; width: 100%; margin-top: 10px;
    box-shadow: none; border-radius: 10px;
  }
  .nav-drawer .nav-profile.open .nav-profile-menu { display: block; }
  .nav-drawer .nav-dropdown { width: 100%; }
  .nav-drawer .nav-dropdown-trigger {
    width: 100%; justify-content: space-between; padding: 14px 0;
    font-size: 1rem; border-bottom: 1px solid var(--line);
  }
  .nav-drawer .nav-dropdown-menu {
    position: static; transform: none; display: none;
    box-shadow: none; border: none; border-radius: 0;
    padding: 0 0 12px; min-width: 0; max-width: none;
  }
  .nav-drawer .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .ad-sticky-mobile { display: flex; }
  body.student-sidebar-open .ad-sticky-mobile,
  body.admin-sidebar-open .ad-sticky-mobile { display: none; }

  /* Student / admin — slide-in sidebar */
  .shell-mobile-bar { display: flex; }
  .app-topbar, .admin-topbar { display: none; }
  .student-sidebar,
  .admin-sidebar {
    display: flex;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 60;
    box-shadow: none;
  }
  body.student-sidebar-open .student-sidebar,
  body.admin-sidebar-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,0.35);
  }
  .app-main, .admin-main { margin-left: 0; width: 100%; }
  .app-topbar, .admin-topbar {
    flex-wrap: wrap; height: auto; min-height: 56px;
    padding: 12px 16px; gap: 10px;
  }
  .app-topbar h1, .admin-topbar .page-title { font-size: 1.05rem; width: 100%; order: -1; }
  .topbar-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .app-content, .admin-content { padding: 20px 16px; }
  .app-shell-footer { padding: 12px 16px; }
  .app-shell-footer-inner { flex-direction: column; align-items: flex-start; text-align: left; }
  .admin-topbar > .btn-sm,
  .admin-topbar > a,
  .admin-topbar > button { flex: 1; min-width: 120px; text-align: center; }

  /* Footer */
  .site-footer { padding: 40px 20px 28px; }
  .site-footer .footer-grid {
    grid-template-columns: 1fr; gap: 28px;
    padding-bottom: 32px;
  }
  .site-footer .footer-brand p { max-width: none; }
  .site-footer .footer-bottom {
    flex-direction: column; text-align: center; gap: 16px;
  }
  .site-footer .footer-links { flex-wrap: wrap; justify-content: center; gap: 16px; }

  /* Landing */
  .landing-hero { padding: 40px 20px; }
  .landing-hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .landing-cta-row { flex-direction: column; }
  .landing-cta-primary, .landing-cta-secondary { width: 100%; text-align: center; }
  .landing-trust { flex-wrap: wrap; gap: 10px 16px; }
  .landing-stats-strip { grid-template-columns: 1fr 1fr; }
  .landing-stat { padding: 20px 16px; }
  .landing-stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .landing-stat:nth-child(2) { border-right: none; }
  .landing-steps, .landing-boards-grid, .landing-pricing { grid-template-columns: 1fr; }
  .landing-section { padding-left: 20px; padding-right: 20px; }
  .landing-cta-band { padding: 40px 20px; }

  /* Auth */
  .login-wrap { padding: 20px 16px 32px; align-items: flex-start; }
  .card-right { padding: 28px 20px; }
  .card-left { padding: 28px 20px; }
  .form-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
  .social-grid, .social-btns { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .auth-right { padding: 32px 20px; }
  .auth-left { padding: 36px 20px; }
  .auth-left h2 { font-size: 2rem; }

  /* Library / past papers */
  .page-header { padding: 40px 20px 0 !important; }
  .page-header-inner { padding: 0 !important; }
  .page-header h1 { font-size: clamp(1.75rem, 7vw, 2.4rem) !important; }
  .library-layout { padding: 24px 16px 48px !important; gap: 20px !important; }
  .papers-area { min-width: 0; }
  .papers-grid { grid-template-columns: 1fr !important; }
  .library-list-toolbar,
  .admin-list-toolbar { flex-direction: column; align-items: stretch; }
  .admin-list-toolbar-left { flex-direction: column; width: 100%; }
  .admin-search input { width: 100%; min-width: 0; }
  .admin-filter-select { width: 100%; }
  .admin-list-footer { flex-direction: column; align-items: stretch; text-align: center; }
  .admin-pagination { justify-content: center; }

  /* Student welcome */
  .student-welcome { grid-template-columns: 1fr; padding: 24px 20px; }
  .student-welcome-cta { width: 100%; text-align: center; }
  .student-welcome-meta { gap: 8px; }

  /* Exam */
  .exam-bar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 16px; }
  .exam-layout { padding: 20px 16px 60px; }
  .score-hero { flex-direction: column; text-align: center; padding: 32px 20px; }
  .score-ring { margin: 0 auto 16px; }

  /* Misc grids */
  .stat-row, .metrics-grid, .two-col, .three-col, .form-grid, .form-grid-3,
  .admin-attention-strip, .admin-kpi-grid, .admin-quick-actions,
  .pricing-mini, .proto-wrap { padding-left: 20px; padding-right: 20px; }
  .stat-row, .metrics-grid, .two-col, .three-col, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .admin-attention-strip, .admin-kpi-grid, .admin-quick-actions { grid-template-columns: 1fr; }
  .admin-dash-grid { grid-template-columns: 1fr; }
  .ai-gen-body { grid-template-columns: 1fr; }
  .ai-gen-body .btn-gen { width: 100%; }
  .countdown-bar { flex-direction: column; align-items: flex-start; }
  .cd-timer { margin-left: 0; }
  .pagination { flex-wrap: wrap; justify-content: center; }
  .proto-hero { padding: 48px 20px 40px; }
  .proto-hero h1 { font-size: 2rem; }
  .seo-hero { padding: 40px 20px 32px; }
  .seo-body { padding: 32px 20px 48px; }
  .seo-search { flex-direction: column; border-radius: 8px; }
  .seo-search input, .seo-search button { width: 100%; }
  .content-page, .legal { padding: 24px 16px 48px !important; }
  .public-page-wrap .page-header { padding-top: 60px; }
}

/* Boards hub & detail */
.boards-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  transform: translateY(-28px); gap: 16px;
}
.boards-stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px; text-align: center;
  box-shadow: 0 8px 24px rgba(13, 13, 15, 0.06);
  animation: pub-fade-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.boards-stat:nth-child(2) { animation-delay: 0.08s; }
.boards-stat:nth-child(3) { animation-delay: 0.16s; }
.boards-stat:nth-child(4) { animation-delay: 0.24s; }
.boards-stat strong {
  display: block; font-family: 'Playfair Display', serif; font-size: 1.5rem;
  font-weight: 900; color: var(--ink); margin-bottom: 4px;
}
.boards-stat span { font-size: 0.78rem; color: var(--muted); }

.boards-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: space-between; margin-bottom: 24px;
}
.boards-search {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; max-width: 360px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 8px; padding: 0 14px;
}
.boards-search input {
  flex: 1; border: none; padding: 12px 0; font-family: inherit; font-size: 0.9rem;
  background: transparent; outline: none;
}
.boards-search span { color: var(--muted); }
.boards-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.boards-chip {
  padding: 8px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-soft);
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.boards-chip:hover { border-color: var(--gold); color: var(--ink); }
.boards-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.boards-count-line { font-size: 0.85rem; color: var(--muted); margin-bottom: 20px; }

.boards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.board-card {
  display: flex; flex-direction: column; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; padding: 22px;
  text-decoration: none; color: inherit;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  animation: pub-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.board-card:hover {
  transform: translateY(-4px); border-color: var(--gold);
  box-shadow: 0 12px 32px rgba(13, 13, 15, 0.08);
}
.board-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.board-card-abbr {
  font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 900; color: var(--gold);
}
.board-card-name {
  font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700;
  color: var(--ink); line-height: 1.3; margin-bottom: 6px;
}
.board-card-meta { font-size: 0.8rem; color: var(--muted); line-height: 1.45; flex: 1; margin-bottom: 16px; }
.board-card-stats {
  display: flex; flex-wrap: wrap; gap: 12px 16px; font-size: 0.78rem; color: var(--muted);
  padding-top: 14px; border-top: 1px solid var(--line); margin-bottom: 12px;
}
.board-card-stats strong { color: var(--ink); }
.board-card-cta { font-size: 0.82rem; font-weight: 700; color: var(--teal); }

.boards-empty {
  display: none; text-align: center; padding: 48px 24px;
  background: var(--paper); border: 1px dashed var(--line); border-radius: 10px;
  grid-column: 1 / -1;
}
.boards-empty.visible { display: block; }
.boards-empty h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin-bottom: 8px; }

.board-detail-hero {
  background: var(--ink); padding: 56px clamp(24px, 5vw, 60px) 48px;
  color: #fff; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.board-detail-hero-inner { max-width: 1200px; margin: 0 auto; }
.board-detail-hero .breadcrumb { font-size: 0.78rem; color: rgba(255,255,255,0.35); margin-bottom: 20px; }
.board-detail-hero .breadcrumb a { color: rgba(255,255,255,0.35); text-decoration: none; }
.board-detail-hero .breadcrumb a:hover { color: var(--gold); }
.board-detail-hero h1 {
  font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900; line-height: 1.12; margin-bottom: 10px;
}
.board-detail-hero h1 em { color: var(--gold); font-style: italic; }
.board-detail-hero-lead { color: rgba(255,255,255,0.5); font-size: 0.95rem; max-width: 720px; line-height: 1.65; margin-bottom: 24px; }
.board-detail-meta {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
}
.board-detail-meta-box {
  background: rgba(255,255,255,0.06); padding: 14px 16px; border-radius: 8px;
}
.board-detail-meta-box label {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35); display: block;
}
.board-detail-meta-box strong { display: block; margin-top: 6px; font-size: 0.95rem; }

.board-detail-layout {
  max-width: 1280px; margin: 0 auto;
  padding: 32px clamp(24px, 5vw, 48px) 80px;
  display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start;
}
.board-level-pill {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  padding: 6px 14px; border-radius: 20px; margin: 0 8px 8px 0;
  background: var(--teal-lt); color: var(--teal);
}
.board-subject-chip {
  display: inline-block; font-size: 0.82rem; font-weight: 600;
  padding: 8px 16px; border-radius: 6px; margin: 0 8px 8px 0;
  background: var(--cream); border: 1px solid var(--line); color: var(--ink-soft);
  text-decoration: none; transition: border-color 0.2s, background 0.2s;
}
.board-subject-chip:hover { border-color: var(--gold); background: var(--paper); color: var(--ink); }
.board-paper-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
  transition: padding-left 0.2s;
}
.board-paper-row:hover { padding-left: 6px; }
.board-paper-row strong { font-size: 0.9rem; color: var(--ink); }
.board-paper-row span { font-size: 0.78rem; color: var(--muted); }
.board-empty-note { font-size: 0.88rem; color: var(--muted); }
.board-cta-panel {
  background: linear-gradient(145deg, var(--ink) 0%, #1a1a22 100%);
  border-radius: 12px; padding: 28px; color: #fff; margin-top: 32px;
}
.board-cta-panel h3 {
  font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 900; margin-bottom: 10px;
}
.board-cta-panel p { font-size: 0.88rem; color: rgba(255,255,255,0.5); margin-bottom: 20px; line-height: 1.6; }
.board-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 960px) {
  .boards-stats { grid-template-columns: repeat(2, 1fr); transform: none; margin-top: -12px; }
  .board-detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .boards-stats { grid-template-columns: 1fr; }
}

/* Public content pages — FAQ, About, Legal, Contact */
.faq-intro { color: var(--ink-soft); font-size: 1rem; line-height: 1.65; margin-bottom: 32px; }
.faq-group { margin-bottom: 36px; }
.faq-group h2 {
  font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 900;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--gold);
  display: inline-block; color: var(--ink);
}
.faq-cta {
  margin-top: 8px; padding: 28px; background: var(--teal-lt); border-radius: 8px;
  text-align: center;
}
.faq-cta p { margin: 0 0 16px; color: var(--teal); font-size: 0.95rem; }

.public-content-layout {
  max-width: 1200px; margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 48px) 80px;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px; align-items: start;
}
.public-content-main { min-width: 0; }
.public-content-page { color: var(--ink-soft); line-height: 1.65; }
.public-content-page h2 {
  font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 900;
  color: var(--ink); margin: 32px 0 12px;
}
.public-content-page h2:first-child { margin-top: 0; }
.public-content-page p { margin-bottom: 16px; font-size: 0.95rem; }
.public-content-page .legal-updated { font-size: 0.85rem; color: var(--muted); margin-bottom: 24px; }

.public-sidebar {
  position: sticky; top: 88px;
  display: flex; flex-direction: column; gap: 20px;
}
.public-sidebar-panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.public-sidebar-head {
  background: var(--ink); color: #fff; padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.public-sidebar-head h3 {
  font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; margin-bottom: 4px;
}
.public-sidebar-head p { font-size: 0.75rem; color: rgba(255,255,255,0.45); line-height: 1.4; }
.public-sidebar-section { padding: 6px 0; }
.public-sidebar-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); padding: 12px 20px 6px;
}
.public-sidebar-link {
  display: block; padding: 11px 20px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--line); transition: background 0.15s, border-color 0.15s;
}
.public-sidebar-link:last-child { border-bottom: none; }
.public-sidebar-link:hover { background: var(--cream); }
.public-sidebar-link.active {
  background: var(--teal-lt); border-left: 3px solid var(--teal); padding-left: 17px;
}
.public-sidebar-link strong { display: block; font-size: 0.88rem; font-weight: 700; color: var(--ink); }
.public-sidebar-link span { display: block; font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.public-sidebar-promo {
  padding: 20px 22px; background: linear-gradient(145deg, var(--ink) 0%, #1a1a22 100%);
  color: #fff; text-align: center;
}
.public-sidebar-promo p {
  font-size: 0.78rem; color: rgba(255,255,255,0.5); line-height: 1.55; margin-bottom: 14px;
}
.public-sidebar-promo .btn-primary { display: block; text-align: center; }

/* Contact page */
.contact-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  transform: translateY(-28px);
  gap: 16px;
}
.contact-stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 22px; text-align: center;
  box-shadow: 0 8px 24px rgba(13, 13, 15, 0.06);
  animation: pub-fade-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.contact-stat:nth-child(2) { animation-delay: 0.08s; }
.contact-stat:nth-child(3) { animation-delay: 0.16s; }
.contact-stat:nth-child(4) { animation-delay: 0.24s; }
.contact-stat-icon { font-size: 1.5rem; margin-bottom: 8px; display: block; }
.contact-stat strong {
  display: block; font-family: 'Playfair Display', serif; font-size: 1.15rem;
  font-weight: 900; color: var(--ink); margin-bottom: 4px;
}
.contact-stat span { font-size: 0.78rem; color: var(--muted); }

.contact-intro {
  font-size: 1rem; color: var(--ink-soft); line-height: 1.65; margin-bottom: 28px;
  animation: pub-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
.contact-grid-inner {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; margin-bottom: 36px;
}
.contact-form-panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 32px; box-shadow: 0 4px 20px rgba(13, 13, 15, 0.04);
  animation: pub-fade-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}
.contact-form-panel h2 {
  font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 900;
  margin-bottom: 6px; color: var(--ink);
}
.contact-form-panel .form-eyebrow {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--teal); margin-bottom: 8px;
}
.contact-form-panel .form-sub { font-size: 0.88rem; color: var(--muted); margin-bottom: 24px; }
.contact-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.contact-channels { display: flex; flex-direction: column; gap: 14px; }
.contact-channel {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  animation: pub-fade-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.contact-channel:nth-child(1) { animation-delay: 0.2s; }
.contact-channel:nth-child(2) { animation-delay: 0.28s; }
.contact-channel:nth-child(3) { animation-delay: 0.36s; }
.contact-channel:nth-child(4) { animation-delay: 0.44s; }
.contact-channel:hover {
  transform: translateY(-3px); border-color: var(--gold);
  box-shadow: 0 10px 28px rgba(13, 13, 15, 0.08);
}
.contact-channel-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  background: var(--teal-lt); color: var(--teal);
}
.contact-channel-icon.gold { background: rgba(200, 147, 58, 0.12); color: var(--gold); }
.contact-channel h3 { font-size: 0.92rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.contact-channel p { font-size: 0.82rem; color: var(--muted); line-height: 1.5; margin: 0; }
.contact-channel a { color: var(--teal); font-weight: 600; text-decoration: none; }
.contact-channel a:hover { text-decoration: underline; }

.contact-map-wrap {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  background: var(--paper); box-shadow: 0 4px 24px rgba(13, 13, 15, 0.06);
  animation: pub-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}
.contact-map-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 24px; background: var(--ink); color: #fff;
}
.contact-map-head h2 {
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; margin: 0;
}
.contact-map-head p { margin: 0; font-size: 0.8rem; color: rgba(255,255,255,0.45); }
.contact-map-badge {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 5px 12px; border-radius: 20px;
  background: rgba(200, 147, 58, 0.2); color: var(--gold-lt);
  animation: contact-pulse 3s ease-in-out infinite;
}
.contact-map-frame { position: relative; line-height: 0; }
.contact-map-frame iframe {
  width: 100%; height: 380px; border: 0; display: block;
  filter: grayscale(15%) contrast(1.02);
  transition: filter 0.4s;
}
.contact-map-wrap:hover .contact-map-frame iframe { filter: grayscale(0%); }
.contact-map-pin {
  position: absolute; bottom: 20px; left: 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 16px; font-size: 0.82rem; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  animation: contact-float 4s ease-in-out infinite;
}
.contact-map-pin strong { display: block; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.contact-map-pin span { color: var(--muted); font-size: 0.75rem; }

.contact-tip {
  margin-top: 20px; padding: 16px 20px; border-radius: 8px;
  background: var(--teal-lt); border-left: 4px solid var(--teal);
  font-size: 0.88rem; color: var(--ink-soft); line-height: 1.55;
  animation: pub-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

@keyframes pub-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes contact-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 147, 58, 0); }
  50% { box-shadow: 0 0 0 6px rgba(200, 147, 58, 0.12); }
}
@keyframes contact-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (max-width: 960px) {
  .public-content-layout { grid-template-columns: 1fr; }
  .public-sidebar { position: static; }
  .contact-stats { grid-template-columns: repeat(2, 1fr); transform: none; margin-top: -12px; padding-bottom: 8px; }
  .contact-grid-inner { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .contact-stats { grid-template-columns: 1fr; }
  .contact-form-row { grid-template-columns: 1fr; }
  .contact-map-frame iframe { height: 280px; }
  .contact-map-pin { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-stat, .contact-intro, .contact-form-panel, .contact-channel,
  .contact-map-wrap, .contact-tip, .contact-map-badge, .contact-map-pin {
    animation: none !important;
  }
  .contact-channel:hover { transform: none; }
}

@media (max-width: 480px) {
  .landing-stats-strip { grid-template-columns: 1fr; }
  .landing-stat { border-right: none !important; border-bottom: 1px solid var(--line); }
  .landing-stat:last-child { border-bottom: none; }
  .gen-preview-stats { grid-template-columns: 1fr; }
  .shell-mobile-actions .btn-sm { padding: 6px 10px; font-size: 0.72rem; }
  .topbar-right .btn-nav,
  .topbar-right .btn-primary { font-size: 0.75rem; padding: 6px 12px; }
}
/* How it works page */
.hiw-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  transform: translateY(-28px); gap: 16px;
}
.hiw-stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px; text-align: center;
  box-shadow: 0 8px 24px rgba(13, 13, 15, 0.06);
  animation: pub-fade-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hiw-stat:nth-child(2) { animation-delay: 0.08s; }
.hiw-stat:nth-child(3) { animation-delay: 0.16s; }
.hiw-stat:nth-child(4) { animation-delay: 0.24s; }
.hiw-stat strong {
  display: block; font-family: 'Playfair Display', serif; font-size: 1.5rem;
  font-weight: 900; color: var(--ink); margin-bottom: 4px; line-height: 1;
}
.hiw-stat strong span { color: var(--gold); }
.hiw-stat span { font-size: 0.78rem; color: var(--muted); }

.hiw-layout { padding-top: 8px; }
.hiw-intro {
  font-size: 1rem; color: var(--ink-soft); line-height: 1.7; margin-bottom: 24px;
  animation: pub-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}
.hiw-jump {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px;
  padding: 14px 16px; background: var(--cream); border: 1px solid var(--line);
  border-radius: 10px;
  animation: pub-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
.hiw-jump a {
  font-size: 0.78rem; font-weight: 600; color: var(--ink-soft);
  text-decoration: none; padding: 6px 12px; border-radius: 20px;
  background: var(--paper); border: 1px solid var(--line);
  transition: border-color .2s, color .2s;
}
.hiw-jump a:hover { border-color: var(--teal); color: var(--teal); }

.hiw-section { margin-bottom: 48px; }
.hiw-section--alt {
  background: var(--cream); margin-left: calc(-1 * clamp(20px, 4vw, 48px));
  margin-right: calc(-1 * clamp(20px, 4vw, 48px));
  padding: 36px clamp(20px, 4vw, 48px); border-radius: 12px;
  border: 1px solid var(--line);
}
.hiw-section-head { margin-bottom: 28px; max-width: 640px; }
.hiw-section-head--center { text-align: center; max-width: 560px; margin-left: auto; margin-right: auto; }
.hiw-section-head h2 {
  font-family: 'Playfair Display', serif; font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 900; line-height: 1.15; margin-bottom: 10px;
}
.hiw-section-head p { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.6; }

.hiw-checklist {
  list-style: none; margin: 16px 0; padding: 0;
  font-size: 0.84rem; color: var(--ink-soft); line-height: 1.85;
}
.hiw-checklist li::before { content: '✓ '; color: var(--teal); font-weight: 700; }
.hiw-checklist--light { color: rgba(255,255,255,0.6); }
.hiw-checklist--light li::before { color: var(--gold-lt); }

.hiw-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.hiw-card-cta { display: inline-block; margin-top: auto; align-self: flex-start; }

.hiw-timeline { display: flex; flex-direction: column; gap: 0; }
.hiw-timeline-item {
  display: grid; grid-template-columns: 56px 1fr; gap: 20px;
  padding-bottom: 32px; position: relative;
}
.hiw-timeline-item:not(:last-child)::before {
  content: ''; position: absolute; left: 27px; top: 48px; bottom: 0;
  width: 2px; background: var(--line);
}
.hiw-timeline-marker {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ink); color: var(--gold-lt);
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; z-index: 1;
}
.hiw-timeline-body {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px 26px;
}
.hiw-timeline-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.hiw-timeline-body > p { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.65; margin-bottom: 12px; }
.hiw-inline-link {
  display: inline-block; margin-top: 8px; font-size: 0.85rem; font-weight: 700;
  color: var(--teal); text-decoration: none;
}
.hiw-inline-link:hover { text-decoration: underline; }

.hiw-paper-preview {
  background: var(--cream); border: 1px dashed var(--line); border-radius: 10px;
  padding: 18px 20px; margin: 16px 0;
}
.hiw-paper-preview .badge-ai {
  display: inline-block; background: var(--gold); color: #fff; font-size: 0.65rem;
  font-weight: 700; padding: 4px 10px; border-radius: 20px; margin-bottom: 12px;
}
.hiw-paper-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px;
}
.hiw-paper-grid > div {
  background: var(--paper); padding: 10px; border-radius: 6px; font-size: 0.78rem; text-align: center;
}
.hiw-paper-grid .hiw-paper-highlight {
  background: var(--teal-lt); color: var(--teal);
}
.hiw-paper-sample {
  font-size: 0.78rem; color: var(--muted); margin: 0 !important;
  border-top: 1px dotted var(--line); padding-top: 10px;
}

.hiw-after-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.hiw-after-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 24px;
}
.hiw-after-icon { font-size: 1.4rem; display: block; margin-bottom: 10px; }
.hiw-after-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.hiw-after-card p { font-size: 0.84rem; color: var(--muted); line-height: 1.55; margin: 0; }

.hiw-boards-link { text-align: center; margin-top: 24px; }
.hiw-section--pricing { padding-top: 8px; }
.hiw-pricing { margin-top: 8px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .hiw-pricing { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1080px) {
  .hiw-pricing { grid-template-columns: repeat(3, 1fr); }
}
.hiw-pricing .landing-price-card.popular { transform: none; }
.hiw-price-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--muted);
}
.hiw-price-label--light { color: rgba(255,255,255,0.45); }
.hiw-price-sub { font-size: 0.8rem; color: var(--muted); margin: 12px 0 20px; }
.hiw-price-sub--light { color: rgba(255,255,255,0.45); }
.hiw-price-list {
  list-style: none; font-size: 0.85rem; color: var(--ink-soft);
  margin-bottom: 24px; line-height: 2;
}
.hiw-price-list--light { color: rgba(255,255,255,0.65); }

.hiw-cta {
  text-align: center; padding: 32px 24px; margin-top: 16px;
  background: linear-gradient(135deg, var(--teal-lt), var(--cream));
  border: 1px solid var(--line); border-radius: 12px;
}
.hiw-cta p { margin: 0 0 18px; color: var(--ink-soft); font-size: 0.95rem; }
.hiw-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

@media (max-width: 900px) {
  .hiw-stats { grid-template-columns: repeat(2, 1fr); transform: none; margin-top: -12px; }
  .hiw-after-grid { grid-template-columns: 1fr; }
  .hiw-paper-grid { grid-template-columns: repeat(2, 1fr); }
  .hiw-section--alt {
    margin-left: 0; margin-right: 0;
  }
}
@media (max-width: 600px) {
  .hiw-stats { grid-template-columns: 1fr; }
  .hiw-timeline-item { grid-template-columns: 44px 1fr; gap: 14px; }
  .hiw-timeline-marker { width: 44px; height: 44px; font-size: 0.95rem; }
}

/* Textbooks library */
.filter-tabs-wrap { border-top: 1px solid rgba(255,255,255,0.1); }
.filter-tabs { display: flex; gap: 0; flex-wrap: wrap; }
.filter-tab {
  padding: 16px 22px; font-size: 0.83rem; font-weight: 600;
  color: rgba(255,255,255,0.45); cursor: pointer;
  border: none; border-bottom: 2px solid transparent; background: transparent;
  font-family: inherit; transition: all .2s;
}
.filter-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.filter-tab:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.03); }
.filter-tabs-hint {
  padding: 10px 22px 14px; font-size: 0.78rem; color: rgba(255,255,255,0.35);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.books-empty {
  display: none; grid-column: 1 / -1; text-align: center; padding: 48px 24px;
  background: var(--paper); border: 1px dashed var(--line); border-radius: 10px;
}
.books-empty.visible { display: block; }
.books-empty h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin-bottom: 8px; }
.books-empty p { color: var(--muted); font-size: 0.88rem; }
.books-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.books-count { font-size: 0.85rem; color: var(--muted); }
.books-count strong { color: var(--ink); }
.books-top-tools {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.sort-select-wrap { position: relative; display: inline-flex; }
.sort-select-wrap::after {
  content: '▾'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 0.75rem; pointer-events: none;
}
.sort-select {
  padding: 10px 36px 10px 14px;
  border: 1.5px solid var(--line); border-radius: 5px;
  font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 500;
  color: var(--ink); background: var(--paper); cursor: pointer; outline: none;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  min-width: 190px; line-height: 1.4;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.sort-select:hover { border-color: var(--ink-soft); }
.sort-select:focus {
  border-color: var(--teal); background: var(--paper);
  box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.12);
}
.search-bar {
  display: flex; align-items: center; gap: 0;
  border: 1.5px solid var(--line); border-radius: 5px;
  background: var(--paper); overflow: hidden;
}
.search-bar input {
  border: none; padding: 9px 14px; font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; outline: none; background: transparent; width: 220px;
}
.search-bar button {
  padding: 9px 16px; background: var(--gold); border: none;
  cursor: pointer; color: var(--paper); font-size: 0.85rem;
}
.books-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.books-list-footer { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--line); }
.book-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 7px; overflow: hidden;
  transition: border-color .2s, box-shadow .2s; display: flex; flex-direction: column;
  text-decoration: none; color: inherit; cursor: pointer;
}
.book-card:hover { border-color: var(--gold); box-shadow: 0 4px 20px rgba(200,147,58,0.12); }
.book-card-top {
  background: linear-gradient(135deg, var(--teal-lt) 0%, #f0f4ff 100%);
  padding: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.book-board-abbr { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 900; color: var(--teal); }
.book-edition { font-family: 'DM Mono', monospace; font-size: 0.72rem; font-weight: 500; color: var(--muted); background: var(--paper); padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.book-cover-icon {
  width: 48px; height: 64px; background: var(--ink); border-radius: 4px 8px 8px 4px;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.15);
}
.book-card-body { padding: 18px 20px; flex: 1; }
.book-title { font-size: 0.98rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; line-height: 1.3; }
.book-detail { font-size: 0.78rem; color: var(--muted); margin-bottom: 12px; }
.book-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.book-tag { font-size: 0.68rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.06em; }
.tag-matric { background: #e8f4e8; color: var(--green); }
.tag-inter { background: #e8eaf6; color: #3949ab; }
.tag-science { background: #e3f2fd; color: #1565c0; }
.tag-arts { background: #fce4ec; color: #c62828; }
.tag-new { background: rgba(200,147,58,0.12); color: var(--gold); }
.book-meta-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.72rem; color: var(--muted); font-family: 'DM Mono', monospace; margin-bottom: 14px; }
.book-lang-badges { display: flex; gap: 6px; margin-bottom: 14px; }
.lang-badge { font-size: 0.68rem; font-weight: 700; padding: 4px 10px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.lang-badge.urdu { background: #fff3e0; color: #e65100; }
.lang-badge.english { background: #e8f5e9; color: #2e7d32; }
.lang-badge.missing { background: var(--line); color: var(--muted); text-decoration: line-through; }
.book-card-footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.btn-view-book { font-size: 0.78rem; font-weight: 700; color: var(--teal); background: var(--teal-lt); border-radius: 4px; padding: 6px 14px; }
.book-card:hover .btn-view-book { background: var(--teal); color: var(--paper); }
.book-size { font-size: 0.72rem; color: var(--muted); font-family: 'DM Mono', monospace; }
.info-banner {
  background: #e6f4f4; border: 1.5px solid rgba(13,110,110,0.25); border-radius: 8px;
  padding: 20px 24px; margin-bottom: 24px; display: flex; gap: 14px; align-items: flex-start;
}
.info-banner strong { font-size: 0.88rem; display: block; margin-bottom: 3px; }
.info-banner span { font-size: 0.78rem; color: var(--muted); }

/* Past papers library grid */
.papers-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.papers-count { font-size: 0.85rem; color: var(--muted); }
.papers-count strong { color: var(--ink); }
.papers-top-tools { display: flex; gap: 12px; align-items: center; }
.papers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.paper-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 7px;
  overflow: hidden; transition: border-color .2s, box-shadow .2s; cursor: pointer;
}
.paper-card:hover { border-color: var(--gold); box-shadow: 0 4px 20px rgba(200,147,58,0.12); }
.paper-card-top {
  background: var(--teal-lt); padding: 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.paper-board-abbr {
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 900; color: var(--teal);
}
.paper-year {
  font-family: 'DM Mono', monospace; font-size: 0.78rem; font-weight: 500; color: var(--muted);
  background: var(--paper); padding: 3px 10px; border-radius: 20px;
}
.paper-card-body { padding: 18px 20px; }
.paper-subject { font-size: 0.98rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.paper-detail { font-size: 0.78rem; color: var(--muted); margin-bottom: 14px; }
.paper-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.paper-tag {
  font-size: 0.68rem; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.tag-matric { background: #e8f4e8; color: var(--green); }
.tag-inter { background: #e8eaf6; color: #3949ab; }
.tag-annual { background: #fff3e0; color: #e65100; }
.tag-supply { background: #fce4ec; color: #c62828; }
.tag-new { background: rgba(200,147,58,0.12); color: var(--gold); }
.paper-card-footer {
  padding: 12px 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.paper-size { font-size: 0.72rem; color: var(--muted); font-family: 'DM Mono', monospace; }
.paper-card:hover .btn-view-paper { background: var(--teal); color: var(--paper); }
.papers-empty {
  display: none; grid-column: 1 / -1; text-align: center; padding: 48px 24px;
  background: var(--paper); border: 1px dashed var(--line); border-radius: 10px;
}
.papers-empty.visible { display: block; }
.papers-empty h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin-bottom: 8px; }
.papers-empty p { color: var(--muted); font-size: 0.88rem; }
.pp-structure-box {
  background: var(--cream); border: 1px solid var(--line); border-radius: 8px;
  padding: 20px 24px; margin-bottom: 32px;
}
.pp-structure-box h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; }
.pp-structure-content { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.8; }

/* Textbook detail */
.tb-hero-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.15; margin-bottom: 12px; }
.tb-hero-subtitle { color: rgba(255,255,255,0.5); font-size: 0.95rem; max-width: 720px; line-height: 1.65; }
.tb-preview {
  display: grid; grid-template-columns: 200px 1fr; gap: 28px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px; margin-bottom: 32px;
}
.tb-cover {
  width: 200px; aspect-ratio: 3/4; border-radius: 6px 12px 12px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px 16px; color: #fff;
  box-shadow: 4px 8px 24px rgba(0,0,0,0.2), inset -3px 0 8px rgba(0,0,0,0.15);
  position: relative; overflow: hidden;
}
.tb-cover::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 14px;
  background: linear-gradient(90deg, rgba(0,0,0,0.25), transparent);
}
.tb-cover-image { max-width: 100%; max-height: 100%; object-fit: cover; position: relative; z-index: 1; border-radius: 4px; }
.tb-cover-icon { font-size: 2.8rem; margin-bottom: 12px; position: relative; z-index: 1; }
.tb-cover-board { font-family: 'Playfair Display', serif; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; position: relative; z-index: 1; }
.tb-cover-subject { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 900; line-height: 1.25; margin-top: 8px; position: relative; z-index: 1; }
.tb-cover-edition { font-family: 'DM Mono', monospace; font-size: 0.65rem; margin-top: auto; padding-top: 16px; opacity: 0.7; position: relative; z-index: 1; }
.tb-preview-info h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 900; margin-bottom: 8px; line-height: 1.2; }
.tb-preview-info .tb-subtitle { font-size: 0.88rem; color: var(--muted); margin-bottom: 16px; }
.tb-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.tb-fact { background: var(--cream); border-radius: 6px; padding: 12px 14px; }
.tb-fact label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); display: block; }
.tb-fact strong { font-size: 0.88rem; display: block; margin-top: 4px; }
.tb-lang-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.tb-lang-pill { font-size: 0.72rem; font-weight: 700; padding: 5px 12px; border-radius: 20px; }
.tb-lang-pill.urdu { background: #fff3e0; color: #e65100; }
.tb-lang-pill.english { background: #e8f5e9; color: #2e7d32; }
.tb-lang-pill.na { background: var(--line); color: var(--muted); }
.tb-section-title { font-size: 1.35rem; font-weight: 900; margin-bottom: 12px; }
.tb-about-copy { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.7; margin-bottom: 16px; }
.tb-about-copy--secondary { margin-bottom: 24px; }
.tb-chapters { background: var(--cream); border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; margin-bottom: 32px; }
.tb-chapters h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; }
.tb-chapters ol { columns: 2; column-gap: 24px; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.9; margin-left: 20px; }
.tb-download-card {
  background: var(--paper); border: 2px solid var(--gold); border-radius: 12px;
  padding: 32px; text-align: center;
}
.tb-download-card h2 { font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 900; margin-bottom: 8px; }
.tb-download-card > p { color: var(--muted); font-size: 0.88rem; margin-bottom: 4px; }
.tb-dl-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.tb-dl-btn {
  min-width: 180px; padding: 14px 28px; font-size: 0.9rem; font-weight: 700;
  border: none; border-radius: 6px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s;
}
.tb-dl-btn.urdu { background: #fff3e0; color: #e65100; border: 2px solid #e65100; }
.tb-dl-btn.urdu:hover { background: #e65100; color: #fff; }
.tb-dl-btn.english { background: #e8f5e9; color: #2e7d32; border: 2px solid #2e7d32; }
.tb-dl-btn.english:hover { background: #2e7d32; color: #fff; }
.tb-dl-btn.disabled { background: var(--line); color: var(--muted); border-color: var(--line); cursor: not-allowed; pointer-events: none; }
.tb-dl-size { display: block; font-size: 0.72rem; font-weight: 500; opacity: 0.75; margin-top: 2px; }
.tb-download-guest .tb-dl-buttons { opacity: 0.55; pointer-events: none; margin-bottom: 16px; }
.tb-signin-btn { padding: 14px 36px; margin-right: 10px; display: inline-block; }
.tb-view-online-card {
  background: var(--cream); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px 32px; margin-bottom: 32px; text-align: center;
}
.tb-view-online-card h2 { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 900; margin-bottom: 6px; }
.tb-view-online-card > p { color: var(--muted); font-size: 0.88rem; max-width: 520px; margin: 0 auto; }
.tb-view-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.tb-view-btn {
  min-width: 200px; padding: 12px 24px; font-size: 0.88rem; font-weight: 700;
  border-radius: 6px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .2s; border: 2px solid var(--teal); background: var(--paper); color: var(--teal);
}
.tb-view-btn:hover { background: var(--teal); color: #fff; }
.tb-view-btn.urdu { border-color: #e65100; color: #e65100; }
.tb-view-btn.urdu:hover { background: #e65100; color: #fff; }
.tb-view-btn.english { border-color: #2e7d32; color: #2e7d32; }
.tb-view-btn.english:hover { background: #2e7d32; color: #fff; }
.tb-view-btn.disabled { background: var(--line); color: var(--muted); border-color: var(--line); cursor: not-allowed; pointer-events: none; }
.tb-detail-alert { margin-top: 24px; }

@media (max-width: 1024px) {
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .papers-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .books-grid { grid-template-columns: 1fr; }
  .papers-grid { grid-template-columns: 1fr; }
  .books-top-tools, .papers-top-tools { width: 100%; }
  .sort-select-wrap { width: 100%; }
  .sort-select { width: 100%; min-width: 0; }
  .tb-preview { grid-template-columns: 1fr; }
  .tb-cover { width: 100%; max-width: 200px; margin: 0 auto; }
  .tb-chapters ol { columns: 1; }
}
.hiw-timeline-item:not(:last-child)::before { left: 21px; }
@media (prefers-reduced-motion: reduce) {
  .hiw-stat, .hiw-intro, .hiw-jump { animation: none !important; }
}
