/* =========================================================
   DESIGN TOKENS

   Theming is three-state. `<html data-theme>` is stamped by
   ThemeContext on every render, and index.html stamps it again
   inline before first paint so there's no flash of the wrong theme.

   - `:root`                          → the complete light palette
   - `@media (prefers-color-scheme: dark)` guarded by
     `:root:not([data-theme='light'])` → dark for anyone following
     their OS, without overriding an explicit light choice
   - `:root[data-theme='dark']`       → an explicit dark choice wins
     even on a light-mode OS

   Every colour gets its definition in plain `:root` first; the dark
   blocks only *redefine*. Nothing may be defined solely inside a
   media/attribute block, or it goes undefined in the other theme.
   ========================================================= */
:root {
  /* --- Brand accent -------------------------------------------------
     Tenant-scoped pages overwrite --tenant-accent once the tenant
     loads (see TenantContext). Everything downstream is derived from
     it with color-mix so a tenant picking magenta doesn't break the
     rest of the palette. */
  --tenant-accent: #4f46e5;
  --tenant-accent-contrast: #ffffff;
  --accent-2: #0ea5e9;
  --accent-3: #f59e0b;
  --accent-soft: color-mix(in srgb, var(--tenant-accent) 12%, transparent);
  --accent-softer: color-mix(in srgb, var(--tenant-accent) 7%, transparent);
  --accent-ring: color-mix(in srgb, var(--tenant-accent) 28%, transparent);
  --accent-gradient: linear-gradient(135deg, var(--tenant-accent), var(--accent-2));
  --accent-gradient-warm: linear-gradient(135deg, var(--tenant-accent), #a855f7 60%, #ec4899);

  /* --- Surfaces (light) --------------------------------------------- */
  --bg: #f6f7fb;
  --bg-tint-1: color-mix(in srgb, var(--tenant-accent) 7%, transparent);
  --bg-tint-2: color-mix(in srgb, var(--accent-2) 6%, transparent);
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --surface-hover: #f1f2f8;
  --surface-sunken: #eef0f6;
  --border: #e4e6ef;
  --border-strong: #d2d5e3;

  /* --- Text (light) -------------------------------------------------- */
  --text-h: #12152a;
  --text: #4d5468;
  --text-muted: #858ba1;
  --text-faint: #a8adbf;

  /* --- Status -------------------------------------------------------- */
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.12);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.13);
  --info: #0284c7;
  --info-bg: rgba(2, 132, 199, 0.12);

  /* --- Elevation ------------------------------------------------------ */
  --shadow-sm: 0 1px 2px rgba(18, 21, 42, 0.05), 0 1px 3px rgba(18, 21, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(18, 21, 42, 0.08), 0 12px 32px -8px rgba(18, 21, 42, 0.1);
  --shadow-lg: 0 8px 24px -4px rgba(18, 21, 42, 0.1), 0 24px 56px -12px rgba(18, 21, 42, 0.16);
  --shadow-glow: 0 6px 20px -6px color-mix(in srgb, var(--tenant-accent) 55%, transparent);
  --shadow-glow-lg: 0 12px 36px -8px color-mix(in srgb, var(--tenant-accent) 60%, transparent);
  /* Hairline highlight along a card's top edge — near-invisible in
     light, does the real elevation work in dark. */
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* --- Geometry -------------------------------------------------------- */
  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-full: 999px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 28px;

  --sans: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  --heading: 'Plus Jakarta Sans', 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', Consolas, monospace;

  --ease: cubic-bezier(0.32, 0.72, 0.28, 1);

  font: 15px/1.55 var(--sans);
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dark, for anyone on the default 'system' preference. Guarded so an
   explicit light choice isn't overridden on a dark-mode OS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a0c17;
    --bg-tint-1: color-mix(in srgb, var(--tenant-accent) 16%, transparent);
    --bg-tint-2: color-mix(in srgb, var(--accent-2) 12%, transparent);
    --surface: #12152a;
    --surface-2: #161a32;
    --surface-hover: #1d2240;
    --surface-sunken: #0e1122;
    --border: #262b4a;
    --border-strong: #343a5e;

    --text-h: #f2f3fb;
    --text: #a9b0cc;
    --text-muted: #737a99;
    --text-faint: #565d7a;

    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.14);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.14);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.14);
    --info: #38bdf8;
    --info-bg: rgba(56, 189, 248, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5), 0 12px 32px -8px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 24px -4px rgba(0, 0, 0, 0.55), 0 24px 56px -12px rgba(0, 0, 0, 0.5);
    --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
}

/* An explicit dark choice — wins regardless of the OS setting. */
:root[data-theme='dark'] {
  --bg: #0a0c17;
  --bg-tint-1: color-mix(in srgb, var(--tenant-accent) 16%, transparent);
  --bg-tint-2: color-mix(in srgb, var(--accent-2) 12%, transparent);
  --surface: #12152a;
  --surface-2: #161a32;
  --surface-hover: #1d2240;
  --surface-sunken: #0e1122;
  --border: #262b4a;
  --border-strong: #343a5e;

  --text-h: #f2f3fb;
  --text: #a9b0cc;
  --text-muted: #737a99;
  --text-faint: #565d7a;

  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.14);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.14);
  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, 0.14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5), 0 12px 32px -8px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 24px -4px rgba(0, 0, 0, 0.55), 0 24px 56px -12px rgba(0, 0, 0, 0.5);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
}

/* Two soft accent washes anchored to the top corners, fixed so they
   don't travel with scroll. This is what stops large empty regions
   from reading as flat dead grey — it's the page's only ambient
   graphic, and it costs no image request. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -8%, var(--bg-tint-1), transparent 70%),
    radial-gradient(760px 460px at 92% 2%, var(--bg-tint-2), transparent 72%);
}

#root {
  min-height: 100vh;
}

h1,
h2,
h3,
h4 {
  font-family: var(--heading);
  font-weight: 700;
  color: var(--text-h);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 30px;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h4 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
}

p {
  margin: 0;
}

a {
  color: var(--tenant-accent);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* A visible, consistent keyboard ring everywhere — the previous
   `outline: none` on inputs left keyboard users with nothing at all
   on some controls. */
:focus-visible {
  outline: 2px solid var(--tenant-accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--text-h);
}

/* Icons sit on the text baseline by default, which knocks them a
   couple of pixels low inside buttons and nav rows. */
.icon {
  display: block;
  flex-shrink: 0;
}

::selection {
  background: color-mix(in srgb, var(--tenant-accent) 25%, transparent);
  color: var(--text-h);
}

/* Scrollbars, so dark mode doesn't get a bright chrome-coloured
   gutter down the side of every scrollable panel. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
  background-clip: content-box;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   COPY LOCK (desktop app only)
   Set by useCopyProtection on <html>. Selection is what makes
   copying possible in the first place, so removing it is the
   quieter half of the block — the event handlers are the rest.
   ========================================================= */
:root[data-copy-locked='true'] body {
  -webkit-user-select: none;
  user-select: none;
}

/* Anything a student legitimately types into stays fully usable —
   passwords, invite codes, search boxes, doubt questions.
   <code>/<pre> and [data-copyable] are exempt too: they carry the
   Razorpay webhook URL, the DNS verification token and invite links,
   which an owner has to be able to select. Keep this list in step with
   COPYABLE in useCopyProtection.ts. */
:root[data-copy-locked='true'] input,
:root[data-copy-locked='true'] textarea,
:root[data-copy-locked='true'] [contenteditable=''],
:root[data-copy-locked='true'] [contenteditable='true'],
:root[data-copy-locked='true'] code,
:root[data-copy-locked='true'] pre,
:root[data-copy-locked='true'] [data-copyable] {
  -webkit-user-select: text;
  user-select: text;
}

/* Long-press on a touchscreen otherwise pops the OS text-selection
   callout, which offers Copy straight back. */
:root[data-copy-locked='true'] body {
  -webkit-touch-callout: none;
}

/* Images are not covered by user-select; this stops the drag-to-desktop
   route out for lesson diagrams and slides. */
:root[data-copy-locked='true'] img {
  -webkit-user-drag: none;
  user-drag: none;
}
/* =========================================================
   NAVTAAR LMS — root-domain landing page
   =========================================================

   Every rule is scoped under `.nlp`. That is load-bearing, not tidiness:
   the source design used bare `nav {}`, `footer {}` and `body::before`
   selectors, and this app already has a `<nav>` in the dashboard shell
   plus a `body::before` carrying the ambient accent washes. Unscoped,
   this stylesheet would restyle the signed-in app.

   It also deliberately does NOT reuse the `.landing-*` classes in
   App.css — those are still used by TenantStorefrontPage, which is a
   different page with a different job.

   This page commits to one palette (paper / ink / signal green) rather
   than following the light-dark theme toggle. It is art-directed
   marketing, and recolouring it per theme would wreck it — which is why
   the theme toggle is absent from this page's nav.
   ========================================================= */

.nlp {
  --paper: #f6f3ec;
  --ink: #0d0c0a;
  --ink2: #1a1916;
  --live: #00df5a;
  --muted: #8c8880;
  --rule: rgba(13, 12, 10, 0.12);
  --rule-hi: rgba(13, 12, 10, 0.25);
  --card: #efece4;
  --display: 'Bebas Neue', 'Plus Jakarta Sans', Impact, sans-serif;

  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

.nlp * {
  box-sizing: border-box;
}
.nlp a {
  text-decoration: none;
}
.nlp a:hover {
  text-decoration: none;
}
/* index.css puts --heading on every h1-h4; the display face is set per
   element below, so neutralise the inherited default first. */
.nlp h1,
.nlp h2,
.nlp h3,
.nlp h4 {
  font-family: inherit;
  letter-spacing: normal;
  color: inherit;
  margin: 0;
}

/* ── GRAIN OVERLAY ──────────────────────────────── */
.nlp::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23noise%29'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px;
}

/* ── NAV ────────────────────────────────────────── */
.nlp-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nlp-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nlp-nav-mark {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 16px;
  color: var(--paper);
}
.nlp-nav-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.nlp-nav-name span {
  color: var(--muted);
  font-weight: 400;
}
.nlp-nav-mid {
  display: flex;
  gap: 28px;
}
.nlp-nav-mid a {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
}
.nlp-nav-mid a:hover {
  color: var(--ink);
}
.nlp-nav-right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.nlp-nav-login {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 14px;
  border: 1px solid var(--rule-hi);
  border-radius: 5px;
  transition: background 0.15s;
}
.nlp-nav-login:hover {
  background: var(--card);
}
.nlp-nav-trial {
  font-size: 13px;
  font-weight: 700;
  color: var(--paper);
  padding: 6px 16px;
  border-radius: 5px;
  background: var(--ink);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.nlp-nav-trial:hover {
  background: var(--ink2);
}
.nlp-trial-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
}

/* ── HERO ───────────────────────────────────────── */
.nlp-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 48px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.nlp-hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-size: clamp(160px, 22vw, 340px);
  color: transparent;
  -webkit-text-stroke: 1px rgba(13, 12, 10, 0.06);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: -4px;
  line-height: 1;
}
.nlp-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 80px 0 24px;
  border-bottom: 1px solid var(--rule);
  gap: 16px;
}
.nlp-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.nlp-live-signal {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--ink);
  color: var(--live);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.nlp-live-signal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  animation: nlp-pulse 1.6s ease infinite;
}
@keyframes nlp-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.nlp-hero-h1-wrap {
  padding: 24px 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.nlp-hero-h1 {
  font-family: var(--display);
  font-size: clamp(80px, 13vw, 190px);
  line-height: 0.92;
  letter-spacing: -3px;
  color: var(--ink);
  flex: 1;
}
.nlp-hero-h1 .nlp-accent {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
}
.nlp-hero-h1 .nlp-live-word {
  color: var(--live);
  -webkit-text-stroke: 0;
  text-shadow: 0 0 60px rgba(0, 223, 90, 0.3);
}
.nlp-hero-right-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  max-width: 280px;
  padding-bottom: 8px;
  flex-shrink: 0;
}
.nlp-hero-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}
.nlp-hero-cta-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nlp-btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--paper);
  background: var(--ink);
  padding: 13px 22px;
  border-radius: 6px;
  transition: background 0.15s;
  border: none;
  cursor: pointer;
}
.nlp-btn-hero:hover {
  background: var(--ink2);
}
.nlp-hero-subtext {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.nlp-hero-subtext code {
  background: var(--card);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 10.5px;
  padding: 1px 5px;
}

.nlp-hero-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  margin-top: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.nlp-hbb-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nlp-hbb-val {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.nlp-hbb-val .g {
  color: var(--live);
}
.nlp-hbb-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.nlp-hbb-divider {
  width: 1px;
  height: 36px;
  background: var(--rule);
}

/* ── MARQUEE ────────────────────────────────────── */
.nlp-marquee-wrap {
  overflow: hidden;
  background: var(--ink);
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nlp-marquee-track {
  display: flex;
  animation: nlp-scroll 22s linear infinite;
  width: max-content;
}
@keyframes nlp-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
.nlp-marquee-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.5px;
  color: rgba(246, 243, 236, 0.35);
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.nlp-marquee-item .nlp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--live);
  flex-shrink: 0;
}
.nlp-marquee-item.hi {
  color: var(--paper);
}

/* ── STATEMENT ──────────────────────────────────── */
.nlp-statement {
  padding: 80px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}
.nlp-statement-left {
  padding-right: 64px;
  border-right: 1px solid var(--rule);
}
.nlp-statement-right {
  padding-left: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}
.nlp-statement-h {
  font-family: var(--display);
  font-size: clamp(48px, 6vw, 90px);
  line-height: 0.92;
  letter-spacing: -2px;
  color: var(--ink);
}
.nlp-statement-h .nlp-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}
.nlp-stmt-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.nlp-stmt-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.nlp-stmt-n {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.nlp-stmt-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.nlp-stmt-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

/* ── FEATURE LEDGER ─────────────────────────────── */
.nlp-ledger {
  border-bottom: 1px solid var(--rule);
}
.nlp-ledger-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 12px 48px;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
}
.nlp-lh-col {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.nlp-ledger-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 20px 48px;
  border-bottom: 1px solid var(--rule);
  align-items: center;
  transition: background 0.15s;
}
.nlp-ledger-row:hover {
  background: var(--card);
}
.nlp-ledger-row:last-child {
  border-bottom: none;
}
.nlp-lr-feature {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nlp-lr-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.nlp-lr-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 380px;
}
.nlp-lr-check {
  font-size: 13px;
  font-weight: 700;
}
.nlp-lr-check.yes {
  color: #0a8f3c;
}
.nlp-lr-check.no {
  color: var(--muted);
  opacity: 0.55;
}
.nlp-tier-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.nlp-tier-label.active {
  color: var(--ink);
}

/* ── DASHBOARD PREVIEW ──────────────────────────── */
.nlp-dash-section {
  padding: 80px 48px;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 64px;
  align-items: start;
}
.nlp-section-num {
  font-family: var(--display);
  font-size: 120px;
  line-height: 1;
  letter-spacing: -4px;
  color: var(--rule-hi);
  margin-bottom: -16px;
}
.nlp-dash-label-col h2 {
  font-family: var(--display);
  font-size: clamp(40px, 4.5vw, 62px);
  line-height: 0.94;
  letter-spacing: -1.5px;
  color: var(--ink);
  margin-bottom: 20px;
}
.nlp-dash-label-col p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 28px;
}
.nlp-dash-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nlp-dl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.nlp-dl-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.nlp-dl-mark::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}
.nlp-dl-item span {
  color: var(--ink);
  font-weight: 600;
}

.nlp-terminal {
  background: var(--ink2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(13, 12, 10, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.nlp-t-bar {
  background: #0a0a08;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nlp-t-dots {
  display: flex;
  gap: 6px;
}
.nlp-t-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.nlp-t-bar-title {
  font-size: 11.5px;
  color: rgba(246, 243, 236, 0.35);
  margin: 0 auto;
}
.nlp-t-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nlp-t-row-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.nlp-t-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 12px;
}
.nlp-t-stat-val {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  color: var(--paper);
  letter-spacing: -0.5px;
}
.nlp-t-stat-val.live-color {
  color: var(--live);
}
.nlp-t-stat-lbl {
  font-size: 9px;
  color: rgba(246, 243, 236, 0.3);
  margin-top: 4px;
  font-weight: 500;
}
.nlp-t-label {
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(246, 243, 236, 0.25);
  letter-spacing: 0.5px;
  padding: 0 2px;
}
.nlp-t-session {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
}
.nlp-t-s-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.nlp-t-s-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--paper);
}
.nlp-t-s-meta {
  font-size: 9.5px;
  color: rgba(246, 243, 236, 0.3);
  margin-top: 2px;
}
.nlp-t-s-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}
.nlp-live-badge {
  background: rgba(0, 223, 90, 0.12);
  color: var(--live);
  border: 1px solid rgba(0, 223, 90, 0.25);
}
.nlp-soon-badge {
  background: rgba(246, 243, 236, 0.06);
  color: rgba(246, 243, 236, 0.5);
  border: 1px solid rgba(246, 243, 236, 0.1);
}
.nlp-done-badge {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(246, 243, 236, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.nlp-t-doubt-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nlp-t-doubt {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  padding: 9px 11px;
}
.nlp-t-d-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}
.nlp-t-d-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--paper);
  margin-bottom: 2px;
}
.nlp-t-d-text {
  font-size: 9.5px;
  color: rgba(246, 243, 236, 0.4);
  line-height: 1.4;
}
.nlp-t-d-reply {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--live);
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 223, 90, 0.25);
  background: rgba(0, 223, 90, 0.06);
}

/* ── CHAT SECTION ───────────────────────────────── */
.nlp-chat-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}
.nlp-chat-left {
  padding: 80px 48px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.nlp-chat-left h2 {
  font-family: var(--display);
  font-size: clamp(52px, 6vw, 86px);
  line-height: 0.92;
  letter-spacing: -2px;
  color: var(--ink);
  margin-bottom: 20px;
}
.nlp-chat-left p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 340px;
}
.nlp-no-mic {
  margin-top: 28px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}
.nlp-chat-right {
  padding: 48px;
  background: var(--ink2);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.nlp-chat-window {
  background: #0a0a08;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.nlp-cw-bar {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nlp-cw-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--paper);
}
.nlp-cw-meta {
  font-size: 10px;
  color: rgba(246, 243, 236, 0.35);
  margin-left: auto;
}
.nlp-cw-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nlp-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.55;
}
.nlp-bubble.s {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--paper);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}
.nlp-bubble.t {
  background: rgba(0, 223, 90, 0.1);
  border: 1px solid rgba(0, 223, 90, 0.2);
  color: var(--paper);
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.nlp-b-meta {
  font-size: 9px;
  color: rgba(246, 243, 236, 0.3);
  margin-bottom: -4px;
}
.nlp-b-meta.r {
  text-align: right;
  align-self: flex-end;
}
.nlp-cw-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}
.nlp-cw-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 11px;
  color: rgba(246, 243, 236, 0.5);
  font-family: inherit;
}
.nlp-cw-send {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--live);
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 223, 90, 0.1);
  border: 1px solid rgba(0, 223, 90, 0.2);
}

/* ── PRICING ────────────────────────────────────── */
.nlp-pricing-section {
  padding: 80px 48px;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.nlp-pricing-left h2 {
  font-family: var(--display);
  font-size: clamp(60px, 8vw, 120px);
  line-height: 0.9;
  letter-spacing: -3px;
  color: var(--ink);
  margin-bottom: 20px;
}
.nlp-pricing-left h2 .nlp-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}
.nlp-pricing-left p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 360px;
  margin-bottom: 28px;
}
.nlp-pricing-note {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
  padding: 16px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  max-width: 360px;
}
.nlp-pricing-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.nlp-trial-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: 12px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.nlp-trial-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 223, 90, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.nlp-trial-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.nlp-trial-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--live);
  background: rgba(0, 223, 90, 0.1);
  border: 1px solid rgba(0, 223, 90, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
}
.nlp-trial-days {
  font-family: var(--display);
  font-size: 72px;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--paper);
}
.nlp-trial-days span {
  font-size: 24px;
  color: rgba(246, 243, 236, 0.4);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  letter-spacing: 0;
}
.nlp-trial-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.nlp-trial-desc {
  font-size: 13px;
  color: rgba(246, 243, 236, 0.55);
  line-height: 1.65;
  margin-bottom: 24px;
}
.nlp-trial-feats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.nlp-tf {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: rgba(246, 243, 236, 0.8);
}
.nlp-tf::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 223, 90, 0.5);
  background: rgba(0, 223, 90, 0.08);
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath d='M1 4l2 2 4-4' stroke='%2300DF5A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.nlp-trial-cta {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--live);
  padding: 13px;
  border-radius: 8px;
  transition: opacity 0.15s;
}
.nlp-trial-cta:hover {
  opacity: 0.88;
}
.nlp-custom-card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nlp-cc-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nlp-cc-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.nlp-cc-sub {
  font-size: 13px;
  color: var(--muted);
}
.nlp-cc-btn {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 7px;
  border: 1.5px solid var(--ink);
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.nlp-cc-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ── WHO ────────────────────────────────────────── */
.nlp-who-section {
  padding: 80px 48px;
  border-bottom: 1px solid var(--rule);
}
.nlp-who-section h2 {
  font-family: var(--display);
  font-size: clamp(48px, 6vw, 86px);
  line-height: 0.92;
  letter-spacing: -2px;
  color: var(--ink);
  margin-bottom: 52px;
}
.nlp-who-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}
.nlp-who-cell {
  padding: 32px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.2s;
}
.nlp-who-cell:hover {
  background: var(--card);
}
.nlp-who-cell:last-child {
  border-right: none;
}
.nlp-who-cell-num {
  font-family: var(--display);
  font-size: 48px;
  line-height: 1;
  color: var(--rule-hi);
  letter-spacing: -1px;
}
.nlp-who-cell-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.nlp-who-cell-body {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
}

/* ── HOW ────────────────────────────────────────── */
.nlp-how-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--rule);
}
.nlp-how-cell {
  padding: 40px 32px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.2s;
}
.nlp-how-cell:hover {
  background: var(--card);
}
.nlp-how-cell:last-child {
  border-right: none;
}
.nlp-how-step-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nlp-how-step-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.nlp-how-icon {
  font-size: 28px;
}
.nlp-how-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.nlp-how-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

/* ── FINAL CTA ──────────────────────────────────── */
.nlp-final-cta {
  padding: 100px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.nlp-fcta-bg {
  position: absolute;
  inset: 0;
  background: var(--ink);
  z-index: 0;
}
.nlp-fcta-grid-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(246, 243, 236, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 243, 236, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.nlp-fcta-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.nlp-fcta-h {
  font-family: var(--display);
  font-size: clamp(64px, 10vw, 140px);
  line-height: 0.9;
  letter-spacing: -4px;
  color: var(--paper);
  margin-bottom: 24px;
}
.nlp-fcta-h .nlp-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--paper);
}
.nlp-fcta-h .nlp-live-word {
  color: var(--live);
}
.nlp-fcta-sub {
  font-size: 16px;
  color: rgba(246, 243, 236, 0.5);
  max-width: 400px;
  line-height: 1.7;
  margin-bottom: 40px;
}
.nlp-fcta-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.nlp-fcta-primary {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: var(--live);
  padding: 14px 30px;
  border-radius: 8px;
  transition: opacity 0.15s;
}
.nlp-fcta-primary:hover {
  opacity: 0.88;
}
.nlp-fcta-ghost {
  font-size: 15px;
  font-weight: 500;
  color: rgba(246, 243, 236, 0.6);
  padding: 14px 24px;
  border-radius: 8px;
  border: 1px solid rgba(246, 243, 236, 0.12);
  transition:
    border-color 0.15s,
    color 0.15s;
}
.nlp-fcta-ghost:hover {
  color: var(--paper);
  border-color: rgba(246, 243, 236, 0.3);
}
.nlp-fcta-note {
  margin-top: 20px;
  font-size: 12px;
  color: rgba(246, 243, 236, 0.25);
}
.nlp-fcta-link {
  color: var(--live);
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 223, 90, 0.4);
}
.nlp-fcta-link:hover {
  border-bottom-color: var(--live);
}

/* Inline text link on the paper background. */
.nlp-inline-link {
  color: var(--ink);
  font-weight: 700;
  border-bottom: 1.5px solid var(--live);
}

/* ── FOOTER ─────────────────────────────────────── */
.nlp-footer {
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 28px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.nlp-foot-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nlp-foot-mark {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: rgba(246, 243, 236, 0.1);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 14px;
  color: var(--paper);
}
.nlp-foot-name {
  font-size: 13px;
  color: rgba(246, 243, 236, 0.4);
}
.nlp-foot-name strong {
  color: var(--paper);
  font-weight: 600;
}
.nlp-foot-name a {
  color: rgba(246, 243, 236, 0.35);
}
.nlp-foot-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.nlp-foot-links a {
  font-size: 12.5px;
  color: rgba(246, 243, 236, 0.35);
  transition: color 0.15s;
}
.nlp-foot-links a:hover {
  color: var(--paper);
}

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 960px) {
  .nlp-nav {
    padding: 0 20px;
  }
  .nlp-nav-mid {
    display: none;
  }
  .nlp-nav-name span {
    display: none;
  }
  .nlp-hero {
    padding: 0 20px;
  }
  .nlp-hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .nlp-hero-h1-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .nlp-hero-right-col {
    max-width: 100%;
    padding-bottom: 0;
  }
  .nlp-hero-bottom-bar {
    gap: 20px;
  }
  .nlp-hbb-divider {
    display: none;
  }
  .nlp-statement {
    grid-template-columns: 1fr;
    padding: 60px 20px;
  }
  .nlp-statement-left {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding-right: 0;
    padding-bottom: 40px;
    margin-bottom: 40px;
  }
  .nlp-statement-right {
    padding-left: 0;
  }
  .nlp-ledger-header,
  .nlp-ledger-row {
    grid-template-columns: 1fr auto;
    padding: 14px 20px;
    gap: 12px;
  }
  /* Drop the two comparison columns rather than crushing four into a
     phone width — the product column is the one that matters. */
  .nlp-ledger-header .nlp-lh-col:nth-child(3),
  .nlp-ledger-header .nlp-lh-col:nth-child(4),
  .nlp-ledger-row .nlp-lr-check:nth-child(3),
  .nlp-ledger-row .nlp-lr-check:nth-child(4) {
    display: none;
  }
  .nlp-dash-section {
    grid-template-columns: 1fr;
    padding: 60px 20px;
    gap: 40px;
  }
  .nlp-section-num {
    font-size: 80px;
  }
  .nlp-t-row-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .nlp-chat-section {
    grid-template-columns: 1fr;
  }
  .nlp-chat-left {
    padding: 60px 20px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .nlp-chat-right {
    padding: 32px 20px;
  }
  .nlp-pricing-section {
    grid-template-columns: 1fr;
    padding: 60px 20px;
    gap: 48px;
  }
  .nlp-who-section {
    padding: 60px 20px;
  }
  .nlp-who-grid {
    grid-template-columns: 1fr;
  }
  .nlp-who-cell {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .nlp-who-cell:last-child {
    border-bottom: none;
  }
  .nlp-how-section {
    grid-template-columns: 1fr 1fr;
  }
  .nlp-how-cell:nth-child(2) {
    border-right: none;
  }
  .nlp-how-cell:nth-child(3) {
    border-top: 1px solid var(--rule);
  }
  .nlp-how-cell:nth-child(4) {
    border-top: 1px solid var(--rule);
  }
  .nlp-final-cta {
    padding: 80px 20px;
  }
  .nlp-footer {
    flex-direction: column;
    gap: 16px;
    padding: 24px 20px;
    text-align: center;
  }
  .nlp-foot-links {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .nlp-how-section {
    grid-template-columns: 1fr;
  }
  .nlp-how-cell {
    border-right: none;
    border-top: 1px solid var(--rule);
  }
}

/* =========================================================
   ROOT-DOMAIN SIGN-IN — see RootSignInPage.tsx
   Shares the landing palette, so it lives here rather than in a
   second stylesheet that would duplicate the tokens.
   ========================================================= */
.nlp-signin-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.nlp-signin-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 20px 48px;
}
.nlp-signin-card {
  width: 100%;
  max-width: 420px;
}
.nlp-signin-h {
  font-family: var(--display);
  font-size: clamp(64px, 12vw, 104px);
  line-height: 0.88;
  letter-spacing: -3px;
  color: var(--ink);
  margin-bottom: 20px;
}
.nlp-signin-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 32px;
}
.nlp-signin-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Input butted against a fixed suffix, so it's obvious the value is a
   subdomain label and not a full URL. */
.nlp-slug-field {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.nlp-slug-field:focus-within {
  box-shadow: 0 0 0 3px rgba(0, 223, 90, 0.35);
}
.nlp-slug-field input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: right;
}
.nlp-slug-field input:focus {
  outline: none;
}
.nlp-slug-field input::placeholder {
  color: var(--muted);
  font-weight: 400;
}
.nlp-slug-suffix {
  display: flex;
  align-items: center;
  padding: 0 14px 0 0;
  font-size: 16px;
  color: var(--muted);
  white-space: nowrap;
}

.nlp-signin-btn {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.nlp-signin-btn:hover:not(:disabled) {
  background: var(--ink2);
}
.nlp-signin-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.nlp-signin-error {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 7px;
  background: rgba(190, 30, 30, 0.07);
  border: 1px solid rgba(190, 30, 30, 0.25);
  color: #a11a1a;
  font-size: 13px;
  line-height: 1.55;
}
.nlp-signin-hint {
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
}
.nlp-signin-hint strong {
  color: var(--ink);
  font-weight: 600;
}
.nlp-signin-foot {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}
.nlp-signin-foot a {
  color: var(--ink);
  font-weight: 700;
  border-bottom: 1.5px solid var(--live);
}

/* =========================================================
   CREATE INSTITUTE — see CreateInstitutePage.tsx
   Two columns: the pitch on the left, the form on the right. Stacks
   under 900px so the form stays reachable on a phone.
   ========================================================= */
.nlp-create-page {
  min-height: 100vh;
  min-height: 100dvh;
}
.nlp-create-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}
.nlp-create-aside {
  padding: 130px 56px 64px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.nlp-create-h {
  font-family: var(--display);
  font-size: clamp(56px, 7vw, 104px);
  line-height: 0.88;
  letter-spacing: -3px;
  color: var(--ink);
  margin-bottom: 24px;
}
.nlp-create-lede {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 380px;
  margin-bottom: 28px;
}
.nlp-create-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
}
.nlp-create-list li {
  position: relative;
  padding-left: 26px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.6;
}
.nlp-create-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(13, 12, 10, 0.35);
  background: rgba(0, 223, 90, 0.16);
}

.nlp-create-form-wrap {
  padding: 130px 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
  width: 100%;
}
.nlp-create-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.nlp-field {
  display: flex;
  flex-direction: column;
}
.nlp-input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  transition: box-shadow 0.15s;
}
.nlp-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 223, 90, 0.35);
}
.nlp-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.nlp-slug-field.is-taken {
  border-color: #a11a1a;
}
.nlp-slug-field.is-taken:focus-within {
  box-shadow: 0 0 0 3px rgba(161, 26, 26, 0.25);
}

.nlp-slug-status {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.nlp-slug-status.is-free {
  color: #0a8f3c;
  font-weight: 600;
}
.nlp-slug-status.is-taken,
.nlp-slug-status.is-invalid {
  color: #a11a1a;
  font-weight: 600;
}

.nlp-create-form .nlp-signin-btn {
  margin-top: 4px;
}
.nlp-create-form-wrap .nlp-signin-hint {
  margin-top: 0;
}

/* Social Crackers early-access form's batch-choice radios. */
.sc-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sc-radio-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.sc-radio-option input {
  accent-color: var(--ink);
}

@media (max-width: 900px) {
  .nlp-create-main {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .nlp-create-aside {
    padding: 100px 20px 40px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .nlp-create-form-wrap {
    padding: 40px 20px 64px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nlp *,
  .nlp *::before,
  .nlp *::after {
    animation: none !important;
    transition: none !important;
  }
}
/* =========================================================
   TENANT STOREFRONT

   One component tree, four templates. Each template is a
   `[data-template]` block that redefines a handful of tokens and a few
   structural rules — rather than four component trees, which would mean
   every future storefront feature written four times.

   Scoped under `.sf` throughout: this renders on a tenant subdomain
   alongside the app's own global styles, so bare element selectors here
   would leak into the signed-in dashboard.
   ========================================================= */

.sf {
  /* Defaults; each template overrides what it needs. */
  --sf-bg: var(--bg);
  --sf-surface: var(--surface);
  --sf-text: var(--text);
  --sf-head: var(--text-h);
  --sf-muted: var(--text-muted);
  --sf-line: var(--border);
  --sf-accent: var(--tenant-accent);
  --sf-on-accent: var(--tenant-accent-contrast);
  --sf-radius: 14px;
  --sf-card-radius: 14px;
  --sf-shadow: var(--shadow-sm);
  --sf-shadow-lg: var(--shadow-md);
  --sf-display: var(--heading);
  --sf-hero-pad: 5rem;
  --sf-max: 1140px;

  background: var(--sf-bg);
  color: var(--sf-text);
  min-height: 100vh;
  font-family: var(--sans);
}

.sf * {
  box-sizing: border-box;
}
.sf a {
  text-decoration: none;
  color: inherit;
}
.sf h1,
.sf h2,
.sf h3,
.sf h4 {
  font-family: var(--sf-display);
  color: var(--sf-head);
  margin: 0;
}

/* ── ANNOUNCEMENT ──────────────────────────────── */
.sf-announce {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  background: var(--sf-accent);
  color: var(--sf-on-accent);
  font-size: 13.5px;
  font-weight: 550;
  text-align: center;
}
.sf-announce button {
  padding: 0.15rem;
  border: none;
  background: transparent;
  box-shadow: none;
  color: inherit;
  opacity: 0.75;
}
.sf-announce button:hover:not(:disabled) {
  background: transparent;
  opacity: 1;
  transform: none;
  border-color: transparent;
}

/* ── HEADER ────────────────────────────────────── */
.sf-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--sf-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sf-line);
}
.sf-header-inner {
  max-width: var(--sf-max);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.sf-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.sf-logo {
  height: 34px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}
.sf-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--sf-accent);
  color: var(--sf-on-accent);
  font-family: var(--sf-display);
  font-size: 16px;
  font-weight: 800;
}
.sf-brand-name {
  font-family: var(--sf-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--sf-head);
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sf-nav {
  display: flex;
  gap: 1.35rem;
  margin-left: auto;
}
.sf-nav a {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--sf-muted);
  transition: color 0.15s var(--ease);
}
.sf-nav a:hover {
  color: var(--sf-head);
}
.sf-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.sf-nav + .sf-header-actions {
  margin-left: 0;
}

/* ── BUTTONS ───────────────────────────────────── */
.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 650;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    background-color 0.15s var(--ease);
  white-space: nowrap;
}
.sf-btn-primary {
  background: var(--sf-accent);
  color: var(--sf-on-accent);
  box-shadow: var(--sf-shadow);
}
.sf-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--sf-shadow-lg);
}
.sf-btn-ghost {
  color: var(--sf-head);
  border-color: var(--sf-line);
}
.sf-btn-ghost:hover {
  background: color-mix(in srgb, var(--sf-head) 6%, transparent);
}
.sf-btn-outline {
  border-color: var(--sf-line);
  color: var(--sf-head);
  background: var(--sf-surface);
}
.sf-btn-outline:hover {
  border-color: var(--sf-accent);
  color: var(--sf-accent);
}
.sf-btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 15px;
  border-radius: 10px;
}

/* ── HERO ──────────────────────────────────────── */
.sf-hero {
  position: relative;
  padding: var(--sf-hero-pad) 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--sf-line);
  background-size: cover;
  background-position: center;
}
.sf-hero.has-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 20, 0.62);
}
.sf-hero.has-banner .sf-hero-inner {
  position: relative;
}
.sf-hero.has-banner h1,
.sf-hero.has-banner .sf-hero-tagline {
  color: #fff;
}
.sf-hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.sf-hero h1 {
  font-size: clamp(34px, 5.5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 1rem;
}
.sf-hero-tagline {
  font-size: 17px;
  line-height: 1.65;
  color: var(--sf-muted);
  max-width: 56ch;
  margin: 0 auto 2rem;
}
.sf-hero-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── HIGHLIGHTS ────────────────────────────────── */
.sf-highlights {
  max-width: var(--sf-max);
  margin: 0 auto;
  padding: 2.25rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  border-bottom: 1px solid var(--sf-line);
}
.sf-highlight {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.sf-highlight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--sf-accent) 12%, transparent);
  color: var(--sf-accent);
}
.sf-highlight strong {
  display: block;
  font-size: 14.5px;
  color: var(--sf-head);
  margin-bottom: 0.15rem;
}
.sf-highlight p {
  font-size: 13px;
  color: var(--sf-muted);
  line-height: 1.55;
  margin: 0;
}

/* ── SECTIONS ──────────────────────────────────── */
.sf-section {
  max-width: var(--sf-max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}
.sf-section-head {
  margin-bottom: 1.5rem;
}
.sf-section-head h2 {
  font-size: clamp(24px, 3.2vw, 34px);
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}
.sf-section-head p {
  font-size: 14px;
  color: var(--sf-muted);
  margin: 0;
}
.sf-error {
  max-width: var(--sf-max);
  margin: 1rem auto;
}

/* ── FILTERS ───────────────────────────────────── */
.sf-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.sf-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.sf-search .icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sf-muted);
  pointer-events: none;
}
.sf-search input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 0.6rem 0.8rem 0.6rem 2.25rem;
  border: 1px solid var(--sf-line);
  border-radius: 9px;
  background: var(--sf-surface);
  color: var(--sf-head);
}
.sf-search input:focus {
  outline: none;
  border-color: var(--sf-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sf-accent) 25%, transparent);
}
.sf-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.sf-chip {
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--sf-line);
  background: var(--sf-surface);
  color: var(--sf-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}
.sf-chip:hover:not(:disabled) {
  color: var(--sf-head);
  transform: none;
  border-color: var(--sf-line);
}
.sf-chip.is-active {
  background: var(--sf-accent);
  border-color: var(--sf-accent);
  color: var(--sf-on-accent);
}
.sf-select {
  font: inherit;
  font-size: 13.5px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--sf-line);
  border-radius: 9px;
  background: var(--sf-surface);
  color: var(--sf-head);
  margin-left: auto;
}

/* ── COURSE CARDS ──────────────────────────────── */
.sf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.sf-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.sf-card {
  display: flex;
  flex-direction: column;
  background: var(--sf-surface);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-card-radius);
  overflow: hidden;
  box-shadow: var(--sf-shadow);
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.sf-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sf-shadow-lg);
  border-color: color-mix(in srgb, var(--sf-accent) 35%, var(--sf-line));
}
.sf-card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: color-mix(in srgb, var(--sf-accent) 10%, var(--sf-surface));
}
.sf-card-cover.is-fallback {
  background-image: linear-gradient(
    135deg,
    color-mix(in srgb, var(--sf-accent) 85%, white),
    var(--sf-accent) 55%,
    color-mix(in srgb, var(--sf-accent) 70%, black)
  );
}
.sf-card-flag,
.sf-card-cat {
  position: absolute;
  top: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(6px);
}
.sf-card-flag {
  left: 0.6rem;
  background: rgba(8, 10, 20, 0.7);
  color: #fff;
}
.sf-card-cat {
  right: 0.6rem;
  background: rgba(255, 255, 255, 0.9);
  color: #12152a;
}
.sf-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem 1.1rem;
  flex: 1;
}
.sf-card-body h3 {
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.sf-card-desc {
  font-size: 13px;
  color: var(--sf-muted);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sf-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.7rem;
}
.sf-card-price {
  font-family: var(--sf-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--sf-head);
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.sf-card-price-was {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sf-muted);
  text-decoration: line-through;
}
.sf-card-includes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.sf-card-includes span {
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full, 999px);
  background: var(--sf-surface-2, rgba(127, 127, 127, 0.1));
  color: var(--sf-muted);
}
.sf-card-norating {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--sf-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sf-card-skeleton {
  pointer-events: none;
}
.sf-card-skeleton .sf-card-cover {
  background: none;
}

.sf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3.5rem 1rem;
  border: 1px dashed var(--sf-line);
  border-radius: var(--sf-radius);
  color: var(--sf-muted);
  text-align: center;
}

/* ── REVIEWS ───────────────────────────────────── */
.sf-reviews {
  border-top: 1px solid var(--sf-line);
}
.sf-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.15rem;
}
.sf-review {
  margin: 0;
  padding: 1.35rem;
  background: var(--sf-surface);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-card-radius);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.sf-review blockquote {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--sf-text);
}
.sf-review figcaption {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
}
.sf-review-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sf-accent) 15%, transparent);
  color: var(--sf-accent);
  font-size: 11.5px;
  font-weight: 700;
}
.sf-review figcaption strong {
  display: block;
  font-size: 13.5px;
  color: var(--sf-head);
}
.sf-review figcaption em {
  font-size: 12px;
  font-style: normal;
  color: var(--sf-muted);
}

/* ── ABOUT / FAQ ───────────────────────────────── */
.sf-about {
  border-top: 1px solid var(--sf-line);
}
.sf-about-body {
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--sf-text);
  max-width: 68ch;
  white-space: pre-wrap;
}
.sf-faq {
  border-top: 1px solid var(--sf-line);
}
.sf-faq-list {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sf-faq-item {
  border: 1px solid var(--sf-line);
  border-radius: 11px;
  background: var(--sf-surface);
  overflow: hidden;
}
.sf-faq-item.is-open {
  border-color: color-mix(in srgb, var(--sf-accent) 35%, var(--sf-line));
}
.sf-faq-item button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.15rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  font-size: 15px;
  font-weight: 650;
  color: var(--sf-head);
}
.sf-faq-item button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--sf-head) 4%, transparent);
  transform: none;
  border-color: transparent;
}
.sf-faq-item .icon {
  color: var(--sf-muted);
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
}
.sf-faq-item.is-open .icon {
  transform: rotate(180deg);
}
.sf-faq-item p {
  margin: 0;
  padding: 0 1.15rem 1.15rem;
  font-size: 14px;
  line-height: 1.7;
  color: var(--sf-muted);
  white-space: pre-wrap;
}

/* ── CTA + FOOTER ──────────────────────────────── */
.sf-cta {
  text-align: center;
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--sf-line);
  background: color-mix(in srgb, var(--sf-accent) 6%, var(--sf-bg));
}
.sf-cta h2 {
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}
.sf-cta p {
  font-size: 15.5px;
  color: var(--sf-muted);
  margin: 0 0 1.75rem;
}

.sf-footer {
  border-top: 1px solid var(--sf-line);
  background: var(--sf-surface);
}
.sf-footer-inner {
  max-width: var(--sf-max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.sf-footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}
.sf-footer-brand strong {
  display: block;
  font-family: var(--sf-display);
  font-size: 15px;
  color: var(--sf-head);
}
.sf-footer-brand p {
  margin: 0.2rem 0 0;
  font-size: 13px;
  color: var(--sf-muted);
  max-width: 34ch;
  line-height: 1.55;
}
.sf-footer-col h4 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--sf-muted);
  margin-bottom: 0.7rem;
}
.sf-footer-col a {
  display: block;
  font-size: 13.5px;
  color: var(--sf-text);
  margin-bottom: 0.35rem;
}
.sf-footer-col a:hover {
  color: var(--sf-accent);
}
.sf-socials {
  display: flex;
  gap: 0.4rem;
}
.sf-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 9px;
  border: 1px solid var(--sf-line);
  color: var(--sf-muted);
  transition:
    color 0.15s var(--ease),
    border-color 0.15s var(--ease);
}
.sf-socials a:hover {
  color: var(--sf-accent);
  border-color: var(--sf-accent);
}
.sf-footer-bottom {
  max-width: var(--sf-max);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sf-line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--sf-muted);
}
.sf-footer-bottom a {
  color: var(--sf-accent);
}

/* =========================================================
   TEMPLATES
   ========================================================= */

/* --- BOLD: dark, oversized type, high contrast ------------ */
.sf[data-template='bold'] {
  --sf-bg: #0a0c17;
  --sf-surface: #12152a;
  --sf-text: #a9b0cc;
  --sf-head: #f2f3fb;
  --sf-muted: #737a99;
  --sf-line: #262b4a;
  --sf-card-radius: 6px;
  --sf-radius: 6px;
  --sf-hero-pad: 7rem;
  --sf-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sf-shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
}
.sf[data-template='bold'] .sf-hero h1 {
  font-size: clamp(44px, 8vw, 88px);
  letter-spacing: -0.05em;
  text-transform: uppercase;
}
.sf[data-template='bold'] .sf-section-head h2 {
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.sf[data-template='bold'] .sf-btn {
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12.5px;
}
.sf[data-template='bold'] .sf-btn-lg {
  font-size: 14px;
}
.sf[data-template='bold'] .sf-cta {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--sf-accent) 22%, #0a0c17),
    #0a0c17
  );
}

/* --- MINIMAL: quiet, roomy, hairline rules ---------------- */
.sf[data-template='minimal'] {
  --sf-surface: transparent;
  --sf-card-radius: 0px;
  --sf-radius: 0px;
  --sf-shadow: none;
  --sf-shadow-lg: none;
  --sf-hero-pad: 7rem;
  --sf-max: 980px;
}
.sf[data-template='minimal'] .sf-card {
  border-width: 0 0 1px 0;
  border-radius: 0;
}
.sf[data-template='minimal'] .sf-card:hover {
  transform: none;
  border-color: var(--sf-line);
  background: color-mix(in srgb, var(--sf-head) 3%, transparent);
}
.sf[data-template='minimal'] .sf-card-cover {
  aspect-ratio: 3 / 1;
}
.sf[data-template='minimal'] .sf-grid,
.sf[data-template='minimal'] .sf-featured-grid {
  grid-template-columns: 1fr;
  gap: 0;
}
.sf[data-template='minimal'] .sf-btn {
  border-radius: 0;
}
.sf[data-template='minimal'] .sf-btn-primary {
  box-shadow: none;
}
.sf[data-template='minimal'] .sf-hero {
  text-align: left;
}
.sf[data-template='minimal'] .sf-hero-inner {
  margin: 0;
  max-width: var(--sf-max);
  padding: 0 0;
}
.sf[data-template='minimal'] .sf-hero-tagline {
  margin-left: 0;
}
.sf[data-template='minimal'] .sf-hero-actions {
  justify-content: flex-start;
}
.sf[data-template='minimal'] .sf-review,
.sf[data-template='minimal'] .sf-faq-item {
  border-width: 0 0 1px 0;
  border-radius: 0;
}

/* --- ACADEMY: warm, trustworthy, softer edges ------------- */
.sf[data-template='academy'] {
  --sf-card-radius: 18px;
  --sf-radius: 18px;
  --sf-hero-pad: 4.5rem;
}
.sf[data-template='academy'] .sf-hero {
  background-color: color-mix(in srgb, var(--sf-accent) 8%, var(--sf-bg));
}
.sf[data-template='academy'] .sf-hero:not(.has-banner)::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 240px at 20% 0%, color-mix(in srgb, var(--sf-accent) 16%, transparent), transparent 70%),
    radial-gradient(520px 220px at 85% 100%, color-mix(in srgb, var(--sf-accent) 12%, transparent), transparent 70%);
}
.sf[data-template='academy'] .sf-hero-inner {
  position: relative;
  z-index: 1;
}
.sf[data-template='academy'] .sf-btn {
  border-radius: 999px;
}
.sf[data-template='academy'] .sf-highlights {
  padding-top: 2.75rem;
  padding-bottom: 2.75rem;
}
.sf[data-template='academy'] .sf-highlight {
  padding: 1.15rem;
  border: 1px solid var(--sf-line);
  border-radius: 14px;
  background: var(--sf-surface);
}

/* ── RESPONSIVE ────────────────────────────────── */
@media (max-width: 820px) {
  .sf-header-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
  }
  .sf-nav {
    display: none;
  }
  .sf-hero {
    padding: 3.5rem 1.25rem;
  }
  .sf-section {
    padding: 2.5rem 1.25rem;
  }
  .sf-highlights {
    padding: 1.75rem 1.25rem;
  }
  .sf-select {
    margin-left: 0;
  }
  .sf-footer-inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding: 2rem 1.25rem;
  }
  .sf-footer-bottom {
    justify-content: center;
    text-align: center;
  }
}
/* =========================================================
   BUTTONS
   Default is a neutral outline button; add .btn-primary to the
   page's main action, .btn-danger for destructive actions, .btn-ghost
   for low-emphasis actions (e.g. sign out, prev/next).
   ========================================================= */
/* Classes as well as the element, because ~20 places render a button as
   a <Link> or <a>. Those were picking up .btn-primary's colours from the
   rule below but none of the layout from here, so an icon and its label
   stacked vertically inside a blue box instead of sitting side by side.
   Anything that looks like a button now lays out like one, whatever tag
   it happens to be. */
button,
.btn-primary,
.btn-ghost,
.btn-danger,
.btn-icon,
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.58rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-h);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background-color 0.16s var(--ease),
    border-color 0.16s var(--ease),
    color 0.16s var(--ease),
    opacity 0.16s var(--ease),
    transform 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}
/* Links carry an underline by default; a button-shaped one must not. */
a.btn-primary,
a.btn-ghost,
a.btn-danger,
a.btn-icon,
a.btn-sm {
  text-decoration: none;
}

/* Element-only on purpose: each variant (.btn-primary, .btn-ghost,
   .btn-danger) defines its own hover below, and adding anchors here
   would fight the primary gradient for specificity. */
button:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
button:active:not(:disabled) {
  transform: translateY(0);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* The primary action carries a gradient + accent glow so it reads as
   the one thing to click, rather than a slightly different grey. */
.btn-primary {
  background-image: linear-gradient(
    135deg,
    color-mix(in srgb, var(--tenant-accent) 92%, white),
    var(--tenant-accent)
  );
  background-color: var(--tenant-accent);
  border-color: transparent;
  color: var(--tenant-accent-contrast);
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover:not(:disabled) {
  background-image: linear-gradient(
    135deg,
    var(--tenant-accent),
    color-mix(in srgb, var(--tenant-accent) 82%, black)
  );
  border-color: transparent;
  box-shadow: var(--shadow-glow-lg);
  transform: translateY(-1.5px);
}

.btn-danger,
.danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
  box-shadow: none;
}
.btn-danger:hover:not(:disabled),
.danger:hover:not(:disabled) {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text);
  box-shadow: none;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-h);
  border-color: transparent;
}

/* Small square button for row-level actions (delete, pin, expand). */
.btn-icon {
  padding: 0.4rem;
  border-radius: var(--radius-xs);
  box-shadow: none;
  color: var(--text-muted);
}
.btn-icon:hover:not(:disabled) {
  color: var(--text-h);
  transform: none;
}

.btn-sm {
  padding: 0.38rem 0.7rem;
  font-size: 12.5px;
}
.btn-lg {
  padding: 0.78rem 1.5rem;
  font-size: 15px;
  border-radius: var(--radius-md);
}
.btn-block {
  width: 100%;
}

/* =========================================================
   FORMS
   ========================================================= */
.auth-form,
.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.auth-form label,
.form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-h);
}

/* Same look as .form label, for a group heading that wraps other real
   <label> elements (checkboxes, radios) — a <label> cannot nest inside
   another <label> without breaking click/keyboard association on the
   inner controls, so this is a plain div standing in for one. */
.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-h);
}

.auth-form input,
.auth-form textarea,
.auth-form select,
.form input,
.form textarea,
.form select,
.inline-form input,
.field-input {
  font: inherit;
  font-size: 14px;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-h);
  transition:
    border-color 0.16s var(--ease),
    background-color 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}
.auth-form input::placeholder,
.auth-form textarea::placeholder,
.form input::placeholder,
.form textarea::placeholder,
.inline-form input::placeholder,
.field-input::placeholder {
  color: var(--text-faint);
}

/* A soft accent ring on focus rather than a bare 1px border change —
   the old version was almost invisible against a dark surface. */
.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus,
.form input:focus,
.form textarea:focus,
.form select:focus,
.inline-form input:focus,
.field-input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--tenant-accent);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}

.auth-form .checkbox-label,
.form .checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
.auth-form .checkbox-label input,
.form .checkbox-label input {
  width: auto;
}

.auth-form button,
.form > button {
  align-self: flex-start;
}

.auth-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-error {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  font-size: 13.5px;
}

.auth-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.inline-form input {
  flex: 1;
}

/* =========================================================
   AUTH PAGES — centered card on a muted page background
   ========================================================= */
.auth-page {
  position: relative;
  max-width: 416px;
  margin: 7vh auto;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg), var(--inset-hi);
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}
.auth-page h1 {
  font-size: 24px;
  margin-bottom: 0.4rem;
}
.auth-page > p:last-child {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
}
.auth-page .btn-primary {
  width: 100%;
  padding: 0.7rem 1.1rem;
  font-size: 14.5px;
}

/* Institute mark above the title — a logo when one's uploaded, an
   accent tile with the initial when not, so the card never opens on
   a bare line of text. */
.auth-logo {
  display: block;
  max-height: 44px;
  margin-bottom: 1.1rem;
}
.auth-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: #fff;
  font-family: var(--heading);
  font-size: 20px;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}
.auth-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.auth-theme-toggle {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
}

/* =========================================================
   SPLIT AUTH LAYOUT — branded panel beside the form.
   See AuthLayout.tsx.
   ========================================================= */
.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(700px 380px at 15% 8%, rgba(255, 255, 255, 0.22), transparent 65%),
    radial-gradient(560px 340px at 92% 92%, rgba(255, 255, 255, 0.14), transparent 65%),
    var(--accent-gradient-warm);
}
/* Faint grid, so the large flat panel has texture without an image request. */
.auth-brand-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent 75%);
}
.auth-brand-top,
.auth-brand-body,
.auth-brand-foot {
  position: relative;
  z-index: 1;
}

.auth-brand-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
}
.auth-brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  padding: 3px;
}
.auth-brand-name {
  font-family: var(--heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-brand-body h2 {
  color: #fff;
  font-size: 30px;
  line-height: 1.22;
  letter-spacing: -0.035em;
  max-width: 16ch;
  margin-bottom: 1.75rem;
}
.auth-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.auth-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.94);
  max-width: 34ch;
}
.auth-highlight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.auth-brand-foot {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.auth-form-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  background: var(--bg);
}
.auth-form-toggle {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
}
.auth-form-inner {
  width: 100%;
  max-width: 380px;
}
.auth-form-inner h1 {
  font-size: 27px;
  margin-bottom: 0.4rem;
}
.auth-form-inner .auth-sub {
  margin-bottom: 1.5rem;
}
.auth-form-inner .btn-primary {
  width: 100%;
  padding: 0.72rem 1.1rem;
  font-size: 14.5px;
  margin-top: 0.25rem;
}
.auth-foot {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
}

/* --- Google button + divider ------------------------------------------ */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.68rem 1.1rem;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-h);
  box-shadow: var(--shadow-sm);
}
.google-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--text-faint);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0.25rem;
  color: var(--text-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

@media (max-width: 880px) {
  .auth-split {
    grid-template-columns: 1fr;
  }
  /* Collapse the panel to a header band so the form stays above the fold. */
  .auth-brand-panel {
    padding: 1.5rem 1.25rem;
    gap: 1.25rem;
  }
  .auth-brand-body h2 {
    font-size: 21px;
    margin-bottom: 0;
    max-width: none;
  }
  .auth-highlights,
  .auth-brand-foot {
    display: none;
  }
  .auth-form-panel {
    padding: 2rem 1.25rem 3rem;
    align-items: flex-start;
  }
  .auth-form-toggle {
    top: 0.85rem;
    right: 1rem;
  }
}

/* =========================================================
   APP SHELL — sidebar + content, used by both dashboards
   ========================================================= */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 252px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  padding: 1rem 0.75rem 0.85rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem 0.9rem;
  min-width: 0;
}
.sidebar-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.sidebar-logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}
.sidebar-brand-text {
  min-width: 0;
  line-height: 1.25;
}
.sidebar-brand-text strong {
  display: block;
  font-family: var(--heading);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-h);
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-brand-text span {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1;
}
.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sidebar-group-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0.7rem 0.35rem;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
  transition:
    background-color 0.15s var(--ease),
    color 0.15s var(--ease);
}
.nav-link .icon {
  color: var(--text-faint);
  transition: color 0.15s var(--ease);
}
.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text-h);
  text-decoration: none;
}
.nav-link:hover .icon {
  color: var(--text);
}
/* Active state is a tinted pill with an accent rail, not a solid
   accent block — a fully saturated bar for every visited page made
   the sidebar shout over the content. */
.nav-link.active {
  background: var(--accent-soft);
  color: var(--tenant-accent);
  font-weight: 650;
}
.nav-link.active .icon {
  color: var(--tenant-accent);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  background: var(--tenant-accent);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.15rem 0.4rem;
  min-width: 0;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sidebar-signout {
  flex: 1;
  justify-content: flex-start;
  font-size: 13px;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.25rem 4rem;
}
.main-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* =========================================================
   THEME TOGGLE — three-way segmented control, see ThemeToggle.tsx
   ========================================================= */
.theme-toggle {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}
.theme-toggle-option {
  padding: 0.3rem;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  box-shadow: none;
  color: var(--text-faint);
}
.theme-toggle-option:hover:not(:disabled) {
  background: transparent;
  color: var(--text);
  transform: none;
  border-color: transparent;
}
.theme-toggle-option.is-active {
  background: var(--surface);
  color: var(--tenant-accent);
  box-shadow: var(--shadow-sm);
}

/* Legacy header classes kept for pages that haven't moved into the
   sidebar shell (auth-adjacent screens) */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  text-align: left;
}
.dashboard-nav {
  display: flex;
  gap: 1rem;
}

/* =========================================================
   CARDS + GRID
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm), var(--inset-hi);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.item-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow-sm), var(--inset-hi);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition:
    box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}
/* An accent rail that wipes in on hover — gives the grid some life
   without moving anything the eye is trying to read. */
.item-card::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent-gradient);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.24s var(--ease);
}
.item-card:hover::after {
  transform: scaleY(1);
}
.item-card:hover {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--tenant-accent) 32%, var(--border));
  text-decoration: none;
  transform: translateY(-3px);
}
.item-card h3 {
  margin-bottom: 0.4rem;
}
.item-card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
}

.empty-state {
  color: var(--text-muted);
  font-size: 14px;
  padding: 1.25rem 0;
}

/* =========================================================
   EMPTY PANEL — see EmptyState.tsx. A bordered, centred block with
   a glyph, replacing the bare grey sentence that used to sit alone
   on the page and read as a rendering failure.
   ========================================================= */
/* Solid hairline, not dashed: dashed reads as a drop zone or something
   half-built, which is the wrong message for "you haven't started yet". */
.empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}
.empty-panel-compact {
  padding: 1.25rem 1rem;
}

/* Nested inside a Section — which is already a bordered, shadowed card —
   the panel's own frame made a box inside a box inside a box. The card
   does the containing; this just holds the message. */
.section-body > .empty-panel,
.section-body > .empty-panel-compact {
  border: none;
  background: none;
  padding: 1.5rem 1rem;
}

/* Muted, not accent-coloured. A bright badge draws the eye to the one
   part of the page where nothing has happened. */
.empty-panel-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.2rem;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-faint);
}
.empty-panel-compact .empty-panel-art {
  width: 34px;
  height: 34px;
}
.empty-panel h4 {
  font-size: 14.5px;
}
.empty-panel p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 34ch;
  line-height: 1.55;
}
.empty-panel-action {
  margin-top: 0.55rem;
}
/* Drop the accent glow here. It's the right emphasis for "save" or "go
   live"; on an empty panel it made the loudest thing on the dashboard a
   box saying nothing had happened yet. */
.empty-panel-action .btn-primary {
  box-shadow: none;
}

/* =========================================================
   LISTS (sub-lists within a detail page — modules, lessons, results)
   ========================================================= */
.list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  text-align: left;
}
.list li {
  padding: 0.65rem 0.15rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.list li:last-child {
  border-bottom: none;
}
.list a {
  color: var(--text-h);
  font-weight: 550;
}
.list a:hover {
  color: var(--tenant-accent);
}

/* Social Crackers leads — per-row "has this person been given access
   yet" tracker (Leads tab, AdminDashboard.tsx). */
.lead-access-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
}
.lead-access-check input {
  accent-color: var(--tenant-accent);
  cursor: pointer;
}

/* Rows that are themselves the click target — pads out to the card
   edge and highlights whole-row, instead of only the link text being
   hoverable. */
.list-interactive li {
  padding: 0;
  border-bottom: 1px solid var(--border);
}
.list-interactive li > a,
.row-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 0.75rem;
  margin: 0 -0.75rem;
  width: calc(100% + 1.5rem);
  border-radius: var(--radius-sm);
  color: var(--text-h);
  text-decoration: none;
  transition: background-color 0.15s var(--ease);
}
.list-interactive li > a:hover,
.row-link:hover {
  background: var(--surface-hover);
  text-decoration: none;
  color: var(--text-h);
}
.row-link-title {
  flex: 1;
  min-width: 0;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Numbered/typed leading glyph on a row (lesson index, file type). */
.row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
}
.row-icon-done {
  background: var(--success-bg);
  border-color: transparent;
  color: var(--success);
}
.row-icon-accent {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--tenant-accent);
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 11px;
  font-weight: 650;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-success,
.badge-warning,
.badge-live,
.badge-accent,
.badge-info {
  border-color: transparent;
}
.badge-info {
  background: var(--info-bg);
  color: var(--info);
}
.badge-success {
  background: var(--success-bg);
  color: var(--success);
}
.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}
/* Shares the live badge's palette but without the pulsing dot — this
   marks a blocked member, which is a state, not an event. */
.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: transparent;
}
.badge-live {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 0.35rem;
  animation: badge-live-pulse 1.6s ease-in-out infinite;
}
@keyframes badge-live-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
.badge-accent {
  background: color-mix(in srgb, var(--tenant-accent) 15%, transparent);
  color: var(--tenant-accent);
  font-weight: 700;
}

/* =========================================================
   MISC CONTENT BLOCKS
   ========================================================= */
.upload-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

.module-block {
  text-align: left;
  margin-bottom: 1.5rem;
}

/* The lesson's content area — a surface behind the video/PDF/prose so
   it reads as a deliberate stage rather than markup floating on the
   page background. */
.lesson-stage {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--inset-hi);
  margin-bottom: 1.5rem;
}
.lesson-footer-action {
  display: flex;
  justify-content: center;
  padding-bottom: 1rem;
}

.lesson-text {
  text-align: left;
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 15.5px;
  color: var(--text);
  max-width: 72ch;
  margin: 0 auto;
}

.session-actions {
  margin-bottom: 1rem;
  text-align: left;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.slow-mode-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.slow-mode-control select {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-h);
}

.attendee-name {
  flex: 1;
}

.student-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}
.student-row-courses {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* =========================================================
   STUDENTS PAGE — search/sort toolbar + card grid, see
   StudentsListPage.tsx
   ========================================================= */
.students-toolbar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.students-search {
  flex: 1;
  max-width: 320px;
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-h);
}
.students-toolbar select {
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-h);
}

.student-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.student-card-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.student-avatar {
  width: 36px;
  height: 36px;
  font-size: 12.5px;
}
.student-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}
.student-card-header strong {
  font-family: var(--heading);
  font-size: 14.5px;
  color: var(--text-h);
}
.student-email {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.student-card-courses {
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}
/* The header block is the link into that student's progress detail. */
a.student-card-top {
  color: inherit;
  text-decoration: none;
  margin: -0.35rem -0.5rem 0;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s var(--ease);
}
a.student-card-top:hover {
  background: var(--surface-hover);
  text-decoration: none;
}

/* =========================================================
   QR — student card + staff scanner
   ========================================================= */
.qr-code {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.qr-code canvas {
  display: block;
  border-radius: var(--radius-xs);
}
.qr-code-caption {
  font-size: 13px;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.qr-scanner {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.qr-scanner-stage {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 3;
  max-height: 340px;
}
.qr-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* A framing guide so staff know where to hold the card. */
.qr-scanner-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(52%, 190px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.qr-scanner-stop {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.qr-scanner-stop:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
}
.qr-scanner-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
  padding: 1.75rem 1.25rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.qr-scanner-idle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--tenant-accent);
}
.qr-scanner-idle p {
  max-width: 44ch;
}
.qr-scanner-manual {
  margin-top: 0;
}

.scan-result {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  color: var(--success);
  font-size: 13.5px;
}
.scan-result strong {
  color: var(--text-h);
}
.scan-result.is-repeat {
  background: var(--warning-bg);
  color: var(--warning);
}

/* =========================================================
   ATTENDANCE — register roster + student pass
   ========================================================= */
.attendance-create-form {
  max-width: 560px;
}

.attendance-roster li {
  padding: 0;
  border-bottom: 1px solid var(--border);
}
/* The whole row is the control — tapping anywhere cycles the status,
   which matters when marking forty students on a phone. */
.attendance-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  margin: 0 -0.75rem;
  width: calc(100% + 1.5rem);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  text-align: left;
  font-weight: 500;
}
.attendance-row:hover:not(:disabled) {
  background: var(--surface-hover);
  transform: none;
  border-color: transparent;
}
.attendance-row.is-present {
  background: color-mix(in srgb, var(--success) 8%, transparent);
}
.attendance-row.is-late {
  background: color-mix(in srgb, var(--warning) 8%, transparent);
}
.attendance-row.is-absent {
  opacity: 0.62;
}
.attendance-row-time {
  flex-shrink: 0;
  min-width: 7.5rem;
  text-align: right;
}

.attendance-pass {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 220px at 100% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm), var(--inset-hi);
}
.attendance-pass-body {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.attendance-rate {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* =========================================================
   FEES
   ========================================================= */
.fee-form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.75rem;
}
.fee-form-row label {
  margin: 0;
}

.fee-student-picker {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}
.fee-student-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
  font-size: 13px;
  color: var(--text-h);
}
.fee-student-picker-actions {
  display: flex;
  gap: 0.25rem;
}
.fee-student-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 190px;
  overflow-y: auto;
}
.fee-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.7rem;
  font-size: 12.5px;
  font-weight: 550;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: none;
}
.fee-chip:hover:not(:disabled) {
  transform: none;
  border-color: var(--border-strong);
}
.fee-chip.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent-ring);
  color: var(--tenant-accent);
}

.fee-row {
  gap: 0.7rem;
  align-items: center;
}
.fee-row-main {
  flex: 1;
  min-width: 140px;
}
.fee-row-main strong {
  font-size: 13.5px;
  color: var(--text-h);
}
.fee-row-main p {
  margin-top: 0.1rem;
}
.fee-row-money {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  min-width: 5.5rem;
}
.fee-row-money strong {
  font-family: var(--heading);
  font-size: 14.5px;
  color: var(--text-h);
  letter-spacing: -0.02em;
}
.fee-row-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .fee-form-row {
    grid-template-columns: 1fr;
  }
  .fee-row {
    flex-wrap: wrap;
  }
  .fee-row-actions {
    width: 100%;
    padding-top: 0.4rem;
  }
  .attendance-row-time {
    display: none;
  }
}

/* =========================================================
   STUDENT PROGRESS DETAIL — see StudentProgressPage.tsx
   ========================================================= */
.progress-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(500px 180px at 100% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm), var(--inset-hi);
}
.progress-summary strong {
  font-family: var(--heading);
  font-size: 16px;
  color: var(--text-h);
}
.progress-summary p {
  margin-top: 0.15rem;
}

.progress-lesson-list li {
  gap: 0.65rem;
}
.progress-lesson-stat {
  flex-shrink: 0;
}
.progress-lesson-time {
  min-width: 6.5rem;
  text-align: right;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .progress-lesson-time {
    min-width: 0;
    text-align: left;
  }
}

.student-card-courses {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.student-course-row {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 0.4rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}
.student-course-row:hover {
  background: var(--surface-hover);
  text-decoration: none;
}
.student-course-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-h);
  margin-bottom: 0.3rem;
}

.item-card-progress {
  margin-bottom: 0.4rem;
}

.progress-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-hover);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--tenant-accent);
  border-radius: inherit;
}

.color-field {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.color-field input[type='color'] {
  width: 44px;
  height: 38px;
  padding: 0.2rem;
  flex-shrink: 0;
}
.color-field input[type='text'],
.color-field input:not([type]) {
  flex: 1;
}

.domain-verify-card {
  max-width: 420px;
}
.domain-verify-card code {
  word-break: break-all;
}
.domain-verify-card button {
  margin-top: 0.75rem;
}

.data-request-row {
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.data-request-info {
  flex: 1;
  min-width: 0;
}
.data-request-info p {
  margin-top: 0.25rem;
}

.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}
.star-rating-star {
  background: none;
  border: none;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--border);
  cursor: default;
}
button.star-rating-star {
  cursor: pointer;
}
.star-rating-star.filled {
  color: var(--warning);
}
.star-rating-count {
  margin-left: 0.4rem;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* =========================================================
   COURSE CHAT ROOM — persistent per-course discussion, reuses the
   live-session .chat-panel shell, see CourseChatRoom.tsx
   ========================================================= */
.course-chat-room {
  max-width: 640px;
  margin-bottom: 1.5rem;
}
.course-chat-messages {
  max-height: 340px;
}
.course-chat-message {
  position: relative;
  padding: 0.5rem 1.75rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.course-chat-message:last-of-type {
  border-bottom: none;
}
.course-chat-delete {
  position: absolute;
  top: 0.3rem;
  right: 0;
  padding: 0.1rem 0.4rem;
  font-size: 15px;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.course-chat-message:hover .course-chat-delete {
  opacity: 1;
}

/* =========================================================
   DOUBTS + ANNOUNCEMENTS — shared card list shape
   ========================================================= */
.doubt-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.doubt-ask-form {
  max-width: 560px;
  margin-bottom: 2rem;
}
.doubt-card {
  transition:
    border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}
.doubt-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.doubt-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.doubt-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}
.doubt-card-heading strong {
  font-family: var(--heading);
  font-size: 15px;
  color: var(--text-h);
}
.doubt-card-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--tenant-accent);
  font-size: 11.5px;
  font-weight: 700;
}
.doubt-card-header p {
  margin-top: 0.2rem;
}
.doubt-body {
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 0.75rem;
}
.doubt-replies {
  margin: 0 0 0.75rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--border);
}
.doubt-replies li {
  border-bottom: none;
  padding: 0.4rem 0;
}
.doubt-replies p {
  margin-top: 0.2rem;
  color: var(--text);
  line-height: 1.5;
}
.doubt-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}
.announcement-card .doubt-card-header strong {
  margin-right: 0.5rem;
}
/* Pinned announcements get an accent left edge so they stay findable
   once the list grows past a screenful. */
.announcement-card.is-pinned {
  border-left: 3px solid var(--tenant-accent);
  background: linear-gradient(90deg, var(--accent-softer), transparent 40%), var(--surface);
}
.announcement-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.announcement-icon.is-pinned {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--tenant-accent);
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 520px;
}
.review-form textarea {
  resize: vertical;
}
.review-form button {
  align-self: flex-start;
}

.review-row {
  align-items: flex-start;
}
.review-row-body {
  flex: 1;
  min-width: 0;
}
.review-row-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.review-row-top strong {
  font-size: 13.5px;
  color: var(--text-h);
}
.review-row-time {
  margin-left: auto;
}

/* Checkout — price on the left, coupon + buy on the right, so the
   amount is legible before the eye reaches the button. */
.checkout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.checkout-price {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.checkout-fields {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.checkout-fields .search-field {
  min-width: 190px;
}
.checkout-section {
  border-color: var(--accent-ring);
  background: linear-gradient(180deg, var(--accent-softer), transparent 60%), var(--surface);
}

/* Legacy aliases — a few pages still render .card variants of these. */
.checkout-card {
  max-width: 380px;
  margin-bottom: 1.5rem;
}
.review-form-card {
  max-width: 480px;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.review-form-card textarea {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-h);
}
.review-form-card button {
  align-self: flex-start;
}

/* =========================================================
   OVERVIEW DASHBOARDS — teacher/student home page, see
   TeacherOverviewPage.tsx / StudentOverviewPage.tsx
   ========================================================= */
.overview-header h1 {
  margin-bottom: 0.3rem;
}

.overview-stats {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 1.5rem;
}
.overview-stat {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.overview-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.overview-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 16px;
  border-radius: 999px;
}
.overview-stat-icon-accent {
  background: color-mix(in srgb, var(--tenant-accent) 15%, transparent);
}
.overview-stat-icon-success {
  background: var(--success-bg);
}
.overview-stat-icon-warning {
  background: var(--warning-bg);
}
.overview-stat-value {
  font-family: var(--heading);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-h);
}

.overview-chart-card,
.overview-actions-card,
.overview-recent-card {
  margin-bottom: 1.5rem;
}
.overview-chart-card h3,
.overview-actions-card h3 {
  margin-bottom: 1rem;
}

.sparkline-svg {
  width: 100%;
  height: 160px;
  display: block;
}
.sparkline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 12px;
  color: var(--text-muted);
}

.overview-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.overview-recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.overview-recent-name {
  font-weight: 500;
  color: var(--text-h);
}
.overview-recent-time {
  margin-left: auto;
}

.analytics-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.analytics-course-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0.9rem 0.15rem;
}
.analytics-course-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.analytics-course-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.analytics-course-top a {
  font-family: var(--heading);
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text-h);
}
.analytics-course-top a:hover {
  color: var(--tenant-accent);
}
.analytics-course-stats {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.analytics-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.analytics-stat-value {
  font-family: var(--heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-h);
}
.analytics-stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* =========================================================
   LIVE SESSION ROOM — video/content main column + chat/poll rail
   ========================================================= */
.session-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .session-layout {
    grid-template-columns: 1fr;
  }
}

.session-main {
  min-width: 0;
}
.session-recording-note {
  margin-bottom: 0.6rem;
}

/* =========================================================
   STREAM SETUP — the "paste your YouTube Live link here" card shown
   in place of the video before a teacher goes live, see
   StreamSetupCard.tsx
   ========================================================= */
.stream-setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: left;
}
.stream-steps {
  margin: 0.75rem 0 1rem;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}
.stream-thumb {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.stream-setup-linked {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stream-setup-linked .stream-thumb {
  width: 120px;
  max-width: 120px;
  margin-top: 0;
  flex-shrink: 0;
}

.session-rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 1.5rem;
}

/* Stable wrapper — the YouTube Player API replaces the mount div
   inside it with its own <iframe>, discarding any className we put
   directly on that div, so sizing targets whatever ends up inside via
   a descendant selector instead. */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-container {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Our own fullscreen target — see VideoFrame.tsx. YouTube's native
   fullscreen button is disabled (fs=0) specifically so this is the
   only path in, keeping the watermark inside the fullscreened element
   instead of left behind as a sibling of the player. */
.video-container:fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 0;
}
.video-container:fullscreen .video-embed {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.video-controls {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  left: 0.6rem;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}
.video-controls button {
  font-size: 12px;
  padding: 0.3rem 0.65rem;
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.video-controls button:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.75);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Sits between the iframe (z-index: auto) and everything else — blocks
   every click from reaching YouTube's own UI, since our .video-controls
   buttons (above this) are the only intended way to control playback. */
.video-click-blocker {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
  cursor: default;
}

.watermark-overlay {
  position: absolute;
  pointer-events: none;
  user-select: none;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--mono);
  transition:
    top 1s ease,
    left 1s ease,
    right 1s ease,
    bottom 1s ease;
  z-index: 2;
}

/* =========================================================
   PANELS (chat, poll) — used stacked in .session-rail
   ========================================================= */
.panel,
.chat-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.panel h3,
.chat-panel h3 {
  margin-bottom: 0.75rem;
}

.chat-messages {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.chat-message {
  font-size: 13.5px;
  line-height: 1.4;
}
.chat-message strong {
  color: var(--text-h);
}

.poll-current {
  margin-bottom: 1rem;
}

/* =========================================================
   QUIZ
   ========================================================= */
.quiz-question {
  text-align: left;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.quiz-question:last-of-type {
  border-bottom: none;
}

/* =========================================================
   PDF VIEWER
   ========================================================= */
.pdf-viewer {
  margin-top: 1rem;
}
.pdf-viewer canvas {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.pdf-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* =========================================================
   MODAL — used by ConfirmDialog and directly for any custom dialog
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 14, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  text-align: left;
}
.modal-title {
  margin-bottom: 0.75rem;
}
.modal-message {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* =========================================================
   TOASTS — ephemeral success/error feedback, see Toast.tsx
   ========================================================= */
.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
}
.toast {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  color: #fff;
  animation: toast-in 0.15s ease;
}
.toast-success {
  background: var(--success);
}
.toast-error {
  background: var(--danger);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   MOBILE APP SHELL — the fixed sidebar above has no responsive
   behavior on its own; below ~768px it becomes a slide-out drawer
   behind a fixed top bar. See AppShell.tsx.
   ========================================================= */
.mobile-topbar {
  display: none;
}
.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.4rem;
    padding: 0 0.85rem;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 60;
  }
  .mobile-nav-toggle {
    padding: 0.45rem;
    box-shadow: none;
  }
  .mobile-topbar-brand {
    flex: 1;
    min-width: 0;
    font-family: var(--heading);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-h);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 272px;
    max-width: 82vw;
    height: 100dvh;
    background: var(--surface);
    backdrop-filter: none;
    transform: translateX(-100%);
    transition: transform 0.24s var(--ease);
    z-index: 70;
    box-shadow: var(--shadow-lg);
  }
  .sidebar-open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 18, 0.55);
    backdrop-filter: blur(2px);
    z-index: 65;
  }

  .main-content {
    padding: calc(3.4rem + 1.25rem) 1.15rem 3rem;
  }

  /* The footer copy already carries a toggle; the top bar's is the
     reachable one while the drawer is shut. */
  .sidebar-footer-row .theme-toggle {
    display: none;
  }
}

/* The top bar only exists in the drawer layout. */
@media (min-width: 901px) {
  .mobile-topbar {
    display: none;
  }
}

/* =========================================================
   LANDING PAGE — root-domain marketing page, see LandingPage.tsx
   ========================================================= */
/* The landing page used to hard-pin a dark palette regardless of
   theme. Now that there's a real light/dark toggle, an override here
   would strand anyone who picked light on a page that ignored them —
   so it follows the tokens like everything else. */
.landing-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0 2.5rem;
}
.landing-header-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.landing-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.landing-page .btn-primary {
  border-radius: 999px;
}
.landing-brand {
  font-family: var(--heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-h);
}

.landing-section-title {
  text-align: center;
  margin-bottom: 2rem;
}

/* Two-column hero: copy left, product mockup right. The old centred
   single column left a lot of empty space and had nothing to look at. */
.landing-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: 3rem;
  padding: 3.5rem 0 4rem;
  border-bottom: 1px solid var(--border);
}
.landing-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: -10%;
  width: 720px;
  height: 460px;
  background: radial-gradient(
    ellipse,
    color-mix(in srgb, var(--tenant-accent) 24%, transparent),
    transparent 70%
  );
  filter: blur(30px);
  z-index: -1;
  pointer-events: none;
}
.landing-hero-text {
  min-width: 0;
}

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 12.5px;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--tenant-accent);
  margin-bottom: 1.5rem;
}

.landing-hero h1 {
  font-size: 46px;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
}

/* --- Product mockups ---------------------------------------------------
   Vector, theme-aware, drawn in LandingMockups.tsx. Tilted slightly and
   given real elevation so they read as a screen rather than a diagram. */
.landing-hero-visual {
  min-width: 0;
  perspective: 1400px;
}
.mock-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.landing-hero-visual .mock-svg {
  transform: rotateY(-9deg) rotateX(3deg);
  transform-origin: left center;
}
.landing-gradient-text {
  background: linear-gradient(120deg, var(--tenant-accent), #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-subhead {
  font-size: 17px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 2rem;
}
.landing-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.landing-final-cta .landing-hero-actions {
  justify-content: center;
}
.landing-hero-actions .btn-primary,
.landing-final-cta .btn-primary {
  padding: 0.9rem 2rem;
  font-size: 15.5px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--tenant-accent), color-mix(in srgb, var(--tenant-accent) 60%, #7c3aed));
  border-color: transparent;
  box-shadow: 0 8px 28px -8px color-mix(in srgb, var(--tenant-accent) 65%, transparent);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.landing-hero-actions .btn-primary:hover,
.landing-final-cta .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -6px color-mix(in srgb, var(--tenant-accent) 75%, transparent);
}
.landing-existing-note {
  margin-top: 1.5rem;
}

.landing-features {
  padding: 3rem 0 1rem;
}
.landing-feature {
  text-align: left;
}
.landing-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 19px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--tenant-accent) 10%, transparent);
  margin-bottom: 0.85rem;
}
.landing-feature p {
  margin-top: 0.5rem;
}

/* =========================================================
   PROBLEM / SOLUTION — short before/after pairs, real pain points
   coaching institutes actually have, see LandingPage.tsx
   ========================================================= */
.landing-problems {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}
.landing-problems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.landing-problem-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}
.landing-problem-text {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  min-height: 42px;
}
.landing-problem-arrow {
  color: var(--tenant-accent);
  font-size: 18px;
  margin: 0.75rem 0;
}
.landing-solution-text {
  color: var(--text-h);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.5;
}

/* =========================================================
   FEATURE SHOWCASE — alternating text/visual rows
   ========================================================= */
.landing-showcase {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.landing-showcase-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0;
}
.landing-showcase-row.reverse {
  grid-template-columns: 0.9fr 1.1fr;
}
.landing-showcase-row.reverse .landing-showcase-visual {
  order: -1;
}
.landing-showcase-text h3 {
  font-size: 22px;
  margin-bottom: 0.75rem;
}
.landing-showcase-text p {
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
}
.landing-showcase-visual {
  min-width: 0;
}

/* =========================================================
   LANDING — capability grid + how-it-works steps
   ========================================================= */
.landing-capabilities {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}
.landing-capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.landing-capability {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--inset-hi);
  transition:
    transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.landing-capability:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--tenant-accent) 32%, var(--border));
}
.landing-capability-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--tenant-accent);
}
.landing-capability h3 {
  font-size: 15px;
  margin-bottom: 0.35rem;
}
.landing-capability p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

.landing-steps {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}
.landing-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}
.landing-step {
  position: relative;
  padding-left: 3.25rem;
}
.landing-step-number {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-family: var(--heading);
  font-size: 16px;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}
.landing-step h3 {
  font-size: 16px;
  margin-bottom: 0.4rem;
  padding-top: 0.5rem;
}
.landing-step p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.landing-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.landing-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* =========================================================
   FINAL CTA
   ========================================================= */
.landing-final-cta {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  padding: 4rem 1rem;
  border-top: 1px solid var(--border);
}
.landing-final-cta h2 {
  font-size: 28px;
  margin-bottom: 0.75rem;
}
.landing-final-cta .btn-primary {
  margin-top: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 15.5px;
}

.landing-footer {
  text-align: center;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}
.landing-footer-brand {
  font-family: var(--heading);
  font-weight: 700;
  color: var(--text-h);
  margin-bottom: 0.5rem;
}

/* The hero and showcase both need to stack well before the phone
   breakpoint — a 400px-wide mockup beside body copy stops working
   around the tablet mark. */
@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    padding-top: 2.5rem;
  }
  .landing-hero-visual .mock-svg {
    transform: none;
  }
  .landing-showcase-row,
  .landing-showcase-row.reverse {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .landing-showcase-row.reverse .landing-showcase-visual {
    order: 0;
  }
}

@media (max-width: 640px) {
  .landing-hero h1 {
    font-size: 31px;
  }
  .landing-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .landing-hero-actions .btn-lg {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   TENANT STOREFRONT — public per-institute page, reuses most
   .landing-* classes above, see TenantStorefrontPage.tsx
   ========================================================= */
.storefront-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.storefront-logo {
  max-height: 28px;
}
.storefront-header-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.storefront-hero h1 {
  font-size: 34px;
}
.storefront-hero-banner {
  position: relative;
  max-width: none;
  margin: 0 -1.5rem 2rem;
  padding: 4rem 1.5rem;
  background-size: cover;
  background-position: center;
  border-radius: 0;
  border-bottom: none;
}
.storefront-hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.55);
}
.storefront-hero-content {
  position: relative;
  z-index: 1;
}
.storefront-hero-banner h1,
.storefront-hero-banner .landing-subhead {
  color: #ffffff;
}

.storefront-about,
.storefront-contact {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
}
.storefront-about p,
.storefront-contact p {
  color: var(--text);
  line-height: 1.6;
  margin-top: 0.5rem;
}
.storefront-course-card {
  display: flex;
  flex-direction: column;
}
.storefront-course-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}
.storefront-course-price {
  margin-top: 0.75rem;
  align-self: flex-start;
}

/* =========================================================
   BASELINE PAGE RHYTHM

   Most pages still lay themselves out as a bare stack of <h1>/<h2>
   with content directly underneath and no wrapper. That's the single
   biggest reason they read as unstyled — nothing separated a heading
   from the block above it. Rather than rewrite all 39 pages at once,
   these rules give the raw stack a real vertical rhythm, so a page
   looks deliberate whether or not it's been migrated to
   PageHeader/Section. Migrated pages override via their own classes.
   ========================================================= */
.main-inner > h1:first-child {
  margin-bottom: 1.5rem;
}
.main-inner > h2,
.main-inner > div > h2 {
  margin: 2.25rem 0 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}
.main-inner > h2:first-child,
.main-inner > div > h2:first-child {
  margin-top: 0;
}
/* A heading immediately after a page title belongs to it, so it
   shouldn't get the full section gap. */
.main-inner .page-head + h2,
.main-inner .page-header + h2 {
  margin-top: 0.5rem;
}
.main-inner > h3,
.main-inner > div > h3 {
  margin: 1.5rem 0 0.6rem;
}
.main-inner > p,
.main-inner > div > p {
  margin-bottom: 0.5rem;
}
.main-inner > form,
.main-inner > div > form {
  margin-bottom: 1.5rem;
}

.boot-error {
  max-width: 480px;
  margin: 12vh auto;
  padding: 0 1.25rem;
}

/* =========================================================
   PAGE HEAD — see PageHeader.tsx. Replaces the ad hoc <h1> + button
   row each page used to roll on its own.
   ========================================================= */
.page-head {
  margin-bottom: 1.75rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  transition: color 0.15s var(--ease);
}
.back-link:hover {
  color: var(--tenant-accent);
  text-decoration: none;
}
.page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.page-head-titles {
  min-width: 0;
  flex: 1;
}
.page-head-titles h1 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 27px;
}
.page-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--tenant-accent);
}
.page-head-sub {
  margin-top: 0.45rem;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 68ch;
}
.page-head-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.page-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* =========================================================
   SECTION — a titled content band, see Section.tsx
   ========================================================= */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--inset-hi);
  padding: 1.25rem 1.35rem 1.35rem;
  margin-bottom: 1.5rem;
}
.section-bare {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-head-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.section-head-title h2 {
  font-size: 17px;
  font-weight: 700;
}
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--tenant-accent);
}
.section-desc {
  margin-top: 0.2rem;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.section-aside {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* =========================================================
   LOADERS
   ========================================================= */
.spinner {
  display: inline-block;
  border: 2px solid var(--border-strong);
  border-top-color: var(--tenant-accent);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 55vh;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 550;
}

/* Content-shaped placeholders — a shimmering block reads as "loading"
   far better than a centred spinner once the page frame is already up. */
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--surface-sunken) 25%,
    var(--surface-hover) 37%,
    var(--surface-sunken) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  from {
    background-position: 100% 50%;
  }
  to {
    background-position: 0 50%;
  }
}
.skeleton-text {
  height: 12px;
  margin-bottom: 0.5rem;
}
.skeleton-card {
  height: 132px;
}

/* =========================================================
   PROGRESS RING — see ProgressRing.tsx
   ========================================================= */
.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.progress-ring-track {
  stroke: var(--surface-sunken);
}
.progress-ring-bar {
  stroke: var(--tenant-accent);
  transition: stroke-dashoffset 0.6s var(--ease);
}
.progress-ring-label {
  position: absolute;
  font-family: var(--heading);
  font-weight: 700;
  color: var(--text-h);
  letter-spacing: -0.02em;
}

.progress-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: inherit;
  transition: width 0.5s var(--ease);
}

/* =========================================================
   TABS — in-page switcher, see CourseViewPage.tsx
   ========================================================= */
.tabs {
  display: flex;
  gap: 0.2rem;
  padding: 0.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.tab:hover:not(:disabled) {
  background: transparent;
  color: var(--text-h);
  transform: none;
  border-color: transparent;
}
.tab.is-active {
  background: var(--surface);
  color: var(--text-h);
  box-shadow: var(--shadow-sm);
}
.tab-count {
  padding: 0.05rem 0.35rem;
  border-radius: var(--radius-full);
  background: var(--surface-hover);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.tab.is-active .tab-count {
  background: var(--accent-soft);
  color: var(--tenant-accent);
}

/* =========================================================
   COURSE HERO — the banner at the top of a course page
   ========================================================= */
.course-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--inset-hi);
  margin-bottom: 1.5rem;
}
.course-hero-cover {
  height: 148px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-sunken);
}
/* No cover art uploaded — a generated gradient beats a grey rectangle. */
.course-hero-cover-fallback {
  background-image: var(--accent-gradient-warm);
  position: relative;
}
.course-hero-cover-fallback::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 200px at 18% 120%, rgba(255, 255, 255, 0.28), transparent 70%),
    radial-gradient(300px 180px at 85% -20%, rgba(255, 255, 255, 0.22), transparent 70%);
}
.course-hero-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 1.5rem 1.5rem;
  flex-wrap: wrap;
}
.course-hero-main {
  flex: 1;
  min-width: 240px;
}
.course-hero-main h1 {
  font-size: 26px;
  margin-bottom: 0.5rem;
}
.course-hero-desc {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  max-width: 62ch;
}
.course-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}
.course-hero-side {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.course-hero-progress {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.course-hero-progress-text strong {
  display: block;
  font-family: var(--heading);
  font-size: 13.5px;
  color: var(--text-h);
}
.course-hero-progress-text span {
  font-size: 12px;
  color: var(--text-muted);
}

.price-tag {
  font-family: var(--heading);
  font-size: 19px;
  font-weight: 800;
  color: var(--text-h);
  letter-spacing: -0.03em;
}

/* "/ month" after a recurring price — deliberately quieter than the
   figure, so the amount still reads first. */
.price-period {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
}

/* =========================================================
   NOTICE — an inline informational callout (limitations, caveats)
   ========================================================= */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  background: var(--info-bg);
}
.notice-icon {
  color: var(--info);
  flex-shrink: 0;
  margin-top: 1px;
}
.notice p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.notice strong {
  color: var(--text-h);
}

/* =========================================================
   PLATFORM ADMIN — root-domain operator view.
   Uses the app's own tokens, not the landing page's paper palette:
   this is a working surface, not marketing.
   ========================================================= */
.admin-shell {
  min-height: 100vh;
  min-height: 100dvh;
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.5rem;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.admin-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.admin-brand strong {
  display: block;
  font-family: var(--heading);
  font-size: 14px;
  color: var(--text-h);
  line-height: 1.2;
}
.admin-brand span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.admin-main {
  padding: 2rem 1.5rem 4rem;
}
.admin-toolbar {
  margin-bottom: 0;
}

/* --- top-bar tabs --------------------------------------------------- */
.admin-tabs {
  display: flex;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  overflow-x: auto;
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.admin-tab:hover:not(:disabled) {
  background: transparent;
  color: var(--text-h);
  transform: none;
  border-color: transparent;
}
.admin-tab.is-active {
  background: var(--surface);
  color: var(--tenant-accent);
  box-shadow: var(--shadow-sm);
}
.admin-whoami {
  max-width: 15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.admin-section-head h1 {
  font-size: 25px;
  margin-bottom: 0.3rem;
}
.admin-section-head .toolbar {
  margin-bottom: 0;
}

/* --- institute cards ------------------------------------------------ */
.admin-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.admin-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--inset-hi);
  transition:
    border-color 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}
.admin-card:hover {
  border-color: color-mix(in srgb, var(--tenant-accent) 32%, var(--border));
  box-shadow: var(--shadow-md);
}
.admin-card.is-suspended {
  opacity: 0.62;
  border-style: dashed;
}
/* The identity block is the click target for the detail panel. */
.admin-card-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  text-align: left;
}
.admin-card-main:hover:not(:disabled) {
  background: transparent;
  transform: none;
  border-color: transparent;
}
.admin-card-avatar {
  width: 36px;
  height: 36px;
  font-size: 12.5px;
}
.admin-card-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.admin-card-text strong {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--heading);
  font-size: 14.5px;
  color: var(--text-h);
}
.admin-card-text .auth-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-card-metrics {
  display: flex;
  gap: 0.85rem;
  flex-shrink: 0;
}
.admin-card-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.admin-card-metrics .icon {
  color: var(--text-faint);
}
.admin-card-time {
  flex-shrink: 0;
  min-width: 6.5rem;
  text-align: right;
}
.admin-card-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.admin-card-actions a.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.55rem;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}
.admin-card-actions a.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-h);
  text-decoration: none;
}

.admin-memberships {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- institute detail modal ----------------------------------------- */
.admin-detail {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.admin-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.admin-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--tenant-accent);
}
.admin-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.admin-detail-stats > div {
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  text-align: center;
}
.admin-detail-stats strong {
  display: block;
  font-family: var(--heading);
  font-size: 20px;
  color: var(--text-h);
  line-height: 1.1;
}
.admin-detail-stats span {
  font-size: 11px;
  color: var(--text-muted);
}
.admin-detail-h {
  margin-top: 0.4rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.admin-member-list {
  max-height: 190px;
  overflow-y: auto;
  margin-bottom: 0;
}
.admin-detail-note {
  margin-top: -0.3rem;
}
.admin-detail-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.admin-danger {
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.admin-danger p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.admin-danger strong {
  color: var(--danger);
}

/* --- sparkline polish ----------------------------------------------- */
.sparkline-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.sparkline-total {
  font-family: var(--heading);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-h);
  line-height: 1;
}
.sparkline-caption {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Standalone sign-in / no-access card for the admin area. */
.admin-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1.25rem;
}
.admin-auth-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--inset-hi);
}
.admin-auth-card h1 {
  font-size: 22px;
}
.admin-auth-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-h);
}
.admin-auth-card input {
  font: inherit;
  font-size: 14px;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-h);
}
.admin-auth-card input:focus {
  outline: none;
  border-color: var(--tenant-accent);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}
.admin-auth-card .btn-primary {
  width: 100%;
  margin-top: 0.35rem;
}

@media (max-width: 1100px) {
  .admin-topbar {
    flex-wrap: wrap;
  }
  .admin-tabs {
    order: 3;
    width: 100%;
  }
  .admin-whoami {
    display: none;
  }
}

@media (max-width: 860px) {
  .admin-card {
    flex-wrap: wrap;
  }
  .admin-card-main {
    flex-basis: 100%;
  }
  .admin-card-time {
    display: none;
  }
  .admin-card-actions {
    margin-left: auto;
  }
  .admin-memberships {
    display: none;
  }
  .admin-detail-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .admin-topbar {
    padding: 0.6rem 1rem;
  }
  .admin-main {
    padding: 1.5rem 1rem 3rem;
  }
}

/* =========================================================
   CONTENT PROTECTION — desktop-only gate, capture warning,
   settings choice. See PlatformGate.tsx / useContentProtection.ts
   ========================================================= */
.desktop-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 3rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(500px 200px at 50% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm), var(--inset-hi);
}
.desktop-gate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin-bottom: 0.3rem;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--tenant-accent);
}
.desktop-gate h2 {
  font-size: 20px;
}
.desktop-gate p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 46ch;
}
.desktop-gate-actions {
  margin-top: 0.85rem;
}
.desktop-gate-note {
  margin-top: 0.5rem;
}

/* Deliberately loud: the deterrent only works if the student sees that
   the attempt was noticed and attributed to them. */
.capture-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13.5px;
  line-height: 1.55;
}
.capture-warning strong {
  color: var(--danger);
}
.capture-warning span {
  color: var(--text);
}

.protect-toggle {
  align-items: flex-start !important;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}
.protect-toggle strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-h);
  margin-bottom: 0.2rem;
}
.protect-toggle .auth-hint {
  display: block;
  font-weight: 400;
}

.alert-list li {
  gap: 0.6rem;
}
.alert-time {
  margin-left: auto;
  white-space: nowrap;
}

/* =========================================================
   TERMS CONSENT — the checkbox on every signup path.
   See TermsConsent.tsx
   ========================================================= */
.terms-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  cursor: pointer;
}
.terms-consent input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--tenant-accent);
  cursor: pointer;
}
.terms-consent a {
  color: var(--tenant-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =========================================================
   LEGAL PAGES — /terms and /privacy
   ========================================================= */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}
.legal-head {
  margin-bottom: 1.5rem;
}
.legal-head h1 {
  font-size: 30px;
  margin: 0.5rem 0 0.3rem;
}
.legal-body h2 {
  font-size: 17px;
  margin: 2rem 0 0.6rem;
}
.legal-body h2:first-child {
  margin-top: 0;
}
.legal-body p {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text);
}

/* =========================================================
   STOREFRONT EDITOR — template picker + repeatable rows.
   See StorefrontSettingsPage.tsx
   ========================================================= */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
}
.tpl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
}
.tpl-card:hover:not(:disabled) {
  border-color: var(--border-strong);
  transform: none;
  background: var(--surface);
}
.tpl-card.is-active {
  border-color: var(--tenant-accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.tpl-card strong {
  font-family: var(--heading);
  font-size: 14px;
  color: var(--text-h);
}
.tpl-blurb {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.45;
}
.tpl-check {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--tenant-accent);
  color: var(--tenant-accent-contrast);
}

/* Miniature of each template, drawn with plain boxes — cheaper and
   always accurate to the tokens, unlike a screenshot that would go
   stale the moment a template changed. */
.tpl-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  padding: 5px;
  background: var(--surface-sunken);
}
.tpl-preview .tpl-bar {
  display: block;
  height: 6px;
  border-radius: 2px;
  background: var(--border-strong);
  margin-bottom: 4px;
}
.tpl-preview .tpl-hero {
  display: block;
  height: 34%;
  border-radius: 3px;
  background: var(--accent-soft);
  margin-bottom: 4px;
}
.tpl-preview .tpl-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  height: 32%;
}
.tpl-preview .tpl-cards span {
  border-radius: 3px;
  background: var(--border-strong);
  opacity: 0.7;
}
.tpl-preview-bold {
  background: #0a0c17;
}
.tpl-preview-bold .tpl-bar,
.tpl-preview-bold .tpl-cards span {
  background: #343a5e;
  border-radius: 1px;
}
.tpl-preview-bold .tpl-hero {
  background: color-mix(in srgb, var(--tenant-accent) 55%, #0a0c17);
  border-radius: 1px;
  height: 42%;
}
.tpl-preview-minimal .tpl-cards {
  grid-template-columns: 1fr;
  gap: 2px;
}
.tpl-preview-minimal .tpl-cards span {
  border-radius: 0;
  height: 5px;
  align-self: start;
}
.tpl-preview-minimal .tpl-hero {
  background: transparent;
  border-bottom: 1px solid var(--border-strong);
  height: 30%;
}
.tpl-preview-academy .tpl-hero,
.tpl-preview-academy .tpl-cards span {
  border-radius: 6px;
}

/* Repeatable editor rows (highlights, FAQ). */
.repeater {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.repeater-row {
  display: grid;
  grid-template-columns: 7rem 1fr 1.4fr auto;
  gap: 0.45rem;
  align-items: center;
}
.repeater-row input,
.repeater-row select,
.repeater-block input,
.repeater-block textarea {
  font: inherit;
  font-size: 13.5px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-h);
  width: 100%;
}
.repeater-row input:focus,
.repeater-row select:focus,
.repeater-block input:focus,
.repeater-block textarea:focus {
  outline: none;
  border-color: var(--tenant-accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.repeater-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}
.repeater-block-head {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}
.repeater-block textarea {
  resize: vertical;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}
.social-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-h);
}
.social-grid input {
  font: inherit;
  font-size: 13.5px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-h);
}
.social-grid input:focus {
  outline: none;
  border-color: var(--tenant-accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.storefront-save {
  position: sticky;
  bottom: 0;
  padding: 1rem 0 1.5rem;
  background: linear-gradient(to top, var(--bg) 65%, transparent);
}

@media (max-width: 700px) {
  .repeater-row {
    grid-template-columns: 1fr auto;
  }
  .repeater-row select {
    grid-column: 1 / -1;
  }
}

/* =========================================================
   TEACHER INVITES — see TeacherInvites.tsx
   ========================================================= */
.invite-created {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--accent-ring);
  border-radius: var(--radius-md);
  background: var(--accent-softer);
}
.invite-created-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--tenant-accent);
  margin-bottom: 0.7rem;
}
.invite-created-top strong {
  font-size: 13.5px;
  color: var(--text-h);
}
.invite-link {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 12.5px;
  word-break: break-all;
  /* Selectable so a blocked clipboard API still leaves a usable path. */
  user-select: all;
}
.invite-created-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}

.invite-list li {
  gap: 0.55rem;
}

/* =========================================================
   MEMBER ROW — team management, see TeamPage.tsx
   ========================================================= */
.member-row {
  gap: 0.7rem;
}
.member-info {
  flex: 1;
  min-width: 0;
}
.member-info strong {
  font-size: 13.5px;
  color: var(--text-h);
}
.member-info p {
  font-size: 12.5px;
  margin-top: 0.1rem;
}
.member-row select {
  font: inherit;
  font-size: 12.5px;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-sunken);
  color: var(--text-h);
}

/* =========================================================
   COURSE CARD — grid tile with cover art, used on both the student
   and teacher course lists
   ========================================================= */
.course-card {
  display: flex;
  flex-direction: column;
  padding: 0;
}
/* The card's own hover rail would sit under the cover image. */
.course-card::after {
  display: none;
}
.course-card-cover {
  position: relative;
  height: 112px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
}
.course-card-cover-fallback {
  background-image: var(--accent-gradient-warm);
}
.course-card-cover-fallback::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(300px 140px at 15% 115%, rgba(255, 255, 255, 0.3), transparent 70%),
    radial-gradient(220px 120px at 88% -15%, rgba(255, 255, 255, 0.25), transparent 70%);
}
.course-card-flag {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(8, 10, 20, 0.68);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.course-card-flag.is-draft {
  background: rgba(8, 10, 20, 0.55);
  color: #fcd34d;
}
.course-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.9rem 1rem 1rem;
  flex: 1;
}
.course-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card-progress {
  margin-top: auto;
  padding-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* =========================================================
   MODULE ACCORDION — course contents
   ========================================================= */
.module-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.module-card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}
.module-card-head:hover:not(:disabled) {
  background: var(--surface-hover);
  transform: none;
  border-color: transparent;
}
.module-card-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  color: var(--tenant-accent);
  font-size: 11.5px;
  font-weight: 700;
}
.module-card-title {
  flex: 1;
  min-width: 0;
  font-family: var(--heading);
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text-h);
}
.module-card-sub {
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.module-card-chevron {
  color: var(--text-faint);
  transition: transform 0.22s var(--ease);
}
.module-card-head[aria-expanded='true'] .module-card-chevron {
  transform: rotate(180deg);
}
.module-card-body {
  padding: 0.25rem 1rem 0.75rem;
  border-top: 1px solid var(--border);
}
.module-card-body .list li:last-child {
  border-bottom: none;
}
.lesson-locked {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.15rem;
  font-size: 13px;
  color: var(--text-muted);
}

/* =========================================================
   COURSE CHAT — message bubbles rather than a flat log
   ========================================================= */
.course-chat-room {
  max-width: none;
  margin-bottom: 0;
}
.course-chat-messages {
  max-height: 380px;
  gap: 0.7rem;
  padding-right: 0.25rem;
}
.course-chat-message {
  position: relative;
  display: flex;
  gap: 0.6rem;
  padding: 0;
  border-bottom: none;
}
.course-chat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  border-radius: var(--radius-full);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
}
.course-chat-message.is-me .course-chat-avatar {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
}
.course-chat-bubble {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}
.course-chat-message.is-me .course-chat-bubble {
  background: var(--accent-softer);
  border-color: var(--accent-ring);
}
.course-chat-byline {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}
.course-chat-byline strong {
  font-size: 12.5px;
  color: var(--text-h);
}
.course-chat-byline span {
  font-size: 11px;
  color: var(--text-faint);
}
.course-chat-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}
.course-chat-delete {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  padding: 0.15rem;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
.course-chat-message:hover .course-chat-delete,
.course-chat-delete:focus-visible {
  opacity: 1;
}
.course-chat-empty {
  padding: 1.25rem 0;
}

/* =========================================================
   STAT TILES — compact metric card used across overview/analytics
   ========================================================= */
.stat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--inset-hi);
  overflow: hidden;
}
.stat-tile::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0.7;
}
.stat-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.stat-tile-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--tenant-accent);
}
.stat-tile-icon-success {
  background: var(--success-bg);
  color: var(--success);
}
.stat-tile-icon-warning {
  background: var(--warning-bg);
  color: var(--warning);
}
.stat-tile-icon-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

/* =========================================================
   GREETING BANNER — the dashboard's first impression
   ========================================================= */
.greeting-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  overflow: hidden;
  padding: 1.6rem 1.75rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(600px 200px at 100% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm), var(--inset-hi);
}
.greeting-eyebrow {
  font-size: 12px;
  font-weight: 650;
  color: var(--tenant-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}
.greeting-banner h1 {
  font-size: 28px;
  margin-bottom: 0.35rem;
}
.greeting-sub {
  font-size: 13.5px;
  color: var(--text-muted);
}
.greeting-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* =========================================================
   QUICK ACTIONS — big tappable destinations
   ========================================================= */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 0.75rem;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--inset-hi);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.quick-action:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--tenant-accent) 32%, var(--border));
}
.quick-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--tenant-accent);
}
.quick-action strong {
  display: block;
  font-family: var(--heading);
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-h);
}
.quick-action span span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Two-up layout for the overview's chart + recent-activity pair. */
.overview-columns {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 860px) {
  .overview-columns {
    grid-template-columns: 1fr;
  }
  .greeting-art {
    display: none;
  }
}
.stat-tile-value {
  font-family: var(--heading);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-h);
  line-height: 1;
}
.stat-tile-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================================================
   TOOLBAR — search + filters above a list
   ========================================================= */
.toolbar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.search-field {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.search-field .icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  padding-left: 2.1rem;
}

@media (max-width: 640px) {
  .course-hero-body {
    flex-direction: column;
  }
  .page-head-titles h1 {
    font-size: 23px;
  }
  .section {
    padding: 1.1rem;
  }
}

/* =========================================================
   PHONE / OTP VERIFICATION
   ========================================================= */

/* The +91 sits inside the field rather than beside it, so the whole
   thing reads as one control and the focus ring wraps both. */
.phone-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  overflow: hidden;
  transition:
    border-color 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}
.phone-input:focus-within {
  background: var(--surface);
  border-color: var(--tenant-accent);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}
.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.7rem;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: var(--surface-2);
  border-right: 1px solid var(--border);
}
/* Override the shared .auth-form input rules — the wrapper owns the
   border and focus ring now, so the input must not draw its own. */
.auth-form .phone-input input,
.form .phone-input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  letter-spacing: 0.04em;
}
.auth-form .phone-input input:focus,
.form .phone-input input:focus {
  border: none;
  box-shadow: none;
  background: transparent;
}

/* Wide-tracked digits so a 6-digit code is easy to read back off the
   SMS without miscounting. */
.otp-input {
  text-align: center;
  font-size: 26px !important;
  letter-spacing: 0.5em;
  text-indent: 0.5em; /* re-centres: tracking adds a gap after the last digit */
  font-variant-numeric: tabular-nums;
  padding: 0.7rem 0.4rem !important;
}

.otp-sent-to {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.2rem;
  padding: 0.6rem 0.75rem;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--success-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.otp-sent-to strong {
  color: var(--text-h);
  font-variant-numeric: tabular-nums;
}
.otp-sent-to svg {
  flex-shrink: 0;
  color: var(--success);
}

/* Verified / unverified chip, used on Account and the student roster. */
.phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.phone-chip svg {
  flex-shrink: 0;
}
.phone-chip.is-verified svg {
  color: var(--success);
}
.phone-chip.is-unverified {
  color: var(--text-faint);
}

/* =========================================================
   DESKTOP SIGN-IN RETURN (/desktop-auth)
   A page nobody should see for more than a second — it exists
   only to bounce a finished Google sign-in into the app.
   ========================================================= */
.auth-return {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--bg);
}
.auth-return-card {
  max-width: 460px;
  padding: var(--space-6);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.auth-return-card h1 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg);
  color: var(--heading);
}
.auth-return-card p {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
  line-height: 1.55;
}
.auth-return-card p:last-child {
  margin-bottom: 0;
}
/* No display override here any more — the base .btn-* rule now gives
   anchors the same inline-flex layout as buttons, and inline-block would
   undo it. text-decoration is handled globally too. */

/* =========================================================
   SIDEBAR COLLAPSE (desktop)
   Narrows the nav to an icon rail. The mobile drawer is a
   separate mechanism — this is hidden below that breakpoint.
   ========================================================= */
/* Sits in the brand row as an ordinary flex item.
   NOT absolutely positioned outside the sidebar: .sidebar is
   `overflow-y: auto`, and per spec setting one overflow axis makes the
   other compute to `auto` too — so a child poking past the right edge
   produced a horizontal scrollbar across the whole nav, and the button
   itself got clipped. */
.sidebar-collapse {
  flex-shrink: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    color 0.16s var(--ease),
    border-color 0.16s var(--ease),
    transform 0.16s var(--ease);
}
.sidebar-collapse:hover {
  color: var(--tenant-accent);
  border-color: var(--tenant-accent);
}
/* Points inward when expanded ("push it away"), outward when collapsed. */
.sidebar-collapse svg {
  transform: rotate(180deg);
  transition: transform 0.18s var(--ease);
}
.nav-collapsed .sidebar-collapse svg {
  transform: rotate(0deg);
}

/* NOTE: do not add `position: relative` to .sidebar here. It already has
   `position: sticky` above, and a later override silently replaced it —
   which detached the sidebar so it scrolled away with the page and
   stopped short of the viewport height. */

.nav-collapsed .sidebar {
  width: 64px;
}
/* Labels go, icons stay. display:none rather than opacity so the flex
   row actually shrinks instead of leaving a 252px-wide ghost. */
.nav-collapsed .sidebar-brand-text,
.nav-collapsed .sidebar-group-label,
.nav-collapsed .sidebar-user-name,
.nav-collapsed .nav-link span,
.nav-collapsed .sidebar-signout span {
  display: none;
}
.nav-collapsed .nav-link,
.nav-collapsed .sidebar-user,
.nav-collapsed .sidebar-footer-row {
  justify-content: center;
}
/* At 64px the 34px logo and the toggle cannot sit side by side, so the
   brand row stacks instead of overflowing. */
.nav-collapsed .sidebar-brand {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.nav-collapsed .sidebar-collapse {
  margin-left: 0;
}
.nav-collapsed .nav-link {
  padding-left: 0;
  padding-right: 0;
}
/* Without a label, the groups run together into one undifferentiated
   column of icons — a rule keeps them readable as sections. */
.nav-collapsed .sidebar-group + .sidebar-group {
  border-top: 1px solid var(--border);
  padding-top: 0.4rem;
}
.nav-collapsed .sidebar-footer-row {
  flex-direction: column;
  gap: 0.4rem;
}

/* The collapse control is desktop-only: below this width the drawer has
   its own toggle in the top bar, and two competing controls is worse
   than one. Matches the breakpoint used by the drawer itself. */
@media (max-width: 900px) {
  .sidebar-collapse {
    display: none;
  }
  .nav-collapsed .sidebar {
    width: auto;
  }
  .nav-collapsed .sidebar-brand-text,
  .nav-collapsed .sidebar-group-label,
  .nav-collapsed .sidebar-user-name,
  .nav-collapsed .nav-link span,
  .nav-collapsed .sidebar-signout span {
    display: initial;
  }
}

/* =========================================================
   STAFF MESSAGES IN CHAT
   A teacher posts as the institute; this marks it so students
   can tell an official answer from a classmate's guess.
   ========================================================= */
.staff-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--tenant-accent-contrast, #fff);
  background: var(--tenant-accent);
  border-radius: var(--radius-full);
  vertical-align: middle;
}
.chat-message.is-staff strong,
.course-chat-message.is-staff .course-chat-byline strong {
  color: var(--tenant-accent);
}
.course-chat-message.is-staff .course-chat-avatar {
  background: var(--tenant-accent);
  color: var(--tenant-accent-contrast, #fff);
}

/* =========================================================
   STUDY PLATFORM CHOICE (institute settings)
   ========================================================= */
.platform-choice {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}
.platform-choice legend {
  padding: 0 0.4rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
}
.platform-choice .protect-toggle {
  margin-top: 0.6rem;
}

.auth-forgot {
  margin: 0.15rem 0 0;
  text-align: center;
}

/* Sparkline with no data — see Sparkline.tsx. Replaces a full-height
   empty grid, which looked like a chart that had failed to load. */
.sparkline-flatline {
  height: 1px;
  margin: 0.9rem 0 0.7rem;
  background: var(--border);
}
.sparkline-empty-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* =========================================================
   VIDEO SEEK BAR + SPEED
   The control row wraps so the seek bar gets a full line of
   its own on narrow players instead of squeezing the buttons.
   ========================================================= */
.video-controls {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  /* Gradient rather than a flat panel: keeps light video frames from
     washing out the controls without boxing them in. */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}

.video-seek {
  flex: 1 1 100%;
  order: -1; /* full-width line above the buttons */
  height: 4px;
  margin: 0 0 0.15rem;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--radius-full);
  background: linear-gradient(
    to right,
    var(--tenant-accent) 0%,
    var(--tenant-accent) var(--seek-pct, 0%),
    rgba(255, 255, 255, 0.28) var(--seek-pct, 0%),
    rgba(255, 255, 255, 0.28) 100%
  );
  cursor: pointer;
}
.video-seek:disabled {
  cursor: default;
  opacity: 0.5;
}
/* Both vendor thumbs need declaring separately — a combined selector is
   dropped wholesale by each engine that doesn't recognise the other. */
.video-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: none;
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.video-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
/* A 4px target is hard to grab; the hit area grows on hover/focus. */
.video-seek:hover,
.video-seek:focus-visible {
  height: 6px;
}
.video-seek:focus-visible {
  outline: 2px solid var(--tenant-accent);
  outline-offset: 3px;
}

.video-time {
  margin-right: auto; /* pushes the buttons to the right edge */
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.video-rate select {
  font: inherit;
  font-size: 12px;
  padding: 0.28rem 0.4rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.video-rate select option {
  /* The dropdown list is drawn by the OS, not over the video — it needs
     app colours or it renders white-on-white in dark mode on Windows. */
  color: var(--text);
  background: var(--surface);
}

/* Visible to screen readers only. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* PDF page holder — the canvas fills the width and the height follows
   the page's aspect ratio, so the bitmap is rasterised at the size it
   is actually displayed rather than being stretched by CSS. */
.pdf-page {
  display: block;
  line-height: 0; /* kills the inline-element gap under the canvas */
}
.pdf-page canvas {
  display: block;
  width: 100%;
  height: auto;
  /* Stops the OS long-press "save image" sheet on touch devices. */
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-drag: none;
}

/* =========================================================
   CAPTURE SHIELD
   Blurs lesson content while the window isn't focused — see
   useCaptureShield.ts for what this does and doesn't cover.
   ========================================================= */
.lesson-stage {
  position: relative;
}

/* The blur goes on the children, not the stage itself: a filter on the
   parent would create a containing block and blur the notice with it.
   No transform here — scaling the stage pushed the video out of its own
   rounded corners and jittered on every toggle. */
.lesson-stage.is-shielded > *:not(.shield-notice) {
  filter: blur(24px) saturate(0.4);
  transition: filter 0.1s ease-out;
  pointer-events: none;
  user-select: none;
}

.shield-notice {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
  border-radius: var(--radius-md);
  /* Near-opaque on purpose. A CSS filter over a cross-origin iframe is
     not something to stake content protection on — if the blur under-
     performs in any browser, this cover still means a screenshot catches
     nothing readable. The blur underneath is the polish, not the barrier. */
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
}
.shield-notice strong {
  font-size: 15px;
  color: var(--heading);
}
.shield-notice span {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* =========================================================
   NOTIFICATION BELL
   Lives in the sidebar footer; the panel opens upward because
   the footer is pinned to the bottom of a full-height column.
   ========================================================= */
.notif {
  position: relative;
  flex-shrink: 0;
}
.notif-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    color 0.16s var(--ease),
    border-color 0.16s var(--ease);
}
.notif-button:hover {
  color: var(--tenant-accent);
  border-color: var(--tenant-accent);
}
.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: var(--danger);
  border-radius: var(--radius-full);
  /* Ring in the sidebar colour so the badge reads as separate from the
     button underneath rather than merging into its border. */
  box-shadow: 0 0 0 2px var(--surface);
}

.notif-panel {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  z-index: 40;
  width: 300px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.notif-panel-head {
  padding: 0.6rem 0.75rem;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.notif-empty {
  margin: 0;
  padding: 1.1rem 0.75rem;
  font-size: 13px;
  text-align: center;
  color: var(--text-faint);
}
.notif-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.notif-list li {
  position: relative;
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
}
.notif-list li:last-child {
  border-bottom: none;
}
.notif-list li.is-unread {
  background: var(--accent-softer);
}
.notif-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.5rem 0.6rem 0.75rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 0;
}
.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-h);
}
.notif-item-body {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
.notif-item-time {
  font-size: 11px;
  color: var(--text-faint);
}
.notif-dismiss {
  align-self: center;
  margin-right: 0.35rem;
  opacity: 0;
  transition: opacity 0.14s var(--ease);
}
/* Revealed on hover, but always present for keyboard users — an action
   that only exists on hover is unreachable without a mouse. */
.notif-list li:hover .notif-dismiss,
.notif-dismiss:focus-visible {
  opacity: 1;
}

/* Collapsed sidebar: the footer stacks, so anchor the panel to the rail. */
.nav-collapsed .notif-panel {
  left: calc(100% + 0.5rem);
  bottom: 0;
}

/* =========================================================
   STUDENT CARD ACTIONS (block / remove / unenrol)
   ========================================================= */
.student-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}
.student-unenroll {
  font-size: 12px;
  padding: 0.28rem 0.45rem;
  max-width: 100%;
  /* Pushes the block/remove buttons to the right so the destructive
     pair sit together, away from the routine course action. */
  margin-right: auto;
}
/* Destructive, but not shouty — it sits next to an everyday action and
   only turns red on approach. */
.btn-danger-ghost {
  color: var(--danger);
}
.btn-danger-ghost:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}
.student-card-header .badge-danger {
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* =========================================================
   MOBILE APP ENTRY (/app) — institute picker for the Android build
   ========================================================= */
.app-entry {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--bg);
}
.app-entry-card {
  width: 100%;
  max-width: 380px;
  padding: var(--space-6) var(--space-5);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.app-entry-mark {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--space-3);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
}
.app-entry-card h1 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  color: var(--heading);
}
.app-entry-sub {
  margin: 0 0 var(--space-4);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
.app-entry-card .auth-form {
  text-align: left;
}

/* =========================================================
   MOBILE / ANDROID APP FIXES
   ========================================================= */
@media (max-width: 900px) {
  /* The notification panel was 300px, absolutely positioned inside a
     sidebar that scrolls. On a phone that overflowed the drawer, and
     because setting one overflow axis makes the other `auto`, the whole
     nav could be dragged sideways — which is what made a notification
     unreadable. Fixed to the viewport instead, so it is always fully on
     screen and never widens its parent. */
  .notif-panel {
    position: fixed;
    left: 0.6rem;
    right: 0.6rem;
    bottom: auto;
    top: calc(3.4rem + env(safe-area-inset-top, 0px) + 0.5rem);
    width: auto;
    max-height: 65dvh;
  }
  .nav-collapsed .notif-panel {
    left: 0.6rem;
    right: 0.6rem;
    top: calc(3.4rem + env(safe-area-inset-top, 0px) + 0.5rem);
    bottom: auto;
  }
  .notif-item-body {
    /* Long messages were being clipped to one unreadable line. */
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Nothing in the drawer may widen it — that sideways scroll again. */
  .sidebar {
    overflow-x: hidden;
  }

  /* The app draws under the status bar, so the fixed top bar and the
     drawer both need the inset or they sit beneath the clock. */
  .mobile-topbar {
    height: calc(3.4rem + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
  .sidebar {
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }
  .main-content {
    padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
  }

  /* Touch targets. 17px icons with tight rows are a desktop density;
     on a phone the nav was fiddly as well as cramped. */
  .nav-link {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    font-size: 14.5px;
  }
  .sidebar-group + .sidebar-group {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
  }
  .sidebar-group-label {
    /* Was near-invisible against the drawer at small sizes. */
    opacity: 0.75;
    letter-spacing: 0.06em;
  }
  .sidebar-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar-footer-row {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
}

/* =========================================================
   PDF VIEWER — zoom + fullscreen
   ========================================================= */
.pdf-nav-spacer {
  flex: 1;
}
.pdf-zoom-label {
  min-width: 3.2rem;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
/* Above 100% the page is wider than the panel, so it has to scroll —
   horizontally as well, which is the whole point of zooming into a
   scanned diagram. */
.pdf-page {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.pdf-viewer.is-fullscreen {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding: 0;
}
.pdf-viewer.is-fullscreen .pdf-page {
  flex: 1;
  min-height: 0;
  border-radius: 0;
}
/* Controls pinned to the bottom in fullscreen, out of the way of the
   page but always reachable. */
.pdf-viewer.is-fullscreen .pdf-nav {
  padding: 0.6rem 0.8rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* The control row wraps on a phone rather than squeezing every button
   into an unusable strip. */
@media (max-width: 640px) {
  .pdf-nav {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .pdf-nav-spacer {
    flex-basis: 100%;
    height: 0;
  }
}

/* =========================================================
   AUTO-HIDING VIDEO CONTROLS
   Fade out during playback, return on any interaction — the
   behaviour every video player has. See VideoFrame.tsx.
   ========================================================= */
.video-controls {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease);
}
.video-controls.is-hidden {
  opacity: 0;
  /* Slides down as it fades, so it reads as leaving rather than
     blinking out. */
  transform: translateY(0.5rem);
  /* Must not stay clickable while invisible — an unseen Pause button
     under the cursor is worse than no button. */
  pointer-events: none;
}
/* Keyboard users must never lose the controls: focusing anything inside
   brings the bar straight back, regardless of the timer. */
.video-controls:focus-within {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Cursor goes too, as it does in any full-screen player. */
.video-container.controls-hidden {
  cursor: none;
}

/* =========================================================
   PDF VIEWER — corrected sizing + tidier toolbar
   The canvas is sized in JS (explicit px, see PdfViewer), so
   the earlier width:100% rule has to give way or zoom cannot
   change anything.
   ========================================================= */
.pdf-page canvas {
  width: auto;
  height: auto;
  /* Centres a page narrower than the panel instead of pinning it left. */
  margin: 0 auto;
}
.pdf-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--surface-sunken);
}
/* Fullscreen: dark surround and the page centred in it, rather than a
   page stuck to the top with a screenful of black underneath. */
.pdf-viewer.is-fullscreen .pdf-page {
  align-items: center;
  background: #0b0d16;
}

/* Toolbar: one compact row that wraps only when it truly must. */
.pdf-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  flex-wrap: wrap;
}
.pdf-nav button {
  font-size: 12.5px;
  padding: 0.42rem 0.7rem;
}
.pdf-nav > span:first-of-type {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pdf-viewer.is-fullscreen .pdf-nav {
  justify-content: center;
}

/* =========================================================
   TEST RUNNER — the actual exam-taking screen
   ========================================================= */
.test-runner-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 1rem;
  position: sticky;
  top: 0.5rem;
  z-index: 5;
}
.test-runner-topbar strong {
  flex: 1;
  font-size: 14px;
}
.test-timer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
  color: var(--text-h);
}
.test-timer.is-critical {
  background: var(--danger-bg);
  color: var(--danger);
}

.test-runner-body {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 720px) {
  .test-runner-body {
    grid-template-columns: 1fr;
  }
}

.test-navigator {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  position: sticky;
  top: 4rem;
}
.test-nav-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
  cursor: pointer;
}
.test-nav-item.is-answered {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}
.test-nav-item.is-marked {
  border-color: var(--warning);
  box-shadow: inset 0 0 0 1.5px var(--warning);
}
.test-nav-item.is-current {
  outline: 2px solid var(--tenant-accent);
  outline-offset: 1px;
}
.test-nav-legend {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
  font-size: 11px;
  color: var(--text-muted);
}
.test-nav-legend span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.test-nav-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.test-nav-dot.is-answered {
  background: var(--success);
  border-color: var(--success);
}
.test-nav-dot.is-marked {
  border-color: var(--warning);
}

.test-question-panel {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-height: 20rem;
}
.test-question-text {
  font-size: 16px;
  line-height: 1.5;
  margin: 0.5rem 0 1.25rem;
  user-select: none;
}
.test-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.test-option-btn {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.test-option-btn:hover:not(:disabled) {
  border-color: var(--tenant-accent);
  background: var(--accent-soft);
}
.test-option-btn:disabled {
  cursor: default;
  opacity: 0.6;
}
.test-question-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* =========================================================
   FAQ ACCORDION — per-course FAQ, teacher-authored
   ========================================================= */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  overflow: hidden;
}
.faq-item button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-h);
  cursor: pointer;
}
.faq-item button:hover {
  background: var(--surface-hover);
}
.faq-item .icon {
  flex-shrink: 0;
  transition: transform 0.15s ease;
  color: var(--text-muted);
}
.faq-item.is-open .icon {
  transform: rotate(180deg);
}
.faq-item p {
  padding: 0 1rem 0.9rem;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem 1rem;
}

/* =========================================================
   TOGGLE — labelled pill switch for "enable this feature" rows
   ========================================================= */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  margin-bottom: 0.7rem;
}
.toggle-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 13px;
  color: var(--text-muted);
}
.toggle-row-text strong {
  color: var(--text-h);
  font-size: 13.5px;
}
/* Reserves room for the description to wrap to two lines up front. The
   webfonts load with font-display: swap (index.html), so this text
   briefly renders in a fallback font before swapping — a narrower or
   wider fallback can change the wrap point and reflow whatever sits
   below. On a toggle right above a submit button (course create/edit
   forms) that reflow was enough to shift the button out from under a
   tap that landed a moment earlier. Reserving the height up front means
   the swap can't move anything. */
.toggle-row-text span {
  min-height: 2.6em;
}
.toggle-row.is-on.toggle-row-success {
  border-left-color: var(--success);
  background: var(--success-bg);
}
.toggle-row.is-on.toggle-row-warning {
  border-left-color: var(--warning);
  background: var(--warning-bg);
}
.toggle-row.is-on.toggle-row-danger {
  border-left-color: var(--danger);
  background: var(--danger-bg);
}
.toggle-row.is-on.toggle-row-default {
  border-left-color: var(--tenant-accent);
  background: var(--accent-soft);
}
.switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 23px;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  transition: background 0.15s ease;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}
.switch.is-checked .switch-track {
  background: var(--tenant-accent);
}
.switch.is-checked .switch-thumb {
  transform: translateX(17px);
}

/* =========================================================
   COVER IMAGE UPLOAD — click/drop zone
   ========================================================= */
.cover-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 2rem 1rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
  position: relative;
  min-height: 140px;
}
.cover-upload:hover {
  border-color: var(--tenant-accent);
}
.cover-upload input {
  display: none;
}
.cover-upload strong {
  color: var(--tenant-accent);
  font-weight: 700;
}
.cover-upload-preview {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.cover-upload-preview-overlay {
  position: relative;
  z-index: 1;
  background: rgba(10, 12, 23, 0.6);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

/* =========================================================
   PRICE PAIR — original (strike-through) + discounted, side by side
   ========================================================= */
.price-pair {
  display: flex;
  gap: 0.75rem;
}
.price-pair > label {
  flex: 1 1 0;
}

/* =========================================================
   RECURRING BILLING DURATION — number input + quick-pick month chips
   ========================================================= */
.duration-presets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.duration-presets input[type='number'] {
  width: 5rem;
  flex: 0 0 auto;
}
.duration-presets .btn-sm.is-active {
  background: var(--accent-soft);
  border-color: var(--tenant-accent);
  color: var(--tenant-accent);
}

/* =========================================================
   PDF SOURCE PICKER — upload a file or import from a link
   ========================================================= */
.pdf-source-picker {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.pdf-source-tabs {
  display: flex;
  gap: 0.5rem;
}
.pdf-source-tabs .btn-sm.is-active {
  background: var(--accent-soft);
  border-color: var(--tenant-accent);
  color: var(--tenant-accent);
}

/* =========================================================
   FEE PLANS
   ========================================================= */
.fee-plan-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.fee-plan-row > label {
  flex: 1 1 12rem;
  min-width: 0;
}
.fee-plan-summary {
  margin-left: auto;
  margin-right: 0.6rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* How many months to authorise autopay for — small on purpose, it is a
   single number sitting next to the button that reads it. */
.fee-plan-autopay-months {
  width: 3.4rem;
  padding: 0.35rem 0.4rem;
  text-align: center;
  font-size: 13px;
}
/* A stopped plan stays listed — its invoices are still owed — but should
   not read as active. */
.list li.is-muted {
  opacity: 0.62;
}
@media (max-width: 640px) {
  .fee-plan-summary {
    margin-left: 0;
    flex-basis: 100%;
  }
}
