/* ============================================================
   Navkar Real Estate Academy — Design System
   Tech Lead deliverable · theme.css v1.0
   Source of truth: DESIGN.md + BUILD-CONTRACT.md §2-4
   ============================================================ */

/* ── Google Fonts import (fallback; pages also link directly) ── */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700;800;900&display=swap');

/* ─────────────────────────────────────────────────────────────
   §2 · Design Tokens
   ───────────────────────────────────────────────────────────── */
:root {
  /* Brand palette */
  --brand:         #16213D;
  --brand-700:     #0F1830;
  --brand-50:      #E9EEF8;

  /* Cobalt (interactive) */
  --cobalt:        #3A6FE0;
  --cobalt-700:    #2C57BC;

  /* Gold (sparing) */
  --gold:          #E2A52C;
  --gold-dark:     #C2870E;

  /* Neutrals */
  --ink:           #14203A;
  --body:          #303A4D;
  --muted:         #5A6379;
  --faint:         #7A8499;

  /* Surfaces */
  --bg:            #F5F7FB;
  --card:          #FFFFFF;
  --line:          #E5E9F1;
  --field-border:  #E0E5EF;
  --outline-border:#C9D4EA;

  /* Semantic */
  --ok:            #1A8754;
  --ok-bg:         #E4F4EC;
  --warn:          #C2780B;
  --warn-bg:       #FBEFD9;
  --danger:        #C0392B;
  --danger-bg:     #FAE7E4;
  --info:          #3A6FE0;
  --info-bg:       #E9EEF8;

  /* Shape */
  --r:             14px;
  --r-sm:          10px;
  --r-lg:          18px;

  /* Elevation */
  --sh:            0 1px 3px rgba(20,33,61,.08), 0 1px 2px rgba(20,33,61,.06);
  --sh-lg:         0 10px 30px rgba(20,33,61,.12);

  /* Layout */
  --maxw:          1200px;
  --maxw-read:     760px;
  --gutter:        28px;
}

/* ─────────────────────────────────────────────────────────────
   §0 · Reset & Base
   ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Public Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--body);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Honor prefers-reduced-motion globally */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

img, svg { display: block; max-width: 100%; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--cobalt-700); }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--ink); }

/* ─────────────────────────────────────────────────────────────
   §3 · Typography Scale
   ───────────────────────────────────────────────────────────── */

/* Display — hero headline */
.display {
  font-size: clamp(2.35rem, 4.4vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
}

/* H2 — section titles */
.h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.14;
  color: var(--ink);
}

/* H3 — card / sub-section titles */
.h3 {
  font-size: clamp(1.08rem, 1.5vw, 1.18rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}

/* Lead — section intro copy */
.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.12rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--body);
}

/* Eyebrow — section kicker label */
.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cobalt);   /* override with .eyebrow-gold on dark bands */
  display: block;
  margin-bottom: 10px;
}
.band-navy .eyebrow,
.eyebrow-gold { color: var(--gold); }

/* Label / caption */
.label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 5px;
}
.caption {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}

/* ─────────────────────────────────────────────────────────────
   §4 · Layout
   ───────────────────────────────────────────────────────────── */

/* Container */
.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  width: 100%;
}
.container-read {
  max-width: var(--maxw-read);
  margin-inline: auto;
  padding-inline: var(--gutter);
  width: 100%;
}

/* Section */
.section {
  padding-block: 78px;
}
@media (max-width: 700px) {
  .section { padding-block: 48px; }
}

/* Band variants */
.band-bg { background: var(--bg); }

.band-navy {
  background: var(--brand);
  color: #fff;
  /* Faint white dot-grid overlay per DESIGN.md §5 */
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.09) 1px, transparent 0);
  background-size: 22px 22px;
}
.band-navy .display,
.band-navy .h2,
.band-navy .h3 { color: #fff; }
.band-navy .lead,
.band-navy p   { color: rgba(255,255,255,.82); }
.band-navy .muted { color: #9FB3D6; }

/* Grids */
.grid { display: grid; gap: 24px; }

.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

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

/* Flex helpers */
.row   { display: flex; align-items: center; gap: 12px; }
.spread{ display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.gap-sm { gap: 8px; }
.gap    { gap: 16px; }
.gap-lg { gap: 28px; }

/* ─────────────────────────────────────────────────────────────
   §4 · Type / Utility
   ───────────────────────────────────────────────────────────── */
.muted  { color: var(--muted); }
.faint  { color: var(--faint); }
.center { text-align: center; }

.mt   { margin-top: 24px; }
.mb   { margin-bottom: 24px; }

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin-block: 26px;
}

.hidden { display: none !important; }

.text-ok     { color: var(--ok); }
.text-warn   { color: var(--warn); }
.text-danger { color: var(--danger); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--brand-50);
  color: var(--cobalt-700);
}

/* ─────────────────────────────────────────────────────────────
   §4 · Buttons
   ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease,
              box-shadow 180ms ease, transform 150ms ease;
  white-space: nowrap;
  -webkit-appearance: none;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58,111,224,.35);
}
.btn svg { flex-shrink: 0; }

/* Navy primary */
.btn-navy {
  background: var(--brand);
  color: #fff;
}
.btn-navy:hover {
  background: var(--brand-700);
  color: #fff;
  box-shadow: 0 6px 18px rgba(22,33,61,.22);
  transform: translateY(-2px);
}

/* Gold convert — lead-gen CTAs only */
.btn-gold {
  background: var(--gold);
  color: var(--brand);
}
.btn-gold:hover {
  background: var(--gold-dark);
  color: var(--brand);
  box-shadow: 0 6px 18px rgba(226,165,44,.30);
  transform: translateY(-2px);
}

/* Outline */
.btn-outline {
  background: #fff;
  color: var(--cobalt-700);
  border: 1.6px solid var(--outline-border);
}
.btn-outline:hover {
  background: var(--brand-50);
  color: var(--cobalt-700);
  border-color: var(--cobalt);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--cobalt-700);
  border: none;
}
.btn-ghost:hover {
  background: var(--brand-50);
  color: var(--cobalt);
}

/* Sizes */
.btn-sm {
  padding: 9px 18px;
  font-size: 0.82rem;
}
.btn-block {
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────
   §4 · Cards
   ───────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 24px;
}
@media (min-width: 600px) {
  .card { padding: 26px; }
}

.card-hover {
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(22,33,61,.14);
}

/* Programme card */
.prog-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.prog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(22,33,61,.14);
}
/* 7px top accent bar — applied via colour modifier classes */
.prog-card::before {
  content: '';
  display: block;
  height: 7px;
  background: var(--cobalt);   /* default, overridden below */
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.prog-card.accent-green::before  { background: var(--ok); }
.prog-card.accent-cobalt::before { background: var(--cobalt); }
.prog-card.accent-gold::before   { background: var(--gold); }

.prog-card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ─────────────────────────────────────────────────────────────
   §4 · Forms
   ───────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}
.field:last-child { margin-bottom: 0; }

.label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}
/* Required asterisk */
.req::after {
  content: ' *';
  color: var(--danger);
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--field-border);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  transition: border-color 150ms, box-shadow 150ms;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--faint); }

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(58,111,224,.14);
}
.textarea { resize: vertical; min-height: 100px; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A6379' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.help  { font-size: 0.8rem; color: var(--muted); margin-top: 3px; }
.error { font-size: 0.8rem; color: var(--danger); margin-top: 3px; }

/* ─────────────────────────────────────────────────────────────
   §4 · Data — Badges
   ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-ok     { background: var(--ok-bg);      color: var(--ok); }
.badge-warn   { background: var(--warn-bg);    color: var(--warn); }
.badge-danger { background: var(--danger-bg);  color: var(--danger); }
.badge-info   { background: var(--info-bg);    color: var(--cobalt-700); }
.badge-muted  { background: var(--line);       color: var(--muted); }
.badge-gold   { background: var(--gold);       color: var(--brand); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--brand-50);
  color: var(--cobalt-700);
}

/* ─────────────────────────────────────────────────────────────
   §4 · Data — KPI, Progress, Stars, Bars
   ───────────────────────────────────────────────────────────── */
.kpi { text-align: center; }
.kpi-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--cobalt);
  line-height: 1;
  display: block;
}
.kpi-label {
  font-size: 0.82rem;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.kpi-trend {
  font-size: 0.78rem;
  font-weight: 700;
  display: block;
  margin-top: 3px;
}

/* Band-navy KPI overrides */
.band-navy .kpi-num   { color: #fff; }
.band-navy .kpi-label { color: #9FB3D6; }
.band-navy .kpi-trend { color: var(--gold); }

.progress {
  height: 8px;
  background: var(--brand-50);
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}
.progress .bar {
  height: 100%;
  background: var(--cobalt);
  border-radius: 999px;
  transition: width 400ms ease;
}

/* Stars */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--gold);
  font-size: 1rem;
  line-height: 1;
}
.stars svg { fill: var(--gold); stroke: none; }

/* Bars chart */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 160px;
}
.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.bar-col .bar {
  width: 100%;
  background: var(--cobalt);
  border-radius: 6px 6px 0 0;
  transition: height 400ms ease;
}
.bar-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}
.bar-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cobalt-700);
}

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 1.05rem;
}

/* ─────────────────────────────────────────────────────────────
   §4 · Data — Table
   ───────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table thead th {
  background: var(--bg);
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--body);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--brand-50); }
.table tfoot td {
  padding: 13px 14px;
  font-weight: 700;
  border-top: 2px solid var(--line);
  background: var(--bg);
}

/* ─────────────────────────────────────────────────────────────
   §4 · Chrome — Topbar (portal)
   ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--brand);
  height: 58px;
  display: flex;
  align-items: center;
  padding-inline: 20px;
  gap: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.07);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-n {
  width: 34px;
  height: 34px;
  background: var(--gold);
  color: var(--brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.topbar-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.topbar-spacer { flex: 1; }
.topbar-role {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: background 150ms;
}
.topbar-role:focus-visible {
  box-shadow: 0 0 0 3px rgba(58,111,224,.45);
}
.topbar-role option { color: var(--ink); background: #fff; }

.topbar-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 150ms, color 150ms;
  white-space: nowrap;
}
.topbar-link:hover { background: rgba(255,255,255,.10); color: #fff; }

/* ─────────────────────────────────────────────────────────────
   §4 · Chrome — Sidebar (portal)
   ───────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: calc(100vh - 58px);
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 18px 0;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-section {
  padding: 0 10px;
  margin-bottom: 8px;
}
.sidebar-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 8px 10px 4px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 1px 6px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 150ms, color 150ms;
}
.side-link:hover {
  background: var(--brand-50);
  color: var(--cobalt-700);
}
.side-link.active,
.side-link[aria-current="page"] {
  background: var(--brand-50);
  color: var(--cobalt-700);
  font-weight: 700;
}
.side-link svg { flex-shrink: 0; color: var(--cobalt); }
.side-link:not(.active) svg { color: var(--faint); }

.sidebar-spacer { flex: 1; }
.sidebar-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

/* Main content area */
.app-main {
  flex: 1;
  min-width: 0;
  padding: 28px 26px;
}
@media (max-width: 700px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
  }
  .app-main { padding: 18px 16px; }
}

/* ─────────────────────────────────────────────────────────────
   §4 · Chrome — Marketing Header (site-nav)
   ───────────────────────────────────────────────────────────── */
.site-nav {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(20,33,61,.05);
}
.site-nav-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 68px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.site-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-nav-n {
  width: 36px;
  height: 36px;
  background: var(--brand);
  color: var(--gold);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.site-nav-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.site-nav-name small {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav-links a {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--body);
  text-decoration: none;
  border-radius: 8px;
  transition: background 150ms, color 150ms;
  white-space: nowrap;
}
.site-nav-links a:hover,
.site-nav-links a.active { background: var(--brand-50); color: var(--cobalt-700); }

.site-nav-spacer { flex: 1; }

.site-nav-ctas {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
  border-radius: 8px;
  margin-left: auto;
}
.nav-hamburger:focus-visible { box-shadow: 0 0 0 3px rgba(58,111,224,.35); outline: none; }

@media (max-width: 820px) {
  .nav-hamburger { display: flex; align-items: center; }
  .site-nav-links,
  .site-nav-ctas { display: none; }
  .site-nav-links.open,
  .site-nav-ctas.open { display: flex; }

  .site-nav-inner { flex-wrap: wrap; height: auto; padding-block: 14px; row-gap: 12px; }
  .site-nav-links {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    order: 3;
    padding-bottom: 6px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }
  .site-nav-links a { width: 100%; }
  .site-nav-ctas {
    width: 100%;
    order: 4;
    padding-bottom: 8px;
    flex-direction: column;
  }
  .site-nav-ctas .btn { width: 100%; }
  .site-nav-spacer { display: none; }
}

/* ─────────────────────────────────────────────────────────────
   §4 · Chrome — Marketing Footer (site-footer)
   ───────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--brand);
  color: rgba(255,255,255,.75);
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.06) 1px, transparent 0);
  background-size: 22px 22px;
}
.site-footer-grid {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 60px var(--gutter) 40px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px 30px;
}
@media (max-width: 820px) {
  .site-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .site-footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

.footer-col-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,.40);
  margin-bottom: 14px;
  display: block;
}
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
  font-size: 0.88rem;
  color: rgba(255,255,255,.70);
  text-decoration: none;
  transition: color 150ms;
}
.footer-links a:hover { color: #fff; }

.footer-brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.footer-n {
  width: 34px;
  height: 34px;
  background: var(--gold);
  color: var(--brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  flex-shrink: 0;
}
.footer-tagline {
  font-size: 0.86rem;
  color: rgba(255,255,255,.60);
  margin-bottom: 16px;
  line-height: 1.5;
}
.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: rgba(255,255,255,.65);
  margin-bottom: 8px;
}
.footer-contact-item svg { flex-shrink: 0; color: var(--gold); }

.site-footer-bar {
  border-top: 1px solid rgba(255,255,255,.10);
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: rgba(255,255,255,.40);
}
.site-footer-bar a { color: rgba(255,255,255,.55); text-decoration: none; }
.site-footer-bar a:hover { color: #fff; }

/* ─────────────────────────────────────────────────────────────
   §4 · Media — Photo placeholder & icon tile
   ───────────────────────────────────────────────────────────── */
.photo {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  background: linear-gradient(
    135deg,
    var(--brand-50) 25%,
    #fff 25%,
    #fff 50%,
    var(--brand-50) 50%,
    var(--brand-50) 75%,
    #fff 75%,
    #fff 100%
  );
  background-size: 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Default 1:1 */
.photo::before {
  content: '';
  display: block;
  padding-top: 100%;
  width: 100%;
}
.photo .photo-caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  padding: 12px;
  line-height: 1.4;
}

/* Ratio modifiers */
.ratio-16x9::before { padding-top: 56.25%; }
.ratio-4x3::before  { padding-top: 75%; }
.ratio-1x1::before  { padding-top: 100%; }
.ratio-3x2::before  { padding-top: 66.67%; }

/* Icon tile */
.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--cobalt);
  flex-shrink: 0;
}
.icon-tile svg { width: 22px; height: 22px; }

/* ─────────────────────────────────────────────────────────────
   §4 · Toast
   ───────────────────────────────────────────────────────────── */
.toast-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-lg);
  padding: 14px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  pointer-events: all;
  animation: toastIn 220ms ease forwards;
}
.toast.removing { animation: toastOut 220ms ease forwards; }

.toast-ok     { border-left: 4px solid var(--ok);     }
.toast-warn   { border-left: 4px solid var(--warn);   }
.toast-danger { border-left: 4px solid var(--danger); }
.toast-info   { border-left: 4px solid var(--cobalt); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px) scale(.96); }
  to   { opacity: 1; transform: translateX(0)    scale(1);   }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0)    scale(1);   }
  to   { opacity: 0; transform: translateX(16px) scale(.96); }
}

/* ─────────────────────────────────────────────────────────────
   Accordion (FAQ)
   ───────────────────────────────────────────────────────────── */
.accordion { border-top: 1px solid var(--line); }
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-btn {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 18px 0;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color 150ms;
}
.accordion-btn:hover { color: var(--cobalt); }
.accordion-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(58,111,224,.25); border-radius: 4px; }
.accordion-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cobalt);
  transition: transform 200ms ease;
}
.accordion-item[open] .accordion-icon,
.accordion-item.open .accordion-icon { transform: rotate(180deg); }
.accordion-body {
  padding: 0 0 18px;
  font-size: 0.92rem;
  color: var(--body);
  line-height: 1.65;
  overflow: hidden;
}
/* Details/summary reset */
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }

/* ─────────────────────────────────────────────────────────────
   Misc utility
   ───────────────────────────────────────────────────────────── */
.flex-1    { flex: 1; }
.w-full    { width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}
.no-scroll { overflow: hidden; }

/* Link list reset (sidebars / footer) */
nav ul, nav ol { list-style: none; margin: 0; padding: 0; }

/* Focus ring baseline — every interactive element */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58,111,224,.30);
  border-radius: 4px;
}
/* Remove default outline safely */
:focus:not(:focus-visible) { outline: none; }

/* Page-level responsive clamp */
@media (max-width: 375px) {
  .container, .container-read { padding-inline: 16px; }
}

/* ─────────────────────────────────────────────────────────────
   Lesson player panel helpers (student portal)
   ───────────────────────────────────────────────────────────── */
.lesson-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--card);
  min-height: 480px;
}
.lesson-list {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  background: var(--bg);
}
.lesson-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--body);
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.lesson-item:hover   { background: var(--brand-50); color: var(--cobalt-700); }
.lesson-item.active  { background: var(--brand-50); color: var(--cobalt-700); }
.lesson-item.done    { color: var(--muted); }
.lesson-item.done svg{ color: var(--ok); }
.lesson-panel { padding: 28px 30px; }
@media (max-width: 700px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-list { border-right: none; border-bottom: 1px solid var(--line); }
}

/* ─────────────────────────────────────────────────────────────
   Quiz / assignment helpers
   ───────────────────────────────────────────────────────────── */
.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--field-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.92rem;
  transition: border-color 150ms, background 150ms;
  margin-bottom: 8px;
}
.quiz-option input[type=radio] { accent-color: var(--cobalt); }
.quiz-option:has(input:checked) {
  border-color: var(--cobalt);
  background: var(--brand-50);
}
.quiz-option.correct { border-color: var(--ok); background: var(--ok-bg); }
.quiz-option.wrong   { border-color: var(--danger); background: var(--danger-bg); }

.rubric-row {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.rubric-row:last-child { border-bottom: none; }

/* Print safety */
@media print {
  .topbar, .sidebar, .site-nav, .site-footer,
  .toast-root, .btn, .accordion-btn, .no-print { display: none; }
  .app-main, .app-shell { display: block; }
}

/* =============================================================
   §B NEW COMPONENT STYLES — v2 depth pass
   Enhancement-CONTRACT.md §B  (appended below existing styles)
   ============================================================= */

/* ─────────────────────────────────────────────────────────────
   .section-head — eyebrow + title + intro cluster
   ───────────────────────────────────────────────────────────── */
.section-head {
  margin-bottom: 48px;
}
.section-head .eyebrow { margin-bottom: 10px; }
.section-head .h2      { margin-bottom: 14px; }
.section-head .lead    { max-width: 640px; }
.section-head.center .lead { margin-inline: auto; }

/* ─────────────────────────────────────────────────────────────
   .kpi-row — horizontal KPI strip inside cards/topbars
   ───────────────────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.kpi-row .kpi {
  background: var(--card);
  padding: 20px 18px;
  text-align: center;
}
.kpi-row .kpi-num { font-size: 1.7rem; }

/* ─────────────────────────────────────────────────────────────
   .seat-meter — seat fill progress bar
   ───────────────────────────────────────────────────────────── */
.seat-meter { width: 100%; }
.seat-meter-bar {
  height: 8px;
  background: var(--brand-50);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.seat-meter-fill {
  height: 100%;
  background: var(--cobalt);
  border-radius: 999px;
  transition: width 500ms ease;
}
.seat-meter-fill.gold { background: var(--gold); }
.seat-meter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}
.seat-meter-count {
  font-weight: 700;
  color: var(--ink);
}
.seat-meter-count.gold { color: var(--gold-dark); }

/* ─────────────────────────────────────────────────────────────
   .stat-tile — icon + big value + label
   ───────────────────────────────────────────────────────────── */
.stat-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
}
.stat-tile-icon { flex-shrink: 0; }
.stat-tile-value {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--cobalt);
  line-height: 1;
}
.stat-tile-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ─────────────────────────────────────────────────────────────
   .price-block — enroll card body
   ───────────────────────────────────────────────────────────── */
.price-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 24px 26px;
}
.price-block-fee {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}
.price-block-currency {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
}
.price-block-amount {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1;
}
.price-block-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.price-block-emi {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 14px;
}
.price-emi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--line);
}
.price-emi-row:last-child { border-bottom: none; }
.price-emi-amount { font-weight: 700; color: var(--cobalt-700); }
.price-block-scholarship {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.price-block-scholarship svg { flex-shrink: 0; margin-top: 1px; }

/* Rating summary */
.rating-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rating-summary-score {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}
.rating-summary-count { font-size: 0.88rem; }

/* ─────────────────────────────────────────────────────────────
   .tabs / .tab — tabbed navigation strip
   ───────────────────────────────────────────────────────────── */
.tabs-wrap { width: 100%; }

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 8px 8px 0 0;
  transition: color 150ms, border-color 150ms, background 150ms;
  -webkit-appearance: none;
  min-height: 44px;
}
.tab:hover { color: var(--cobalt-700); background: var(--brand-50); }
.tab.active,
.tab[aria-selected="true"] {
  color: var(--cobalt-700);
  border-bottom-color: var(--cobalt);
  font-weight: 700;
}
.tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58,111,224,.30);
  border-radius: 6px;
}
.tabs-panels { padding-top: 28px; }

/* ─────────────────────────────────────────────────────────────
   .module-accordion — curriculum accordion
   ───────────────────────────────────────────────────────────── */
.module-accordion { width: 100%; }

.module-accordion-item {
  border-bottom: 1px solid var(--line);
}
.module-accordion-item:first-child {
  border-top: 1px solid var(--line);
}

.module-accordion-btn {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 20px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  min-height: 44px;
}
.module-accordion-btn::-webkit-details-marker { display: none; }
.module-accordion-btn::marker { display: none; }
.module-accordion-btn:hover .module-accordion-title { color: var(--cobalt); }
.module-accordion-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58,111,224,.25);
  border-radius: 4px;
}

details.module-accordion-item[open] .accordion-icon { transform: rotate(180deg); }
.accordion-icon { transition: transform 200ms ease; flex-shrink: 0; }

.module-accordion-meta { flex: 1; min-width: 0; }
.module-accordion-title {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 3px;
  transition: color 150ms;
}
.module-accordion-sub { font-size: 0.82rem; }

.module-accordion-body {
  padding-bottom: 20px;
}
.module-summary {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.module-lessons { display: flex; flex-direction: column; gap: 4px; }

.module-lesson-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  transition: background 150ms;
}
.module-lesson-row:hover { background: var(--brand-50); }
.module-lesson-icon { color: var(--cobalt); flex-shrink: 0; }
.module-lesson-title { color: var(--body); font-weight: 600; min-width: 0; }
.module-lesson-title a { color: inherit; text-decoration: none; }
.module-lesson-title a:hover { color: var(--cobalt); }
.module-lesson-type { flex-shrink: 0; }
.module-lesson-dur { font-size: 0.78rem; flex-shrink: 0; white-space: nowrap; }

/* ─────────────────────────────────────────────────────────────
   .agenda / .agenda-item — session calendar list
   ───────────────────────────────────────────────────────────── */
.agenda { display: flex; flex-direction: column; gap: 0; }
.agenda-month {
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.agenda-month-label { margin-bottom: 0; color: var(--cobalt); }

.agenda-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.agenda-item:last-child { border-bottom: none; }

.agenda-date-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  background: var(--brand-50);
  border-radius: var(--r-sm);
  padding: 6px 4px;
  min-width: 48px;
}
.agenda-day {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--cobalt);
  line-height: 1;
}
.agenda-month-short {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.agenda-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.agenda-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.agenda-action { flex-shrink: 0; }

@media (max-width: 600px) {
  .agenda-item { grid-template-columns: 48px 1fr; }
  .agenda-action { grid-column: 2; }
}

/* ─────────────────────────────────────────────────────────────
   .announce — announcement card
   ───────────────────────────────────────────────────────────── */
.announce {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--sh);
}
.announce-pinned {
  border-left: 4px solid var(--gold);
  background: #FFFBF0;
}
.announce-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.announce-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  flex: 1;
}
.announce-body {
  color: var(--body);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.announce-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.announce-meta svg { color: var(--cobalt); width: 14px; height: 14px; }

/* ─────────────────────────────────────────────────────────────
   .resource-row — resource library row
   ───────────────────────────────────────────────────────────── */
.resource-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: box-shadow 180ms;
}
.resource-row:hover { box-shadow: var(--sh-lg); }
.resource-icon { flex-shrink: 0; color: var(--cobalt); }
.resource-body { flex: 1; min-width: 0; }
.resource-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 4px;
}
.resource-meta { display: flex; align-items: center; gap: 8px; }

/* ─────────────────────────────────────────────────────────────
   .thread / .reply — discussion forum
   ───────────────────────────────────────────────────────────── */
.thread {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px;
  box-shadow: var(--sh);
}
.thread-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.thread-meta { flex: 1; min-width: 0; }
.thread-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
  margin-bottom: 2px;
}
.thread-replies {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.thread-body {
  font-size: 0.92rem;
  color: var(--body);
  margin-bottom: 12px;
}
.thread-reply-list {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reply {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.reply-body { flex: 1; min-width: 0; }
.reply-body p { font-size: 0.88rem; color: var(--body); margin: 4px 0 0; }
.reply .avatar { width: 30px; height: 30px; font-size: 0.72rem; flex-shrink: 0; }

/* badge-cobalt (teacher role in threads) */
.badge-cobalt { background: var(--brand-50); color: var(--cobalt-700); }

/* ─────────────────────────────────────────────────────────────
   .certificate — printable certificate card
   ───────────────────────────────────────────────────────────── */
.certificate {
  background: var(--card);
  border: 2px solid var(--gold);
  border-radius: var(--r-lg);
  padding: 40px 48px;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: var(--sh-lg);
  position: relative;
}
.certificate-locked {
  border-color: var(--line);
  padding: 40px 32px;
  opacity: 0.9;
}
.certificate-lock-icon {
  width: 56px; height: 56px;
  background: var(--brand-50);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--cobalt);
}
.certificate-locked-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
}
.certificate-locked-text { font-size: 0.9rem; margin-bottom: 16px; }

.certificate-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 32px;
}
.certificate-n {
  width: 44px; height: 44px;
  background: var(--brand);
  color: var(--gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
}
.certificate-org {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}
.certificate-declares {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.certificate-name {
  font-size: 2rem;
  font-weight: 900;
  color: var(--brand);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.certificate-course {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cobalt);
  margin-bottom: 8px;
}
.certificate-details {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 36px;
}
.certificate-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.certificate-sig { text-align: left; }
.certificate-sig-line {
  width: 140px;
  height: 1px;
  background: var(--ink);
  margin-bottom: 6px;
}
.certificate-seal {
  width: 72px; height: 72px;
  border: 3px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.04em;
}
.certificate-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

@media print {
  .certificate { border: 2px solid var(--gold) !important; box-shadow: none; }
  .certificate-actions { display: none; }
}

/* ─────────────────────────────────────────────────────────────
   .quiz-q / .quiz-opt / .quiz-result — quiz taker
   ───────────────────────────────────────────────────────────── */
.quiz-q {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--sh);
}
.quiz-q-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.quiz-q-num {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--cobalt);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.quiz-q-pts {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.quiz-q-text {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.5;
}
.quiz-q-req { color: var(--danger); margin-left: 3px; }

.quiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--field-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--body);
  font-weight: 500;
  background: var(--card);
  transition: border-color 150ms, background 150ms;
  margin-bottom: 8px;
  min-height: 44px;
  width: 100%;
  text-align: left;
}
.quiz-opt:hover {
  border-color: var(--cobalt);
  background: var(--brand-50);
  color: var(--cobalt-700);
}
.quiz-opt.selected {
  border-color: var(--cobalt);
  background: var(--brand-50);
  color: var(--cobalt-700);
  font-weight: 700;
}
.quiz-opt.correct {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}
.quiz-opt.wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}
.quiz-opt-input {
  accent-color: var(--cobalt);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.quiz-opt-text { flex: 1; }

.quiz-result {
  background: var(--brand-50);
  border: 1.5px solid var(--cobalt);
  border-radius: var(--r);
  padding: 20px 24px;
  margin-top: 24px;
}
.quiz-result-score {
  font-size: 2rem;
  font-weight: 900;
  color: var(--cobalt);
  line-height: 1;
}
.quiz-result-pass { color: var(--ok); }
.quiz-result-fail { color: var(--danger); }
.quiz-result-label { font-size: 0.88rem; color: var(--muted); margin-top: 4px; }

/* ─────────────────────────────────────────────────────────────
   .builder-q / .builder-opt / .builder-toolbar / .builder-preview
   — Quiz & assignment builder (teacher)
   ───────────────────────────────────────────────────────────── */
.builder-q {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
  margin-bottom: 16px;
  overflow: hidden;
}
.builder-q-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.builder-q-drag {
  color: var(--faint);
  cursor: grab;
  display: flex;
  align-items: center;
}
.builder-q-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--cobalt);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: 1;
}
.builder-q-body { padding: 18px 20px; }
.builder-q-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.builder-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.builder-opt input[type=text] {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  outline: none;
  padding: 2px 4px;
}
.builder-opt input[type=text]:focus {
  border-bottom: 1.5px solid var(--cobalt);
}
.builder-opt-correct {
  width: 16px; height: 16px;
  accent-color: var(--cobalt);
  cursor: pointer;
  flex-shrink: 0;
}
.builder-opt-del {
  background: none;
  border: none;
  color: var(--faint);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  min-width: 28px; min-height: 28px;
  justify-content: center;
  transition: color 150ms, background 150ms;
}
.builder-opt-del:hover { color: var(--danger); background: var(--danger-bg); }
.builder-opt-del:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(58,111,224,.30); border-radius: 4px; }

.builder-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.builder-preview {
  background: var(--brand-50);
  border: 1.5px dashed var(--cobalt);
  border-radius: var(--r);
  padding: 24px;
}
.builder-preview-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--cobalt);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 16px;
  display: block;
}

/* ─────────────────────────────────────────────────────────────
   .video-frame / .video-embed / .live-room
   — §D video and live session UI
   ───────────────────────────────────────────────────────────── */
.video-frame {
  border-radius: var(--r);
  overflow: hidden;
  background: var(--brand);
  margin-bottom: 20px;
}

/* 16:9 responsive iframe embed */
.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Mux/upload branded placeholder */
.video-frame-mux .video-embed-placeholder {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-embed-placeholder {
  position: relative;
  background: var(--brand);
}
.video-embed-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  color: var(--gold);
  opacity: .85;
}
.video-embed-play svg { width: 56px; height: 56px; }
.video-embed-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 18px;
  background: linear-gradient(to top, rgba(22,33,61,.85) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.video-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}
.video-caption {
  font-size: 0.74rem;
  color: rgba(255,255,255,.60);
  font-weight: 600;
}

/* Generic "coming soon" placeholder */
.video-frame-placeholder .photo { border-radius: 0; }

/* .live-room */
.live-room {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  box-shadow: var(--sh);
  margin-bottom: 20px;
}
.live-room-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.live-room-head svg { color: var(--cobalt); flex-shrink: 0; margin-top: 2px; }
.live-room-title { font-size: 1rem; font-weight: 800; color: var(--ink); margin-bottom: 3px; }
.live-room-upcoming { border-left: 4px solid var(--cobalt); }
.live-room-active   { border-left: 4px solid var(--ok); }
.live-room-past     { border-left: 4px solid var(--muted); }
.live-room-countdown {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--cobalt);
  margin-bottom: 10px;
}
.live-room-days { font-size: 2rem; color: var(--cobalt); }

/* Pulsing "live now" indicator */
.live-room-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ok);
  position: absolute;
  top: 20px; right: 20px;
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(1.5); }
}
.live-room-active { position: relative; }

/* ─────────────────────────────────────────────────────────────
   .timeline — step / milestone list
   ───────────────────────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  padding: 0 0 24px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--cobalt);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 2px var(--cobalt);
  z-index: 1;
}
.timeline-dot.done { background: var(--ok); box-shadow: 0 0 0 2px var(--ok); }
.timeline-dot.locked { background: var(--line); box-shadow: 0 0 0 2px var(--line); }
.timeline-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.timeline-sub { font-size: 0.82rem; color: var(--muted); }

/* ─────────────────────────────────────────────────────────────
   .ring — circular progress ring (SVG-based)
   ───────────────────────────────────────────────────────────── */
.ring-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ring-svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--brand-50); stroke-width: 8; }
.ring-fill  { fill: none; stroke: var(--cobalt); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 600ms ease; }
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ring-pct {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--cobalt);
  line-height: 1;
}
.ring-sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}

/* ─────────────────────────────────────────────────────────────
   .feature-rich — dense icon + text feature grid item
   ───────────────────────────────────────────────────────────── */
.feature-rich {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.feature-rich:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-lg);
}
.feature-rich .icon-tile { margin-bottom: 4px; }
.feature-rich-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}
.feature-rich-text {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

/* ─────────────────────────────────────────────────────────────
   Empty state
   ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 52px 24px;
}
.empty-state-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}
.empty-state-text {
  font-size: 0.9rem;
  margin-bottom: 20px;
  max-width: 320px;
  margin-inline: auto;
}

/* ─────────────────────────────────────────────────────────────
   Misc additions
   ───────────────────────────────────────────────────────────── */
/* lesson-link style inside accordions */
.lesson-link {
  color: var(--cobalt-700);
  text-decoration: none;
  font-weight: 600;
}
.lesson-link:hover { text-decoration: underline; }

/* Ensure badge-cobalt readable */
.badge-cobalt { background: var(--brand-50); color: var(--cobalt-700); }

/* Inline label for form fields in builders */
.field-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}
.field-inline .label { margin-bottom: 0; white-space: nowrap; }
.field-inline .input { flex: 1; }

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--body);
  cursor: pointer;
}
.toggle {
  position: relative;
  width: 38px; height: 22px;
  background: var(--line);
  border-radius: 999px;
  transition: background 180ms;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 180ms ease;
  box-shadow: 0 1px 3px rgba(20,33,61,.20);
}
input:checked ~ .toggle,
.toggle.on { background: var(--cobalt); }
input:checked ~ .toggle::after,
.toggle.on::after { transform: translateX(16px); }

/* Responsive module-lesson-row on very small screens */
@media (max-width: 480px) {
  .module-lesson-row {
    grid-template-columns: 24px 1fr auto;
  }
  .module-lesson-dur { display: none; }
}
