/* =====================================================================
   LearnEdgeSchool — design system
   Colours come from the logo: plum ink, edge purple, teal, tassel gold.
   Type: Baloo 2 (display, Ek Type) + Mukta (text, Ek Type).
   Signature motif: the ruled school-notebook page (blue rules, red margin).
   ===================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Mukta:wght@400;500;600;700&display=swap");

:root {
  --ink: #22163f;
  --ink-2: #4d4468;
  --ink-3: #7a7292;
  --line: #e4dfee;
  --line-2: #d4cde4;
  --paper: #f6f4fb;
  --surface: #ffffff;

  --purple: #6a3dc2;
  --purple-deep: #4c2a96;
  --purple-tint: #efe8fc;
  --teal: #0e7f8c;
  --teal-tint: #e0f3f4;
  --gold: #f2b32e;
  --gold-deep: #9a6a00;
  --gold-tint: #fff3d3;
  --red: #cf3e3e;
  --red-tint: #fdeaea;
  --green: #1c8f57;
  --green-tint: #e2f5ea;

  --rule: #cfdff3;
  --margin: #ec8b84;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow-1: 0 1px 2px rgba(34, 22, 63, .06), 0 2px 8px rgba(34, 22, 63, .05);
  --shadow-2: 0 2px 4px rgba(34, 22, 63, .06), 0 12px 32px rgba(34, 22, 63, .10);

  --font-display: "Baloo 2", "Mukta", system-ui, sans-serif;
  --font-text: "Mukta", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1120px;
  --header-h: 64px;
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
a { color: var(--purple); text-underline-offset: 3px; }
a:hover { color: var(--purple-deep); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .4em; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; }
h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 700; }
h3 { font-size: 21px; font-weight: 700; }
h4 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 1em; }
::selection { background: var(--gold-tint); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: 12px; }

/* ── Header ──────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.brand-word { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.01em; line-height: 1; }
.brand-word b { color: var(--purple); font-weight: 800; }
.brand-word span { color: var(--teal); }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 16px;
  padding: 8px 12px; border-radius: var(--r-sm);
}
.site-nav a:hover { color: var(--ink); background: var(--purple-tint); }
.site-nav a.is-current { color: var(--purple); }
.site-nav .btn { margin-left: 8px; color: var(--fg); padding: 8px 14px; }
.site-nav .btn:hover { color: var(--fg); background: var(--bg); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); border-radius: var(--r-sm); }
.nav-toggle svg { width: 26px; height: 26px; display: block; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 8px;
  padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--purple-tint);
  color: var(--purple-deep); font-weight: 600; font-size: 15px; text-decoration: none;
}
.user-chip i {
  font-style: normal; width: 30px; height: 30px; border-radius: 50%;
  background: var(--purple); color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; box-shadow: var(--shadow-2);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
  .site-nav .btn, .user-chip { margin: 6px 0 0; justify-content: center; }
}

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer { margin-top: 72px; background: var(--ink); color: #cfc8e6; font-size: 15px; }
.site-footer .wrap { padding-top: 48px; padding-bottom: 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
.site-footer .brand { color: #fff; }
.site-footer .brand-word b { color: #c6b1f5; }
.site-footer .brand-word span { color: #7fd6de; }
.site-footer h4 { color: #fff; font-size: 16px; margin-bottom: 10px; }
.site-footer a { color: #e7e2f6; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.footer-base { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: #9f97bb; font-size: 14px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  --bg: var(--purple); --fg: #fff; --bd: var(--purple);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-text); font-weight: 600; font-size: 16px; line-height: 1.2;
  padding: 11px 20px; border-radius: 10px; border: 1.5px solid var(--bd);
  background: var(--bg); color: var(--fg); cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { --bg: var(--purple-deep); --bd: var(--purple-deep); color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-secondary { --bg: #fff; --fg: var(--ink); --bd: var(--line-2); }
.btn-secondary:hover { --bg: var(--purple-tint); --bd: var(--purple); --fg: var(--purple-deep); }
.btn-teal { --bg: var(--teal); --bd: var(--teal); }
.btn-teal:hover { --bg: #0a6672; --bd: #0a6672; }
.btn-gold { --bg: var(--gold); --fg: var(--ink); --bd: var(--gold); }
.btn-gold:hover { --bg: #e7a312; --bd: #e7a312; --fg: var(--ink); }
.btn-ghost { --bg: transparent; --fg: var(--ink-2); --bd: transparent; }
.btn-ghost:hover { --bg: var(--purple-tint); --bd: transparent; --fg: var(--purple-deep); }
.btn-danger { --bg: #fff; --fg: var(--red); --bd: #f0c4c4; }
.btn-danger:hover { --bg: var(--red); --fg: #fff; --bd: var(--red); }
.btn-sm { font-size: 14px; padding: 7px 12px; border-radius: 8px; }
.btn-lg { font-size: 18px; padding: 14px 26px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-google { --bg: #fff; --fg: var(--ink); --bd: var(--line-2); }
.btn-google:hover { --bg: #f7f7f9; --bd: var(--ink-3); --fg: var(--ink); }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 999px;
  background: var(--purple-tint); color: var(--purple-deep); white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge-free { background: var(--teal-tint); color: var(--teal); }
.badge-premium { background: var(--gold-tint); color: var(--gold-deep); }
.badge-key { background: #eef0f4; color: #4a5568; }
.badge-ok { background: var(--green-tint); color: var(--green); }
.badge-warn { background: var(--gold-tint); color: var(--gold-deep); }
.badge-err { background: var(--red-tint); color: var(--red); }
.badge-muted { background: #f0eef5; color: var(--ink-3); }

/* ── Forms ───────────────────────────────────────────────────────── */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; color: var(--ink-2); }
.input, .select, .textarea,
input[type="email"], input[type="password"], input[type="text"], input[type="search"], input[type="number"] {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--line-2); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234d4468' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
.input:focus, .select:focus, .textarea:focus, input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(106, 61, 194, .15); }
.input-sm, .select.input-sm { padding: 7px 10px; font-size: 15px; border-radius: 8px; }
.select.input-sm { padding-right: 30px; background-position: right 10px center; }

.form-msg { font-size: 15px; min-height: 0; margin: 4px 0 10px; }
.form-msg:empty { display: none; }
.form-msg.is-error { color: var(--red); background: var(--red-tint); padding: 10px 12px; border-radius: 10px; }
.form-msg.is-ok { color: var(--green); background: var(--green-tint); padding: 10px 12px; border-radius: 10px; }

/* Segmented control */
.seg { display: inline-flex; background: #f0edf7; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 14px; font-weight: 600; padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }
.seg button[data-v="free"][aria-pressed="true"] { color: var(--teal); }
.seg button[data-v="paid"][aria-pressed="true"] { color: var(--gold-deep); }

/* ── Alerts / toast / overlay / spinner ─────────────────────────── */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--purple-tint); color: var(--purple-deep); font-size: 15px; }
.alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }
.alert-gold { background: var(--gold-tint); color: #6b4a00; }
.alert-teal { background: var(--teal-tint); color: #08535c; }
.alert-error { background: var(--red-tint); color: #8f2323; }
.alert p:last-child { margin-bottom: 0; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-weight: 600; font-size: 15px; box-shadow: var(--shadow-2);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 300; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.is-error { background: var(--red); }

#paymentOverlay {
  position: fixed; inset: 0; z-index: 250; background: rgba(34, 22, 63, .55);
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  color: #fff; font-weight: 600; font-size: 17px;
}
#paymentOverlay .spinner { border-color: rgba(255,255,255,.25); border-top-color: #fff; }

.spinner { display: inline-block; width: 34px; height: 34px; border: 3.5px solid var(--purple-tint); border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner-sm { width: 18px; height: 18px; border-width: 2.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; color: var(--ink-3); grid-column: 1 / -1; }

.skeleton { background: linear-gradient(90deg, #ece8f4 25%, #f5f2fa 50%, #ece8f4 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty {
  text-align: center; padding: 40px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg);
  color: var(--ink-3); background: rgba(255,255,255,.6); grid-column: 1 / -1;
}
.empty h3 { color: var(--ink-2); font-size: 19px; }
.empty p { margin: 0; }

/* ── Panels ──────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-1); }
.panel-tight { padding: 16px; }

/* ── Notebook motif ──────────────────────────────────────────────── */
.notebook {
  position: relative; background-color: #fff; border-radius: var(--r-lg);
  background-image:
    linear-gradient(to right, transparent 54px, var(--margin) 54px, var(--margin) 56px, transparent 56px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--rule) 31px, var(--rule) 32px);
  background-position: 0 0, 0 14px;
  box-shadow: var(--shadow-2);
  border: 1px solid var(--line);
}

/* ── Page head (inner pages) ─────────────────────────────────────── */
.page-head { padding: 36px 0 20px; }
.page-head h1 { font-size: clamp(30px, 4.2vw, 44px); margin-bottom: 6px; }
.page-head p { color: var(--ink-2); max-width: 62ch; margin: 0; font-size: 18px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-3); margin-bottom: 12px; }
.crumbs a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.crumbs a:hover { color: var(--purple); text-decoration: underline; }
.crumbs .sep { color: var(--line-2); }

/* ── Home: hero ──────────────────────────────────────────────────── */
.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.4vw, 60px); line-height: 1.04; margin-bottom: 18px; }
.hero-lead { font-size: 20px; color: var(--ink-2); max-width: 46ch; margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 16px; }
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts svg { width: 20px; height: 20px; color: var(--teal); }

.picker { padding: 22px 22px 26px 78px; }
.picker-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 32px; margin: 0 0 4px; }
.picker-sub { color: var(--ink-3); font-size: 15px; line-height: 32px; margin: 0 0 6px; }
.class-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.class-tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 1 / 1.05; padding: 10px 12px; border-radius: 14px; text-decoration: none;
  background: var(--purple); color: #fff; border: 2px solid var(--purple);
  box-shadow: 0 3px 0 var(--purple-deep);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.class-tile.c1 { background: var(--teal); border-color: var(--teal); box-shadow: 0 3px 0 #0a5f69; }
.class-tile.c2 { background: #b0581a; border-color: #b0581a; box-shadow: 0 3px 0 #7c3d10; }
.class-tile.c3 { background: #2c5fc9; border-color: #2c5fc9; box-shadow: 0 3px 0 #1d4190; }
.class-tile:hover { transform: translateY(-3px); color: #fff; box-shadow: 0 6px 0 var(--ink); }
.class-tile:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--ink); }
.class-tile .lbl { font-size: 14px; font-weight: 600; opacity: .9; }
.class-tile .num { font-family: var(--font-display); font-weight: 800; font-size: clamp(40px, 5vw, 56px); line-height: .9; }
.class-tile .meta { font-size: 13px; opacity: .9; }
.class-tile.is-soon { background: #fff; color: var(--ink-3); border: 2px dashed var(--line-2); box-shadow: none; pointer-events: none; }
.class-tile.is-soon .num { color: #cfc8de; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero { padding-top: 32px; } }
@media (max-width: 520px) { .picker { padding: 18px 14px 20px 66px; } .class-tiles { grid-template-columns: repeat(2, 1fr); } .notebook { background-image: linear-gradient(to right, transparent 46px, var(--margin) 46px, var(--margin) 48px, transparent 48px), repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--rule) 31px, var(--rule) 32px); } .picker { padding-left: 60px; } }

/* ── Home: sections ─────────────────────────────────────────────── */
.section { padding: 56px 0; }
.section-head { max-width: 640px; margin-bottom: 28px; }
.section-head p { color: var(--ink-2); font-size: 18px; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; padding-top: 58px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; background: var(--gold); color: var(--ink);
  font-family: var(--font-display); font-weight: 800; font-size: 24px;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 22px; left: 56px; right: -16px; border-top: 2px dashed var(--line-2); }
.steps h3 { font-size: 20px; }
.steps p { color: var(--ink-2); margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } .steps li:not(:last-child)::after { display: none; } }

.demo { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.demo-copy ul { padding-left: 20px; color: var(--ink-2); }
.demo-copy li { margin: 6px 0; }
.try-q { padding: 22px 22px 24px 78px; }
.try-q .q-meta, .try-q .q-text { line-height: 32px; }
@media (max-width: 520px) { .try-q { padding-left: 60px; } }
.try-q .q-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; color: var(--ink-3); }
.try-q .q-text { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.25; margin-bottom: 16px; }
.try-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.try-opts button {
  font: inherit; font-weight: 600; font-size: 16px; text-align: left; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line-2); background: #fff; color: var(--ink); display: flex; gap: 10px; align-items: center;
}
.try-opts button i { font-style: normal; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--purple-tint); color: var(--purple-deep); font-size: 14px; font-weight: 700; flex-shrink: 0; }
.try-opts button:hover:not(:disabled) { border-color: var(--purple); }
.try-opts button.is-right { border-color: var(--green); background: var(--green-tint); }
.try-opts button.is-right i { background: var(--green); color: #fff; }
.try-opts button.is-wrong { border-color: var(--red); background: var(--red-tint); }
.try-opts button.is-wrong i { background: var(--red); color: #fff; }
.try-opts button:disabled { cursor: default; }
.try-explain { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--teal-tint); color: #08535c; font-size: 15px; }
@media (max-width: 860px) { .demo { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .try-opts { grid-template-columns: 1fr; } }

.plans { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; max-width: 860px; }
.plan { padding: 28px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); }
.plan.is-featured { border: 2px solid var(--purple); box-shadow: var(--shadow-2); position: relative; }
.plan h3 { margin-bottom: 4px; }
.plan .price { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1; margin: 12px 0 2px; }
.plan .price small { font-family: var(--font-text); font-weight: 500; font-size: 16px; color: var(--ink-3); }
.plan .per { color: var(--ink-3); font-size: 15px; margin-bottom: 18px; }
.ticks { list-style: none; padding: 0; margin: 0 0 22px; }
.ticks li { display: flex; gap: 10px; margin: 9px 0; color: var(--ink-2); }
.ticks svg { width: 20px; height: 20px; color: var(--teal); flex-shrink: 0; margin-top: 2px; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }

.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative; font-weight: 600; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-family: var(--font-display); font-size: 28px; color: var(--purple); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin: 0 0 18px; max-width: 64ch; }

/* ── Subjects (class page) ──────────────────────────────────────── */
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.subject-card {
  --c: var(--purple); --t: var(--purple-tint);
  display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: var(--r-lg);
  background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.subject-card:hover { border-color: var(--c); box-shadow: var(--shadow-2); color: var(--ink); transform: translateY(-2px); }
.subject-card .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--t); color: var(--c); }
.subject-card .ico svg { width: 28px; height: 28px; }
.subject-card h3 { margin: 0; font-size: 22px; }
.subject-card .meta { color: var(--ink-3); font-size: 15px; margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.subject-card .meta b { color: var(--c); font-weight: 600; }

/* ── Chapters list ──────────────────────────────────────────────── */
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.chapter-list a {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r-md);
  background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.chapter-list a:hover { border-color: var(--purple); box-shadow: var(--shadow-1); color: var(--ink); }
.chapter-list .n {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--purple-tint); color: var(--purple-deep); font-family: var(--font-display); font-weight: 800; font-size: 20px;
}
.chapter-list .t { font-weight: 600; font-size: 17px; line-height: 1.3; }
.chapter-list .s { display: block; font-weight: 400; font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.chapter-list .go { margin-left: auto; color: var(--line-2); }
.chapter-list a:hover .go { color: var(--purple); }
.chapter-list .go svg { width: 20px; height: 20px; display: block; }

/* ── Resources page ─────────────────────────────────────────────── */
.res-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.res-layout.no-aside { grid-template-columns: 1fr; }
@media (max-width: 960px) { .res-layout { grid-template-columns: 1fr; } }
.res-block + .res-block { margin-top: 36px; }
.res-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.res-block-head h2 { font-size: 26px; margin: 0; display: flex; align-items: center; gap: 10px; }
.res-block-head h2 svg { width: 24px; height: 24px; color: var(--purple); }
.res-block-head .count { color: var(--ink-3); font-size: 15px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.res-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-md);
  background: #fff; border: 1px solid var(--line); min-height: 132px;
}
.res-card .top { display: flex; gap: 12px; align-items: flex-start; }
.res-card .ficon { width: 40px; height: 48px; flex-shrink: 0; border-radius: 6px; display: grid; place-items: center; position: relative; }
.res-card .ficon svg { width: 22px; height: 22px; }
.ficon.pdf { background: #fdecea; color: #c2352b; }
.ficon.quiz { background: var(--purple-tint); color: var(--purple); }
.res-card h3 { font-family: var(--font-text); font-size: 17px; font-weight: 600; line-height: 1.3; margin: 0 0 6px; }
.res-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.res-card .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.res-card .acts .btn { flex: 1 1 auto; }
.res-card.is-locked { background: #fbfaf7; }
.res-card.is-locked h3 { color: var(--ink-2); }

.sub-card { position: sticky; top: calc(var(--header-h) + 20px); padding: 24px; border-radius: var(--r-lg); background: var(--ink); color: #e9e4f8; }
.sub-card h3 { color: #fff; font-size: 22px; }
.sub-card .price { font-family: var(--font-display); font-weight: 800; font-size: 40px; color: var(--gold); line-height: 1; margin: 8px 0 2px; }
.sub-card .price small { font-family: var(--font-text); font-size: 15px; color: #b6add2; font-weight: 500; }
.sub-card .ticks li { color: #e3ddf4; }
.sub-card .ticks svg { color: var(--gold); }
.sub-card.is-active { background: var(--teal-tint); color: #08535c; }
.sub-card.is-active h3 { color: #08535c; }

/* ── Dashboard ──────────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.dash-card { padding: 20px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.dash-card.is-active { border: 2px solid var(--teal); }
.dash-card .cls { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; }
.meter { height: 8px; border-radius: 99px; background: #ece8f4; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.meter.is-low > i { background: var(--gold); }
.stat-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.stat { flex: 1 1 200px; padding: 18px 20px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--font-display); font-size: 32px; line-height: 1.1; }
.stat span { color: var(--ink-3); font-size: 15px; }

/* ── Auth ───────────────────────────────────────────────────────── */
.auth { display: grid; grid-template-columns: 1fr 1fr; max-width: 980px; margin: 40px auto 0; border-radius: 22px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.auth-side { padding: 44px 40px; background: var(--purple); color: #efe9fd; position: relative; overflow: hidden; }
.auth-side h2 { color: #fff; font-size: 34px; }
.auth-side .ticks li { color: #efe9fd; }
.auth-side .ticks svg { color: var(--gold); }
.auth-side .deco { position: absolute; right: -40px; bottom: -40px; width: 220px; opacity: .18; }
.auth-main { padding: 40px; }
.auth-main h1 { font-size: 32px; margin-bottom: 4px; }
.auth-main .lead { color: var(--ink-3); margin-bottom: 22px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 14px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 64px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: inherit; font-size: 14px; font-weight: 600; color: var(--purple); background: none; border: 0; cursor: pointer; padding: 6px 8px; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; margin-top: 20px; } .auth-side { display: none; } .auth-main { padding: 28px 22px; } }

/* ── Prose (policy pages) ───────────────────────────────────────── */
.prose { max-width: 760px; }
.prose h2 { font-size: 26px; margin-top: 1.6em; }
.prose h3 { font-size: 20px; margin-top: 1.4em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink); background: var(--purple-tint); }

/* ── Tables (admin) ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 14px; padding: 10px 12px; background: #faf9fd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-skip td { opacity: .55; }
.table .input-sm { min-width: 160px; }

/* ── Legacy helpers kept for older markup ───────────────────────── */
.sub-badge { display: inline-block; background: var(--green-tint); color: var(--green); font-size: 13px; padding: 3px 9px; border-radius: 99px; font-weight: 600; }
.expiry-soon { background: var(--gold-tint); color: var(--gold-deep); }

@media print {
  .site-header, .site-footer, #toast { display: none !important; }
  body { background: #fff; }
}

/* Callouts inside policy pages */
.prose .callout { display: block; margin: 20px 0; }
.prose .callout strong { display: block; font-family: var(--font-display); font-size: 19px; color: #08535c; margin-bottom: 4px; }
.prose .callout p { color: #08535c; margin: 0; }
.prose > :first-child { margin-top: 0; }

/* =====================================================================
   Colourful page banners, subject cards and chapter rows
   Each page sets --c (strong colour) and --t (tint) for its subject.
   ===================================================================== */
.banner {
  --c: var(--purple); --c2: var(--purple-deep);
  position: relative; overflow: hidden; margin: 28px 0 28px; padding: 30px 32px 32px;
  border-radius: 24px; color: #fff;
  background-color: var(--c);
  background-image:
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(255,255,255,.10) 31px, rgba(255,255,255,.10) 32px),
    linear-gradient(135deg, var(--c) 0%, var(--c2) 100%);
  box-shadow: 0 14px 34px -14px var(--c);
}
.banner::before { content: ""; position: absolute; left: 22px; top: 0; bottom: 0; width: 2px; background: rgba(255,180,170,.55); }
.banner > * { position: relative; }
.banner .crumbs, .banner .crumbs a { color: rgba(255,255,255,.85); }
.banner .crumbs a:hover { color: #fff; }
.banner .crumbs .sep { color: rgba(255,255,255,.45); }
.banner h1 { color: #fff; font-size: clamp(32px, 4.6vw, 48px); margin-bottom: 6px; max-width: 18ch; }
.banner p { color: rgba(255,255,255,.9); font-size: 18px; margin: 0; max-width: 54ch; }
.banner .big {
  position: absolute; right: 26px; bottom: -28px; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(140px, 20vw, 210px); line-height: 1; color: rgba(255,255,255,.16); pointer-events: none;
}
.banner .big svg { width: clamp(120px, 16vw, 170px); height: auto; color: rgba(255,255,255,.18); stroke-width: 1.4; }
.banner .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.banner .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.18); color: #fff; font-size: 14px; font-weight: 600; }
.banner .chip svg { width: 16px; height: 16px; }
@media (max-width: 600px) { .banner { padding: 24px 20px 26px 34px; border-radius: 20px; } .banner .big { right: 10px; bottom: -18px; } }

/* Subject cards: tinted, with a colour header and a big faint icon */
.subject-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.subject-card {
  position: relative; overflow: hidden; gap: 10px; padding: 0; border: 0;
  background: var(--t); box-shadow: 0 1px 0 rgba(34,22,63,.04), 0 6px 18px -10px var(--c);
}
.subject-card .head {
  position: relative; height: 92px; padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between;
  background: var(--c);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 23px, rgba(255,255,255,.12) 23px, rgba(255,255,255,.12) 24px);
}
.subject-card .head .deco { position: absolute; right: -14px; top: -10px; width: 120px; height: 120px; color: rgba(255,255,255,.18); }
.subject-card .head .deco svg { width: 100%; height: 100%; stroke-width: 1.3; }
.subject-card .ico { position: absolute; left: 20px; top: 64px; width: 56px; height: 56px; border-radius: 16px; background: #fff; color: var(--c); box-shadow: 0 6px 14px -6px rgba(34,22,63,.35); }
.subject-card .body { padding: 34px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.subject-card h3 { font-size: 23px; }
.subject-card .meta { margin-top: auto; padding-top: 6px; }
.subject-card .count { color: var(--ink-2); font-weight: 600; }
.subject-card .go {
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px 7px 14px; border-radius: 99px;
  background: var(--c); color: #fff; font-weight: 600; font-size: 15px; transition: gap .15s;
}
.subject-card .go svg { width: 16px; height: 16px; }
.subject-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -14px var(--c); }
.subject-card:hover .go { gap: 8px; }

/* Chapter rows: subject colour accent */
.chapter-list { --c: var(--purple); --t: var(--purple-tint); gap: 14px; }
.chapter-list a { position: relative; border: 1px solid var(--line); border-left: 5px solid var(--c); padding: 16px 18px 16px 16px; }
.chapter-list a:hover { background: var(--t); border-color: var(--c); }
.chapter-list .n { background: var(--c); color: #fff; box-shadow: 0 4px 10px -4px var(--c); }
.chapter-list a:hover .go { color: var(--c); }
.chapter-list li:nth-child(even) a { background-image: linear-gradient(90deg, var(--t), #fff 40%); }
.chapter-list li:nth-child(even) a:hover { background-image: none; }

/* Resource sections pick up the subject colour too */
.res-page { --c: var(--purple); --t: var(--purple-tint); }
.res-page .res-block-head h2 svg { color: var(--c); }
.res-page .res-block-head { padding-bottom: 10px; border-bottom: 2px solid var(--t); }
@media (max-width: 600px) {
  .banner .big { display: none; }
  .banner h1 { font-size: 30px; }
  .banner p { font-size: 16px; }
  .subject-card .head { height: 80px; }
  .subject-card .ico { top: 52px; }
}

/* Extra downloads offer */
.modal-back { position: fixed; inset: 0; z-index: 260; background: rgba(34,22,63,.55); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .15s ease-out; }
.modal { position: relative; width: 100%; max-width: 440px; background: #fff; border-radius: 22px; padding: 28px 24px 20px; box-shadow: 0 24px 60px -20px rgba(34,22,63,.5); text-align: center; animation: popIn .18s ease-out; }
.modal h3 { font-size: 22px; margin: 10px 0 6px; }
.modal > p { margin: 0 auto 18px; max-width: 34ch; font-size: 15px; }
.modal-ico { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: var(--teal-tint); color: var(--teal); }
.modal-ico svg { width: 28px; height: 28px; }
.modal-x { position: absolute; right: 10px; top: 10px; border: 0; background: none; padding: 8px; border-radius: 8px; color: var(--ink-3); cursor: pointer; }
.modal-x:hover { background: #f1eef7; color: var(--ink); }
.modal-x svg { width: 20px; height: 20px; display: block; }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 10px 14px; border-radius: 16px; border: 2px solid var(--line-2); background: #fff; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, transform .1s, box-shadow .15s; }
.pack:hover, .pack:focus-visible { border-color: var(--purple); box-shadow: 0 8px 20px -10px var(--purple); transform: translateY(-2px); }
.pack b { font-family: var(--font-display); font-weight: 800; font-size: 38px; line-height: 1; }
.pack span { font-size: 14px; color: var(--ink-3); }
.pack em { font-style: normal; margin-top: 8px; padding: 6px 16px; border-radius: 99px; background: var(--purple); color: #fff; font-weight: 700; font-size: 17px; }
.pack small { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.pack.is-best { border-color: var(--gold); background: #fffbef; }
.pack.is-best em { background: var(--gold); color: var(--ink); }
.pack .tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.extra-line { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--teal); font-weight: 600; margin-top: 8px; }
.extra-line svg { width: 16px; height: 16px; }

/* ── Slim banner (class / chapter / resources pages) ── */
.banner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; row-gap: 2px;
  margin: 16px 0 20px; padding: 12px 22px 14px 36px; border-radius: 16px;
  box-shadow: 0 8px 20px -14px var(--c);
}
.banner::before { left: 20px; }
.banner .crumbs { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.banner h1 { grid-column: 1; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.15; margin: 0; max-width: none; }
.banner p { display: none; }
.banner .big { display: none; }
.banner .chips { grid-column: 2; margin: 0; justify-content: flex-end; }
.banner .chip { padding: 4px 10px; font-size: 13px; }
@media (max-width: 600px) {
  .banner { grid-template-columns: 1fr; margin: 12px 0 16px; padding: 10px 16px 12px 30px; border-radius: 14px; }
  .banner::before { left: 16px; }
  .banner h1 { font-size: 22px; }
  .banner .chips { display: none; }
}

/* ── Home hero: smaller heading so the class picker shows sooner ── */
.hero { padding: 32px 0 28px; }
.hero h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; margin-bottom: 12px; max-width: 20ch; }
.hero-lead { font-size: 18px; margin-bottom: 20px; }
.hero-actions { margin-bottom: 20px; }
.hero-actions .btn-lg { font-size: 17px; padding: 12px 22px; }
.hero-facts { font-size: 15px; }
@media (max-width: 920px) { .hero { padding-top: 18px; } .hero-grid { gap: 20px; } }
@media (max-width: 600px) {
  .hero { padding: 14px 0 20px; }
  .hero h1 { font-size: 27px; margin-bottom: 8px; }
  .hero-lead { font-size: 16px; line-height: 1.5; margin-bottom: 14px; }
  .hero-actions { gap: 8px; margin-bottom: 0; }
  .hero-actions .btn-lg { font-size: 15px; padding: 10px 12px; flex: 1 1 0; min-width: 0; white-space: normal; text-align: center; }
  .hero-facts { display: none; }
  .picker { padding-top: 14px; padding-bottom: 16px; }
  .class-tiles { gap: 10px; }
  .class-tile { aspect-ratio: 1 / .8; }
  .class-tile .num { font-size: 40px; }
}
.hero-grid > * { min-width: 0; }
.class-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.class-tile { min-width: 0; aspect-ratio: auto; min-height: 112px; }
@media (max-width: 520px) { .class-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .class-tile { min-height: 96px; } }
@media (min-width: 921px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px; } }
