/* ============================================================
   SCM Capital AI Programme
   Editorial fintech aesthetic — Bloomberg meets Linear meets
   a Swiss design annual. Dense, deliberate, institutional.
   ============================================================ */

:root {
  /* === BRAND PALETTE ===
     Drawn from the SCM Capital + Voranex Africa lockup:
       SCM red  : #B3181E (dominant), warmer accent at #C63A2B
       Navy     : #17274B (Voranex 'V' and "VORANEX" wordmark)
     Both brands share black + white + this red/navy duo. No gold. */

  --navy-900: #0A1429;
  --navy-800: #17274B;    /* primary navy — matches logo */
  --navy-700: #1F3160;
  --navy-600: #2C4378;
  --navy-100: #E5E8EF;
  --navy-50:  #EFF1F6;

  /* SCM red — used as the accent throughout.
     The legacy --gold-* names are kept as aliases so the codebase
     doesn't need a global find/replace. */
  --red-900:  #6E0E12;
  --red-800:  #8B131A;
  --red-700:  #9D161C;
  --red-600:  #B3181E;    /* primary red — matches logo */
  --red-500:  #C63A2B;    /* accent / hover — warmer coral */
  --red-100:  #F8D7D5;
  --red-50:   #FCEEEC;

  /* Aliases — gold-named variables now point to red so existing
     templates keep working. Treat these as deprecated names. */
  --gold-700: var(--red-700);
  --gold-600: var(--red-600);
  --gold-500: var(--red-600);
  --gold-100: var(--red-100);
  --gold-50:  var(--red-50);

  --green-700:#0F7A35;
  --green-600:#16A34A;
  --green-50: #ECFDF3;

  /* Neutrals — editorial scale */
  --ink:      #0F1419;
  --ink-2:    #2C333E;
  --ink-3:    #4B5563;
  --ink-4:    #6B7280;
  --ink-5:    #9CA3AF;
  --ink-6:    #C7CCD3;
  --rule:     #E4E7EB;
  --rule-2:   #EEF0F3;
  --paper:    #F6F7F9;
  --surface:  #FFFFFF;

  /* Aliases used across the app */
  --primary:        var(--navy-800);
  --primary-dark:   var(--navy-900);
  --primary-light:  var(--navy-700);
  --accent:         var(--gold-500);
  --accent-dark:    var(--gold-600);
  --accent-light:   var(--gold-100);
  --destructive:    var(--red-500);
  --destructive-dark: var(--red-600);
  --success:        var(--green-600);
  --bg:             var(--paper);
  --card:           var(--surface);
  --fg:             var(--ink);
  --muted:          var(--ink-4);
  --muted-light:    var(--ink-5);
  --border:         var(--ink-6);
  --border-light:   var(--rule);

  --radius-sm: 3px;
  --radius:    6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(10, 21, 48, .04);
  --shadow:    0 2px 8px rgba(10, 21, 48, .06), 0 1px 2px rgba(10, 21, 48, .04);
  --shadow-lg: 0 12px 32px rgba(10, 21, 48, .10);
  --transition: 150ms cubic-bezier(.2,.6,.2,1);

  --font-sans:    'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif:   'IBM Plex Serif', 'Source Serif Pro', Georgia, serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: 'ss01', 'cv11', 'kern';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.num, .data-table td, .data-table th, code, kbd,
.metric-card .value, .countdown-unit .num, .stat .num,
.result-circle, time {
  font-variant-numeric: tabular-nums lining-nums;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--navy-800); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-600); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.011em;
}
h1 { font-size: 2.5rem; letter-spacing: -0.025em; }
h2 { font-size: 1.875rem; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; color: var(--ink); letter-spacing: -0.015em; }
h4 { font-size: 1.0625rem; font-family: var(--font-sans); font-weight: 600; }
p  { margin-bottom: 1rem; color: var(--ink-2); }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tiny  { font-size: 0.75rem; }
.mono  { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
}

/* ---------- Layout ---------- */
.container        { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 760px;  margin: 0 auto; padding: 0 32px; }
.section          { padding: 96px 0; }
.section-sm       { padding: 56px 0; }

hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; stroke-width: 2; }

.btn-primary {
  background: var(--navy-800);
  color: #fff;
  border-color: var(--navy-800);
}
.btn-primary:hover { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }

.btn-accent {
  background: var(--red-600);
  color: #fff;
  border-color: var(--red-600);
  font-weight: 600;
}
.btn-accent:hover { background: var(--red-700); border-color: var(--red-700); color: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--navy-800);
  border-color: var(--navy-800);
}
.btn-secondary:hover { background: var(--navy-800); color: #fff; }

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.4);
}
.btn-outline:hover { background: rgba(255,255,255,.08); border-color: #fff; }

.btn-outline-dark {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--border);
}
.btn-outline-dark:hover { border-color: var(--navy-800); color: var(--navy-800); }

.btn-ghost {
  background: transparent;
  color: var(--ink-3);
  border-color: transparent;
  padding-left: 10px; padding-right: 10px;
}
.btn-ghost:hover { color: var(--navy-800); background: var(--navy-50); }

.btn-danger { background: var(--red-500); color: #fff; border-color: var(--red-500); }
.btn-danger:hover { background: var(--red-600); border-color: var(--red-600); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ===== Public site header ===== */
.site-header {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.site-header .wrap {
  max-width: 1240px; margin: 0 auto; padding: 0 32px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.site-header .logo {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem; font-weight: 600;
  letter-spacing: -0.015em;
  flex-shrink: 0;
}
.site-header .logo .mark {
  width: 32px; height: 32px;
  background: var(--red-600);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.8125rem;
  letter-spacing: -0.02em;
  border-radius: var(--radius-sm);
}
.site-header .logo .meta {
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-4); font-weight: 500;
  border-left: 1px solid var(--rule); padding-left: 12px; margin-left: 4px;
}

.site-header .primary-nav {
  display: flex; align-items: center; gap: 28px;
}
.site-header .primary-nav a {
  color: var(--ink-3); font-size: 0.9375rem; font-weight: 500;
}
.site-header .primary-nav a:hover { color: var(--navy-800); }

.site-header .primary-actions {
  display: flex; gap: 10px; align-items: center;
  flex-shrink: 0;
}

/* ── Hamburger button (mobile only) ── */
.site-header .nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--ink-3);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  flex-shrink: 0;
}
.site-header .nav-toggle:hover {
  background: var(--navy-50);
  border-color: var(--navy-800);
}
.site-header .nav-toggle .bars {
  position: relative;
  display: block;
  width: 20px; height: 14px;
}
.site-header .nav-toggle .bars span {
  position: absolute; left: 0; right: 0;
  height: 2px; background: currentColor;
  border-radius: 1px;
  transition: transform 200ms ease, opacity 200ms ease, top 200ms ease;
}
.site-header .nav-toggle .bars span:nth-child(1) { top: 0; }
.site-header .nav-toggle .bars span:nth-child(2) { top: 6px; }
.site-header .nav-toggle .bars span:nth-child(3) { top: 12px; }
.site-header .nav-toggle.open .bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.site-header .nav-toggle.open .bars span:nth-child(2) { opacity: 0; }
.site-header .nav-toggle.open .bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* ── Mobile drawer — full-screen overlay ── */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 20, 25, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 90;
  animation: backdrop-in 200ms ease;
}
.drawer-backdrop[hidden] { display: none; }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(88vw, 360px);
  background: #fff;
  z-index: 100;
  display: flex; flex-direction: column;
  box-shadow: -16px 0 48px -16px rgba(0,0,0,0.25);
  animation: drawer-in 240ms cubic-bezier(0.4, 0, 0.2, 1);
}
.drawer[hidden] { display: none; }
@keyframes drawer-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--rule);
  min-height: 64px;
}
.drawer-head .logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1rem; font-weight: 600;
  letter-spacing: -0.015em;
}
.drawer-head .logo .mark {
  width: 32px; height: 32px;
  background: var(--red-600); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}
.drawer-close {
  background: transparent; border: 0;
  padding: 6px; cursor: pointer;
  color: var(--ink-3);
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.drawer-close:hover { background: var(--navy-50); color: var(--navy-800); }
.drawer-close svg { width: 22px; height: 22px; }

.drawer-nav {
  display: flex; flex-direction: column;
  padding: 8px 22px;
  flex: 1;
}
.drawer-nav a {
  display: block;
  padding: 16px 0;
  font-family: var(--font-serif);
  font-size: 1.1875rem; font-weight: 400;
  color: var(--ink); letter-spacing: -0.01em;
  border-bottom: 1px solid var(--rule);
}
.drawer-nav a:last-child { border-bottom: 0; }
.drawer-nav a:hover { color: var(--navy-800); }

.drawer-actions {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px 22px 28px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.drawer-actions .btn { width: 100%; justify-content: center; }

/* Belt-and-braces: drawer NEVER shows on desktop. */
@media (min-width: 769px) {
  .drawer, .drawer-backdrop { display: none !important; }
}

/* ============================================================
   HERO — institutional, with depth
   ============================================================ */
.hero {
  background: var(--navy-900);
  color: #fff;
  position: relative;
  overflow: hidden;
  padding: 96px 0 112px;
  border-bottom: 1px solid var(--navy-700);
  /* Layered background:
     1. Warm red glow upper-right (echoes SCM Capital sphere mark)
     2. Cool navy depth lower-left (Voranex anchor)
     3. Subtle dot-grid for institutional texture */
  background-image:
    radial-gradient(ellipse 60% 50% at 92% 8%, rgba(179, 24, 30, 0.18), transparent 65%),
    radial-gradient(ellipse 55% 60% at 5% 100%, rgba(23, 39, 75, 0.6), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.045) 1px, transparent 0);
  background-size: auto, auto, 28px 28px;
}
/* Decorative red rule running diagonally across the bottom-left */
.hero::before {
  content: "";
  position: absolute;
  left: -120px; bottom: -80px;
  width: 520px; height: 1px;
  background: linear-gradient(to right, transparent, var(--red-600) 30%, var(--red-500) 70%, transparent);
  transform: rotate(-12deg);
  transform-origin: left bottom;
  opacity: 0.7;
  pointer-events: none;
}
/* Subtle horizontal hairline across the upper section — like a chart axis */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 64px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.04) 20%, rgba(255,255,255,0.04) 80%, transparent);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-inner { max-width: 760px; }

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.6875rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 36px;
  padding: 7px 14px 7px 10px;
  background: rgba(179, 24, 30, 0.12);
  border: 1px solid rgba(179, 24, 30, 0.4);
  border-radius: 100px;
}
.hero-meta strong {
  color: #fff;
  font-weight: 700;
}
.hero-meta::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red-500);
  box-shadow: 0 0 0 3px rgba(198, 58, 43, 0.25);
  animation: hero-pulse 2.4s ease-in-out infinite;
}
@keyframes hero-pulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 3px rgba(198, 58, 43, 0.25); }
  50%      { opacity: 0.6; box-shadow: 0 0 0 6px rgba(198, 58, 43, 0.06); }
}

.hero h1 {
  font-family: var(--font-serif);
  color: #fff; font-weight: 400;
  font-size: clamp(2.5rem, 5.4vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--red-500);
}

.hero-sub {
  font-size: 1.125rem; line-height: 1.55;
  color: rgba(255,255,255,0.72);
  max-width: 540px;
  margin: 0 0 40px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Countdown (used by quiz.php locked panel only) ── */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.countdown-unit {
  padding: 4px 0;
  text-align: left;
  border-right: 1px solid var(--rule);
}
.countdown-unit:last-child { border-right: none; }
.countdown-unit:not(:first-child) { padding-left: 12px; }
.countdown-unit .num {
  font-family: var(--font-serif);
  font-size: 1.75rem; font-weight: 400;
  color: var(--navy-800);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.countdown-unit .lbl {
  display: block;
  font-family: var(--font-mono); font-size: 0.625rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-5); margin-top: 6px;
}

/* ── Mobile ── */
@media (max-width: 880px) {
  .hero { padding: 56px 0 72px; }
  .hero h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
  .hero-meta { margin-bottom: 20px; }
  .hero-sub { font-size: 1rem; margin-bottom: 32px; }
}


/* ===== Section header (editorial) ===== */
.section-head {
  display: grid; grid-template-columns: 280px 1fr; gap: 64px;
  margin-bottom: 56px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  align-items: end;
}
.section-head .lead {
  font-family: var(--font-serif);
  font-size: 1.25rem; line-height: 1.4;
  color: var(--ink-2); font-weight: 400;
}
.section-head h2 { margin-bottom: 0; }
.section-head .num-tag {
  font-family: var(--font-mono);
  color: var(--gold-600);
  font-size: 0.8125rem; letter-spacing: 0.15em;
  text-transform: uppercase; margin-bottom: 12px;
}

/* ===== Day cards (landing) ===== */
.day-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.day-card {
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  position: relative;
  transition: background var(--transition);
}
.day-card:last-child { border-right: none; }
.day-card:hover { background: var(--navy-50); }
.day-card .day-badge {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-600); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.day-card .day-badge .num {
  font-family: var(--font-serif); font-size: 2.25rem; line-height: 1;
  color: var(--navy-800); font-weight: 400; letter-spacing: -0.02em;
}
.day-card h3 {
  font-family: var(--font-serif); font-size: 1.375rem;
  color: var(--navy-800); margin-bottom: 14px;
  font-weight: 500; letter-spacing: -0.015em;
}
.day-card .audience { color: var(--ink-3); font-size: 0.9375rem; margin-bottom: 18px; }
.day-card .time {
  font-family: var(--font-mono); color: var(--ink-4); font-size: 0.8125rem;
  letter-spacing: 0.04em;
  padding-top: 14px; border-top: 1px solid var(--rule);
}

/* ===== Feature blocks ===== */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.feature { padding: 0; background: transparent; }
.feature .icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: var(--gold-600);
  margin-bottom: 18px;
}
.feature .icon svg { width: 24px; height: 24px; stroke-width: 1.5; }
.feature h4 { font-size: 1rem; margin-bottom: 6px; color: var(--navy-800); font-weight: 600; }
.feature p { color: var(--ink-3); margin: 0; font-size: 0.9375rem; line-height: 1.55; }

/* ===== Agenda accordion ===== */
.accordion { border-top: 1px solid var(--rule); }
.accordion-item { border-bottom: 1px solid var(--rule); background: transparent; }
.accordion-trigger {
  width: 100%; background: none; border: none;
  padding: 24px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  cursor: pointer; text-align: left;
  font-family: var(--font-serif);
  font-size: 1.25rem; color: var(--navy-800); font-weight: 500;
  letter-spacing: -0.015em;
  transition: color var(--transition);
}
.accordion-trigger:hover { color: var(--gold-700); }
.accordion-trigger .meta {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink-4); font-weight: 500;
}
.accordion-trigger .arrow {
  width: 24px; height: 24px; flex-shrink: 0;
  color: var(--ink-4); transition: transform var(--transition);
}
.accordion-item.open .accordion-trigger .arrow { transform: rotate(180deg); color: var(--gold-600); }
.accordion-body { display: none; padding: 0 0 32px; color: var(--ink-2); }
.accordion-item.open .accordion-body { display: block; }
.accordion-body ul { padding-left: 0; list-style: none; }
.accordion-body li {
  padding: 14px 0; display: grid; grid-template-columns: 160px 1fr;
  gap: 24px; border-top: 1px solid var(--rule-2);
}
.accordion-body li:first-child { border-top: none; }
.accordion-body .when {
  font-family: var(--font-mono); font-size: 0.8125rem; color: var(--gold-700);
  letter-spacing: 0.02em;
}
.accordion-body .what strong {
  display: block; color: var(--navy-800); font-weight: 600; margin-bottom: 4px;
}

/* =================================================================
   Venue section
   ================================================================= */
.venue-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 40px;
  align-items: stretch;
}
.venue-info {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.venue-card {
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.venue-card .venue-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-600);
  font-weight: 600;
  margin-bottom: 8px;
}
.venue-card .venue-value {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.venue-card .venue-value a {
  color: var(--navy-800);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 150ms ease;
}
.venue-card .venue-value a:hover {
  border-color: var(--red-600);
  color: var(--red-700);
}
.venue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.venue-map {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--rule);
  min-height: 420px;
  background: var(--paper);
}
.venue-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 820px) {
  .venue-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .venue-map { min-height: 320px; }
  .venue-actions .btn { flex: 1; justify-content: center; min-width: 0; }
}

/* ===== Facilitator block ===== */
.facilitator {
  display: grid; grid-template-columns: 100px 1fr; gap: 32px;
  align-items: start;
  padding: 40px 0;
}
.facilitator .portrait {
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--navy-800); color: var(--gold-500);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 2.25rem; font-weight: 500;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.facilitator .portrait img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.facilitator .badge {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-700); margin-bottom: 6px;
}
.facilitator h3 {
  font-family: var(--font-serif); font-size: 1.5rem;
  color: var(--navy-800); margin-bottom: 4px; font-weight: 500;
}
.facilitator .role { color: var(--ink-3); margin-bottom: 12px; font-size: 0.9375rem; }
.facilitator p { color: var(--ink-2); }

/* ===== Stats bar ===== */
.stats-bar {
  background: var(--navy-900);
  color: #fff;
  padding: 48px 0;
  border-top: 1px solid var(--navy-700);
  border-bottom: 1px solid var(--navy-700);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.stat { padding: 0 32px; border-right: 1px solid rgba(255,255,255,.08); }
.stat:first-child { padding-left: 0; }
.stat:last-child  { border-right: none; padding-right: 0; }
.stat .num {
  font-family: var(--font-serif); font-size: 2.75rem; font-weight: 400;
  color: var(--gold-500); line-height: 1; letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.stat .lbl {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,.6);
}

/* ===== CTA band ===== */
.cta-band {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 80px 0;
  text-align: center;
}
.cta-band h2 {
  font-family: var(--font-serif); font-size: 2.25rem; font-weight: 400;
  margin-bottom: 14px; color: var(--navy-800);
  letter-spacing: -0.02em;
}
.cta-band p {
  color: var(--ink-3); margin-bottom: 32px; max-width: 540px; margin-left: auto; margin-right: auto;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--navy-900);
  color: rgba(255,255,255,.6);
  padding: 56px 0 32px;
  font-size: 0.875rem;
}
.site-footer .grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
  margin-bottom: 40px;
}
.site-footer h5 {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-500); margin-bottom: 16px; font-weight: 500;
}
.site-footer a { color: rgba(255,255,255,.6); display: block; padding: 4px 0; }
.site-footer a:hover { color: var(--gold-500); }
.site-footer .bottom {
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; gap: 24px;
  font-size: 0.8125rem; color: rgba(255,255,255,.5);
  flex-wrap: wrap;
}
.site-footer .bottom .brand {
  font-family: var(--font-serif); color: rgba(255,255,255,.7);
}

/* ===== Forms ===== */
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.form-group label {
  font-family: var(--font-sans);
  font-size: 0.8125rem; font-weight: 500; color: var(--ink-2);
}
.form-group label .req { color: var(--red-500); margin-left: 2px; }
.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password],
.form-group input[type=number],
.form-group input[type=url],
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  font-family: var(--font-sans); font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(13, 27, 62, .08);
}
.form-group textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.form-help { font-size: 0.8125rem; color: var(--ink-4); margin-top: -4px; }

/* Track radio cards */
.track-options { display: grid; gap: 10px; }
.track-option {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
}
.track-option:hover { border-color: var(--navy-700); }
.track-option input { position: absolute; opacity: 0; pointer-events: none; }
.track-option:has(input:checked) {
  border-color: var(--navy-800);
  background: var(--navy-50);
  box-shadow: inset 3px 0 0 var(--gold-500);
}
.track-content strong {
  display: block; font-family: var(--font-sans); color: var(--ink);
  font-size: 0.9375rem; font-weight: 600; margin-bottom: 2px;
}
.track-content .desc { color: var(--ink-4); font-size: 0.8125rem; }

/* Auth pages — split-screen editorial */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: grid; grid-template-columns: 1fr 1fr;
}
.auth-form-col {
  display: flex; align-items: center; justify-content: center;
  padding: 56px 48px;
}
.auth-form-col .auth-form { width: 100%; max-width: 420px; }
.auth-form-col h1 {
  font-family: var(--font-serif); font-size: 2rem;
  margin-bottom: 8px; font-weight: 500;
}
.auth-form-col .sub { color: var(--ink-4); margin-bottom: 32px; }

.auth-aside-col {
  background: var(--navy-900);
  color: #fff;
  padding: 56px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-aside-col::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(212,160,23,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(212,160,23,.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom-left, #000, transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom-left, #000, transparent 80%);
}
.auth-aside-col > * { position: relative; z-index: 1; }
.auth-aside-col .quote {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 400;
  line-height: 1.4; max-width: 460px; color: #fff;
  letter-spacing: -0.015em;
}
.auth-aside-col .quote::before {
  content: '"'; display: block;
  font-family: var(--font-serif); font-size: 4rem; line-height: .5;
  color: var(--gold-500); margin-bottom: 16px;
}
.auth-aside-col .attribution {
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(255,255,255,.5); margin-top: 24px;
}

/* ===== Alerts ===== */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 0.9375rem;
  border-left: 3px solid;
  background: var(--surface);
  color: var(--ink-2);
  line-height: 1.5;
}
.alert-error   { border-color: var(--red-500); background: #FEF4F2; color: #7F1D1D; }
.alert-success { border-color: var(--green-600); background: #F0FDF4; color: #14532D; }
.alert-info    { border-color: var(--navy-700); background: var(--navy-50); color: var(--navy-900); }

/* ===== Status pills ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 3px;
  background: var(--navy-50);
  color: var(--ink-3);
  white-space: nowrap;
}
.badge-success { background: var(--green-50);   color: var(--green-700); }
.badge-danger  { background: #FEF2F2;            color: var(--red-700); }
.badge-warn    { background: #FEF6E5;            color: var(--gold-700); }
.badge-info    { background: #EFF4FF;            color: #1E40AF; }
.badge-primary { background: var(--navy-50);     color: var(--navy-800); }
.badge-gold    { background: var(--gold-50);     color: var(--gold-700); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============================================================
   APP SHELL — dashboard / admin
   ============================================================ */

.app-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  background: var(--paper);
}

.sidebar {
  background: var(--navy-900);
  color: rgba(255,255,255,.7);
  padding: 24px 0;
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--navy-700);
  display: flex; flex-direction: column;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 16px;
  color: #fff;
}
.sidebar .brand .mark {
  width: 32px; height: 32px;
  background: var(--red-600); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 700;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.sidebar .brand .text {
  font-family: var(--font-serif); font-size: 0.9375rem;
  color: #fff; font-weight: 500;
  line-height: 1.2;
}
.sidebar .brand .text small {
  display: block; font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,.4); font-weight: 500; margin-top: 2px;
}

.sidebar nav { display: flex; flex-direction: column; padding: 0 12px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  color: rgba(255,255,255,.65);
  font-size: 0.875rem; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-decoration: none;
}
.sidebar nav a svg { width: 16px; height: 16px; stroke-width: 1.75; flex-shrink: 0; }
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.sidebar nav a.active {
  color: #fff; background: var(--navy-700);
  box-shadow: inset 2px 0 0 var(--gold-500);
}
.sidebar .nav-section {
  font-family: var(--font-mono);
  font-size: 0.6875rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(255,255,255,.35);
  padding: 20px 12px 8px; font-weight: 500;
}

.main { min-width: 0; }
.topbar {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--rule);
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.topbar .crumb {
  font-family: var(--font-mono);
  font-size: 0.6875rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink-4);
  font-weight: 500;
}
.topbar .title {
  font-family: var(--font-serif); font-weight: 500;
  color: var(--ink); font-size: 1.0625rem; margin-top: 2px;
  letter-spacing: -0.01em;
}
.topbar .user-chip {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 4px 4px 4px 12px;
  border-radius: 100px;
  transition: background 150ms ease;
}
.topbar .user-chip:hover { background: var(--navy-50); }
.topbar .user-chip .name {
  font-size: 0.875rem; font-weight: 600; color: var(--ink); text-align: right;
}
.topbar .user-chip .role {
  font-size: 0.75rem; color: var(--ink-4); text-align: right;
}

/* Avatar — universal style for all .avatar spans, supports photo OR initials */
/* Avatar — universal style for all .avatar spans, supports photo OR initials.
   The wrapper is a positioned block; initials sit centered via flex,
   photos absolutely fill the box so they're clipped to the circle. */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-800);
  color: #fff;
  border-radius: 50%;
  font-family: var(--font-mono); font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  /* Don't let the helper's inline width/height get distorted by parent flex layouts */
  box-sizing: border-box;
  vertical-align: middle;
}
.avatar.has-photo {
  background: var(--paper);
}
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Legacy / topbar-specific overrides kept compatible */
.topbar .avatar { width: 36px; height: 36px; font-size: 0.8125rem; }

/* Mobile-topbar avatar link wrapper */
.mt-avatar-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 50%;
  transition: opacity 150ms ease;
}
.mt-avatar-link:hover { opacity: 0.8; }

/* Profile page — large avatar with subtle ring */
.profile-avatar-lg {
  box-shadow: 0 0 0 1px var(--rule), 0 12px 28px -12px rgba(13, 27, 62, 0.18);
}

.main > .content { padding: 32px; max-width: 1400px; margin: 0 auto; }

/* ===== Page-head pattern ===== */
.page-head {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  flex-wrap: wrap;
}
.page-head .title-block .eyebrow { margin-bottom: 6px; }
.page-head h1 {
  font-family: var(--font-serif); font-size: 1.75rem;
  font-weight: 500; letter-spacing: -0.02em;
  margin: 0;
}
.page-head .subtitle { color: var(--ink-4); margin-top: 6px; font-size: 0.9375rem; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Panels ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.panel.flush { padding: 0; overflow: hidden; }
.panel-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.panel-head h3, .panel > h3 {
  font-family: var(--font-serif); font-size: 1rem; font-weight: 600;
  color: var(--ink); margin: 0; letter-spacing: -0.01em;
}
.panel > h3 { margin-bottom: 16px; }

/* ===== Dashboard greeting ===== */
.greeting {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.greeting::before {
  content: ''; position: absolute;
  top: 0; left: 0; bottom: 0; width: 3px;
  background: var(--gold-500);
}
.greeting .eyebrow { margin-bottom: 6px; }
.greeting h1 {
  font-family: var(--font-serif); font-size: 1.625rem; font-weight: 500;
  color: var(--ink); margin: 0 0 4px;
  letter-spacing: -0.015em;
}
.greeting p { color: var(--ink-4); margin: 0; font-size: 0.9375rem; }
.greeting .greeting-venue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 12px;
  background: rgba(179, 24, 30, 0.06);
  border: 1px solid rgba(179, 24, 30, 0.15);
  border-radius: 100px;
  font-size: 0.8125rem;
  color: var(--ink-2);
  font-weight: 400;
}
.greeting .greeting-venue svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color: var(--red-600);
}
.greeting .greeting-venue strong {
  color: var(--navy-800);
  font-weight: 700;
}
.greeting .status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--navy-50);
  color: var(--navy-800);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.05em; font-weight: 500;
}
.greeting .status svg { width: 14px; height: 14px; }

/* ===== Metric cards ===== */
.metric-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  transition: border-color var(--transition);
}
.metric-card:hover { border-color: var(--ink-6); }
.metric-card .label {
  font-family: var(--font-mono);
  font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 12px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
}
.metric-card .label .ico { width: 14px; height: 14px; color: var(--ink-5); }
.metric-card .value {
  font-family: var(--font-serif);
  font-size: 2rem; font-weight: 500;
  color: var(--ink); line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}
.metric-card .value small {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 1rem; color: var(--ink-4); margin-left: 2px;
}
.metric-card .sub { color: var(--ink-4); font-size: 0.8125rem; margin-top: 4px; }
.metric-card .progress {
  height: 3px; background: var(--rule); border-radius: 999px;
  overflow: hidden; margin-top: 14px;
}
.metric-card .progress > span {
  display: block; height: 100%; background: var(--gold-500);
  border-radius: 999px; transition: width .6s ease;
}

/* ===== Dashboard layout ===== */
.dashboard-row {
  display: grid; grid-template-columns: 1.5fr 1fr;
  gap: 24px; margin-bottom: 24px;
}

/* Quick actions list */
.action-list { display: flex; flex-direction: column; }
.action-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink-2);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color var(--transition);
}
.action-row:last-child { border-bottom: none; }
.action-row:hover { color: var(--navy-800); }
.action-row .ico {
  width: 36px; height: 36px;
  background: var(--navy-50);
  color: var(--navy-800);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.action-row .ico svg { width: 16px; height: 16px; stroke-width: 1.75; }
.action-row:hover .ico { background: var(--navy-800); color: var(--gold-500); }
.action-row .label { flex: 1; font-weight: 500; }
.action-row .arr {
  color: var(--ink-5);
  transition: transform var(--transition), color var(--transition);
}
.action-row:hover .arr { color: var(--navy-800); transform: translateX(2px); }

/* Timeline items */
.timeline-item {
  display: grid; grid-template-columns: 56px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-2);
  align-items: center;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item .when {
  width: 56px; padding: 8px 0; text-align: center;
  background: var(--navy-50);
  border-radius: var(--radius-sm);
  color: var(--navy-800);
}
.timeline-item .when strong {
  display: block; font-family: var(--font-serif);
  font-size: 1.125rem; font-weight: 500;
  line-height: 1; color: var(--navy-800);
}
.timeline-item .when small {
  display: block; font-family: var(--font-mono);
  font-size: 0.625rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-4);
  margin-top: 4px; font-weight: 500;
}
.timeline-item .what strong {
  display: block; color: var(--ink); font-size: 0.9375rem;
  font-weight: 600; margin-bottom: 2px;
}
.timeline-item .what .time {
  color: var(--ink-4); font-size: 0.8125rem;
  font-family: var(--font-mono);
}

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.data-table th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-4);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.data-table tr:hover td { background: var(--paper); }
.data-table code {
  font-family: var(--font-mono); font-size: 0.8125rem;
  background: var(--navy-50); color: var(--navy-800);
  padding: 1px 6px; border-radius: 3px;
}
.data-table small { color: var(--ink-4); }

/* Filter bar */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 16px;
  align-items: flex-end;
}
.filter-bar .field { display: flex; flex-direction: column; gap: 4px; }
.filter-bar label {
  font-family: var(--font-mono); font-size: 0.625rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 500;
}
.filter-bar select, .filter-bar input[type=text], .filter-bar input[type=email] {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit; font-size: 0.875rem;
  min-width: 160px;
}

/* ===== Pre-reading ===== */
.progress-strip {
  background: var(--rule); border-radius: 999px;
  height: 4px; overflow: hidden; margin-top: 14px;
}
.progress-strip > span {
  display: block; height: 100%; background: var(--gold-500);
  border-radius: 999px; transition: width .8s ease;
}

.material-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0;
  border-top: 1px solid var(--rule);
}
.material-card {
  display: flex; flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
  transition: background var(--transition);
}
.material-card:nth-child(2n) { border-right: none; }
.material-card:hover { background: var(--paper); }
.material-card.done::before {
  content: ''; position: absolute;
  top: 0; left: 0; bottom: 0; width: 3px;
  background: var(--green-600);
}
.material-card.locked {
  background: var(--paper);
  opacity: 0.78;
}
.material-card.locked:hover { background: var(--paper); }
.material-card.locked h3, .material-card.locked p { color: var(--ink-4); }
.material-card .top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.material-card .cat {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold-700); font-weight: 500;
}
.material-card.done .cat { color: var(--green-700); }
.material-card .time {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--ink-4);
}
.material-card h3 {
  font-family: var(--font-serif); font-size: 1.125rem; font-weight: 500;
  color: var(--navy-800); margin-bottom: 8px; line-height: 1.3;
  letter-spacing: -0.01em;
}
.material-card h3 .mat-num {
  font-family: var(--font-mono); font-size: 0.75rem;
  font-weight: 600; color: var(--ink-5);
  margin-right: 8px;
  letter-spacing: 0.02em;
}
.material-card p { color: var(--ink-4); font-size: 0.875rem; margin-bottom: 18px; flex: 1; }
.material-card .actions {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}

/* =================================================================
   Inline reading quiz (renders at the bottom of material.php)
   ================================================================= */
.reading-quiz {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 2px solid var(--navy-800);
}
.reading-quiz .rq-head {
  margin-bottom: 24px;
}
.reading-quiz .rq-eyebrow {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--red-600); font-weight: 600;
  margin-bottom: 6px;
}
.reading-quiz .rq-title {
  font-family: var(--font-serif); font-size: 1.5rem;
  color: var(--navy-800); font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  border: 0; padding: 0;
}
.reading-quiz .rq-sub {
  font-family: var(--font-sans); font-size: 0.9375rem;
  color: var(--ink-3); margin: 0;
  line-height: 1.5;
}

/* Result banners (pass/fail) */
.reading-quiz .rq-result {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; border-radius: 8px;
  margin-bottom: 24px;
  font-family: var(--font-sans);
}
.reading-quiz .rq-result-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 700; font-size: 1rem;
  line-height: 1;
}
.reading-quiz .rq-result-title {
  font-weight: 600; font-size: 0.9375rem; margin-bottom: 2px;
}
.reading-quiz .rq-result-msg {
  font-size: 0.875rem;
}
.reading-quiz .rq-pass {
  background: var(--green-50);
  border: 1px solid #BBF0CC;
  color: var(--green-700);
}
.reading-quiz .rq-pass .rq-result-icon { background: var(--green-600); color: #fff; }
.reading-quiz .rq-fail {
  background: var(--red-50);
  border: 1px solid var(--red-100);
  color: var(--red-700);
}
.reading-quiz .rq-fail .rq-result-icon { background: var(--red-600); color: #fff; }

/* Individual question card */
.reading-quiz .rq-question {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 28px 30px;
  margin-bottom: 24px;
}
.reading-quiz .rq-question.is-correct { border-color: #BBF0CC; background: #F8FDF9; }
.reading-quiz .rq-question.is-wrong   { border-color: var(--red-100); background: #FEF8F7; }

.reading-quiz .rq-q-num {
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-5); font-weight: 600;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.reading-quiz .rq-q-status {
  font-family: var(--font-mono); font-size: 0.625rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 3px;
  font-weight: 700;
}
.reading-quiz .rq-q-status-correct {
  background: var(--green-50); color: var(--green-700);
  border: 1px solid #BBF0CC;
}
.reading-quiz .rq-q-status-wrong {
  background: var(--red-50); color: var(--red-700);
  border: 1px solid var(--red-100);
}
.reading-quiz .rq-q-text {
  font-family: var(--font-serif); font-size: 1.1875rem;
  color: var(--navy-800); font-weight: 600;
  line-height: 1.55;
  margin-bottom: 24px;
  letter-spacing: -0.005em;
}

/* Options */
.reading-quiz .rq-options {
  display: flex; flex-direction: column; gap: 12px;
}
.reading-quiz .rq-option {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  background: var(--surface);
  position: relative;
}
.reading-quiz .rq-option:hover {
  border-color: var(--navy-700);
  background: var(--navy-50);
}
.reading-quiz .rq-option input[type="radio"] {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: var(--red-600);
  width: 16px; height: 16px;
}
.reading-quiz .rq-option input[type="radio"]:disabled { cursor: default; }
.reading-quiz .rq-option:has(input:disabled) { cursor: default; }
.reading-quiz .rq-option:has(input:disabled):hover { border-color: var(--rule); background: var(--surface); }

.reading-quiz .rq-opt-letter {
  font-family: var(--font-mono); font-size: 0.8125rem;
  font-weight: 700; color: var(--ink-3);
  flex-shrink: 0;
  background: var(--paper);
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px;
}
.reading-quiz .rq-opt-text {
  font-family: var(--font-sans); font-size: 0.9375rem;
  color: var(--ink-2);
  line-height: 1.55;
  flex: 1;
  padding-top: 2px;
}
.reading-quiz .rq-opt-tag {
  font-family: var(--font-mono); font-size: 0.625rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 3px;
  font-weight: 700;
  flex-shrink: 0;
  align-self: center;
}
.reading-quiz .rq-opt-tag-correct {
  background: var(--green-600); color: #fff;
}
.reading-quiz .rq-opt-tag-wrong {
  background: var(--red-600); color: #fff;
}
.reading-quiz .rq-option.rq-opt-correct {
  border-color: var(--green-600);
  background: #F8FDF9;
}
.reading-quiz .rq-option.rq-opt-correct .rq-opt-letter {
  background: var(--green-600); color: #fff;
}
.reading-quiz .rq-option.rq-opt-wrong {
  border-color: var(--red-600);
  background: #FEF8F7;
}
.reading-quiz .rq-option.rq-opt-wrong .rq-opt-letter {
  background: var(--red-600); color: #fff;
}

/* Explanation under question after submission */
.reading-quiz .rq-explanation {
  margin-top: 22px;
  padding: 16px 18px;
  background: var(--navy-50);
  border-left: 3px solid var(--navy-700);
  border-radius: 0 6px 6px 0;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--ink-2);
  line-height: 1.6;
}
.reading-quiz .rq-explanation strong { color: var(--navy-800); }

/* Quiz actions row */
.reading-quiz .rq-actions {
  display: flex; gap: 12px; align-items: center;
  margin-top: 20px; flex-wrap: wrap;
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .reading-quiz .rq-question { padding: 20px 18px; margin-bottom: 18px; }
  .reading-quiz .rq-q-text { font-size: 1.0625rem; margin-bottom: 20px; }
  .reading-quiz .rq-option { padding: 14px 14px; gap: 12px; }
  .reading-quiz .rq-opt-tag { font-size: 0.5625rem; padding: 2px 5px; }
  .reading-quiz .rq-explanation { margin-top: 18px; padding: 14px 16px; }
  .reading-quiz .rq-actions .btn-lg { width: 100%; }
}

/* Reading view */
.material-body { max-width: 720px; margin: 0 auto; padding: 32px 40px; }
.material-body h1 {
  font-family: var(--font-serif); font-size: 2.25rem;
  font-weight: 500; letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.material-body h2 {
  font-family: var(--font-serif); font-size: 1.5rem;
  margin: 40px 0 14px; color: var(--navy-800);
  font-weight: 500; letter-spacing: -0.015em;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
.material-body h3 {
  font-size: 1.0625rem; color: var(--ink);
  margin: 28px 0 10px; font-weight: 600;
  font-family: var(--font-sans);
}
.material-body .lead {
  font-family: var(--font-serif); font-size: 1.125rem;
  color: var(--ink-3); margin-bottom: 32px;
  padding-bottom: 24px; border-bottom: 1px solid var(--rule);
  line-height: 1.5;
}
.material-body p {
  font-family: var(--font-serif); font-size: 1.0625rem;
  line-height: 1.7; color: var(--ink-2);
  margin-bottom: 20px;
}
.material-body ul, .material-body ol {
  margin: 0 0 20px; padding-left: 24px;
  font-family: var(--font-serif); font-size: 1.0625rem;
  color: var(--ink-2); line-height: 1.7;
}
.material-body li { margin-bottom: 8px; }
.material-body strong { color: var(--ink); }
.material-body code {
  font-family: var(--font-mono); font-size: 0.875em;
  background: var(--navy-50); color: var(--navy-800);
  padding: 1px 6px; border-radius: 3px;
}

/* ===== Resources tabs ===== */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.tabs button {
  background: none; border: none;
  padding: 10px 18px 12px;
  font-family: var(--font-sans); font-size: 0.875rem;
  color: var(--ink-4); font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--navy-800); border-bottom-color: var(--gold-500); }

.video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.video-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.video-card:hover { border-color: var(--ink-6); }
.video-card .embed {
  position: relative; aspect-ratio: 16/9;
  background: var(--navy-900);
}
.video-card .embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.video-card .meta { padding: 16px; }
.video-card h4 {
  font-family: var(--font-serif); font-size: 1rem; font-weight: 500;
  color: var(--navy-800); margin-bottom: 6px; letter-spacing: -0.01em;
}
.video-card .desc { color: var(--ink-4); font-size: 0.8125rem; margin-bottom: 10px; line-height: 1.5; }
.video-card .footer {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); padding-top: 10px; border-top: 1px solid var(--rule);
}

.download-list { display: flex; flex-direction: column; }
.download-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: none;
  transition: background var(--transition);
}
.download-item:first-child { border-top: 1px solid var(--rule); border-radius: var(--radius) var(--radius) 0 0; }
.download-item:last-child  { border-radius: 0 0 var(--radius) var(--radius); }
.download-item:hover { background: var(--paper); }
.download-item .meta strong {
  display: block; color: var(--ink); font-size: 0.9375rem;
  font-weight: 600; margin-bottom: 4px;
}
.download-item .meta .info { color: var(--ink-4); font-size: 0.8125rem; }

/* =================================================================
   Programme agenda — day cards with session timeline
   ================================================================= */
.agenda-list {
  display: flex; flex-direction: column;
  position: relative;
  padding-left: 8px;
}
/* Vertical timeline rule down the left */
.agenda-list::before {
  content: '';
  position: absolute;
  left: 124px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--rule);
}

.agenda-row {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 28px;
  padding: 20px 0;
  position: relative;
}
.agenda-row:not(:last-child) {
  border-bottom: 1px solid var(--rule-2);
}
/* Time-side dot on the timeline rule */
.agenda-row::before {
  content: '';
  position: absolute;
  left: 119px; top: 28px;
  width: 11px; height: 11px;
  background: var(--surface);
  border: 2px solid var(--red-600);
  border-radius: 50%;
  z-index: 1;
}

.agenda-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy-800);
  letter-spacing: -0.005em;
  line-height: 1.4;
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}

.agenda-body {
  min-width: 0;
}
.agenda-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--navy-800);
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 8px;
}
.agenda-desc {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-3);
}

/* Day-card header styling — already inside a .panel, just polish the hierarchy */
.panel .day-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.panel .day-card-head .day-kicker {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-600);
  font-weight: 600;
  margin-bottom: 8px;
}
.panel .day-card-head .day-title {
  font-family: var(--font-serif);
  font-size: 1.625rem;
  font-weight: 500;
  color: var(--navy-800);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 10px;
}
.panel .day-card-head .day-audience {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--ink-3);
  line-height: 1.5;
}
.panel .day-card-head .day-audience strong {
  color: var(--ink); font-weight: 600;
}

/* Mobile */
@media (max-width: 640px) {
  .agenda-list { padding-left: 0; }
  .agenda-list::before { display: none; }
  .agenda-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 0;
  }
  .agenda-row::before { display: none; }
  .agenda-time {
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    color: var(--red-600);
    text-transform: uppercase;
    padding-top: 0;
  }
  .agenda-title { font-size: 1.0625rem; }
  .panel .day-card-head .day-title { font-size: 1.375rem; }
}

/* ===== Quiz ===== */
.quiz-shell {
  max-width: 760px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 32px;
}
.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.quiz-progress {
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 500;
}
.quiz-progress strong { color: var(--ink); font-weight: 600; }
.quiz-timer {
  font-family: var(--font-mono); font-size: 0.9375rem;
  padding: 6px 14px; background: var(--navy-50); color: var(--navy-800);
  border-radius: var(--radius-sm); font-weight: 600;
  letter-spacing: 0.02em;
}
.quiz-timer.warn {
  background: var(--red-500); color: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}

.q-text {
  font-family: var(--font-serif); font-size: 1.25rem;
  color: var(--ink); margin-bottom: 24px;
  font-weight: 500; letter-spacing: -0.01em;
  line-height: 1.4;
}
.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
}
.option:hover { border-color: var(--navy-700); background: var(--paper); }
.option input { display: none; }
.option .letter {
  width: 24px; height: 24px; flex: 0 0 24px;
  background: var(--paper); color: var(--ink-3);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 0.75rem;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.option .text { flex: 1; line-height: 1.5; font-size: 0.9375rem; color: var(--ink-2); padding-top: 1px; }
.option.selected, .option:has(input:checked) {
  border-color: var(--navy-800); background: var(--navy-50);
}
.option.selected .letter, .option:has(input:checked) .letter {
  background: var(--navy-800); color: var(--gold-500); border-color: var(--navy-800);
}
.option.correct { border-color: var(--green-600); background: var(--green-50); }
.option.correct .letter { background: var(--green-600); color: #fff; border-color: var(--green-600); }
.option.wrong   { border-color: var(--red-500); background: #FEF4F2; }
.option.wrong .letter { background: var(--red-500); color: #fff; border-color: var(--red-500); }

.quiz-nav { display: flex; justify-content: space-between; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--rule); }

/* Result */
.result-circle {
  width: 160px; height: 160px;
  margin: 0 auto 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 2.75rem; font-weight: 500;
  color: var(--navy-800);
  background: conic-gradient(var(--gold-500) var(--pct, 0%), var(--rule) 0);
  position: relative;
  letter-spacing: -0.025em;
}
.result-circle::before {
  content: ''; position: absolute; inset: 10px;
  background: var(--surface); border-radius: 50%;
}
.result-circle span { position: relative; z-index: 1; }
.result-circle.fail { color: var(--red-600); background: conic-gradient(var(--red-500) var(--pct, 0%), var(--rule) 0); }

/* Locked quiz state */
.locked-state {
  text-align: center; padding: 64px 32px;
  max-width: 640px; margin: 0 auto;
}
.locked-state .lock-icon {
  width: 48px; height: 48px; margin: 0 auto 20px;
  color: var(--ink-5);
}
.locked-state .lock-icon svg { width: 100%; height: 100%; stroke-width: 1.25; }
.locked-state h2 {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 500;
  margin-bottom: 10px; letter-spacing: -0.015em;
}

/* ===== Certificate ===== */
.cert-page {
  background: var(--surface);
  width: 1056px; max-width: 100%;
  margin: 24px auto;
  padding: 80px 96px;
  border: 1px solid var(--rule);
  position: relative;
  font-family: var(--font-sans);
}
.cert-page::before {
  content: ''; position: absolute; inset: 16px;
  border: 1px solid var(--gold-500);
  pointer-events: none;
}
.cert-header { text-align: center; margin-bottom: 48px; }
.cert-header .crest {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-700); font-weight: 500;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gold-500);
}
.cert-page h1 {
  font-family: var(--font-serif);
  font-size: 2.75rem; font-weight: 400;
  text-align: center; margin: 32px 0 8px;
  color: var(--navy-800); letter-spacing: -0.025em;
}
.cert-page .cert-sub {
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-4); text-align: center;
  margin-bottom: 48px; font-weight: 500;
}
.cert-name {
  text-align: center;
  font-family: var(--font-serif); font-size: 3rem; font-weight: 400;
  color: var(--navy-800);
  font-style: italic;
  border-bottom: 1px solid var(--gold-500);
  display: inline-block;
  padding: 0 80px 16px;
  margin: 0 auto 40px;
  width: auto;
  letter-spacing: -0.02em;
}
.cert-text {
  text-align: center; font-family: var(--font-serif);
  font-size: 1.125rem; color: var(--ink-2); line-height: 1.7;
  max-width: 680px; margin: 0 auto 64px;
}
.cert-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; padding-top: 40px; }
.cert-sig { text-align: center; }
.cert-sig .line { border-top: 1px solid var(--ink-3); padding-top: 8px; margin-top: 48px; }
.cert-sig .name { font-family: var(--font-serif); font-weight: 500; color: var(--navy-800); font-size: 1.0625rem; }
.cert-sig .role { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4); margin-top: 4px; }
.cert-seal {
  position: absolute; right: 80px; bottom: 80px;
  width: 96px; height: 96px;
  border: 2px solid var(--gold-500); border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gold-700);
  font-family: var(--font-mono); font-size: 0.625rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  text-align: center; line-height: 1.4;
}

@media print {
  body { background: #fff; }
  .no-print, .site-header, .sidebar, .topbar, .site-footer { display: none !important; }
  .main { padding: 0; }
  .main > .content { padding: 0; max-width: none; }
  .cert-page { margin: 0; border: none; box-shadow: none; }
  .cert-page::before { inset: 8mm; }
  @page { size: A4 landscape; margin: 0; }
}

/* ===== Empty / misc ===== */
.empty-state {
  text-align: center; padding: 56px 24px;
  color: var(--ink-4);
}
.empty-state .icon {
  width: 36px; height: 36px; margin: 0 auto 14px;
  color: var(--ink-5);
}
.empty-state h3 {
  font-family: var(--font-serif); color: var(--navy-800);
  font-size: 1.0625rem; font-weight: 500;
  margin-bottom: 4px;
}

code {
  font-family: var(--font-mono); font-size: 0.875em;
  background: var(--navy-50); color: var(--navy-800);
  padding: 1px 6px; border-radius: 3px;
}
details { font-size: 0.875rem; }
details summary { cursor: pointer; user-select: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .container, .container-narrow { padding: 0 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .day-cards { grid-template-columns: 1fr; }
  .day-card { border-right: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 24px; border-right: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-last-child(-n+2) { border-bottom: none; }
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .dashboard-row { grid-template-columns: 1fr; }
  .material-grid { grid-template-columns: 1fr; }
  .material-card { border-right: none; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside-col { display: none; }
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Mobile topbar (dashboard/admin shell — shown only on mobile)
   ============================================================ */
.mobile-topbar {
  display: none; /* shown via media query below */
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 60;
  height: 56px;
}
.mobile-topbar .nav-toggle {
  background: transparent;
  border: 1px solid var(--ink-5);
  border-radius: 6px;
  padding: 0;
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
}
.mobile-topbar .nav-toggle:hover {
  background: var(--navy-50);
  border-color: var(--navy-800);
}
.mobile-topbar .nav-toggle .bars {
  position: relative;
  width: 18px; height: 12px;
  display: block;
}
.mobile-topbar .nav-toggle .bars span {
  position: absolute; left: 0; right: 0;
  height: 2px; background: currentColor;
  border-radius: 1px;
  transition: transform 200ms ease, opacity 200ms ease, top 200ms ease;
}
.mobile-topbar .nav-toggle .bars span:nth-child(1) { top: 0; }
.mobile-topbar .nav-toggle .bars span:nth-child(2) { top: 5px; }
.mobile-topbar .nav-toggle .bars span:nth-child(3) { top: 10px; }
.mobile-topbar .nav-toggle.open .bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.mobile-topbar .nav-toggle.open .bars span:nth-child(2) { opacity: 0; }
.mobile-topbar .nav-toggle.open .bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

.mobile-topbar .mt-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
  overflow: hidden;
}
.mobile-topbar .mt-brand .mark {
  width: 28px; height: 28px;
  background: var(--red-600);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 700;
  border-radius: 4px;
  flex-shrink: 0;
}
.mobile-topbar .mt-brand .text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-topbar .mt-avatar {
  width: 32px; height: 32px;
  font-size: 0.75rem;
}

/* Mobile — sidebar becomes a slide-in drawer */
@media (max-width: 768px) {
  body { font-size: 14px; }
  .container, .container-narrow { padding: 0 20px; }
  .section { padding: 56px 0; }

  .site-header .wrap { padding: 0 16px; height: 60px; }
  .site-header .primary-nav     { display: none !important; }
  .site-header .primary-actions { display: none !important; }
  .site-header .logo .meta      { display: none; }
  .site-header .nav-toggle      { display: inline-flex !important; }

  .hero { padding: 56px 0 72px; }
  .hero h1 { font-size: 2.25rem; }

  /* ── Dashboard / Admin layout becomes single-column with topbar ── */
  .app-shell { grid-template-columns: 1fr; }

  /* Show the mobile topbar */
  .mobile-topbar { display: flex; }

  /* Hide the desktop topbar (in main >) since we have the mobile topbar */
  .main > .topbar { display: none; }

  /* The sidebar becomes a slide-in drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(86vw, 320px);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 16px 0 48px -16px rgba(0,0,0,0.35);
  }
  .sidebar.is-open { transform: translateX(0); }

  /* Backdrop */
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(10, 20, 41, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 150;
    animation: backdrop-in 200ms ease;
  }
  .sidebar-backdrop[hidden] { display: none; }

  /* Mobile drawer shows full labels (not icon rail) */
  .sidebar nav a .label { display: inline; }
  .sidebar nav a { padding: 12px 14px; justify-content: flex-start; }
  .sidebar nav a.active { box-shadow: inset 3px 0 0 var(--red-500); }
  .sidebar .brand { padding: 18px 18px 16px; justify-content: flex-start; }
  .sidebar .brand .text { display: flex; }

  .topbar { padding: 12px 16px; }
  .topbar .user-chip .name, .topbar .user-chip .role { display: none; }
  .main > .content { padding: 20px 16px; }

  .metric-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-bar { padding: 32px 0; }

  .page-head { flex-direction: column; align-items: flex-start; }
  .greeting { padding: 20px; flex-direction: column; align-items: flex-start; }
  .filter-bar { padding: 12px; }
  .filter-bar select, .filter-bar input { min-width: 0; width: 100%; }
  .filter-bar .field { flex: 1; min-width: 140px; }
  .accordion-body li { grid-template-columns: 1fr; gap: 4px; }

  .quiz-shell { padding: 20px; }
  .q-text { font-size: 1.125rem; }
  .countdown { grid-template-columns: repeat(4, 1fr); }
  .countdown-unit .num { font-size: 1.75rem; }
  .countdown-unit:not(:first-child) { padding-left: 8px; }

  .material-body { padding: 24px 20px; }
  .material-body h1 { font-size: 1.75rem; }
  .material-body p, .material-body ul, .material-body ol { font-size: 1rem; }

  .cert-page { padding: 32px 24px; }
  .cert-name { font-size: 1.75rem; padding: 0 20px 8px; }
  .cert-page h1 { font-size: 1.75rem; }
  .cert-footer { grid-template-columns: 1fr; gap: 32px; }

  .site-footer .grid { grid-template-columns: 1fr; gap: 32px; }
}

/* Very narrow phones — drop the wordmark, leave the mark + hamburger. */
@media (max-width: 380px) {
  .site-header .logo .logo-text { display: none; }
}