/* ============================================================================
   Snap Test-it — design system
   Concept: a graded worksheet. Ink-navy + worksheet paper, red-pen accent for
   scores/grading, green for approvals. High-contrast text everywhere.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --ink:        #16233A;   /* primary text, dark surfaces */
  --ink-2:      #3A4A66;   /* secondary text (AA on white/paper) */
  --paper:      #FBFAF7;   /* app background — worksheet paper */
  --surface:    #FFFFFF;
  --line:       #E7E2D8;   /* hairlines */
  --line-2:     #D8D2C5;

  --brand:       #0E6DBE;  /* logo blue, deepened so white text passes AA */
  --brand-ink:   #0A568F;  /* hover / link text */
  --brand-bright:#0089E5;  /* exact logo blue — accents, focus rings */
  --brand-tint:  #E3F2FC;

  --accent:      #FE8001;  /* exact logo orange — signature actions */
  --accent-ink:  #8A4A00;  /* dark orange text on light */
  --accent-tint: #FFEBD2;

  --red:        #E8442B;   /* red pen — scores, grading */
  --red-tint:   #FDECE8;
  --red-ink:    #B32C16;

  --green:      #1F9D63;   /* approved / passing */
  --green-tint: #E6F6EE;
  --green-ink:  #137045;

  --amber-ink:  #8A5A00;   /* pending */
  --amber-tint: #FBF0D9;

  --radius:     14px;
  --radius-sm:  10px;
  --shadow:     0 1px 2px rgba(22,35,58,.06), 0 8px 24px rgba(22,35,58,.06);
  --shadow-lg:  0 20px 60px rgba(22,35,58,.18);

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body:    'Inter', system-ui, sans-serif;
  --mono:    'Space Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -.01em; }

a { color: var(--brand-ink); }

button { font-family: var(--body); cursor: pointer; }

.hidden { display: none !important; }

/* worksheet paper texture: faint ruled lines */
.paper-lines {
  background-image: linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 30px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 11px 18px; font-size: 15px; font-weight: 600;
  text-decoration: none; transition: transform .04s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-red { background: var(--red-ink); color: #fff; }   /* dark red — white text passes AA */
.btn-red:hover { background: #8F2210; }
.btn-accent { background: var(--accent); color: var(--ink); }   /* orange + navy text — passes AA */
.btn-accent:hover { background: #E57100; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
input, select, textarea {
  width: 100%; font-family: var(--body); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}
.field { margin-bottom: 16px; }
.field-hint { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }

/* ---------- badges / pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
}
.pill-green { background: var(--green-tint); color: var(--green-ink); }
.pill-amber { background: var(--amber-tint); color: var(--amber-ink); }
.pill-red   { background: var(--red-tint);   color: var(--red-ink); }
.pill-blue  { background: var(--brand-tint); color: var(--brand-ink); }
.pill-gray  { background: #EFEDE7; color: var(--ink-2); }

/* ============================================================================
   AUTH SCREEN  (landing + login/signup)
   ============================================================================ */
#auth-screen { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }

.auth-hero {
  background: var(--ink); color: #fff; position: relative; overflow: hidden;
  padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 100% 34px; opacity: .5; pointer-events: none;
}
.hero-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.hero-brand img { width: 40px; height: 40px; }
.hero-brand span { font-family: var(--display); font-weight: 800; font-size: 20px; }

.hero-mid { position: relative; z-index: 1; max-width: 460px; }
.hero-mid .eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: #9FB4D9; margin-bottom: 18px;
}
.hero-mid h1 { font-size: clamp(34px, 4vw, 52px); font-weight: 800; }
.hero-mid h1 em { font-style: normal; color: #FF9A33; }
.hero-mid p { color: #C4D0E6; font-size: 17px; margin-top: 18px; }

/* the signature "graded worksheet" card */
.snap-card {
  position: relative; z-index: 1; align-self: flex-start;
  background: var(--paper); color: var(--ink); border-radius: 16px;
  padding: 18px 18px 16px; width: 280px; box-shadow: var(--shadow-lg);
  transform: rotate(-2deg);
}
.snap-card .sc-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.snap-card .sc-problem { font-family: var(--display); font-weight: 700; font-size: 26px; margin: 14px 0 4px; }
.snap-card .sc-work { font-family: var(--mono); font-size: 14px; color: var(--ink-2); }
.snap-card .sc-check { position: absolute; right: 14px; bottom: 44px; }
.snap-card .sc-score {
  position: absolute; right: -14px; top: -16px; width: 62px; height: 62px; border-radius: 50%;
  background: #fff; border: 3px solid var(--red); color: var(--red-ink);
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 22px;
  box-shadow: var(--shadow); transform: rotate(8deg);
}
.snap-card .sc-grade { margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--red-ink); border-top: 1px dashed var(--line-2); padding-top: 10px; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 26px; margin-bottom: 6px; }
.auth-box .sub { color: var(--ink-2); margin: 0 0 22px; }

.role-switch { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; background: #EFEDE7; padding: 4px; border-radius: 12px; margin-bottom: 20px; }
.role-switch button { border: none; background: transparent; padding: 9px 4px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.role-switch button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.auth-tabs { display: flex; gap: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.auth-tabs button { background: none; border: none; padding: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.auth-tabs button.active { color: var(--ink); border-bottom-color: var(--brand); }

.auth-msg { font-size: 13.5px; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.auth-msg.error { background: var(--red-tint); color: var(--red-ink); }
.auth-msg.ok { background: var(--green-tint); color: var(--green-ink); }

/* ============================================================================
   APP SHELL
   ============================================================================ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 64px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--ink); }
.topbar .brand img { width: 32px; height: 32px; }
.topbar .who { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.topbar .who .name { font-weight: 600; }
.topbar .who .role-tag { font-family: var(--mono); font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 32px 24px 80px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 30px; }
.page-head p { color: var(--ink-2); margin: 6px 0 0; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.section-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 34px 0 14px; font-family: var(--mono); }
.section-title:first-of-type { margin-top: 0; }

/* course card */
.course-card { display: flex; flex-direction: column; }
.course-card .cc-top { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.course-card h3 { font-size: 19px; }
.course-card .grade { font-family: var(--mono); font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.course-card .desc { color: var(--ink-2); font-size: 14px; margin: 12px 0 0; }
.course-card .cc-foot { padding: 14px 20px; display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: auto; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .n { font-family: var(--display); font-weight: 800; font-size: 30px; }
.stat .l { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.stat.red .n { color: var(--red-ink); }
.stat.green .n { color: var(--green-ink); }
.stat.blue .n { color: var(--brand-ink); }

/* table */
table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding: 12px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-weight: 700; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

/* score circle (red pen) */
.score {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  border: 2.5px solid var(--red); color: var(--red-ink); font-family: var(--display); font-weight: 800; font-size: 15px;
}
.score.pass { border-color: var(--green); color: var(--green-ink); }
.score.ungraded { border-color: var(--line-2); color: var(--ink-2); border-style: dashed; font-size: 12px; }

/* child code display */
.code-chip {
  font-family: var(--mono); font-weight: 700; font-size: 16px; letter-spacing: .08em;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; display: inline-block;
}

/* empty state */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty h3 { font-size: 18px; color: var(--ink); margin-bottom: 6px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(22,35,58,.45); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto; }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 19px; }
.modal-head .x { background: none; border: none; font-size: 22px; color: var(--ink-2); line-height: 1; }
.modal-body { padding: 20px; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--ink-2); }
.mono { font-family: var(--mono); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* upload preview */
.preview { margin-top: 12px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.preview img { width: 100%; display: block; max-height: 320px; object-fit: contain; background: #F2EFE8; }

/* toast */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 99;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red-ink); }

/* loading splash */
#loading { min-height: 100vh; display: grid; place-items: center; color: var(--ink-2); font-family: var(--mono); font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  #auth-screen { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 28px; gap: 28px; }
  .snap-card { transform: rotate(-1deg); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .wrap { padding: 22px 16px 70px; }
  .topbar { padding: 0 16px; }
  .topbar .who .name { display: none; }
  .stats { grid-template-columns: 1fr; }
  .tbl th:nth-child(n+4), .tbl td:nth-child(n+4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ============================================================================
   v2 COMPONENTS — banners, store, content library, attendance
   ============================================================================ */

/* notice banners */
.banner {
  border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 22px;
  font-size: 14px; line-height: 1.5; border: 1px solid var(--line-2);
  background: var(--brand-tint); color: var(--ink);
}
.banner a { font-weight: 600; }
.banner-red   { background: var(--red-tint);   border-color: #F3C9BF; }
.banner-amber { background: var(--amber-tint); border-color: #ECD8A6; }
.banner-blue  { background: var(--brand-tint); border-color: #BFE2F8; }

/* update / announcement rows */
.upd-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 14px 18px; }

/* store — book cards */
.book-card { padding: 0; overflow: hidden; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg, 0 10px 30px rgba(16,35,58,.12)); }
.book-img {
  position: relative; aspect-ratio: 3 / 4; background: var(--brand-tint);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.book-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-ph { font-size: 46px; opacity: .7; }
.book-tag {
  position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
}
.book-body { padding: 16px 18px 18px; }
.book-body h3 { font-family: var(--display); font-size: 18px; margin: 0; line-height: 1.25; }
.book-price { font-family: var(--mono); font-weight: 700; color: var(--accent-ink); margin-top: 6px; }

/* content library — resource rows */
.topic-blk { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; background: var(--surface); }
.topic-name { font-family: var(--display); font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.res-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink); border: 1px solid var(--line); margin-top: 8px; background: var(--paper);
}
a.res-row:hover { border-color: var(--brand); background: var(--brand-tint); }
.res-ic { font-size: 20px; line-height: 1; }
.res-type { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--brand-ink); margin-left: 6px; }
.res-go { font-size: 18px; color: var(--brand); }

/* live-session rows */
.sess-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 10px; background: var(--surface);
}

/* attendance toggle */
.att-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.att-btn { border: 0; background: var(--surface); padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.att-btn + .att-btn { border-left: 1px solid var(--line-2); }
.att-present.active { background: var(--green-tint); color: var(--green-ink); }
.att-absent.active  { background: var(--red-tint);   color: var(--red-ink); }

/* ============================================================================
   PUBLIC PAGES — header/nav, landing, fees, video, terms
   ============================================================================ */
.pub-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 30px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
}
.pub-top .brand, .brand-btn {
  display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer;
  font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--ink);
}
.pub-top .brand img, .brand-btn img { height: 34px; width: auto; }
.pub-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pub-link {
  border: 0; background: none; cursor: pointer; color: var(--ink-2);
  font-family: inherit; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: var(--radius-sm);
}
.pub-link:hover { background: var(--brand-tint); color: var(--brand-ink); }
.pub-link.active { color: var(--brand-ink); background: var(--brand-tint); }

/* landing hero */
.land-hero {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center;
  max-width: 1080px; margin: 0 auto; padding: 64px 30px 40px;
}
.land-hero-inner .eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 700; margin-bottom: 14px;
}
.land-hero-inner h1 { font-size: 46px; line-height: 1.04; }
.land-hero-inner h1 em { color: var(--brand); font-style: normal; }
.land-hero-inner p { font-size: 17px; color: var(--ink-2); margin: 18px 0 26px; max-width: 30em; }
.land-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.land-hero-card { display: flex; justify-content: center; }

/* feature blurbs */
.land-feats { margin-top: 8px; }
.feat-ic { font-size: 30px; margin-bottom: 8px; }
.land-feats h3 { font-size: 18px; margin-bottom: 6px; }

/* fees */
.fee-card { padding: 22px; }
.fee-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.fee-head h3 { font-size: 20px; }
.fee-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.fee-when { font-weight: 600; }
.fee-time { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.fee-price { font-family: var(--display); font-weight: 800; color: var(--accent-ink); white-space: nowrap; }
.fee-note { font-size: 13px; margin-top: 12px; }
.scholar { margin-top: 24px; background: var(--brand-tint); border-color: #BFE2F8; }
.scholar h3 { margin-bottom: 8px; }

/* video embed */
.video-embed { position: relative; width: 100%; max-width: 860px; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* terms */
.terms-text { white-space: pre-wrap; line-height: 1.6; color: var(--ink); }

/* footer */
.pub-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  max-width: 1080px; margin: 48px auto 0; padding: 24px 30px; border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: 14px;
}
.pub-foot-links { display: flex; gap: 4px; flex-wrap: wrap; }

/* hamburger — hidden on desktop */
.hamburger {
  display: none; border: 0; background: none; cursor: pointer;
  font-size: 36px; line-height: 1; padding: 8px 10px; color: var(--ink);
}
.drawer-close { display: none; }
.drawer-overlay { display: none; }
.drawer-signin { font-size: 15px; }

@media (max-width: 760px) {
  .pub-top { padding: 12px 18px; }
  .hamburger { display: block; }

  /* full-screen drawer */
  .pub-nav {
    position: fixed; top: 0; right: 0; width: 100%; height: 100vh;
    background: var(--ink); z-index: 200;
    display: flex; flex-direction: column; align-items: stretch; justify-content: center;
    gap: 0; padding: 40px 30px;
    transform: translateX(100%); transition: transform .28s ease;
  }
  .pub-nav.open { transform: translateX(0); }

  .pub-nav .pub-link {
    color: rgba(255,255,255,.85); font-size: 28px; font-weight: 700;
    font-family: var(--display); padding: 22px 10px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-align: left; width: 100%;
  }
  .pub-nav .pub-link:hover, .pub-nav .pub-link.active {
    color: #fff; background: rgba(255,255,255,.08);
  }

  .drawer-signin {
    margin-top: 20px; padding: 18px; font-size: 20px; font-weight: 700;
    border-radius: var(--radius-sm); text-align: center; width: 100%;
  }

  .drawer-close {
    display: block; position: absolute; top: 18px; right: 22px;
    border: 0; background: none; color: rgba(255,255,255,.7);
    font-size: 36px; cursor: pointer; padding: 8px; line-height: 1;
  }
  .drawer-close:hover { color: #fff; }

  .drawer-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 199;
  }
  .drawer-overlay.open { display: block; }

  .land-hero { grid-template-columns: 1fr; padding: 36px 18px 24px; gap: 28px; }
  .land-hero-inner h1 { font-size: 34px; }
  .land-hero-card { order: -1; }
}

/* practice apps */
.app-card { display: flex; flex-direction: column; align-items: flex-start; }
.app-ic { font-size: 26px; margin-bottom: 6px; }
.app-card h3 { font-family: var(--display); }

/* ============================================================================
   GROUPED ADMIN TABS
   ============================================================================ */
.admin-groups {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.grp-btn {
  border: 0; background: var(--surface); color: var(--ink-2); cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); transition: all .12s ease;
}
.grp-btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.grp-btn.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.admin-subtabs {
  display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap;
}
.sub-btn {
  border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-2); padding: 7px 14px; border-radius: 999px;
}
.sub-btn:hover { background: var(--brand-tint); color: var(--brand-ink); }
.sub-btn.active { background: var(--brand-tint); color: var(--brand-ink); }

/* ============================================================================
   MOBILE RESPONSIVE TABLES — stack as cards on small screens
   ============================================================================ */
@media (max-width: 640px) {
  .tbl-wrap { overflow-x: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr {
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 14px 16px; margin-bottom: 10px; background: var(--surface);
    position: relative;
  }
  .tbl td { padding: 3px 0; border: 0; font-size: 14px; }
  .tbl td:first-child { font-size: 15px; margin-bottom: 4px; }
  .tbl td:last-child { margin-top: 6px; }
  .tbl td[style*="white-space"] { white-space: normal !important; }

  /* admin groups on mobile */
  .admin-groups { gap: 4px; }
  .grp-btn { font-size: 13px; padding: 8px 12px; flex: 1 1 auto; text-align: center; min-width: 0; }
  .pub-nav { gap: 2px; }
}

/* promo banner on landing page */
.promo-banner {
  background: linear-gradient(135deg, var(--brand-tint) 0%, #FFF5EB 100%);
  border: 2px solid var(--accent); border-radius: var(--radius);
  padding: 30px 34px; margin-bottom: 28px;
}
.promo-banner h2 { font-size: 24px; margin-bottom: 6px; color: var(--ink); }
.promo-sub { font-family: var(--mono); font-size: 13px; color: var(--brand-ink); font-weight: 600; margin-bottom: 18px; }
.promo-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.promo-item {
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 18px 20px; border: 1px solid var(--line);
}
.promo-item h3 { font-size: 17px; margin-bottom: 6px; }
.promo-when { font-family: var(--mono); font-size: 13px; color: var(--brand-ink); font-weight: 600; }
.promo-note { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.promo-footer { font-size: 14px; color: var(--ink-2); margin-top: 18px; font-style: italic; }

/* fee card — labels + collapsible pricing */
.fee-label { font-size: 12px; color: var(--brand-ink); font-weight: 600; margin-top: 3px; }
.fee-toggle {
  display: block; width: 100%; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--brand-ink);
  padding: 14px 0 4px; text-align: left;
}
.fee-toggle:hover { text-decoration: underline; }
.fee-drop { display: none; padding-top: 8px; }
.fee-drop.open { display: block; }
.fee-price-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.fee-price-row .fee-price { font-family: var(--display); font-weight: 800; color: var(--accent-ink); }

/* inline video embeds in content viewer */
.res-video { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--paper); }
.res-video .res-row { border: 0; margin: 0; }
.video-embed-inline {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-top: 1px solid var(--line);
}
.video-embed-inline iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* drag-and-drop reordering */
.sortable-list { display: flex; flex-direction: column; gap: 6px; }
.sortable-item { cursor: grab; transition: opacity .15s ease, box-shadow .15s ease; }
.sortable-item.dragging { opacity: 0.4; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.drag-handle {
  cursor: grab; color: var(--ink-2); font-size: 18px; line-height: 1;
  padding: 0 8px 0 0; user-select: none; flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }

/* student photo on landing + classes */
.hero-photo {
  width: 100%; max-width: 480px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); object-fit: cover; aspect-ratio: 1;
}
.class-photo-wrap { margin-bottom: 24px; text-align: center; }
.class-photo {
  width: 100%; max-width: 700px; border-radius: var(--radius);
  box-shadow: var(--shadow); object-fit: cover; aspect-ratio: 16 / 10;
}

/* parallax classroom background behind fee cards */
.fees-parallax {
  background: url('assets/classroom.jpg') center / cover no-repeat fixed;
  border-radius: var(--radius); padding: 30px 24px; margin-bottom: 24px;
  position: relative;
}
.fees-parallax::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,.82); border-radius: var(--radius);
}
.fees-parallax > .grid { position: relative; z-index: 1; }
.fees-parallax .fee-card {
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.6); box-shadow: 0 4px 20px rgba(22,35,58,.08);
}

@media (max-width: 760px) {
  .fees-parallax { background-attachment: scroll; padding: 20px 14px; }
}

/* feature card with nested image */
.feat-with-img { overflow: hidden; padding: 0; }
.feat-with-img .feat-img {
  width: 100%; height: 160px; object-fit: cover; display: block;
}
.feat-with-img > div { padding: 18px 20px 20px; }

/* ==========================================================================
   In-app quizzes
   ========================================================================== */
.mini-title { font-size: 14px; margin-top: 18px; color: var(--ink-2); }
.quiz-card { align-items: flex-start; }
.quiz-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
  color: var(--ink-2); font-size: 12px; font-weight: 700;
}
.quiz-meta span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; }
.quiz-wrap { max-width: 880px; }
.quiz-instructions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px;
  font-size: 14px;
}
.quiz-question { margin-bottom: 16px; }
.quiz-question h3, .answer-review h3 { font-size: 16px; margin: 0; }
.quiz-qtext { font-size: 18px; line-height: 1.45; margin: 14px 0; font-weight: 700; }
.quiz-options { display: grid; gap: 10px; }
.quiz-option {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer;
}
.quiz-option:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(22,35,58,.06); }
.quiz-option input { width: 18px; height: 18px; }
.option-letter {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px;
  border-radius: 999px; background: var(--surface); font-weight: 800;
}
.quiz-submitbar {
  position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 0; background: linear-gradient(to top, var(--paper) 65%, rgba(255,255,255,0));
}
.quiz-result { text-align: center; border-width: 2px; }
.quiz-result.passed { border-color: var(--green-ink); }
.quiz-result.needs-work { border-color: var(--amber-ink); }
.result-score {
  font-family: var(--display); font-size: 54px; font-weight: 900; line-height: 1;
  color: var(--accent-ink); margin-bottom: 8px;
}
.answer-review { margin-bottom: 14px; border-left: 5px solid var(--line); }
.answer-review.correct { border-left-color: var(--green-ink); }
.answer-review.wrong { border-left-color: var(--red-ink); }
.explain-box {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
@media (max-width: 760px) {
  .quiz-instructions { grid-template-columns: 1fr 1fr; }
  .quiz-qtext { font-size: 16px; }
  .result-score { font-size: 42px; }
}
