/* ============================================================
   IELTS Learning — modern SaaS design system
   ============================================================ */

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Neutral scale */
  --n-0: #ffffff;
  --n-50: #f7f8fb;
  --n-100: #eef0f6;
  --n-200: #e2e5ee;
  --n-300: #cdd2e0;
  --n-400: #a8aec2;
  --n-500: #7c8299;
  --n-600: #5b6178;
  --n-700: #40465c;
  --n-800: #262a3b;
  --n-900: #14151f;

  --bg: var(--n-50);
  --surface: var(--n-0);
  --surface-2: var(--n-100);
  --border: var(--n-200);
  --border-strong: var(--n-300);

  --ink: var(--n-900);
  --ink-soft: var(--n-600);
  --ink-faint: var(--n-500);

  --primary: #4f46e5;
  --primary-dark: #4034c7;
  --primary-darker: #322aa3;
  --primary-soft: #eef0fe;
  --primary-ring: rgba(79, 70, 229, .18);
  --accent: #0891b2;
  --accent-soft: #e3f6fa;

  --success: #059669;
  --success-dark: #047857;
  --success-soft: #e6f8f1;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --danger-soft: #fdecec;
  --warning: #b45309;
  --warning-dark: #92400e;
  --warning-soft: #fef3e2;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(20, 21, 31, .06);
  --shadow: 0 1px 2px rgba(20, 21, 31, .04), 0 6px 20px rgba(20, 21, 31, .06);
  --shadow-lg: 0 12px 32px rgba(20, 21, 31, .10), 0 4px 10px rgba(20, 21, 31, .05);
  --shadow-xl: 0 24px 64px rgba(20, 21, 31, .18);

  --ease: cubic-bezier(.2, .8, .2, 1);

  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 { font-weight: 750; letter-spacing: -0.022em; color: var(--ink); line-height: 1.25; }
h1 { font-size: 1.95rem; margin: 0 0 6px; }
h2 { font-size: 1.3rem; margin: 34px 0 14px; }
h3 { font-size: 1.08rem; margin: 0 0 4px; }
p.lede { color: var(--ink-soft); margin-top: 0; }
code { font-family: var(--font-mono); background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: .88em; }

::selection { background: var(--primary-ring); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------------- Top navigation ---------------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 32px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #4034c7);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .38), inset 0 1px 0 rgba(255,255,255,.2);
}
.brand-logo-img {
  height: 32px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
  display: block;
}
/* Collapsed student-sidebar rail: a wide uploaded logo would overflow the
   narrow rail, so it's constrained the same way the default brand-mark
   square already is at that width. */
html.sb-collapsed .student-sidebar .brand-logo-img { max-width: 40px; }
.brand span { color: var(--primary); }
.topbar nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.topbar nav a:not(.btn-nav) {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.topbar nav a:not(.btn-nav):hover { background: var(--surface-2); color: var(--ink); }
.btn-nav {
  background: var(--primary);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, transform .1s ease;
}
.btn-nav:hover { background: var(--primary-dark); transform: translateY(-1px); }
.track-pill {
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.page { max-width: 1040px; margin: 0 auto; padding: 40px 24px 70px; }
.page.narrow { max-width: 460px; }
.page.wide { max-width: 1240px; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  margin-bottom: 16px;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* ---------------- Forms ---------------- */
label { display: block; font-weight: 600; font-size: 0.87rem; margin-bottom: 6px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=url], input[type=tel], select, textarea {
  width: 100%;
  padding: 10.5px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--n-0);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--n-400); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
}
textarea { resize: vertical; }
.field { margin-bottom: 18px; }
.field .hint { font-size: .8rem; color: var(--ink-faint); margin-top: 5px; }
.radio-row { display: flex; gap: 20px; flex-wrap: wrap; }
.radio-row label { font-weight: 500; display: flex; align-items: center; gap: 7px; margin-bottom: 0; }

/* ---------------- Buttons ---------------- */
button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10.5px 19px;
  border-radius: 10px;
  font-size: 0.93rem;
  font-weight: 640;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease);
  box-shadow: 0 1px 2px rgba(79, 70, 229, .18);
}
button:hover, .btn:hover { background: var(--primary-dark); text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(79, 70, 229, .28); }
button:active, .btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(79, 70, 229, .18); }
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary {
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--border-strong);
  box-shadow: none;
}
.btn.secondary:hover { background: var(--surface-2); border-color: var(--n-400); color: var(--ink); box-shadow: none; }
.btn.danger { background: var(--danger); box-shadow: 0 1px 2px rgba(220,38,38,.2); }
.btn.danger:hover { background: var(--danger-dark); box-shadow: 0 8px 18px rgba(220,38,38,.25); }
.btn.small, .btn.sm { padding: 7px 13px; font-size: .82rem; border-radius: 8px; }
.btn.block { display: flex; width: 100%; justify-content: center; }

/* ---------------- Alerts ---------------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 0.92rem; border: 1px solid transparent; font-weight: 500; display: flex; align-items: flex-start; gap: 9px; }
.alert.error { background: var(--danger-soft); color: var(--danger-dark); }
.alert.success { background: var(--success-soft); color: var(--success-dark); }
.alert.info { background: var(--primary-soft); color: var(--primary-dark); }
.alert.warning { background: var(--warning-soft); color: var(--warning-dark); }

/* ---------------- Tables ---------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--ink-faint); font-weight: 700; font-size: 0.73rem; text-transform: uppercase; letter-spacing: .05em; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }

/* ---------------- Stat tiles ---------------- */
.stat { text-align: center; }
.stat .stat-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin: 0 auto 12px;
}
.stat .num { font-size: 2.2rem; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; }
.stat .lbl { color: var(--ink-soft); font-size: 0.85rem; margin-top: 2px; }

/* ---------------- Badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3.5px 11px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.badge.mock { background: var(--danger-soft); color: var(--danger-dark); }
.badge.practice { background: var(--primary-soft); color: var(--primary-dark); }

.footer { text-align: center; color: var(--ink-faint); font-size: 0.8rem; padding: 28px 20px 40px; }

/* ---------------- Full public footer (logged-out visitors) ---------------- */
.footer-full { text-align: left; max-width: 1240px; margin: 0 auto; padding: 44px 24px 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.footer-brand-mark { display: flex; align-items: center; margin-bottom: 10px; }
.footer-brand-mark .brand-mark { margin-right: 8px; }
.footer-col h4 { margin: 0 0 12px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.footer-col a { display: block; color: var(--ink-soft); text-decoration: none; font-size: 0.88rem; margin-bottom: 9px; }
.footer-col a:hover { color: var(--primary); text-decoration: underline; }
.footer-col p { max-width: 420px; }
.footer-bottom { text-align: center; padding-top: 20px; color: var(--ink-faint); font-size: 0.78rem; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; gap: 22px; } }

/* ---------------- Landing hero ---------------- */
.hero {
  text-align: center;
  padding: 60px 32px;
  background:
    radial-gradient(90% 140% at 15% -20%, rgba(79,70,229,.14) 0%, transparent 55%),
    radial-gradient(90% 140% at 85% -10%, rgba(8,145,178,.10) 0%, transparent 55%),
    var(--n-50);
  border: 1px solid var(--border);
}
.hero h1 { font-size: 2.4rem; max-width: 680px; margin: 0 auto 14px; }
.hero p.lede { max-width: 580px; margin: 0 auto 24px; font-size: 1.04rem; }

/* ---------------- Hero banner slider ---------------- */
.hero-slider { position: relative; padding-bottom: 76px; }
.hero-slider .hero-slide {
  display: none;
  animation: heroFadeIn .5s ease;
}
.hero-slider .hero-slide.is-active { display: block; }
@keyframes heroFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.hero-dots {
  position: absolute;
  left: 0; right: 0; bottom: 28px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.hero-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--border);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.hero-dot.is-active { background: var(--primary); transform: scale(1.2); }
@media (max-width: 700px) { .hero-slider { padding-bottom: 64px; } }

/* ---------------- Test selection ---------------- */
.mock-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #6423c9 100%);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}
.mock-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(60% 120% at 100% 0%, rgba(255,255,255,.14), transparent 60%);
  pointer-events: none;
}

/* ---------------- Upsell banners (paid-feature teasers on free-tier list pages) ---------------- */
.upsell-banner {
  background: linear-gradient(135deg, #4f46e5 0%, #6423c9 100%);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}
.upsell-banner::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(70% 140% at 90% -10%, rgba(255,255,255,.16), transparent 60%);
  pointer-events: none;
}
.upsell-banner h2 { color: #fff; margin-top: 0; position: relative; }
.upsell-banner p.lede { color: rgba(255,255,255,.86); position: relative; }
.upsell-banner .btn { background: #fff; color: var(--primary-dark); box-shadow: none; position: relative; }
.upsell-banner .btn:hover { background: #f2f2ff; }
.mock-card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.mock-card-body { flex: 1; }
.mock-card-body h3 { color: #fff; margin-bottom: 4px; }
.mock-card-body p.lede { color: rgba(255,255,255,.82); }
.mock-card .btn { background: #fff; color: var(--primary-dark); box-shadow: none; flex-shrink: 0; }
.mock-card .btn:hover { background: #f2f2ff; transform: translateY(-1px); }
@media (max-width: 640px) { .mock-card { flex-direction: column; align-items: stretch; text-align: center; } }

.practice-list { margin-bottom: 26px; }
.practice-list summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 4px;
  list-style: none;
}
.practice-list summary::-webkit-details-marker { display: none; }
.practice-list summary::before { content: '▸ '; color: var(--primary); }
.practice-list[open] summary::before { content: '▾ '; }
.practice-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 22px;
}
.practice-row h4 { margin: 0 0 4px; font-size: 1rem; }
@media (max-width: 640px) { .practice-row { flex-direction: column; align-items: stretch; text-align: center; } }

/* ---------------- Exam-taking layout (real IELTS-CBT-style replica) ---------------- */
body.exam-mode { background: var(--n-100); }
body.exam-mode main.page { max-width: none; padding: 0 0 96px; }
.exam-topbar { padding: 9px 22px; }
.exam-topbar .exam-topbar-note { color: var(--ink-soft); font-size: .86rem; }
.exam-topbar .exam-topbar-note a { font-weight: 700; }

.exam-header {
  position: sticky; top: 0; z-index: 16;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--n-900); color: #fff; padding: 12px 26px;
  box-shadow: var(--shadow);
  gap: 12px;
}
.exam-header .exam-title { font-size: .88rem; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-header .exam-title strong { font-weight: 700; }
.exam-header .timer {
  font-variant-numeric: tabular-nums;
  font-weight: 800; font-size: 1.15rem;
  background: rgba(255,255,255,.12);
  padding: 7px 20px; border-radius: 999px;
  letter-spacing: .03em;
  justify-self: center;
  transition: background .2s ease, color .2s ease;
}
.exam-header .timer::before { content: '⏱ '; }
.exam-header .timer.warn { background: rgba(217, 119, 6, .35); color: #fed7aa; }
.exam-header .timer.low { background: rgba(220, 38, 38, .4); color: #ffd7d3; animation: examPulse 1s ease-in-out infinite; }
@keyframes examPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.exam-header .exam-actions { justify-self: end; display: flex; gap: 8px; }
.exam-header .exam-actions button { background: rgba(255,255,255,.1); color: #fff; box-shadow: none; padding: 7px 14px; font-size: .82rem; }
.exam-header .exam-actions button:hover { background: rgba(255,255,255,.2); transform: none; box-shadow: none; }
@media (max-width: 640px) {
  .exam-header { grid-template-columns: auto auto; }
  .exam-header .exam-title { display: none; }
  .exam-header .exam-actions { grid-column: 2; }
}

.exam-help-panel {
  max-width: 1320px; margin: 14px auto 0; padding: 0 24px;
}
.exam-help-panel .card { background: var(--primary-soft); border-color: var(--primary-ring); font-size: .88rem; }

.exam-body { max-width: 1320px; margin: 0 auto; padding: 20px 24px 0; }
.exam-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .exam-split { grid-template-columns: 1fr; } }
.passage-pane, .questions-pane {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px; max-height: calc(100vh - 150px); overflow-y: auto;
  position: relative; top: auto;
}
/* The passage stays in view beside its questions. (An offset on a non-sticky pane
   pushed it down over the next passage's heading, so the offset lives here only.) */
.exam-split > .passage-pane { position: sticky; top: 74px; }
@media (max-width: 900px) {
  .exam-split > .passage-pane { position: relative; top: auto; max-height: 55vh; }
}
.passage-pane h3 { margin-top: 0; }
.passage-pane p { white-space: pre-line; color: var(--ink); }
.section-intro { max-width: 1320px; margin: 0 auto; padding: 4px 24px 0; }
.section-intro h2 { margin: 22px 0 4px; }

.q-group { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px dashed var(--border); }
.q-group:last-child { border-bottom: none; }
.q-group-label { font-weight: 700; margin-bottom: 12px; color: var(--primary-dark); font-size: 0.92rem; white-space: pre-line; }
.q-item {
  margin-bottom: 6px; padding: 12px 14px 14px; border-radius: var(--radius-sm);
  scroll-margin-top: 90px;
  transition: background .5s ease, box-shadow .2s ease;
}
.q-item.jump-highlight { background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary-ring); }
.q-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.q-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--surface-2); color: var(--ink-soft);
  font-weight: 800; font-size: .78rem; flex-shrink: 0;
  transition: background .15s ease, color .15s ease;
}
.q-item.is-answered .q-badge { background: var(--success-soft); color: var(--success-dark); }
.flag-btn {
  background: none; border: 1.5px solid var(--border-strong); color: var(--ink-faint);
  width: 26px; height: 26px; border-radius: 999px; padding: 0; font-size: .82rem;
  box-shadow: none; flex-shrink: 0; line-height: 1;
}
.flag-btn:hover { background: var(--warning-soft); border-color: var(--warning); color: var(--warning-dark); transform: none; box-shadow: none; }
.flag-btn.is-flagged { background: var(--warning); border-color: var(--warning); color: #fff; }
.q-item p { margin: 0 0 8px; }
.q-item input[type=text] { max-width: 320px; display: inline-block; }
.q-choice {
  display: block; margin: 5px 0; font-weight: 500; padding: 8px 10px;
  border-radius: 8px; transition: background .12s ease;
}
.q-choice:hover { background: var(--primary-soft); }
.audio-box { text-align: center; padding: 30px 10px; }
.audio-box button { font-size: 1.02rem; padding: 14px 26px; border-radius: 999px; }
.audio-status { margin-top: 14px; color: var(--ink-soft); font-size: 0.9rem; }
.charged-audio-box { text-align: center; padding: 24px 10px; }
.charged-audio-box button { font-size: 1.02rem; padding: 14px 26px; border-radius: 999px; }

/* ---------------- Bottom question navigator (like the real exam's part/question palette) ---------------- */
.exam-navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 17;
  background: #fff; border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(20,21,31,.08);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
}
.exam-navbar .nav-scroll {
  flex: 1; display: flex; gap: 6px; overflow-x: auto; padding: 2px;
  scrollbar-width: thin;
}
.exam-navbar .nav-part-label {
  display: flex; align-items: center; padding: 0 8px; color: var(--ink-faint);
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  flex-shrink: 0;
}
.nav-q-btn {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2); border: 1.5px solid transparent; color: var(--ink-soft);
  font-weight: 700; font-size: .82rem; box-shadow: none; padding: 0;
  position: relative;
}
.nav-q-btn:hover { background: var(--primary-soft); color: var(--primary-dark); transform: none; box-shadow: none; }
.nav-q-btn.is-answered { background: var(--success-soft); color: var(--success-dark); }
.nav-q-btn.is-answered::after {
  content: ''; position: absolute; left: 7px; right: 7px; bottom: 4px; height: 2px;
  background: var(--success); border-radius: 2px;
}
.nav-q-btn.is-flagged { border-radius: 999px; border-color: var(--warning); background: var(--warning-soft); color: var(--warning-dark); }
.nav-q-btn.is-current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.exam-navbar .nav-summary { flex-shrink: 0; font-size: .78rem; color: var(--ink-soft); padding: 0 4px; white-space: nowrap; }
.exam-navbar .btn.review-btn { flex-shrink: 0; }
@media (max-width: 640px) {
  .exam-navbar .nav-summary { display: none; }
  .nav-q-btn { width: 28px; height: 28px; font-size: .76rem; }
}

/* ---------------- Review-before-submit overlay ---------------- */
.review-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 16, 26, .55);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.review-overlay.open { opacity: 1; pointer-events: auto; }
.review-panel {
  background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-width: 760px; max-height: 86vh; overflow-y: auto;
  padding: 26px 28px 28px; box-shadow: var(--shadow-xl);
  transform: translateY(24px); transition: transform .2s var(--ease);
}
.review-overlay.open .review-panel { transform: translateY(0); }
.review-panel h2 { margin-top: 0; }
.review-stats { display: flex; gap: 18px; margin: 14px 0 20px; flex-wrap: wrap; }
.review-stats .rs-item { display: flex; align-items: center; gap: 7px; font-size: .88rem; color: var(--ink-soft); font-weight: 600; }
.review-stats .rs-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.review-stats .rs-dot.answered { background: var(--success); }
.review-stats .rs-dot.unanswered { background: var(--n-300); }
.review-stats .rs-dot.flagged { background: var(--warning); border-radius: 999px; }
.review-grid { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 24px; }
.review-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.review-actions .btn.secondary { margin-right: auto; }

/* ---------------- Results ---------------- */
.band-hero { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.band-hero .band-num {
  font-size: 3.4rem; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.04em;
  background: var(--primary-soft);
  width: 110px; height: 110px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.breakdown-bar { background: #eef0f4; border-radius: 999px; overflow: hidden; height: 9px; margin-top: 5px; }
.breakdown-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #4f46e5); transition: width .4s ease; }
.review-row.correct { border-left: 4px solid var(--success); }
.review-row.incorrect { border-left: 4px solid var(--danger); }
.review-row {
  padding: 12px 16px; margin-bottom: 9px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

/* ---------------- Extra badges / pills ---------------- */
.badge.free { background: var(--success-soft); color: var(--success); }
.badge.locked { background: var(--warning-soft); color: var(--warning); }
.badge.open { background: var(--warning-soft); color: var(--warning); }
.badge.resolved { background: var(--success-soft); color: var(--success); }
.badge.paid { background: var(--success-soft); color: var(--success); }
.badge.free-plan { background: var(--danger-soft); color: var(--danger); }
.badge.admin { background: var(--primary-soft); color: var(--primary-dark); }
.badge.manager { background: #eef2ff; color: #4338ca; }
.track-pill.plan-paid { background: var(--success-soft); color: var(--success); }
.track-pill.plan-free { background: var(--warning-soft); color: var(--warning); }
.track-pill.plan-expired { background: var(--danger-soft); color: var(--danger); }
.badge.pending { background: var(--warning-soft); color: var(--warning); }
.badge.approved { background: var(--success-soft); color: var(--success); }
.badge.denied { background: var(--danger-soft); color: var(--danger); }
.badge.charged { background: var(--danger-soft); color: var(--danger-dark); }
.badge.unread-count { background: var(--danger); color: #fff; padding: 1px 7px; font-size: 0.68rem; margin-left: 4px; }
.badge.exam_update { background: var(--primary-soft); color: var(--primary-dark); }
.badge.study_abroad { background: var(--success-soft); color: var(--success); }
.badge.general { background: var(--warning-soft); color: var(--warning); }

/* ---------------- Admin shell (sidebar layout for admin & manager) ---------------- */
:root {
  --sb-bg: #171a2b;
  --sb-bg-2: #1f2338;
  --sb-ink: #e8e9f5;
  --sb-ink-soft: #9297b8;
  --sb-border: rgba(255,255,255,.08);
  --sb-width: 254px;
}
body.has-admin-shell { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; align-items: stretch; }
.admin-sidebar {
  width: var(--sb-width); flex-shrink: 0;
  background: linear-gradient(180deg, var(--sb-bg) 0%, var(--sb-bg-2) 100%);
  color: var(--sb-ink);
  padding: 18px 14px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 30;
}
.admin-brand { color: #fff; padding: 6px 8px 18px; }
.admin-brand span { color: #a5b4fc; }
.sidebar-section-label {
  color: var(--sb-ink-soft); font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; padding: 14px 10px 6px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar-nav a {
  color: var(--sb-ink); font-weight: 560; font-size: .89rem;
  padding: 9px 10px; border-radius: 9px;
  display: flex; align-items: center; gap: 9px;
  transition: background .13s ease, color .13s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav a.active { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.4); }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--sb-border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; }
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #4034c7);
  color: #fff; font-weight: 800; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user-name { font-size: .87rem; font-weight: 650; color: #fff; margin-bottom: 3px; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 28px; background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 15;
}
.admin-topbar-title { font-weight: 750; font-size: 1.05rem; letter-spacing: -0.01em; }
.admin-main .page { flex: 1; max-width: 1240px; }
.sidebar-scrim { display: none; }

@media (max-width: 960px) {
  .admin-sidebar {
    position: fixed; left: 0; top: 0; height: 100dvh;
    transform: translateX(-100%);
    transition: transform .22s var(--ease);
    box-shadow: var(--shadow-xl);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-topbar .nav-toggle { display: inline-block; }
  .sidebar-scrim.show {
    display: block; position: fixed; inset: 0; background: rgba(10,10,20,.45);
    z-index: 25; backdrop-filter: blur(1px);
  }
}
@media (min-width: 961px) { .admin-topbar .nav-toggle { display: none; } }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions form { display: inline; }
.row-actions .btn, .row-actions button { padding: 6px 12px; font-size: 0.82rem; border-radius: 8px; }
table.compact th, table.compact td { padding: 9px 10px; font-size: 0.86rem; }
.section-block { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.section-block h4 { margin-top: 0; }
.q-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.q-row:last-child { border-bottom: none; }
.q-row .q-meta { color: var(--ink-soft); font-size: 0.82rem; }

/* ---------------- Pricing / plans ---------------- */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card { text-align: center; }
.price-card .price { font-size: 2.4rem; font-weight: 800; color: var(--ink); margin: 10px 0; letter-spacing: -0.03em; }
.price-card .price span { font-size: 1rem; color: var(--ink-soft); font-weight: 600; }
.price-card ul { list-style: none; padding: 0; margin: 16px 0 22px; text-align: left; }
.price-card li { padding: 6px 0; color: var(--ink-soft); font-size: 0.9rem; }
.price-card li::before { content: '✓ '; color: var(--success); font-weight: 700; }
.demo-banner { background: var(--warning-soft); color: var(--warning); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; margin-bottom: 14px; }

/* ---------------- Support tickets ---------------- */
.ticket-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.ticket-row:last-child { border-bottom: none; }
.msg-bubble { padding: 13px 16px; border-radius: var(--radius); margin-bottom: 12px; max-width: 80%; font-size: 0.92rem; }
.msg-bubble.student { background: var(--primary-soft); margin-right: auto; }
.msg-bubble.staff { background: #f1f2f6; margin-left: auto; }
.msg-bubble.ai { background: linear-gradient(135deg, #f4f1ff, #eef0fe); border: 1px solid var(--primary-ring); margin-right: auto; white-space: pre-line; }
.msg-bubble .msg-meta { font-size: 0.74rem; color: var(--ink-faint); margin-bottom: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }

/* ---------------- AI chat (English Improvement) ---------------- */
.chat-thread { max-height: 55vh; overflow-y: auto; padding-right: 4px; }

/* ---------------- Study notes ---------------- */
.note-card.locked { opacity: 0.6; }
.note-content h3 { margin-top: 22px; color: var(--primary-dark); }
.note-content h3:first-child { margin-top: 0; }
.note-content ul { padding-left: 22px; margin: 10px 0; }
.note-content li { margin-bottom: 6px; }
.note-content p { margin: 0 0 14px; }
.note-quiz-feedback { margin-top: 8px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.86rem; }
.note-quiz-feedback.correct { background: var(--success-soft); color: var(--success); }
.note-quiz-feedback.incorrect { background: var(--danger-soft); color: var(--danger); }

/* ---------------- Video lectures ---------------- */
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .video-grid { grid-template-columns: 1fr; } }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-sm); background: #000; margin-bottom: 12px; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* ---------------- Responsive nav (hamburger below ~860px) ---------------- */
.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--border-strong);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  box-shadow: none;
}
.nav-toggle:hover { background: var(--primary-soft); border-color: var(--primary); transform: none; box-shadow: none; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .topbar nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    order: 3;
    gap: 2px;
    padding-top: 8px;
  }
  .topbar nav.open { display: flex; }
  .topbar nav a, .topbar nav .track-pill { width: 100%; text-align: left; box-sizing: border-box; }
  .topbar nav a:not(.btn-nav) { padding: 12px 14px; }
  .btn-nav { text-align: center; }
}

/* ---------------- General small-screen polish ---------------- */
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.7rem; }
  .page { padding: 24px 16px 50px; }
  .card { padding: 20px 18px; }
  .band-hero .band-num { width: 84px; height: 84px; font-size: 2.4rem; }
  .msg-bubble { max-width: 92%; }
}

/* ---------------- Quick Wrap (tips checklist) ---------------- */
.wrap-progress-track {
  width: 100%; height: 10px; background: var(--n-100); border-radius: 999px;
  overflow: hidden; margin-top: 10px;
}
.wrap-progress-track.small { height: 7px; margin-top: 8px; }
.wrap-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px; transition: width .25s var(--ease);
}
.wrap-overall-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.wrap-overall-pct { font-size: 1.6rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.wrap-category-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.wrap-category-right { display: flex; align-items: center; gap: 10px; }
.wrap-count { font-size: 0.84rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.wrap-reset-btn { padding: 5px 11px; font-size: 0.78rem; border-radius: 8px; }
.wrap-tip-list { list-style: none; margin: 14px 0 0; padding: 0; }
.wrap-tip-item {
  padding: 10px 4px; border-bottom: 1px solid var(--border);
  position: relative;
}
.wrap-tip-item:last-child { border-bottom: none; }
.wrap-tip-item label {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-weight: 500; margin: 0;
}
.wrap-tip-item input[type="checkbox"] {
  margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); cursor: pointer;
}
.wrap-tip-text { color: var(--ink); line-height: 1.5; transition: color .15s var(--ease); }
.wrap-tip-item.checked .wrap-tip-text { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.wrap-tip-note {
  display: inline-block; margin-left: 8px; font-size: 0.76rem; font-weight: 600;
  color: var(--danger); background: var(--danger-soft); padding: 2px 8px; border-radius: 999px;
}
.card.wrap-overall { background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); border-color: var(--primary-ring); }

/* ---------------- Student left sidebar (collapsible) ---------------- */
:root {
  --stu-sb-width: 246px;
  --stu-sb-collapsed: 76px;
}
body.has-student-shell { background: var(--bg); }
.student-shell { display: flex; min-height: 100vh; align-items: stretch; }
.student-sidebar {
  width: var(--stu-sb-width); flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 12px 14px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  z-index: 30;
  transition: width .18s var(--ease);
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 14px; }
.sidebar-top .brand { overflow: hidden; min-width: 0; flex-shrink: 0; }
.sidebar-top .brand-text { white-space: nowrap; }
.sidebar-collapse-btn {
  background: none; border: 1.5px solid var(--border-strong); color: var(--ink-soft);
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .95rem; padding: 0;
  box-shadow: none; transition: transform .18s var(--ease), background .15s ease, color .15s ease;
}
.sidebar-collapse-btn:hover { background: var(--surface-2); color: var(--ink); box-shadow: none; transform: none; }

.student-nav { display: flex; flex-direction: column; gap: 1px; }
.student-nav a {
  color: var(--ink-soft); font-weight: 600; font-size: .89rem;
  padding: 9px 10px; border-radius: 9px;
  display: flex; align-items: center; gap: 10px;
  transition: background .13s ease, color .13s ease;
  white-space: nowrap;
}
.student-nav a .nav-ic { font-size: 1.02rem; width: 20px; text-align: center; flex-shrink: 0; }
.student-nav a:hover { background: var(--surface-2); color: var(--ink); }
.student-nav a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }

.student-sidebar .sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.sidebar-status { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 4px 12px; }
.student-sidebar .sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 4px 12px; min-width: 0; }
.student-sidebar .sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #4034c7); color: #fff; font-weight: 800; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user-info { min-width: 0; }
.student-sidebar .sidebar-user-name { font-size: .86rem; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-sidebar .btn.secondary.small.block { justify-content: flex-start; gap: 10px; }

.student-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.student-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 28px; background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 15;
}
.student-topbar-title { font-weight: 750; font-size: 1.05rem; letter-spacing: -0.01em; }
.student-main .page { flex: 1; max-width: 1240px; }

@media (max-width: 960px) {
  .student-sidebar {
    position: fixed; left: 0; top: 0; height: 100dvh;
    transform: translateX(-100%);
    transition: transform .22s var(--ease);
    box-shadow: var(--shadow-xl);
    width: var(--stu-sb-width) !important;
  }
  .student-sidebar.open { transform: translateX(0); }
  .student-topbar .nav-toggle { display: inline-block; }
  .sidebar-collapse-btn { display: none; }
}
@media (min-width: 961px) {
  .student-topbar .nav-toggle { display: none; }

  /* Desktop minimize/maximize: icon-only rail when collapsed, remembered via localStorage. */
  html.sb-collapsed .student-sidebar { width: var(--stu-sb-collapsed); }
  html.sb-collapsed .student-sidebar .brand-text,
  html.sb-collapsed .student-sidebar .nav-label,
  html.sb-collapsed .student-sidebar .sidebar-status,
  html.sb-collapsed .student-sidebar .sidebar-user-info { display: none; }
  html.sb-collapsed .student-sidebar .sidebar-top { flex-direction: column; justify-content: center; gap: 10px; padding-bottom: 12px; }
  html.sb-collapsed .student-sidebar .sidebar-collapse-btn { transform: rotate(180deg); }
  html.sb-collapsed .student-nav a { justify-content: center; padding: 9px 4px; }
  html.sb-collapsed .student-sidebar .sidebar-user { justify-content: center; padding-left: 0; padding-right: 0; }
  html.sb-collapsed .student-sidebar .btn.secondary.small.block { justify-content: center; padding: 9px; gap: 0; }
}

/* Horizontally scrollable tables on narrow screens, without changing markup */
@media (max-width: 700px) {
  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  table.compact { min-width: 640px; }
}

/* ---------------- Writing Task 1 charts (line/bar/table/process/map) ---------------- */
.writing-chart {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 14px; margin-bottom: 18px;
}
.chart-svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis-label { fill: var(--ink-faint); font-size: 10px; font-family: var(--font); }
.chart-axis-unit { fill: var(--ink-faint); font-size: 9.5px; font-family: var(--font); font-style: italic; }
.chart-edge-label { fill: var(--primary-dark); font-size: 10px; font-family: var(--font); font-weight: 600; }
.chart-edge-label-back { fill: var(--danger); }
.chart-process-label { fill: var(--ink); font-size: 10.5px; font-family: var(--font); font-weight: 600; }
.chart-pie-label { fill: #fff; font-size: 11px; font-weight: 700; font-family: var(--font); }
.chart-map-num { fill: #fff; font-size: 10px; font-weight: 700; font-family: var(--font); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; justify-content: center; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.chart-legend-item i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart-subtitle { text-align: center; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); margin: 0 0 4px; }
.chart-combined { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 700px) { .chart-combined { grid-template-columns: 1fr; } }
.chart-pie-block { display: flex; flex-direction: column; align-items: center; }
.chart-pie { max-width: 220px; margin: 0 auto; }
.chart-table.compact { background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; }
.chart-process { margin: 0 auto; }
.chart-map-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 800px) { .chart-map-grid { grid-template-columns: 1fr; } }
.chart-map-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.chart-map-year {
  display: inline-block; font-size: 0.78rem; font-weight: 800; border: 1.5px solid; border-radius: 999px;
  padding: 2px 11px; margin-bottom: 8px;
}
.chart-map-sketch { width: 100%; height: auto; border-radius: 6px; margin-bottom: 8px; }
.chart-map-features { margin: 0; padding-left: 18px; font-size: 0.82rem; color: var(--ink-soft); }
.chart-map-features li { margin-bottom: 4px; }

/* ---------------- Public content pages (About Us, Terms, Privacy, Contact, ---------------- */
/* ---------------- and the Vocabulary/Grammar/Band Score/Practice Tests resource pages) ----- */
.page-body { max-width: 740px; line-height: 1.65; color: var(--ink-soft); }
.page-body h3 { color: var(--ink); margin: 26px 0 8px; font-size: 1.18rem; }
.page-body h3:first-child { margin-top: 0; }
.page-body p { margin: 0 0 14px; }
.page-body ul { margin: 0 0 14px; padding-left: 22px; }
.page-body ul li { margin-bottom: 6px; }
.page-body code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 0.88em; }

/* ---------------- Homepage sections ---------------- */
.home-section { margin: 0 auto; padding: 46px 0 0; }
.home-section-head { text-align: center; max-width: 640px; margin: 0 auto 26px; }
.home-section-head h2 { margin: 0 0 8px; font-size: 1.6rem; }
.home-section-head p { color: var(--ink-soft); margin: 0; }

.module-card { text-align: center; }
.module-card .stat-icon { background: var(--accent-soft); }
.module-card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.module-card p { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 14px; }
.module-card a.btn { width: 100%; justify-content: center; }

.resource-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.resource-card p { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 12px; }
.resource-card a.card-link { font-weight: 650; font-size: 0.88rem; }

.faq-item h3 { margin: 0 0 8px; font-size: 1rem; }
.faq-item p { color: var(--ink-soft); margin: 0; font-size: 0.92rem; }

.cta-banner {
  text-align: center;
  padding: 40px 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent, #0891b2));
  color: #fff;
}
.cta-banner h2 { color: #fff; margin: 0 0 8px; }
.cta-banner p { color: rgba(255,255,255,.9); margin: 0 0 20px; }
.cta-banner .btn.secondary { background: #fff; color: var(--primary-dark); border-color: transparent; }
.cta-banner .btn.secondary:hover { background: rgba(255,255,255,.9); }

/* Logout rendered as a POST form (CSRF-safe) — keep it looking like the old link button */
.logout-form { margin: 0; }
.logout-form .btn { width: 100%; cursor: pointer; font: inherit; }

/* ------------------------------------------------------------------
   Student top bar actions: "Book a Teacher" + notices bell (Sep 2026)
   ------------------------------------------------------------------ */
.student-topbar-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-teacher-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #4034c7); color: #fff !important;
  font-weight: 700; font-size: .86rem; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
  transition: transform .12s ease, box-shadow .12s ease;
}
.topbar-teacher-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79,70,229,.38); color: #fff; }
.topbar-teacher-btn.active { outline: 2px solid rgba(79,70,229,.35); outline-offset: 2px; }
.notif-wrap { position: relative; }
.notif-bell {
  position: relative; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.notif-bell:hover, .notif-bell[aria-expanded="true"] { background: #f1f1fe; border-color: #c7c9f7; color: var(--primary); }
.notif-count {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: #e11d48; color: #fff; font-size: .68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.notif-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 320px; max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(20,20,50,.16); overflow: hidden; z-index: 40;
}
.notif-menu[hidden] { display: none; }
.notif-menu-head { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-menu-sub { font-size: .78rem; color: #e11d48; font-weight: 700; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; color: var(--ink); border-bottom: 1px solid #f0f0f6; }
.notif-item:hover { background: #f7f7fd; color: var(--ink); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: transparent; }
.notif-item.unread .notif-dot { background: var(--primary); }
.notif-item.unread .notif-title { font-weight: 700; }
.notif-text { display: flex; flex-direction: column; min-width: 0; }
.notif-title { font-size: .88rem; line-height: 1.35; }
.notif-date { font-size: .75rem; color: var(--muted, #6b7090); margin-top: 2px; }
.notif-empty { padding: 18px 14px; color: var(--muted, #6b7090); font-size: .88rem; }
.notif-all { display: block; padding: 11px 14px; text-align: center; font-weight: 700; font-size: .86rem; background: #fafaff; }
@media (max-width: 600px) {
  .topbar-teacher-btn .tt-label { display: none; }
  .topbar-teacher-btn { padding: 8px 11px; }
  .student-topbar { padding: 12px 14px; }
}

/* ------------------------------------------------------------------
   Admin / teacher sidebar: higher contrast + logo on a light plate
   ------------------------------------------------------------------ */
:root { --sb-ink: #f4f5ff; --sb-ink-soft: #c3c7ea; }
.admin-brand {
  background: #fff; border-radius: 14px; padding: 10px 14px; margin: 2px 2px 12px;
  color: var(--ink); justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.admin-brand:hover { color: var(--ink); }
.admin-brand span { color: var(--primary); }
.admin-brand .brand-logo-img { height: 34px; max-width: 190px; }
.sidebar-section-label { color: #aab0e6; font-size: .7rem; padding-top: 16px; }
.sidebar-nav a { color: #f4f5ff; font-weight: 600; font-size: .9rem; }
.sidebar-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.admin-sidebar .sidebar-user-name { color: #fff; }
.admin-sidebar .btn.secondary { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.admin-sidebar .btn.secondary:hover { background: rgba(255,255,255,.18); }
.notif-bell { padding: 0; box-shadow: none; flex-shrink: 0; }
.notif-bell:hover { transform: none; box-shadow: none; }
.notif-bell svg { width: 20px; height: 20px; flex-shrink: 0; display: block; }

/* Mobile overflow guards (Sep 2026): wide tables scroll inside their card
   instead of stretching the whole page sideways. */
.grid > *, .card { min-width: 0; }
@media (max-width: 700px) {
  .student-main .page table, .admin-main .page table { display: block; max-width: 100%; min-width: 0 !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
/* The shell's main area is a flex column and .page uses auto margins, which
   made it size to its widest content on phones. Pin it to the column width. */
.student-main > .page, .admin-main > .page { width: 100%; min-width: 0; box-sizing: border-box; }

/* Hover contrast fix: the generic `a:hover` colour (primary-dark) was beating
   `.btn` on link-buttons, making the label vanish into the button background. */
a.btn:hover, a.btn:focus-visible { color: #fff; }
a.btn.secondary:hover, a.btn.secondary:focus-visible { color: var(--ink); }
.upsell-banner a.btn:hover, .mock-card a.btn:hover { color: var(--primary-dark); }
.cta-banner a.btn.secondary:hover { color: var(--primary-dark); }
.admin-sidebar a.btn.secondary:hover { color: #fff; }

/* Top bar "Support" link (next to the bell) */
.topbar-icon-btn {
  height: 40px; padding: 0 13px; border-radius: 12px; gap: 7px;
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  display: inline-flex; align-items: center; font-weight: 650; font-size: .86rem; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.topbar-icon-btn svg { width: 19px; height: 19px; flex-shrink: 0; display: block; }
.topbar-icon-btn:hover, .topbar-icon-btn.active { background: #f1f1fe; border-color: #c7c9f7; color: var(--primary-dark); }
@media (max-width: 600px) {
  .topbar-icon-btn { width: 40px; padding: 0; justify-content: center; }
  .topbar-icon-btn .tib-label { display: none; }
  .topbar-actions { gap: 7px; }
}

/* Account menu (top bar, far right) */
.user-menu-btn {
  height: 40px; padding: 0 10px 0 5px; border-radius: 999px; gap: 7px;
  border: 1px solid var(--border); background: #fff; color: var(--ink); box-shadow: none;
  display: inline-flex; align-items: center; font-weight: 650; font-size: .86rem; cursor: pointer;
}
.user-menu-btn:hover, .user-menu-btn[aria-expanded="true"] { background: #f1f1fe; border-color: #c7c9f7; color: var(--ink); transform: none; box-shadow: none; }
.user-menu-avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1, #4034c7); color: #fff; font-weight: 800; font-size: .85rem;
}
.user-menu-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu { width: 260px; }
.user-menu .notif-item { align-items: center; }
.user-menu-logout { margin: 0; border-top: 1px solid var(--border); }
.user-menu-logout button {
  width: 100%; text-align: left; background: #fff; color: #b42318; border: 0; border-radius: 0; box-shadow: none;
  padding: 12px 14px; font-weight: 700; font-size: .9rem; justify-content: flex-start;
}
.user-menu-logout button:hover { background: #fef3f2; color: #b42318; transform: none; box-shadow: none; }
@media (max-width: 600px) {
  .user-menu-name, .user-menu-btn svg { display: none; }
  .user-menu-btn { padding: 0 4px; width: 40px; justify-content: center; }
}

/* Footer: full-width band with a gradient line on top so it reads clearly as the footer */
.footer-full {
  position: relative;
  max-width: none;
  margin-top: 20px;
  padding: 48px max(24px, calc((100% - 1240px) / 2 + 24px)) 30px;
  background: linear-gradient(135deg, #e6e8fd 0%, #eceefe 45%, #e1f1f8 100%);
  box-shadow: 0 -8px 24px rgba(79, 70, 229, .06);
}
.footer-full::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 35%, #0ea5e9 70%, #14b8a6 100%);
}
.footer-full .footer-grid { border-bottom-color: #d9dcf5; }
.footer-full .footer-col h4 { color: var(--primary); }
.footer-full .footer-col p, .footer-full .footer-col a { color: #4b5070; }
.footer-full .footer-bottom { color: #6b7090; }

/* Footer social icons */
.footer-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.footer-social a { display: inline-flex !important; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 1px solid #d9dcf5; color: #4338ca !important; margin: 0 !important; text-decoration: none !important; transition: transform .15s, background .15s; }
.footer-social a:hover { background: var(--primary, #4f46e5); color: #fff !important; transform: translateY(-2px); }
.footer-social a.custom { width: auto; padding: 0 14px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }

/* "Rate our app" popup */
.rp-overlay { position: fixed; inset: 0; background: rgba(17, 24, 39, .5); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 16px; }
.rp-overlay[hidden] { display: none !important; }
.rp-box { position: relative; background: #fff; border-radius: 18px; max-width: 420px; width: 100%; padding: 28px 24px 22px; text-align: center; box-shadow: 0 24px 60px rgba(17, 24, 39, .25); animation: rpIn .18s ease-out; }
@keyframes rpIn { from { transform: translateY(12px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.rp-box h2 { margin: 6px 0 8px; font-size: 1.3rem; }
.rp-box p { color: var(--ink-soft, #6b7280); margin: 0 0 18px; line-height: 1.5; }
.rp-stars { font-size: 1.9rem; color: #f59e0b; letter-spacing: 3px; }
.rp-actions { display: flex; flex-direction: column; gap: 8px; }
.rp-actions .btn { width: 100%; justify-content: center; text-align: center; }
.rp-later { align-self: center; background: none !important; border: 0; color: var(--ink-soft, #6b7280) !important; font-size: .9rem; padding: 6px; cursor: pointer; box-shadow: none !important; }
.rp-later:hover { color: var(--ink, #111827) !important; text-decoration: underline; }
.rp-close { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; padding: 0 !important; border-radius: 50%; background: transparent !important; color: #9ca3af !important; font-size: 1.5rem; line-height: 1; border: 0; box-shadow: none !important; cursor: pointer; }
.rp-close:hover { background: #f3f4f6 !important; color: #111827 !important; }

/* Keep the public top menu on one row on laptop screens */
@media (min-width: 901px) and (max-width: 1400px) {
  .topbar nav a:not(.btn-nav) { padding-left: 9px; padding-right: 9px; font-size: .86rem; }
}

/* Partner / coupon codes */
.code-box { padding: 12px 18px; }
.code-box summary { cursor: pointer; font-weight: 700; }
.code-form { display: flex; gap: 8px; margin-top: 10px; max-width: 460px; }
.code-form input { flex: 1; min-width: 0; text-transform: uppercase; }
.price .list-price { font-size: .6em; color: var(--ink-faint, #9ca3af); font-weight: 600; margin-right: 4px; }
.discount-banner form { margin: 0; }

/* Partners & coupons (admin + partner report) */
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.copy-row input { flex: 1 1 280px; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.partner-links { background: var(--primary-soft, #f6f7fb); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.partner-links label { font-weight: 600; font-size: 0.88rem; }
.partner-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.partner-stats .card { margin: 0; text-align: center; }
.partner-stats strong { display: block; font-size: 1.8rem; line-height: 1.1; }
.partner-stats span { color: var(--ink-soft, #667085); font-size: 0.88rem; }

/* Promo popup (includes/promo_popup.php) */
.promo-overlay { position: fixed; inset: 0; z-index: 4000; display: flex; padding: 16px; overflow-y: auto;
  background: rgba(15, 12, 41, 0.62); backdrop-filter: blur(3px); animation: promoFade .25s ease-out; }
.promo-overlay[hidden] { display: none; }
/* The box clips its decorative circles (no scrollbars); on very short screens the overlay scrolls instead. */
.promo-box { position: relative; width: 100%; max-width: 440px; margin: auto; overflow: hidden; flex-shrink: 0; border-radius: 24px;
  padding: 30px 26px 22px; text-align: center; color: #fff;
  background: linear-gradient(140deg, #6d28d9 0%, #4f46e5 45%, #db2777 100%);
  box-shadow: 0 30px 80px rgba(49, 16, 122, 0.55); animation: promoPop .35s cubic-bezier(.2, 1.2, .4, 1); }
.promo-buyer .promo-box { background: linear-gradient(140deg, #0f766e 0%, #2563eb 50%, #7c3aed 100%); }
.promo-box::before, .promo-box::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.promo-box::before { width: 190px; height: 190px; right: -70px; top: -70px; background: rgba(253, 224, 71, 0.28); }
.promo-box::after { width: 150px; height: 150px; left: -60px; bottom: -60px; background: rgba(255, 255, 255, 0.12); }
.promo-box > * { position: relative; z-index: 1; }
.promo-close { position: absolute !important; top: 10px; right: 12px; z-index: 2 !important; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.22); color: #fff; font-size: 1.4rem; line-height: 1; padding: 0; }
.promo-close:hover { background: rgba(255, 255, 255, 0.36); }
.promo-art { width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 50%; background: #fde047; display: flex; align-items: center; justify-content: center;
  font-size: 2.3rem; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25); animation: promoBob 2.4s ease-in-out infinite; }
.promo-badge { display: inline-block; background: #fde047; color: #3b0764; font-weight: 800; font-size: 0.74rem; letter-spacing: .08em; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
.promo-box h2 { color: #fff; font-size: 1.55rem; line-height: 1.2; margin: 0 0 8px; }
.promo-text { color: rgba(255, 255, 255, 0.92); margin: 0 0 12px; font-size: 1rem; }
.promo-points { list-style: none; margin: 0 auto 14px; padding: 0; text-align: left; max-width: 340px; }
.promo-points li { position: relative; padding: 5px 0 5px 30px; font-size: 0.95rem; color: #fff; }
.promo-points li::before { content: "✓"; position: absolute; left: 0; top: 5px; width: 21px; height: 21px; border-radius: 50%; background: #34d399; color: #064e3b;
  font-weight: 800; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
.promo-price { margin: 0 0 14px; font-size: 1rem; color: #fff; }
.promo-price strong { font-size: 1.9rem; }
.promo-price del { opacity: .75; margin-right: 4px; }
.promo-price em { font-style: normal; background: #fde047; color: #3b0764; font-weight: 800; font-size: 0.78rem; padding: 3px 9px; border-radius: 999px; margin-left: 6px; }
.promo-cta { display: block; background: #fde047; color: #3b0764 !important; font-weight: 800; font-size: 1.08rem; text-decoration: none; padding: 14px 18px; border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28); transition: transform .15s ease, box-shadow .15s ease; }
.promo-cta:hover, .promo-cta:focus { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34); outline: none; }
.promo-later { margin-top: 10px; background: none; border: 0; color: rgba(255, 255, 255, 0.85); text-decoration: underline; cursor: pointer; font-size: 0.9rem; padding: 6px; }
html.promo-open { overflow: hidden; }
@keyframes promoFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes promoPop { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes promoBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .promo-overlay, .promo-box, .promo-art { animation: none; } }
@media (max-width: 420px) { .promo-box { padding: 26px 18px 18px; } .promo-box h2 { font-size: 1.32rem; } }

/* ---- Extra IELTS question types: choose TWO, map labelling, flow-chart ---- */
.q-ghost { height: 0; min-height: 0; margin: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden; }
.practice-q-ghost { margin-top: -6px; padding-top: 0; border-top: 0; }
.practice-q-ghost:not(.is-correct):not(.is-incorrect) { display: none; }
.q-multi-hint { font-size: .82rem; color: var(--ink-soft); margin: 6px 0 0; }
.q-multi .q-choice input[disabled] + *, .q-multi .q-choice:has(input[disabled]) { opacity: .55; }
.q-map { margin: 12px 0 4px; text-align: center; }
.q-map img { max-width: 100%; width: 560px; height: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
.q-letters { display: flex; flex-wrap: wrap; gap: 6px; }
.q-letters .q-choice { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 600; }
.q-letters .q-choice:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); }
.q-item-letters > p { margin-bottom: 6px; font-weight: 600; }
/* Flow-chart: each step is a box, joined by arrows */
.q-group-flow-chart-completion .q-item, .q-item-flow { position: relative; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 26px; background: var(--surface); }
.q-group-flow-chart-completion .q-item:not(:last-child)::after, .q-item-flow + .q-item-flow::before { content: "↓"; position: absolute; left: 50%; transform: translateX(-50%); font-size: 1.2rem; color: var(--ink-soft); line-height: 1; }
.q-group-flow-chart-completion .q-item:not(:last-child)::after { bottom: -23px; }
.q-item-flow + .q-item-flow::before { top: -23px; }
.q-badge { white-space: nowrap; }
.q-multi .q-item-head .q-badge { min-width: 0; width: auto; padding-left: 8px; padding-right: 8px; }
/* The map stays in view while its questions are answered. */
.q-group-map-labelling > .q-group-label, .practice-group-map-labelling { display: block; }
.q-group-map-labelling > .q-group-label { display: contents; color: var(--primary-dark); font-weight: 700; }
.q-group-map-labelling .q-map, .practice-questions .q-map { position: sticky; top: 70px; z-index: 6; background: var(--surface); padding: 6px 0; margin: 8px 0; }
.q-map img { max-height: 44vh; width: auto; }
@media (max-width: 700px) { .q-map img { max-height: 36vh; } }
.q-item-letters { scroll-margin-bottom: 96px; }
.q-item-letters, .q-item-letters .q-choice, .q-item-letters input { scroll-margin-top: calc(44vh + 120px); }

/* ---- Access period over (payments/expired.php) ---- */
.plan-expired-card { text-align: center; padding: 34px 26px; border-top: 5px solid #f59e0b; }
.plan-expired-icon { font-size: 46px; line-height: 1; margin-bottom: 8px; }
.plan-expired-card h1 { margin: 0 0 8px; }
.plan-expired-date { margin: 0 0 10px; color: #b45309; }
.plan-expired-btn { display: inline-block; margin: 14px 0 10px; font-size: 1.05rem; padding: 12px 26px; }
.plan-expired-note { margin-top: 12px; font-size: .92rem; }
.plan-expired-links { margin: 14px 0 0; font-size: .9rem; }

/* ---- Mobile number field (sign-up, profile, consent popup) ---- */
.phone-row { display: flex; gap: 8px; }
.phone-row select { flex: 0 0 auto; max-width: 46%; }
.phone-row input { flex: 1; min-width: 0; }
.field-hint { margin: 6px 0 0; font-size: .85rem; color: #6b7280; }

/* ---- Study-abroad contact question (one-time popup after login) ---- */
.consent-overlay { position: fixed; inset: 0; z-index: 1200; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.consent-box { position: relative; background: #fff; border-radius: 18px; max-width: 520px; width: 100%; padding: 28px 26px 22px; box-shadow: 0 24px 60px rgba(15, 23, 42, .3); border-top: 6px solid #0ea5e9; }
.consent-icon { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.consent-box h2 { margin: 0 0 8px; }
.consent-box > p { margin: 0 0 12px; color: #374151; }
.consent-statement { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 10px; padding: 12px 14px; font-size: .95rem; margin: 0 0 14px; }
.consent-phone { margin-bottom: 14px; }
.consent-phone label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.consent-actions .btn { flex: 1 1 160px; text-align: center; }
.consent-small { margin: 12px 0 0; font-size: .82rem; color: #6b7280; }
.consent-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1200; background: #065f46; color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: consentToast 6s forwards; max-width: calc(100% - 32px); }
@keyframes consentToast { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.check-line { display: block; font-weight: 400; margin: 4px 0; }

/* ---------- Study abroad: onboarding, student options, admin ---------- */
.onboard .card { padding: 28px; }
.onboard-step { color: var(--primary); font-weight: 600; margin: 0 0 4px; }
.onboard-q { border: 0; border-top: 1px solid var(--border); margin: 0; padding: 18px 0 6px; min-width: 0; }
.onboard-q legend, .onboard-q > summary { font-weight: 600; font-size: 1.02rem; padding: 0; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.onboard-q legend small, .onboard-q summary small { font-weight: 400; color: var(--ink-soft); }
.onboard-q > summary { cursor: pointer; list-style: none; }
.onboard-q > summary::-webkit-details-marker { display: none; }
.onboard-q > summary::after { content: '▾'; color: var(--ink-faint); margin-left: auto; }
.onboard-q[open] > summary::after { content: '▴'; }
.q-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: .85rem; font-weight: 700; flex: none; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 10px; }
.choice, .chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 400; background: var(--surface); transition: border-color .15s, background .15s; }
.choice:hover, .chip:hover { border-color: var(--border-strong); }
.choice:has(input:checked), .chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice input, .chip input { margin: 0; accent-color: var(--primary); }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { border-radius: 999px; padding: 7px 14px; }
.course-inputs { display: grid; gap: 8px; }
.loc-grid, .edu-grid { gap: 10px; }
.edu-grid .field { margin: 0; }
.purpose-other { margin-top: 2px; }
.onboard-consent .consent-statement { margin-bottom: 10px; }
.onboard-actions { display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 18px; margin-top: 12px; }
.study-plan-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.plan-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; margin: 0 0 8px; }
.plan-dl dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); margin: 0; }
.plan-dl dd { margin: 2px 0 0; }
.sub-h { font-size: 1rem; margin: 18px 0 8px; }
.option-list { display: grid; gap: 14px; }
.option-card { margin: 0; }
.option-card.is-new { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.option-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.option-head h3 { margin: 4px 0 2px; font-size: 1.1rem; }
.option-uni { margin: 0; color: var(--ink-soft); }
.option-facts { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .92rem; }
.option-notes { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: .94rem; margin-bottom: 10px; }
.option-actions { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.option-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.new-badge { background: var(--primary); color: #fff; }
.study-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--primary-soft); border: 1px solid #c7cbfb; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.study-banner.subtle { background: var(--surface); border-color: var(--border); }
.search-row, .filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.search-row input[type=search] { flex: 1 1 260px; max-width: 420px; margin: 0; }
.filter-bar input[type=search] { flex: 1 1 220px; margin: 0; }
.filter-bar select { width: auto; margin: 0; }
.filter-bar .check-line { margin: 0 6px; }
.waiting-card { border-color: #fcd34d; background: #fffbeb; }
.suggest-form { margin-top: 14px; }
.suggest-form > summary { display: inline-block; cursor: pointer; list-style: none; }
.suggest-form > summary::-webkit-details-marker { display: none; }
.inline-status select { margin: 0; padding: 4px 8px; font-size: .88rem; width: auto; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; box-shadow: none; }
.link-btn:hover { background: none; color: var(--primary-dark); }
.unlisted-list { display: flex; flex-wrap: wrap; gap: 8px; }
.unlisted-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px 4px 12px; margin: 0; }
.muted-row td { opacity: .55; }
.rename-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.rename-form input { margin: 0; padding: 4px 8px; }
@media (max-width: 600px) {
  .onboard .card { padding: 18px; }
  .choice-grid { grid-template-columns: 1fr; }
  .option-head { flex-direction: column; }
}

/* Wide admin tables scroll inside their card instead of spilling out of the page */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-scroll > table { margin: 0; }
.students-table th { white-space: nowrap; }
.students-table td { vertical-align: middle; }
.students-table .st-name { min-width: 160px; max-width: 240px; }
.students-table th, .students-table td { padding-left: 8px; padding-right: 8px; }
.students-table .st-name small { color: var(--ink-soft); word-break: break-all; }
.students-table .st-plan { min-width: 110px; max-width: 150px; }
.students-table .st-plan .badge { white-space: normal; display: inline-block; line-height: 1.35; }
.students-table .st-plan small { color: var(--ink-soft); }

/* Student menu switches (Admin → Student menu) */
.menu-switch-table .c { text-align: center; width: 140px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-ui { position: absolute; inset: 0; background: var(--n-300); border-radius: 999px; transition: background .15s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--success); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 3px var(--primary-ring); }

/* Deleting students */
.students-table .sel { width: 28px; padding-right: 0; }
.students-table .sel input { margin: 0; width: 16px; height: 16px; }
.bulk-bar { display: flex; align-items: center; gap: 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.bulk-bar[hidden] { display: none; }
.danger-card { border-color: #fecaca; }
.delete-confirm { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.delete-confirm .code-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.delete-confirm input { margin: 0; }

/* ---------- Reading passages: continuous text; letters only when questions need them ---------- */
.reading-passage .rp-title { font-size: 1.05rem; margin: 0 0 12px; }
.reading-passage .rp-text { margin: 0 0 14px; line-height: 1.75; }
.reading-passage .rp-para { margin: 0 0 16px; }
.reading-passage .rp-letter { font-weight: 700; font-size: 1.05rem; margin: 0 0 4px; }
.reading-passage .rp-para p { margin: 0; line-height: 1.75; }

/* ---------- Drag-and-drop (summary word box, headings) ---------- */
.dnd-src { display: none !important; }
.dnd-src.is-correct, .dnd-src.is-incorrect { display: block !important; } /* practice feedback after "Check answers" */
.dnd-src.is-correct .q-choice, .dnd-src.is-incorrect .q-choice { display: none; }
.dnd-wordbox { margin: 6px 0 18px; }
.dnd-sentences { line-height: 2.9; margin-bottom: 14px; }
.dnd-sentences p { margin: 0 0 6px; }
.dnd-flow .dnd-line { border: 1.5px solid var(--border); border-radius: 10px; padding: 4px 12px; text-align: center; margin: 0 0 22px; position: relative; }
.dnd-flow .dnd-line:not(:last-child)::after { content: "↓"; position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); color: var(--ink-soft); line-height: 1; }
.dnd-slot { display: inline-flex; align-items: center; gap: 8px; min-width: 190px; min-height: 40px; vertical-align: middle; padding: 3px 10px 3px 4px; margin: 2px 2px; border: 1.5px dashed var(--border-strong); border-radius: 6px; background: var(--surface); cursor: pointer; line-height: 1.3; text-align: left; transition: border-color .12s, background .12s; }
.dnd-slot:hover, .dnd-slot:focus-visible { border-color: var(--primary); outline: none; }
.dnd-slot.is-over, .dnd-selecting .dnd-slot:not(.is-filled):not(.is-locked) { border-color: var(--primary); background: var(--primary-soft); }
.dnd-slot .dnd-num { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 4px; border: 1.5px solid var(--ink); border-radius: 4px; font-weight: 700; background: var(--surface); }
.dnd-slot .dnd-text { color: var(--ink-faint); font-style: italic; font-size: .9rem; }
.dnd-slot.is-filled { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
.dnd-slot.is-filled .dnd-text { color: var(--ink); font-style: normal; font-weight: 600; font-size: .95rem; }
.dnd-slot.is-answered .dnd-num { background: var(--success-soft); }
.dnd-slot.is-correct { border-color: var(--success); background: var(--success-soft); }
.dnd-slot.is-incorrect { border-color: var(--danger); background: #fef2f2; }
.dnd-slot.is-locked { cursor: default; }
.dnd-slot.jump-highlight { box-shadow: 0 0 0 3px var(--primary-ring); }
.dnd-bank-wrap, .dnd-headings { background: var(--n-50); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.dnd-hint { font-style: italic; font-size: .9rem; color: var(--ink-soft); margin: 0 0 10px; }
.dnd-bank { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; border-radius: 8px; transition: background .12s; }
.dnd-bank.is-over { background: var(--primary-soft); }
.dnd-bank.is-hint { animation: dnd-pulse .9s ease; }
@keyframes dnd-pulse { 0%, 100% { box-shadow: none; } 40% { box-shadow: 0 0 0 3px var(--primary-ring); } }
.dnd-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: grab; box-shadow: none; text-align: left; line-height: 1.35; }
.dnd-chip:hover { border-color: var(--primary); background: var(--surface); color: var(--ink); }
.dnd-chip .dnd-key { font-weight: 400; color: var(--ink-soft); }
.dnd-chip.is-selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-ring); }
.dnd-chip.is-dragging { opacity: .45; }
.dnd-chip[disabled] { cursor: default; opacity: .7; }
.dnd-bank-list { flex-direction: column; }
.dnd-bank-list .dnd-chip { width: 100%; padding: 12px 14px; font-size: .98rem; }
.dnd-heading-title { margin: 0 0 6px; font-size: 1.05rem; }
.dnd-headings { margin: 6px 0 16px; }
.dnd-para-zone { margin: 0 0 8px; }
.dnd-para-zone .dnd-slot { display: flex; width: 100%; min-height: 48px; border-width: 2px; }

/* ---------- Matching Information / Features grid ---------- */
.mi-legend { display: grid; gap: 4px 12px; grid-template-columns: auto 1fr; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--n-50); }
.mi-legend > div { display: contents; }
.mi-grid { border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; margin: 4px 0 16px; }
.mi-row { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(var(--mi-cols, 7), minmax(40px, 52px)); align-items: center; border-bottom: 1px solid var(--border); margin: 0 !important; padding: 0 !important; border-radius: 0 !important; background: var(--surface); box-shadow: none !important; }
.mi-row:last-child { border-bottom: 0; }
.mi-head { background: var(--n-100); font-weight: 700; }
.mi-row .mi-q { padding: 10px 12px; display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.mi-row .mi-q .q-item-head { margin: 0; flex: none; }
.mi-row .mi-q p { margin: 0 !important; }
.mi-row .mi-cell { display: flex; justify-content: center; align-items: center; height: 100%; min-height: 48px; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--border); background: transparent; cursor: pointer; border-radius: 0; }
.mi-head .mi-cell { min-height: 40px; }
.mi-row label.mi-cell:hover { background: var(--primary-soft); }
.mi-row .mi-cell input { margin: 0; width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.mi-row .note-quiz-feedback { grid-column: 1 / -1; margin: 0 12px 10px; }
.mi-row.is-correct { background: #f0fdf4; }
.mi-row.is-incorrect { background: #fef2f2; }
@media (max-width: 600px) {
  .mi-row { grid-template-columns: minmax(150px, 1fr) repeat(var(--mi-cols, 7), 36px); }
  .mi-row .mi-q { padding: 8px; font-size: .92rem; }
  .dnd-slot { min-width: 150px; }
}

/* Anything marked hidden stays hidden, whatever its display style */
[hidden] { display: none !important; }
