/* All color and type tokens live in one file so the theme inverts in one
   place. Must stay the first rule: @import is only valid at the top. Pages
   with their own inline <style> block link tokens.css directly instead. */
@import url('/assets/tokens.css');

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The HTML `hidden` attribute must always win over author `display` rules on
   the same element — otherwise sections we toggle via el.hidden still render. */
[hidden] { display: none !important; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  height: 100vh;
}

.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--charcoal);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* Flash only the "MEMBER PORTAL" badge on the auth/portal cards — the
   Courses "COURSE LIBRARY" badge (not inside .auth-card) stays steady. */
.auth-card .brand-badge {
  border: 1px solid rgba(255,255,255,0.85);
  animation: badge-flash 3s ease-in-out infinite;
}

/* Periodic attention flash — stays red, white outline brightens + glows. */
@keyframes badge-flash {
  0%, 72%, 100% {
    background: var(--red);
    border-color: rgba(255,255,255,0.85);
    box-shadow: 0 0 0 rgba(227, 24, 55,0);
    transform: scale(1);
  }
  82% {
    background: #FF2E4C;
    border-color: #ffffff;
    box-shadow: 0 0 16px 2px rgba(227, 24, 55,0.9), 0 0 0 2px rgba(255,255,255,0.55);
    transform: scale(1.05);
  }
  92% {
    background: var(--red);
    border-color: rgba(255,255,255,0.85);
    box-shadow: 0 0 0 rgba(227, 24, 55,0);
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card .brand-badge { animation: none; }
}

.brand-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  display: inline-block;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--white);
}

.sidebar-title span { color: var(--red); }

.sidebar-sub {
  font-size: 11px;
  color: var(--gray-light);
  margin-top: 6px;
  letter-spacing: 0.03em;
}

.progress-wrap {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label span:first-child {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-label span:last-child {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--red);
  font-weight: 500;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.pillar-section {
  padding: 16px 24px 8px;
}

.pillar-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gray-mid);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pillar-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  position: relative;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--surface);
  border-color: var(--border);
}

.nav-item.active {
  background: rgba(227, 24, 55,0.12);
  border-color: rgba(227, 24, 55,0.3);
}

.nav-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-light);
  flex-shrink: 0;
  transition: all 0.15s;
}

.nav-item.active .nav-num {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.nav-item.completed .nav-num {
  background: var(--surface);
  border-color: #3A5C3A;
  color: #5CAD5C;
}

.nav-item.completed .nav-num::after {
  content: '✓';
  font-size: 12px;
}

.nav-item.completed .nav-num span { display: none; }

.nav-text { flex: 1; min-width: 0; }

.nav-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item.active .nav-title { color: #FF6B6B; }

.nav-meta {
  font-size: 10px;
  color: var(--gray-mid);
  margin-top: 2px;
}

.nav-tag {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* Pillar coding in monochrome: three grey steps, red reserved for "all". */
.tag-p1 { background: var(--surface2); color: var(--gray-600); }
.tag-p2 { background: var(--gray-dark); color: var(--ink); }
.tag-p3 { background: var(--accent); color: var(--paper); }
.tag-all { background: rgba(227, 24, 55,0.2); color: #FF7070; }

.sidebar-footer {
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.cert-status {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.cert-status-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gray-light);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.cert-status-val {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--gray-mid);
}

.cert-status-val.active { color: var(--accent); }

.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.main::-webkit-scrollbar { width: 4px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.topbar {
  background: var(--charcoal);
  border-bottom: 1px solid var(--border);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-breadcrumb {
  font-size: 12px;
  color: var(--gray-mid);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.topbar-breadcrumb span { color: var(--red); }

.breadcrumb-link {
  color: var(--gray-light);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb-link:hover { color: var(--white); }

.topbar-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  font-family: var(--font-body);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--white);
}

.btn-ghost:hover {
  border-color: var(--white);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
}

.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(227, 24, 55,0.25);
}

/* Attention CTA — breathing glow + slow scale pulse + periodic shine sweep
   so the button reads as "live" and draws the eye. Pauses its idle motion
   on hover/focus and hands off to the standard lift. Honors reduced-motion. */
.btn-cta-pulse {
  position: relative;
  overflow: hidden;
  animation: cta-breathe 2.6s ease-in-out infinite;
  will-change: transform, box-shadow;
}

.btn-cta-pulse::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  transform: translateX(-180%) skewX(-18deg);
  animation: cta-shine 2.6s ease-in-out infinite;
  pointer-events: none;
}

.btn-cta-pulse:hover,
.btn-cta-pulse:focus-visible {
  animation-play-state: paused;
}

@keyframes cta-breathe {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(227, 24, 55, 0.0), 0 6px 18px rgba(227, 24, 55, 0.18);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 22px rgba(227, 24, 55, 0.55), 0 10px 28px rgba(227, 24, 55, 0.35);
  }
}

@keyframes cta-shine {
  0%   { transform: translateX(-180%) skewX(-18deg); }
  /* Sweep happens quickly, then rests until the next cycle. */
  35%  { transform: translateX(260%) skewX(-18deg); }
  100% { transform: translateX(260%) skewX(-18deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-cta-pulse { animation: none; }
  .btn-cta-pulse::after { animation: none; display: none; }
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--white);
}
.btn-outline:hover { border-color: var(--white); transform: translateY(-2px); }

.btn-lg { padding: 14px 28px; font-size: 15px; }

.btn-success {
  background: #1C3B1C;
  color: #5CAD5C;
  border: 1px solid #2E5A2E;
}

.content {
  padding: 48px 48px 80px;
  max-width: 900px;
}

.module-header {
  margin-bottom: 40px;
}

.module-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.module-eyebrow .num {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--red);
}

.module-eyebrow .divider {
  width: 32px;
  height: 2px;
  background: var(--red);
  opacity: 0.4;
}

.module-eyebrow .pillar-name {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--gray-light);
  text-transform: uppercase;
}

.module-title {
  font-family: var(--font-display);
  font-size: 52px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--white);
  margin-bottom: 16px;
}

.module-title span { color: var(--red); }

.module-desc {
  font-size: 15px;
  color: var(--white-dim);
  line-height: 1.7;
  max-width: 620px;
}

.module-meta {
  display: flex;
  gap: 24px;
  margin-top: 20px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-mid);
  font-family: var(--font-mono);
}

.meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.6;
}

.divider-line {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

.lesson-block {
  margin-bottom: 40px;
}

.lesson-block h2 {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.06em;
  color: var(--white);
  margin-bottom: 14px;
}

.lesson-block p {
  font-size: 15px;
  color: var(--white-dim);
  line-height: 1.75;
  margin-bottom: 14px;
}

.lesson-block p:last-child { margin-bottom: 0; }

.callout {
  background: rgba(227, 24, 55,0.08);
  border: 1px solid rgba(227, 24, 55,0.25);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 18px 20px;
  margin: 24px 0;
}

.callout-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.callout p {
  font-size: 14px;
  color: var(--white);
  line-height: 1.6;
  margin: 0;
}

.framework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.framework-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  transition: border-color 0.15s;
}

.framework-card:hover { border-color: rgba(227, 24, 55,0.4); }

.fc-icon {
  font-size: 22px;
  margin-bottom: 10px;
}

.fc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.fc-desc {
  font-size: 12px;
  color: var(--gray-light);
  line-height: 1.5;
}

.exercise {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 28px 0;
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.exercise-badge {
  background: var(--accent);
  color: var(--black);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.exercise-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.exercise p {
  font-size: 13px;
  color: var(--white-dim);
  line-height: 1.65;
  margin-bottom: 14px;
}

.exercise-questions { list-style: none; }

.exercise-questions li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--white-dim);
  line-height: 1.55;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.exercise-questions li:last-child { border-bottom: none; }

.exercise-questions li::before {
  content: attr(data-n);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--red);
  min-width: 18px;
  padding-top: 1px;
}

.notes-area {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.65;
  padding: 14px;
  resize: vertical;
  margin-top: 14px;
  min-height: 100px;
  transition: border-color 0.15s;
  outline: none;
}

.notes-area:focus { border-color: rgba(227, 24, 55,0.5); }
.notes-area::placeholder { color: var(--gray-mid); }

.key-list { list-style: none; margin: 16px 0; }

.key-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--white-dim);
  line-height: 1.55;
}

.key-list li:last-child { border-bottom: none; }

.key-list li::before {
  content: '→';
  color: var(--red);
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.quote-block {
  border-left: 3px solid var(--red);
  padding: 16px 20px;
  margin: 28px 0;
  background: rgba(227, 24, 55,0.04);
  border-radius: 0 8px 8px 0;
}

.quote-text {
  font-size: 17px;
  font-style: italic;
  color: var(--white);
  line-height: 1.65;
  margin-bottom: 8px;
}

.quote-attr {
  font-size: 11px;
  color: var(--gray-mid);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
  border-top: 1px solid var(--border);
  background: var(--charcoal);
  position: sticky;
  bottom: 0;
}

.footer-progress {
  font-size: 12px;
  color: var(--gray-mid);
  font-family: var(--font-mono);
}

.footer-progress span { color: var(--white); }

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 32px 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}

.stat-value.red { color: var(--red); }
.stat-value.gold { color: var(--accent); }

.stat-sub {
  font-size: 11px;
  color: var(--gray-mid);
  margin-top: 6px;
}

.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }

.tier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  position: relative;
}

.tier-card.featured {
  border-color: rgba(227, 24, 55,0.5);
  background: rgba(227, 24, 55,0.06);
}

.tier-tag {
  position: absolute;
  top: -1px;
  right: 16px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 0 0 6px 6px;
  font-family: var(--font-mono);
}

.tier-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-bottom: 4px;
}

.tier-price {
  font-size: 26px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 14px;
}

.tier-price sup {
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-light);
  vertical-align: super;
}

.tier-features { list-style: none; }

.tier-features li {
  font-size: 12px;
  color: var(--white-dim);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-features li:last-child { border-bottom: none; }

.tier-features li::before {
  content: '✓';
  color: #5CAD5C;
  font-size: 11px;
  flex-shrink: 0;
}

.flow-steps {
  display: flex;
  gap: 0;
  margin: 24px 0;
  flex-wrap: wrap;
}

.flow-step {
  flex: 1;
  min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 14px;
  position: relative;
  transition: background 0.15s;
}

.flow-step:not(:first-child) { border-left: none; }
.flow-step:first-child { border-radius: 10px 0 0 10px; }
.flow-step:last-child { border-radius: 0 10px 10px 0; }

.flow-step.done { background: rgba(92,173,92,0.07); border-color: rgba(92,173,92,0.3); }
.flow-step.current { background: rgba(227, 24, 55,0.08); border-color: rgba(227, 24, 55,0.4); }

.flow-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray-mid);
  margin-bottom: 6px;
  letter-spacing: 0.08em;
}

.flow-step.done .flow-num { color: #5CAD5C; }
.flow-step.current .flow-num { color: var(--red); }

.flow-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}

.flow-desc {
  font-size: 11px;
  color: var(--gray-mid);
  line-height: 1.4;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.content { animation: fadeIn 0.3s ease; }

.completion-banner {
  background: linear-gradient(135deg, rgba(92,173,92,0.12), rgba(92,173,92,0.04));
  border: 1px solid rgba(92,173,92,0.3);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin: 32px 0;
}

.completion-banner h3 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.06em;
  color: #5CAD5C;
  margin-bottom: 8px;
}

.completion-banner p {
  font-size: 14px;
  color: var(--white-dim);
}

.hidden { display: none; }

/* ── Auth / admin / owner ─────────────────────────────────────────────── */

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 10px;
  padding-right: 10px;
  border-right: 1px solid var(--border);
  position: relative;
}

.user-chip-email {
  font-size: 12px;
  color: var(--gray-light);
  font-family: var(--font-mono);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep the sign-out button on one line and out of the squeeze */
.user-chip #btn-signout {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Thin divider in front of the avatar groups identity (avatar · name ·
   sign out) apart from the utility icons (search, bell) and admin menu. */
.user-chip .c-avatar-link {
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

.user-chip-link {
  font-size: 11px;
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.user-chip-link:hover { background: var(--surface); border-color: var(--border-red); color: var(--red); }

/* Admin / Owner: high-visibility filled button so privileged users get
   one-click access from any portal page without digging through the menu. */
.user-chip-admin {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
  transition: background 0.15s, filter 0.15s;
}
.user-chip-admin:hover { background: var(--red-dark); filter: brightness(1.05); }
.c-admin-dropdown-toggle { cursor: pointer; line-height: 1; }

.c-admin-dropdown {
  position: relative;
  flex-shrink: 0;
}

.c-admin-dropdown-menu {
  position: fixed;
  background: var(--surface-2);
  border: 1px solid var(--red);
  border-radius: 6px;
  min-width: 170px;
  z-index: 300;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.154);
}

.c-admin-dropdown-item {
  display: block;
  padding: 10px 14px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-strong);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s, color 0.12s;
}
.c-admin-dropdown-item:last-child { border-bottom: none; }
.c-admin-dropdown-item:hover { background: var(--red-tint); color: var(--red); }

.auth-shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 50%, rgba(227, 24, 55,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(227, 24, 55,0.04) 0%, transparent 60%),
    var(--black);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 52px;
  text-align: center;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--white);
  margin: 0 auto 16px;
}
.auth-brand-mark { height: 112px; width: auto; flex-shrink: 0; }
.auth-brand-text { display: flex; flex-direction: column; line-height: 1; }
.auth-brand-line1 {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-light);
}
.auth-brand-line2 {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  margin-top: 3px;
}

.auth-back {
  margin-top: 22px;
  text-align: center;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 48px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  margin: 18px 0 8px;
  text-align: center;
}

.auth-card h1 span { color: var(--red); }

.auth-sub {
  font-size: 14.5px;
  color: var(--gray-light);
  margin-bottom: 32px;
  text-align: center;
}

.auth-form { text-align: left; }

.auth-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gray-light);
  text-transform: uppercase;
  margin-bottom: 7px;
}

.auth-form input,
.auth-form textarea {
  width: 100%;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--white);
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  margin-bottom: 18px;
  outline: none;
  transition: border-color 0.15s;
}

.auth-form textarea {
  resize: vertical;
  min-height: 84px;
}

.auth-form input:focus,
.auth-form textarea:focus { border-color: rgba(227, 24, 55,0.5); }

/* Opt-in consent row — checkbox + fine print, left-aligned. */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  text-transform: none;
  letter-spacing: normal;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--gray-light);
  cursor: pointer;
}
.auth-consent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  flex-shrink: 0;
  accent-color: var(--red);
  cursor: pointer;
}
.auth-consent a { color: var(--red); }

/* Google Places autocomplete dropdown — match the dark auth theme. */
.pac-container {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
  box-shadow: 0 12px 21px rgba(0, 0, 0, 0.168);
  font-family: var(--font-body);
}
.pac-item {
  border-top: 1px solid var(--border);
  color: var(--gray-light);
  padding: 6px 10px;
  cursor: pointer;
}
.pac-item:first-child { border-top: none; }
.pac-item:hover, .pac-item-selected { background: rgba(0, 0, 0,0.05); }
.pac-item-query { color: var(--white); }
.pac-matched { color: var(--red); }
.pac-icon { display: none; }
.pac-container { z-index: 1100; } /* float above sibling form fields */

/* Modern PlaceAutocompleteElement — match the dark auth theme. */
.ob-address-ac {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  font-family: var(--font-body);
  --gmp-mat-color-surface: var(--charcoal);
  --gmp-mat-color-on-surface: var(--white);
  --gmp-mat-color-on-surface-variant: var(--gray-light);
  --gmp-mat-color-outline: var(--border);
  --gmp-mat-color-primary: var(--red);
  --gmp-mat-color-info: var(--red);
}
/* Keep the prediction popup above following fields (no ancestor transforms,
   so z-index alone is enough — body is overflow:auto, not hidden). */
gmp-place-autocomplete,
.ob-address-ac::part(prediction-list) { z-index: 1100; }

/* Onboarding ("Your Details") — larger brand lockup than the auth default. */
.onboarding-card .auth-brand-mark { height: 180px; }
.onboarding-card .brand-badge { font-size: 12px; letter-spacing: 0.14em; padding: 6px 14px; }

/* ── Onboarding: wider, two-column desktop layout (mobile untouched) ──
   All rules below are gated behind min-width, so the mobile experience
   and the shared login/signup cards are completely unaffected. */
@media (min-width: 760px) {
  .onboarding-shell { padding: 64px 24px; }
  .onboarding-card {
    max-width: 780px;
    padding: 56px 64px;
  }
  .onboarding-card .auth-brand-mark { height: 210px; }
  .onboarding-card h1 { font-size: 44px; }
  .onboarding-card .auth-sub { max-width: 540px; margin-left: auto; margin-right: auto; }
  .onboarding-card .auth-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    margin-top: 30px;
  }
  /* Fields wrap label+input; vertical rhythm comes from the input's own
     margin-bottom (16px), matching the mobile spacing. */
  .onboarding-card .ob-field-full { grid-column: 1 / -1; }
}

.auth-form .btn { width: 100%; padding: 14px 18px; font-size: 15px; text-align: center; justify-content: center; }
.auth-form .btn + .btn { margin-top: 10px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--gray-mid);
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.2em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-light);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

.auth-error {
  background: rgba(227, 24, 55,0.12);
  border: 1px solid rgba(227, 24, 55,0.35);
  color: #FF9B9B;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-ok {
  background: rgba(92,173,92,0.1);
  border: 1px solid rgba(92,173,92,0.35);
  color: #9EDB9E;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.btn-google {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-google:hover { background: #e3e0da; }

/* Admin / owner dashboards */

.console-shell {
  min-height: 100vh;
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
}

.console-topbar {
  background: rgba(11, 11, 12, 0.9);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.console-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.console-title span { color: var(--red); }

/* Console-style brand chip mirrors the academy-header brand on console pages. */
.console-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
}
.console-brand-mark {
  height: 38px;
  width: auto;
  flex-shrink: 0;
}
.console-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.console-brand-line1 {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--gray-light);
  text-transform: uppercase;
}
.console-brand-line2 {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--white);
  text-transform: uppercase;
  margin-top: 2px;
}
.console-brand-line2 span { color: var(--red); }
.console-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* Mobile: stack the chip below the brand, scroll links horizontally so
   the topbar never wraps the title and never clips the navigation. */
@media (max-width: 760px) {
  .console-topbar {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px 12px;
  }
  .console-title {
    font-size: 16px;
    letter-spacing: 0.04em;
  }
  .user-chip {
    flex-basis: 100%;
    margin-right: 0;
    padding-right: 0;
    border-right: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .user-chip::-webkit-scrollbar { display: none; }
  .user-chip-link {
    font-size: 11px;
    padding: 4px 8px;
    flex-shrink: 0;
  }
  .user-chip-admin { font-size: 11px; padding: 5px 10px; }
  .user-chip-email { display: none; }
  .user-chip > .c-bell { flex-shrink: 0; }
}

/* Console pages use the full window width on desktop; below 1200px the
   old cap never applied anyway, so phones/tablets are unchanged. */
.console-body {
  padding: 32px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 1200px) {
  .console-body { padding: 32px 44px 64px; }
}

/* CRM uses tighter top padding within the full-width console. */
.console-body:has(.crm-toolbar) {
  padding: 24px 44px 64px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--white);
  margin-bottom: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--white-dim);
}
.data-table th {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
  font-family: var(--font-mono);
}
.data-table td.num { font-family: var(--font-mono); color: var(--white); }
.data-table tr:hover td { background: rgba(0, 0, 0,0.02); }

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.inline-form .field { flex: 1; min-width: 180px; }
.inline-form label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gray-light);
  text-transform: uppercase;
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.inline-form input {
  width: 100%;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
}
.inline-form input:focus { border-color: rgba(227, 24, 55,0.5); }

.pill {
  display: inline-block;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}
.pill-ok { background: rgba(92,173,92,0.15); color: #8AD08A; }
.pill-warn { background: rgba(227, 24, 55,0.15); color: #FF9B9B; }
.pill-muted { background: rgba(160,160,160,0.15); color: var(--gray-light); }
.pill-red { background: rgba(227, 24, 55,0.2); color: #FF7070; }

/* ─── Course builder (manage-courses.html) ──────────────────────────────── */

/* Top-level tab nav: Courses / Coupons */
.console-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.console-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--gray-light);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 16px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.console-tab:hover { color: var(--white); }
.console-tab.is-active {
  color: var(--white);
  border-bottom-color: var(--red);
}

/* Builder header: back link + title + preview button */
.builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.builder-back {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  color: var(--gray-light);
  text-decoration: none;
}
.builder-back:hover { color: var(--red); }

/* Collapsible builder sections styled as cards */
.builder-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.builder-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.builder-section > summary::-webkit-details-marker { display: none; }
.builder-section > summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 6px solid var(--gray-light);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.builder-section[open] > summary::before { transform: rotate(90deg); }
.builder-section > summary:hover { color: var(--white); }
.builder-section > summary:hover::before { border-left-color: var(--red); }
.builder-section-body {
  padding: 0 22px 22px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

/* Inline status <select> in the course list */
.row-status {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
}
.row-status:focus { border-color: rgba(227, 24, 55,0.5); }
.row-status.status-live { color: #8AD08A; }
.row-status.status-inactive { color: #FF7070; }
.row-status.status-coming-soon,
.row-status.status-bundle { color: var(--gray-light); }

/* Course title link in the list — plain white, not a blue hyperlink */
.course-open { color: var(--white); text-decoration: none; }
.course-open:hover { text-decoration: underline; }

/* Inline editable number fields (price / sale) in the course list */
.row-num {
  width: 84px;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 8px;
  outline: none;
}
.row-num:focus { border-color: rgba(227, 24, 55,0.5); }

/* Desktop: consoles span the full window, so scale cards, tables and the
   inline row controls up to use the room. min-width guard keeps the
   compact mobile/tablet sizing untouched. */
@media (min-width: 1200px) {
  .card { padding: 28px 32px; }
  .card h2 { font-size: 22px; }
  .data-table { font-size: 15px; }
  .data-table th, .data-table td { padding: 14px 16px; }
  .data-table th { font-size: 11px; }
  .row-status { font-size: 14px; padding: 6px 10px; }
  .row-num { font-size: 14px; padding: 6px 10px; width: 100px; }
}

/* Row "⋯" kebab menu */
.kebab { position: relative; display: inline-block; }
.kebab-btn {
  appearance: none;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--gray-light);
  font-size: 18px;
  line-height: 1;
  padding: 2px 10px;
  cursor: pointer;
}
.kebab-btn:hover { color: var(--white); border-color: var(--border); }
.kebab-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 150px;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.112);
}
.kebab.open .kebab-menu { display: block; }

/* ============================================================
   MANAGE COURSES — Kajabi × Skool course builder (js/course-builder.js)
   Dashboard: cover-image course cards. Builder: tabbed workspace with a
   draggable lesson rail (left) + lesson editor (right).
   ============================================================ */

/* ── Dashboard card grid ── */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.mc-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  /* No overflow:hidden here — the ⋯ menu opens below the actions row, i.e.
     past the card's bottom edge, and clipping the card swallowed it whole.
     The cover clips its own image instead (see .mc-card-cover). */
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}

/* An open ⋯ menu must paint over the cards that follow it in the grid. */
.mc-card:has(.kebab.open) { z-index: 5; }

.mc-card:hover { border-color: rgba(227, 24, 55,0.4); transform: translateY(-2px); }

.mc-card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--red-tint) 0%, var(--surface-2) 100%);
  cursor: pointer;
  overflow: hidden;
  /* 13px = the card's 14px radius less its 1px border. */
  border-radius: 13px 13px 0 0;
}

.mc-card-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mc-card-cover-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 44px;
  letter-spacing: 2px;
  color: rgba(227, 24, 55,0.55);
  text-transform: uppercase;
  padding: 0 16px;
  text-align: center;
  line-height: 1;
}

.mc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #222;
  color: var(--gray-light);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.mc-pill.is-live { background: rgba(46,204,113,0.12); color: #2ecc71; border-color: rgba(46,204,113,0.4); }
.mc-pill.is-coming-soon { background: rgba(255,190,60,0.10); color: #f1b23c; border-color: rgba(255,190,60,0.35); }
.mc-pill.is-inactive { background: rgba(0, 0, 0,0.05); color: var(--gray-mid); }
.mc-pill.is-bundle { background: rgba(240,200,80,0.10); color: #e8c56a; border-color: rgba(240,200,80,0.35); }

/* The status pill sits under the card title, not over the cover art — a
   cover is a designed image and the pill was landing on top of it. */
.mc-card-status { margin-top: 8px; }

.mc-card-body { padding: 16px 16px 12px; flex: 1; }

.mc-card-title {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.5px;
  color: var(--white);
  line-height: 1.1;
  cursor: pointer;
}

.mc-card-title:hover { color: var(--red); }

.mc-card-slug { font-family: var(--font-mono); font-size: 10px; color: var(--gray-mid); margin-top: 3px; }

.mc-card-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--gray-light);
}

.mc-card-price { color: var(--white); font-weight: 600; }
.mc-card-price s { color: var(--gray-mid); font-weight: 400; margin-right: 6px; }

.mc-card-actions {
  display: flex;
  align-items: center;
  /* Wraps because the cards are only ~300px wide at the grid's minmax floor,
     and the row carries a status select, the "On main site" switch, Edit,
     Preview and the kebab. Without this the controls squash into each other. */
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
}

.mc-card-actions .row-status { max-width: 130px; }

/* ── Builder header ── */
.mc-bhead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.mc-bhead-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.mc-bhead-title h2 { margin: 0; }

.mc-bhead-actions { display: flex; gap: 10px; align-items: center; position: relative; flex-wrap: wrap; }

/* Publish dropdown */
.mc-publish { position: relative; }

.mc-publish-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  z-index: 30;
  min-width: 200px;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.14);
}

.mc-publish.open .mc-publish-menu { display: block; }

.mc-publish-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--white-dim);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-family: var(--font-body);
}

.mc-publish-menu button:hover { background: rgba(0, 0, 0,0.06); color: var(--white); }
.mc-publish-menu button b { display: block; font-size: 12px; }
.mc-publish-menu button span { font-size: 11px; color: var(--gray-mid); }

/* ── Builder tab strip ── */
.mc-btabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}

.mc-btab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--gray-light);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}

.mc-btab:hover { color: var(--white); }
.mc-btab.is-active { color: var(--white); border-bottom-color: var(--red); }

.mc-tabpanel { display: none; }
.mc-tabpanel.is-active { display: block; }

/* ── Curriculum workspace: rail + editor ── */
.mc-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  min-height: 540px;
}

.mc-rail {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.mc-rail-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-mid);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mc-rail-list { flex: 1; overflow-y: auto; padding: 8px 0; max-height: 640px; }

.mc-rail-list::-webkit-scrollbar { width: 4px; }
.mc-rail-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.mc-rail-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px 10px 8px;
  border-left: 3px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}

.mc-rail-item:hover { background: #150000; }
.mc-rail-item.is-active { background: var(--red-tint); border-left-color: var(--red); }
.mc-rail-item.is-dragging { opacity: 0.35; }
.mc-rail-item.is-drop-before { box-shadow: inset 0 2px 0 var(--red); }
.mc-rail-item.is-drop-after { box-shadow: inset 0 -2px 0 var(--red); }

.mc-rail-handle {
  color: #3a3a3a;
  font-size: 14px;
  cursor: grab;
  flex-shrink: 0;
  padding: 2px;
  line-height: 1;
}

.mc-rail-item:hover .mc-rail-handle { color: var(--gray-mid); }

.mc-rail-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2A2A2A;
  color: var(--gray-light);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mc-rail-item.is-active .mc-rail-num { background: var(--red); color: var(--white); }

.mc-rail-text { flex: 1; min-width: 0; }

.mc-rail-title {
  font-size: 12px;
  font-weight: 600;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-rail-item.is-active .mc-rail-title { color: var(--white); }

.mc-rail-sub { font-size: 10px; color: #4a4a4a; margin-top: 1px; }

.mc-draft-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f1b23c;
  background: rgba(255,190,60,0.10);
  border: 1px solid rgba(255,190,60,0.35);
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}

.mc-rail-arrows { display: none; gap: 2px; flex-shrink: 0; }
.mc-rail-item:hover .mc-rail-arrows { display: inline-flex; }

.mc-rail-arrow {
  background: none;
  border: none;
  color: var(--gray-mid);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
}

.mc-rail-arrow:hover:not(:disabled) { color: var(--white); background: rgba(0, 0, 0,0.08); }
.mc-rail-arrow:disabled { opacity: 0.25; cursor: default; }

.mc-rail-foot { padding: 10px; border-top: 1px solid var(--border); }

.mc-rail-empty { padding: 28px 18px; color: var(--gray-mid); font-size: 13px; text-align: center; }

/* ── Lesson editor pane ── */
.mc-editor { padding: 20px 24px 0; min-width: 0; display: flex; flex-direction: column; }

.mc-editor-scroll { flex: 1; min-height: 0; }

.mc-editor-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--gray-mid);
  padding: 60px 20px;
  text-align: center;
}

.mc-video-hint { font-size: 12px; margin-top: 6px; min-height: 16px; }
.mc-video-hint.ok { color: #2ecc71; }
.mc-video-hint.err { color: #ff7070; }

.mc-collapse {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 14px;
  background: rgba(0, 0, 0,0.015);
}

.mc-collapse > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--white-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-collapse > summary::-webkit-details-marker { display: none; }
.mc-collapse > summary::before { content: '▸'; color: var(--gray-mid); transition: transform 0.15s; }
.mc-collapse[open] > summary::before { transform: rotate(90deg); }
.mc-collapse > summary .mc-collapse-note { font-weight: 400; font-size: 11px; color: var(--gray-mid); }

.mc-collapse-body { padding: 4px 16px 16px; }

/* Editor footer action bar */
.mc-editor-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0 18px;
  border-top: 1px solid var(--border);
  margin-top: 18px;
  position: sticky;
  bottom: 0;
  background: var(--charcoal);
  z-index: 5;
}

.mc-dirty-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  display: none;
  flex-shrink: 0;
}

.mc-dirty-dot.on { display: inline-block; }

/* Published switch */
.mc-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--white-dim); user-select: none; }
.mc-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mc-switch-track {
  width: 34px;
  height: 19px;
  border-radius: 12px;
  background: #333;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.mc-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #999;
  transition: transform 0.15s, background 0.15s;
}
.mc-switch input:checked + .mc-switch-track { background: rgba(46,204,113,0.5); }
.mc-switch input:checked + .mc-switch-track::after { transform: translateX(15px); background: #2ecc71; }

/* Sales tab helpers */
.mc-cover-preview {
  margin-top: 8px;
  max-width: 320px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: none;
}
.mc-cover-preview.on { display: block; }

.mc-field-note { font-size: 11px; color: var(--gray-mid); margin-top: 5px; }

.mc-reset-field {
  background: none;
  border: none;
  color: var(--gray-mid);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  margin-left: 8px;
}

.mc-reset-field:hover { color: var(--white); }

/* Standalone .field inputs in the builder (outside .inline-form) — match the
   inline-form styling so every input in the console reads the same. */
#builder-view .field > label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 6px;
}

#builder-view .field input:not([type="checkbox"]),
#builder-view .field select,
#builder-view #m-html {
  width: 100%;
  background: rgba(0, 0, 0,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 12px;
  box-sizing: border-box;
}

#builder-view #m-html { font-family: 'Space Mono', monospace; font-size: 12px; }

#builder-view .field input:focus,
#builder-view .field select:focus { outline: none; border-color: rgba(227, 24, 55,0.5); }

#builder-view .field select option { background: var(--charcoal); color: var(--white); }

textarea.mc-lines {
  width: 100%;
  background: rgba(0, 0, 0,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 12px;
  min-height: 110px;
  resize: vertical;
  box-sizing: border-box;
}

textarea.mc-lines:focus { outline: none; border-color: rgba(227, 24, 55,0.5); }

/* Danger zone */
.mc-danger {
  border: 1px solid rgba(227, 24, 55,0.35);
  border-radius: 10px;
  padding: 16px;
  margin-top: 22px;
}

.mc-danger h4 { color: var(--red); font-size: 13px; margin-bottom: 8px; }

/* Built-in content banner */
.mc-code-banner {
  background: rgba(255,190,60,0.08);
  border: 1px solid rgba(255,190,60,0.3);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--white-dim);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .mc-workspace { grid-template-columns: 1fr; }
  .mc-rail { border-right: none; border-bottom: 1px solid var(--border); }
  .mc-rail-list { max-height: 240px; }
  .mc-editor { padding: 16px 14px 0; }
  .mc-grid { grid-template-columns: 1fr; }
}
.kebab-menu button {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  background: none;
  border: 0;
  border-radius: 5px;
  color: var(--white-dim);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 10px;
  cursor: pointer;
}
.kebab-menu button:hover { background: rgba(0, 0, 0,0.06); color: var(--white); }
.kebab-menu button.kebab-danger { color: #FF7070; }
.kebab-menu button.kebab-danger:hover { background: rgba(227, 24, 55,0.12); }

.invite-code {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  background: var(--charcoal);
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin: 12px 0;
  word-break: break-all;
}

@media (max-width: 768px) {
  body { flex-direction: column; height: auto; overflow: auto; }
  .sidebar { width: 100%; min-width: 100%; height: auto; }
  .main { overflow: visible; }
  .module-title { font-size: 36px; }
  .content { padding: 28px 20px 60px; }
  .topbar { padding: 14px 20px; }
  .module-footer { padding: 16px 20px; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .tier-grid { grid-template-columns: 1fr; }
}

/* ── Community feature ──────────────────────────────────────────────────
   Shared tokens apply (--red, --surface, --border, etc). Community-scoped
   classes all use the `c-` prefix so they don't collide with anything else. */

.c-shell {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 24px;
  align-items: start;
}
/* Very wide desktops: give the side rails more room too. */
@media (min-width: 1500px) {
  .c-shell { grid-template-columns: 260px 1fr 320px; gap: 32px; }
}
.c-shell > #gate-msg,
.c-shell > .c-dashboard-hero { grid-column: 1 / -1; }
.c-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (max-width: 1180px) {
  .c-shell { grid-template-columns: 220px 1fr; max-width: 1040px; }
  /* Stack the right rail UNDER the feed rather than hiding it. It used to be
     display:none here, which took the leaderboard and the group card off every
     laptop and phone — and the Leaderboard and About tabs scrollIntoView()
     those exact elements, so both tabs silently did nothing. Sticky also has
     to go once it's a full-width row. */
  .c-rightrail { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .c-shell { grid-template-columns: 1fr; gap: 16px; }
  .c-sidebar { display: none; }       /* mobile uses chip strip at top of feed instead */
}

.c-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--white-dim);
}
.c-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-avatar-initials {
  background: linear-gradient(135deg, rgba(227, 24, 55, 0.14), rgba(227, 24, 55, 0.06));
  color: var(--ink-strong);
}
.c-avatar-link { display: inline-flex; }

.c-composer-card { padding: 18px 20px; }
.c-composer-row { display: flex; gap: 12px; align-items: flex-start; }

.c-textarea {
  width: 100%;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--white);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.c-textarea:focus { border-color: rgba(227, 24, 55,0.5); }
.c-textarea::placeholder { color: var(--gray-mid); }

.c-input {
  width: 100%;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  margin-bottom: 14px;
}
.c-input:focus { border-color: rgba(227, 24, 55,0.5); }

.c-composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.c-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  padding: 8px 14px;
}
.c-filename {
  font-size: 11px;
  color: var(--gray-light);
  font-family: var(--font-mono);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-preview-img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  margin-top: 10px;
  border: 1px solid var(--border);
}

.c-err {
  background: rgba(227, 24, 55,0.12);
  border: 1px solid rgba(227, 24, 55,0.35);
  color: #FF9B9B;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  margin-top: 10px;
}

.c-feed { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.c-feed-loading {
  font-size: 12px;
  color: var(--gray-mid);
  font-family: var(--font-mono);
  text-align: center;
  padding: 10px 0;
}
.c-load-more-wrap { text-align: center; margin: 18px 0 40px; }

.c-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: border-color 0.15s;
}
.c-post:hover { border-color: rgba(227, 24, 55,0.25); }

.c-post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.c-post-author {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}
.c-post-who { min-width: 0; }
.c-post-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 6px;
}
.c-post-meta {
  font-size: 11px;
  color: var(--gray-mid);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  margin-top: 2px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.c-role-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.c-role-owner { background: var(--accent); color: var(--paper); }
.c-role-admin { background: rgba(227, 24, 55,0.18); color: #FF7070; }

.c-scope-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.c-scope-global { background: var(--gray-dark); color: var(--accent); }
.c-scope-company { background: var(--surface2); color: var(--gray-600); }

.c-post-menu-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gray-mid);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.c-post-menu-btn:hover { border-color: var(--red); color: #FF7070; }

.c-post-body {
  font-size: 14px;
  color: var(--white);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 10px;
}

.c-link { color: var(--accent); text-decoration: none; }
.c-link:hover { text-decoration: underline; }

.c-post-image {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.c-post-image img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.c-post-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.c-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--gray-light);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s;
}
.c-action:hover { color: var(--white); background: rgba(0, 0, 0,0.03); }
.c-action.c-liked { color: #FF7070; }
.c-action-icon { font-size: 15px; line-height: 1; }
.c-action-count { font-family: var(--font-mono); font-size: 11px; }

.c-comments {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.c-comments-loading { font-size: 12px; color: var(--gray-mid); }
.c-no-comments { font-size: 12px; color: var(--gray-mid); padding: 4px 0 10px; }
.c-comments-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.c-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.c-comment-body {
  flex: 1;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 0;
}
.c-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.c-comment-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
}
.c-comment-name:hover { text-decoration: underline; }
.c-comment-time {
  font-size: 10px;
  color: var(--gray-mid);
  font-family: var(--font-mono);
}
.c-comment-del {
  background: transparent;
  border: none;
  color: var(--gray-mid);
  cursor: pointer;
  font-size: 11px;
  margin-left: auto;
  padding: 0 4px;
}
.c-comment-del:hover { color: #FF7070; }
.c-comment-text {
  font-size: 13px;
  color: var(--white-dim);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.c-comment-composer {
  display: flex;
  gap: 10px;
  align-items: center;
}
.c-comment-input {
  flex: 1;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--white);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
}
.c-comment-input:focus { border-color: rgba(227, 24, 55,0.5); }

.c-empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
}
.c-empty-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--white);
  margin-bottom: 8px;
}
.c-empty p { font-size: 13px; color: var(--gray-light); max-width: 380px; margin: 0 auto; }

/* Members grid */
.c-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.c-member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.15s;
}
.c-member-card:hover {
  border-color: rgba(227, 24, 55,0.4);
  transform: translateY(-2px);
}
.c-member-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.c-member-bio {
  font-size: 12px;
  color: var(--gray-light);
  line-height: 1.4;
  margin-top: 6px;
  min-height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.c-member-progress {
  width: 100%;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.c-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.c-progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.c-progress-pct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--white-dim);
}

/* Profile */
.c-profile-card { padding: 28px; }
.c-profile-edit {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  align-items: flex-start;
}
.c-profile-avatar-col { display: flex; flex-direction: column; align-items: center; }
.c-profile-fields label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gray-light);
  text-transform: uppercase;
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.c-save-status {
  font-size: 12px;
  color: var(--gray-light);
  font-family: var(--font-mono);
}

.c-profile-view { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.c-profile-view-info { flex: 1; min-width: 260px; }
.c-profile-name {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.c-profile-bio {
  font-size: 14px;
  color: var(--white-dim);
  line-height: 1.6;
  margin-bottom: 18px;
}
.c-profile-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.c-stat {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 140px;
}
.c-stat-label {
  font-size: 10px;
  color: var(--gray-mid);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.c-stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--white);
  letter-spacing: 0.04em;
}

/* Topbar avatar chip + new-badge pill for nav links */
.user-chip-link.c-has-badge {
  position: relative;
  padding-right: 22px;
}
.user-chip-link.c-has-badge::after {
  content: '•';
  color: var(--red);
  font-size: 18px;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-55%);
  line-height: 1;
}

@media (max-width: 640px) {
  .c-profile-edit { grid-template-columns: 1fr; }
  .c-profile-avatar-col { flex-direction: row; gap: 18px; align-items: center; }
}

/* ── CRM (Phase 2) ──────────────────────────────────────────────────────
   All class names prefixed with `crm-` to avoid collisions. Reuses tokens
   (--red, --surface, --border, etc) + .card / .btn / .auth-card styles. */

.crm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.crm-tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.crm-tab {
  background: transparent;
  border: none;
  color: var(--gray-light);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.crm-tab:hover { color: var(--white); }
.crm-tab.active {
  background: var(--charcoal);
  color: var(--white);
}
.crm-toolbar-spacer { flex: 1; }
.crm-search {
  max-width: 280px;
}

.crm-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.crm-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.crm-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--gray-light);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.crm-chip:hover {
  color: var(--white);
  border-color: var(--gray-mid);
}
.crm-chip.active {
  background: rgba(227, 24, 55,0.14);
  border-color: rgba(227, 24, 55,0.45);
  color: var(--white);
}

.crm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Kanban */
.crm-kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.crm-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crm-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.crm-col-title {
  color: var(--white);
  flex: 1;
}
.crm-col-count {
  background: var(--charcoal);
  border: 1px solid var(--border);
  color: var(--white-dim);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
}
.crm-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s;
}
.crm-col-over {
  background: rgba(232,197,71,0.06);
  outline: 1px dashed rgba(232,197,71,0.35);
}
.crm-col-empty {
  color: var(--gray-mid);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  padding: 10px 0;
}

.crm-card {
  display: block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  cursor: grab;
  transition: border-color 0.12s, transform 0.08s;
}
.crm-card:hover {
  border-color: var(--gray-mid);
}
.crm-card:active { cursor: grabbing; }
.crm-card.dragging { opacity: 0.55; }
.crm-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.crm-card-name {
  color: var(--white);
  font-weight: 500;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-card-sub {
  color: var(--gray-light);
  font-size: 11px;
  font-family: var(--font-mono);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.crm-card-foot {
  color: var(--gray-mid);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crm-tag {
  display: inline-block;
  background: rgba(232,197,71,0.12);
  color: var(--accent);
  border: 1px solid rgba(232,197,71,0.25);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
}
.crm-tag-more {
  background: var(--charcoal);
  color: var(--gray-light);
  border-color: var(--border);
}
.crm-tag-removable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.crm-tag-x {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
}
.crm-tag-x:hover { color: var(--red); }

/* Stage badge pill — used in list + contact header */
.crm-stage-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--stage-color, #A0A0A0) 18%, transparent);
  color: var(--stage-color, #fff);
  border: 1px solid color-mix(in srgb, var(--stage-color, #A0A0A0) 40%, transparent);
}
/* Fallback for browsers without color-mix — still readable. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .crm-stage-badge {
    background: rgba(160,160,160,0.18);
    border-color: rgba(160,160,160,0.4);
  }
}

/* List view */
.crm-list-card { padding: 14px 18px; }
.crm-list-table th { cursor: pointer; user-select: none; }
.crm-list-table th.active { color: var(--white); }
.crm-sort-arrow { color: var(--accent); }
.crm-list-row { cursor: pointer; }
.crm-list-name {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
}
.crm-list-name:hover { color: var(--accent); }

/* Modal */
.crm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}
.crm-modal {
  max-width: 520px;
  width: 100%;
  margin: auto;
}
.crm-form { display: flex; flex-direction: column; gap: 12px; }
.crm-form-row { display: flex; flex-direction: column; gap: 6px; }
.crm-form-row label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
}
.crm-form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.crm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.crm-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gray-light) 50%),
                    linear-gradient(135deg, var(--gray-light) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

/* Contact detail page */
.crm-contact-header {
  margin-bottom: 12px;
}
.crm-back-link {
  color: var(--gray-light);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.crm-back-link:hover { color: var(--white); }

.crm-contact-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.crm-contact-name-wrap { flex: 1; min-width: 240px; }
.crm-contact-name-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.02em;
  color: var(--white);
  width: 100%;
  outline: none;
  padding: 2px 0;
}
.crm-contact-name-input:hover, .crm-contact-name-input:focus {
  border-bottom-color: var(--border);
}
.crm-contact-sub {
  color: var(--gray-light);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.crm-contact-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.crm-field { display: flex; flex-direction: column; gap: 5px; min-width: 140px; }
.crm-field label, .crm-field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
}

.crm-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.crm-tags-block {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
}
.crm-tags-empty {
  color: var(--gray-mid);
  font-family: var(--font-mono);
  font-size: 11px;
}
.crm-add-tag input {
  max-width: 360px;
}

.crm-save-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}
.crm-save-status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.crm-save-status.ok { color: #8AD08A; }
.crm-save-status.err { color: #FF7070; }

/* Feed tabs */
.crm-feed-tabs {
  display: flex;
  gap: 2px;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 14px;
  width: fit-content;
}
.crm-feed-pane {}
.crm-note-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.crm-note-compose-actions {
  display: flex;
  justify-content: flex-end;
}
.crm-notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.crm-note {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.crm-note-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.crm-note-author {
  color: var(--white);
  font-weight: 500;
}
.crm-note-time {
  color: var(--gray-light);
  flex: 1;
}
.crm-note-del {
  background: transparent;
  border: none;
  color: var(--gray-mid);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}
.crm-note-del:hover { color: #FF7070; }
.crm-note-body {
  color: var(--white-dim);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.crm-empty {
  color: var(--gray-mid);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 16px 0;
  text-align: center;
}

.crm-activity-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.crm-activity-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-right: 4px;
}
.crm-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crm-activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.crm-activity-icon {
  font-size: 14px;
  width: 22px;
  text-align: center;
  color: var(--accent);
  flex-shrink: 0;
}
.crm-activity-body { flex: 1; min-width: 0; }
.crm-activity-desc {
  color: var(--white-dim);
  font-size: 13px;
  line-height: 1.5;
}
.crm-activity-meta {
  color: var(--gray-mid);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  margin-top: 3px;
  display: flex;
  gap: 6px;
}

@media (max-width: 1100px) {
  .crm-kanban { grid-template-columns: repeat(6, 240px); }
}
@media (max-width: 768px) {
  .crm-contact-top { flex-direction: column; }
  .crm-form-row-grid { grid-template-columns: 1fr; }
}

/* ────────────────────────────────────────────────────────────────
   Campaigns (Phase 3)
   ──────────────────────────────────────────────────────────────── */
.camp-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.camp-toolbar-spacer { flex: 1; }

.camp-table-wrap {
  overflow-x: auto;
}
.camp-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--gray-mid);
  font-size: 13px;
}

.camp-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}
.camp-status-draft    { background: rgba(160,160,160,0.15); color: var(--gray-light); }
.camp-status-ready    { background: rgba(90,168,230,0.18); color: #6FB8EB; }
.camp-status-sending  { background: rgba(232,197,71,0.18); color: var(--accent); }
.camp-status-sent     { background: rgba(92,173,92,0.18); color: #8AD08A; }
.camp-status-failed   { background: rgba(227, 24, 55,0.22); color: #FF7070; }

.camp-name-link {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
}
.camp-name-link:hover { color: var(--accent); }

.camp-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}
@media (max-width: 768px) {
  .camp-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.camp-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.camp-detail-title { font-family: var(--font-display); font-size: 28px; color: var(--white); letter-spacing: 0.03em; }
.camp-detail-sub {
  color: var(--gray-light);
  font-size: 12px;
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.camp-event-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.camp-event-row {
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.camp-event-type {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 82px;
  color: var(--accent);
}
.camp-event-email { flex: 1; color: var(--white-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-event-time { color: var(--gray-mid); font-family: var(--font-mono); font-size: 10px; }

.camp-recipient-picker-opts { display: flex; flex-direction: column; gap: 10px; }
.camp-recipient-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--white-dim);
  cursor: pointer;
}
.camp-recipient-opt input[type="radio"] { accent-color: var(--red); }
.camp-recipient-opt.active { color: var(--white); }
.camp-recipient-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 8px;
}
.camp-recipient-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 11px;
  color: var(--gray-light);
  cursor: pointer;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}
.camp-recipient-checkbox:hover { border-color: var(--gray-mid); }
.camp-recipient-checkbox input { accent-color: var(--red); }
.camp-recipient-checkbox.checked { color: var(--white); background: rgba(227, 24, 55,0.08); border-color: rgba(227, 24, 55,0.4); }

.camp-modal { max-width: 640px; }
.camp-from-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray-mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: -4px;
}

.camp-error-sample {
  background: rgba(227, 24, 55,0.08);
  border: 1px solid rgba(227, 24, 55,0.3);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #FF9A9A;
  white-space: pre-wrap;
}

/* Invite email status mini-badge */
.invite-email-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.invite-email-status.sent    { color: #8AD08A; }
.invite-email-status.failed  { color: #FF7070; }
.invite-email-status.pending { color: var(--gray-mid); }

/* Send email modal on contact page */
.send-email-modal { max-width: 560px; }

/* Destructive "Delete user" button on the admin roster */
.roster-delete:hover {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

/* ============================================================
   ACADEMY HUB — module map widget ("Your course arc")
   Horizontal row of module cards showing done/current/todo
   ============================================================ */

.hub-progress {
  margin-bottom: 48px;
}

.hub-module-map {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
}

.hub-module-map::before {
  content: '';
  position: absolute;
  left: 36px;
  right: 36px;
  top: 44px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.hub-mm-cell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--white);
  transition: background 0.15s, transform 0.15s;
  min-width: 0;
}

.hub-mm-cell:hover { background: var(--surface2); transform: translateY(-2px); }

.hub-mm-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  border: 2px solid var(--border);
  background: var(--black);
  color: var(--gray-light);
  transition: all 0.15s;
  flex-shrink: 0;
}

.hub-mm-cell.is-done .hub-mm-marker {
  background: var(--white);
  border-color: var(--white);
  color: var(--black);
}

.hub-mm-cell.is-current .hub-mm-marker {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(227, 24, 55,0.18);
  animation: hub-mm-pulse 1.8s ease-in-out infinite;
}

@keyframes hub-mm-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(227, 24, 55,0.18); }
  50%      { box-shadow: 0 0 0 7px rgba(227, 24, 55,0.08); }
}

.hub-mm-cell.is-todo .hub-mm-marker {
  /* Default style is the todo state */
}

.hub-mm-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
  min-width: 0;
  width: 100%;
}

.hub-mm-pillar {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.hub-mm-cell.is-current .hub-mm-pillar { color: var(--red); }
.hub-mm-cell.is-done .hub-mm-pillar { color: var(--gray-light); }

.hub-mm-title {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hub-mm-cell.is-todo .hub-mm-title { color: var(--white-dim); }

.hub-mm-duration {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--gray-mid);
}

@media (max-width: 900px) {
  .hub-module-map {
    grid-template-columns: repeat(7, 140px);
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .hub-module-map::before { display: none; }
}

/* ============================================================
   KAILEY BROWN ACADEMY — HUB SHELL
   The post-login landing wraps the existing app with a shared
   Academy header + tab bar. Course/community/admin pages keep
   their existing sidebar layout; the hub itself uses this shell.
   ============================================================ */

body.academy-hub {
  display: block;
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
  background: var(--black);
}

.academy-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.academy-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 11, 12, 0.9);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.academy-header-inner {
  margin: 0 auto;
  max-width: 1280px;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
@media (min-width: 1200px) {
  .academy-header-inner { padding: 18px 44px; }
}

.academy-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--white);
}

.academy-brand-mark {
  height: 44px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.academy-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.academy-brand-line1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--gray-light);
  text-transform: uppercase;
}

.academy-brand-line2 {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  margin-top: 2px;
}

/* "Back to main site" link styled like main site's nav portal button. */
.back-to-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 3px;
  border: 1px solid var(--border-red);
  color: var(--red);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.back-to-main:hover { background: var(--red); color: var(--white); }
@media (max-width: 760px) {
  .back-to-main { padding: 6px 10px; font-size: 10px; letter-spacing: 0.1em; }
}

.academy-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  /* `safe` keeps the first tab reachable once the strip overflows — plain
     `center` centres the overflow and makes the left end unscrollable. The
     plain value stays as a fallback for engines that don't parse `safe`. */
  justify-content: center;
  justify-content: safe center;
  /* Let the tab strip shrink and scroll instead of shoving the user chip past
     the right edge — an owner's chip (Admin menu, search, bell, avatar, name,
     sign out) is wide enough to overflow the header at 1280px otherwise. */
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.academy-tabs::-webkit-scrollbar { display: none; }

/* The chip is the last thing that should be sacrificed for space. */
.academy-header-right { flex-shrink: 0; }

/* On anything narrower than a wide desktop the spelled-out display name is the
   cheapest thing to drop — the avatar already identifies the user, and the
   ~130px it frees keeps the full tab strip visible next to an owner-sized chip
   (which carries the Admin/Owner menu, search, bell, avatar and sign-out). */
@media (max-width: 1400px) {
  .academy-header-right .user-chip-email { display: none; }
}

.academy-tab {
  padding: 10px 16px;
  border-radius: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--gray-light);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  border: 1px solid transparent;
}

.academy-tab:hover {
  color: var(--white);
  background: var(--surface);
}

.academy-tab.active {
  color: var(--white);
  background: var(--surface);
  border-color: var(--border);
  position: relative;
}

.academy-tab.active::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
}

.academy-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.academy-container {
  margin: 0 auto;
  max-width: 1280px;
  padding: 48px 32px 96px;
  width: 100%;
}
@media (min-width: 1200px) {
  .academy-container { padding: 48px 44px 96px; }
}

.academy-hero {
  margin-bottom: 48px;
}

.academy-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.academy-eyebrow::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--red);
}

.academy-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--white);
  margin-bottom: 18px;
  text-transform: uppercase;
}

.academy-hero h1 span { color: var(--red); }

.academy-hero p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--white-dim);
  max-width: 640px;
}

/* "Quote of the day" caption — small mono label above the daily quote.
   Deliberately lightweight so it tags the line without adding bulk. */
.hub-quote-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}

.hub-quote-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px rgba(227, 24, 55, 0.7);
  animation: hub-quote-dot-pulse 2s ease-in-out infinite;
}

@keyframes hub-quote-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

@media (prefers-reduced-motion: reduce) {
  .hub-quote-dot { animation: none; }
}

/* Daily quote entrance — fades up and brightens so it pulls the eye on
   sign-in. Honors reduced-motion: the quote simply appears at rest. */
#hub-subtitle.hub-quote-enter {
  animation: hub-quote-in 2400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hub-quote-in {
  0% {
    opacity: 0;
    transform: translateY(24px);
    color: var(--white);
    filter: blur(6px);
  }
  75% {
    color: var(--white);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    color: var(--white-dim);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #hub-subtitle.hub-quote-enter { animation: none; }
}

.academy-tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gray-light);
  text-transform: uppercase;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  max-width: 640px;
}

.academy-tagline strong {
  color: var(--white);
  font-weight: 500;
}

/* Continue / resume card */
.academy-continue {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.academy-continue::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--red);
}

.academy-continue-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}

.academy-continue-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--white);
  margin-bottom: 6px;
}

.academy-continue-sub {
  font-size: 13px;
  color: var(--white-dim);
  margin-bottom: 14px;
}

.academy-continue-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
}

.academy-continue-progress .progress-bar {
  flex: 1;
  background: var(--gray-dark);
}

.academy-continue-progress-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--white);
  min-width: 40px;
  text-align: right;
}

.academy-continue .btn {
  padding: 12px 22px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Hub section heading */
.academy-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.academy-section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--white);
}

.academy-section-head .academy-section-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

/* Quick-access tile grid */
.academy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.academy-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 160px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.academy-tile:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  background: var(--surface2);
}

.academy-tile-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-light);
}

.academy-tile-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--white);
}

.academy-tile-desc {
  font-size: 13px;
  color: var(--white-dim);
  line-height: 1.55;
  flex: 1;
}

.academy-tile-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.academy-tile-cta::after {
  content: '→';
  transition: transform 0.15s;
}

.academy-tile:hover .academy-tile-cta::after {
  transform: translateX(4px);
}

.academy-tile-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--red);
  color: #fff;
}

/* Two-column split for lower hub sections — equal halves keep the page balanced */
.academy-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 900px) {
  .academy-split { grid-template-columns: 1fr; }
  .academy-container { padding: 32px 20px 80px; }
  .academy-hero h1 { font-size: 40px; }
  .academy-header-inner {
    padding: 12px 16px;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  /* Row 1: brand + user chip side-by-side (compact) */
  .academy-brand { flex: 0 0 auto; gap: 10px; }
  .academy-brand-mark { height: 28px; width: auto; }
  .academy-brand-line1 { font-size: 12px; }
  .academy-brand-line2 { font-size: 9px; letter-spacing: 0.16em; }
  .academy-header-right { flex: 0 0 auto; margin-left: auto; }
  .academy-header-right .user-chip { gap: 8px; }
  /* The displayed full name is hidden on mobile — the avatar is enough ID */
  .academy-header-right .user-chip-email { display: none; }
  .academy-header-right #btn-signout { padding: 6px 10px; font-size: 12px; }
  .academy-header-right .user-chip-link { font-size: 10px; padding: 4px 8px; }
  .academy-header-right .user-chip-admin { font-size: 10px; padding: 4px 10px; }
  /* Row 2: tabs fill full width.
     `flex-basis` — not just `width` — is what forces the wrap: the base rule sets
     `flex: 1` (basis 0), and a flex item's base size wins over `width`, so the tabs
     stayed on row 1 and squeezed the user chip (Admin/Owner menu, bell, sign-out)
     down to a few pixels or off-screen entirely. */
  .academy-tabs {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 4px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .academy-tabs::-webkit-scrollbar { display: none; }
  .academy-tab { padding: 8px 12px; font-size: 12px; flex-shrink: 0; }
  .academy-continue { grid-template-columns: 1fr; }
}

/* ── Phone-specific header compaction (≤ 600 px) ──────────────────────── */
@media (max-width: 600px) {
  .academy-header-inner { padding: 8px 12px; gap: 6px; }

  /* Collapse "← Main Site" label to just the arrow — saves ~45 px in row 1 */
  .back-to-main {
    font-size: 0;
    padding: 7px 10px;
    min-width: 34px;
    justify-content: center;
    letter-spacing: 0;
  }
  .back-to-main::before {
    content: '←';
    font-size: 14px;
    font-family: var(--font-mono);
    color: var(--red);
  }

  /* Tighter user-chip controls */
  .academy-header-right .user-chip { gap: 5px; }
  .academy-header-right #btn-signout { padding: 5px 8px; font-size: 11px; }

  /* Slightly smaller tabs so more fit before scrolling */
  .academy-tab { padding: 7px 10px; font-size: 11px; }
}

/* ── Dashboard: Invite & Earn ─────────────────────────────────────────── */
.hub-referral { margin-bottom: 48px; }

.referral-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.referral-lede {
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-light);
  margin: 0;
}
.referral-lede b { color: var(--red); font-family: var(--font-mono); }

.referral-link-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.referral-url {
  flex: 1;
  min-width: 0;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 11px 12px;
}
.referral-url:focus { outline: none; border-color: var(--border-red); }

.referral-link-row .btn { flex-shrink: 0; white-space: nowrap; }

.referral-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.referral-stat { text-align: center; }
.referral-stat-value {
  font-family: var(--font-display, var(--font-sans));
  font-weight: 600;
  font-size: 24px;
  color: var(--white);
  line-height: 1;
}
.referral-stat-label {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.referral-note {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--gray-mid);
}

@media (max-width: 600px) {
  .referral-card { padding: 18px 16px; gap: 14px; }
  /* The link itself is unreadable at phone width and nobody types it by hand —
     the Copy / Share buttons are the real controls, so give them the row. */
  .referral-url { flex-basis: 100%; font-size: 11px; }
  .referral-link-row .btn { flex: 1; }
  .referral-stat-value { font-size: 20px; }
}

.academy-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
}

.academy-list-item {
  padding: 14px 16px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: var(--white);
  transition: background 0.15s;
}

.academy-list-item:hover { background: var(--surface2); }

.academy-list-item + .academy-list-item { border-top: 1px solid var(--border); }

.academy-list-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.academy-list-main {
  min-width: 0;
  overflow: hidden;
}

.academy-list-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.academy-list-sub {
  font-size: 11px;
  color: var(--gray-light);
  margin-top: 2px;
}

.academy-list-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--gray-mid);
  text-transform: uppercase;
  white-space: nowrap;
}

.academy-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-light);
  font-size: 13px;
}

/* Resources "coming soon" stub */
.academy-stub {
  text-align: center;
  padding: 96px 24px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.academy-stub .academy-eyebrow { justify-content: center; }

.academy-stub h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 14px;
}

.academy-stub p {
  font-size: 14px;
  color: var(--white-dim);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

/* Display-font tweaks — Space Grotesk needs heavier weights to read as "display" */
.sidebar-title,
.module-title,
.lesson-block h2,
.cert-status-val {
  font-weight: 700;
}

/* Ensure course page (keeps existing sidebar layout) inherits body flex/overflow */
body.course-page {
  display: flex;
  overflow: hidden;
  height: 100vh;
}

/* ============================================================
   COURSES PAGE — Academy header + course-library sidebar + main
   Default: sidebar lists all courses, main shows welcome.
   Click a course: sidebar highlights it (and nests module nav
   for a code-authored course), main swaps to that course's content.
   ============================================================ */

body.academy-course {
  display: grid;
  grid-template-rows: auto 1fr;
  /* minmax(0, 1fr), NOT 1fr. A bare `1fr` track is minmax(auto, 1fr), so its
     floor is the item's min-content width — the header's brand + back-link +
     tab strip. On a phone that floor (417px) exceeds the viewport, the column
     grows to match, and every descendant inherits the too-wide box, letting the
     whole page scroll sideways. Capping the minimum at 0 lets the tab strip
     scroll inside its own box instead. */
  grid-template-columns: minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  min-height: 100vh;
}

body.academy-course .academy-header { grid-row: 1; position: static; }
body.academy-course #course-workspace {
  grid-row: 2;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Course-library sidebar (replaces the old per-course sidebar) */
.courses-sidebar {
  width: 320px;
  min-width: 320px;
  background: var(--charcoal);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.courses-sidebar::-webkit-scrollbar { width: 4px; }
.courses-sidebar::-webkit-scrollbar-track { background: transparent; }
.courses-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.courses-sidebar-header {
  padding: 24px 22px 18px;
  border-bottom: 1px solid var(--border);
}

.courses-sidebar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--white);
  margin-top: 10px;
}

.courses-sidebar-title span { color: var(--red); }

.courses-sidebar-sub {
  font-size: 11px;
  color: var(--gray-light);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.courses-sidebar-list {
  padding: 12px 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* A single course entry in the sidebar list */
.course-entry {
  border-radius: 10px;
  border: 1px solid transparent;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.course-entry:hover {
  background: var(--surface);
  border-color: var(--border);
}

.course-entry.active {
  background: rgba(227, 24, 55,0.06);
  border-color: rgba(227, 24, 55,0.35);
}

.course-entry.is-soon .course-entry-title { color: var(--gray-light); }

.course-entry-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  text-decoration: none;
  color: var(--white);
}

.course-entry-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-dark);
  border: 1px solid var(--gray-mid);
  flex-shrink: 0;
  transition: all 0.15s;
}

.course-entry.active .course-entry-indicator {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227, 24, 55,0.18);
}

.course-entry.is-soon .course-entry-indicator {
  background: transparent;
  border-style: dashed;
}

.course-entry-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.course-entry-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-entry-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.course-entry.active .course-entry-sub { color: var(--red); }

.course-entry-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--white);
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--gray-dark);
  letter-spacing: 0.02em;
}

.course-entry.active .course-entry-pct {
  background: var(--red);
  color: #fff;
}

.course-entry-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--gray-dark);
  color: var(--gray-light);
  flex-shrink: 0;
}

/* Course hero — lives at the top of the main area when a live course is active */
.course-hero {
  padding: 28px 48px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--charcoal);
}

.course-hero .academy-eyebrow { margin-bottom: 12px; }

.course-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 8px;
}

.course-hero p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--white-dim);
  max-width: 680px;
}

.course-hero-meta {
  margin-top: 20px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.course-hero-meta .progress-wrap {
  padding: 0;
  border: none;
  flex: 1;
  min-width: 260px;
  max-width: 460px;
}

.course-cert-inline {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.course-cert-inline .cert-status-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-light);
}

.course-cert-inline .cert-status-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--gray-light);
}

.course-cert-inline .cert-status-val.active { color: var(--white); }

/* Horizontal module strip — flattened pillar groups so modules appear on the main page */
.course-modules-strip {
  display: flex;
  gap: 10px;
  padding: 16px 32px;
  background: var(--black);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  /* overflow-x:auto makes the browser compute overflow-y to auto, which removes
     the strip's automatic min-content height. As a flex item in the column-flex
     .workspace-live-content scroll container it would then get shrunk to a sliver
     when the page overflows, clipping the module cards. Pin the axes and stop it
     from shrinking so it always keeps its full height. */
  overflow-y: hidden;
  flex-shrink: 0;
  scrollbar-width: thin;
  position: sticky;
  top: 0;
  z-index: 6;
}

.course-modules-strip::-webkit-scrollbar { height: 6px; }
.course-modules-strip::-webkit-scrollbar-track { background: transparent; }
.course-modules-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.course-modules-strip .pillar-section {
  padding: 0;
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-shrink: 0;
  position: relative;
  padding-right: 14px;
  margin-right: 4px;
}

.course-modules-strip .pillar-section:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 12%;
  bottom: 12%;
  width: 1px;
  background: var(--border);
}

.course-modules-strip .pillar-label {
  /* Hide label in strip mode — the pillar tag pill on each nav-item already conveys grouping */
  display: none;
}

.course-modules-strip .nav-item {
  flex-shrink: 0;
  width: 210px;
  padding: 10px 12px;
  margin-bottom: 0;
  background: var(--surface);
}

.course-modules-strip .nav-item:hover { background: var(--surface2); }

.course-modules-strip .nav-item.active { background: rgba(227, 24, 55,0.1); }

/* Main area — welcome + course content. Each child workspace-* is its own
   scroll container so sticky topbars inside live courses work correctly. */
.courses-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.courses-main > section { /* scroll containers */ }
.workspace-welcome,
.workspace-live-content,
.workspace-coming-soon-main {
  overflow-y: auto;
}

.workspace-welcome::-webkit-scrollbar,
.workspace-live-content::-webkit-scrollbar,
.workspace-coming-soon-main::-webkit-scrollbar { width: 4px; }
.workspace-welcome::-webkit-scrollbar-thumb,
.workspace-live-content::-webkit-scrollbar-thumb,
.workspace-coming-soon-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Welcome state */
.workspace-welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 48px;
}

/* Hero — headline left, brand visual right. */
.courses-hero {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto 88px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}

.courses-hero-text h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 5.2vw, 76px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 20px;
}

.courses-hero-text h1 span { color: var(--red); }

.courses-hero-text p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--white-dim);
  max-width: 560px;
}

.courses-hero-text .academy-tagline { max-width: 560px; }

/* Breadcrumb pills (Home / Courses) */
.courses-crumbs {
  margin-top: 36px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--black-2);
}

.courses-crumbs a,
.courses-crumbs .is-current {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--gray-light);
  transition: color 0.2s;
}

.courses-crumbs a:hover { color: var(--white); }

.courses-crumbs .is-current {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 16px rgba(227, 24, 55, 0.35);
}

/* Brand visual — rounded panel with a big 1% mark, in place of a photo. */
.courses-hero-visual {
  display: flex;
  justify-content: flex-end;
}

.courses-hero-shape {
  position: relative;
  width: min(440px, 100%);
  aspect-ratio: 1.2 / 1;
  border-radius: 28px 28px 28px 150px;
  border: 1px solid var(--border-red);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background:
    radial-gradient(circle at 78% 18%, rgba(227, 24, 55, 0.55), transparent 55%),
    radial-gradient(circle at 15% 95%, rgba(227, 24, 55, 0.35), transparent 50%),
    linear-gradient(150deg, #2a0001 0%, #140000 45%, #0B0B0C 100%);
}

.courses-hero-shape::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.04) 0 1px, transparent 1px 18px);
}

.courses-hero-mark {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(110px, 12vw, 170px);
  line-height: 0.9;
  color: var(--white);
  text-shadow: 0 14px 60px rgba(227, 24, 55, 0.5);
}

.courses-hero-caption {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

/* Founder photo variant of the hero shape */
.courses-hero-shape--photo {
  justify-content: flex-end;
  padding: 0;
}
.courses-hero-shape--photo .courses-hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  /* No desaturation: the photography arrives pre-treated (B&W + red). */
}
.courses-hero-shape--photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 1;
}
.courses-hero-shape--photo .courses-hero-caption {
  z-index: 2;
  margin: 0 0 22px 0;
  align-self: center;
  text-align: center;
}

/* Hero entrance — text slides from the left, visual fades from the right.
   Honors reduced-motion. */
.courses-hero-text .academy-eyebrow,
.courses-hero-text h1,
.courses-hero-text p,
.courses-hero-text .academy-tagline,
.courses-hero-text .courses-crumbs {
  animation: welcome-slide-in 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.courses-hero-text .academy-eyebrow { animation-delay: 0ms; }
.courses-hero-text h1 { animation-delay: 120ms; }
.courses-hero-text p { animation-delay: 260ms; }
.courses-hero-text .academy-tagline { animation-delay: 380ms; }
.courses-hero-text .courses-crumbs { animation-delay: 500ms; }

.courses-hero-visual {
  animation: hero-visual-in 900ms cubic-bezier(0.16, 1, 0.3, 1) 300ms both;
}

@keyframes welcome-slide-in {
  0% {
    opacity: 0;
    transform: translateX(-48px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes hero-visual-in {
  0% {
    opacity: 0;
    transform: translateX(40px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* On a phone the +40px start position pushes the hero past the viewport, so the
   page can be scrolled sideways for the ~1.2s the animation runs (and forever
   if it never fires). There's no room to slide into at this width — fade and
   scale only. */
@media (max-width: 900px) {
  @keyframes hero-visual-in {
    0% {
      opacity: 0;
      transform: scale(0.97);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .courses-hero-text .academy-eyebrow,
  .courses-hero-text h1,
  .courses-hero-text p,
  .courses-hero-text .academy-tagline,
  .courses-hero-text .courses-crumbs,
  .courses-hero-visual {
    animation: none;
  }
}

/* Live course content fills the main column (topbar + content + footer) */
.workspace-live-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.workspace-live-content .topbar {
  position: static;
  padding: 14px 48px;
}

/* Widen + center the course content so it fills the page rather than
   sitting in a small column on the left. */
.workspace-live-content .content {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 48px 60px;
}

.workspace-live-content .module-footer {
  padding: 18px 48px;
}

@media (max-width: 900px) {
  .course-hero { padding: 22px 24px 18px; }
  .course-hero h1 { font-size: 28px; }
  .course-hero-meta { gap: 16px; margin-top: 16px; }
  .course-modules-strip { padding: 12px 20px; }
  .workspace-live-content .topbar { padding: 12px 20px; }
  .workspace-live-content .content { padding: 28px 20px 40px; }
  .workspace-live-content .module-footer { padding: 14px 20px; }
}

/* Coming-soon inside the main column */
.workspace-coming-soon-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
}

.course-soon-card {
  max-width: 640px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 56px 48px;
  text-align: center;
}

.course-soon-card .academy-eyebrow { justify-content: center; }

.course-soon-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 16px;
  line-height: 1.05;
}

.course-soon-card p {
  font-size: 15px;
  color: var(--white-dim);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

.course-soon-payment-note {
  margin-top: 16px !important;
  font-size: 13px !important;
  color: var(--gray-mid, #888) !important;
  font-style: italic;
}

.course-soon-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  body.academy-course #course-workspace {
    flex-direction: column;
  }
  .courses-sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: 300px;
  }
  .courses-hero {
    grid-template-columns: 1fr;
    gap: 44px;
    margin-bottom: 56px;
  }
  .courses-hero-visual { justify-content: center; }
  .workspace-welcome { padding: 40px 24px; }
  .course-soon-card { padding: 40px 24px; }
  .course-soon-card h2 { font-size: 30px; }
}

/* ============================================================
   COURSE PLAYER — the uniform Coursera-style in-course UI every
   course renders through (js/course-player.js): module sidebar +
   progress, topbar, tabbed lesson pane, prev/complete footer.
   ============================================================ */

.workspace-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.cp-shell {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  background: var(--paper);
  position: relative;
}

/* ── Sidebar ── */
.cp-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease, min-width 0.3s ease;
}

.cp-sidebar.is-closed { width: 0; min-width: 0; border-right: none; }

.cp-sidebar-head {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  min-width: 280px;
}

.cp-brand {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--red);
  margin-bottom: 2px;
  white-space: nowrap;
}

.cp-course-title {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 12px;
}

.cp-progress { display: flex; align-items: center; gap: 12px; }

.cp-progress-bar {
  flex: 1;
  height: 3px;
  background: #2A2A2A;
  border-radius: 2px;
}

.cp-progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.cp-progress-label { font-size: 12px; color: var(--gray-light); white-space: nowrap; }

.cp-modlist {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  min-width: 280px;
}

.cp-modlist::-webkit-scrollbar { width: 4px; }
.cp-modlist::-webkit-scrollbar-thumb { background: var(--red); border-radius: 2px; }

.cp-mod {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  padding: 12px 16px;
  text-align: left;
  transition: all 0.15s;
  font-family: var(--font-body);
}

.cp-mod:hover { background: #150000; }
.cp-mod.is-active { background: var(--red-tint); border-left-color: var(--red); }

.cp-mod-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2A2A2A;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-light);
  transition: all 0.2s;
}

.cp-mod.is-active .cp-mod-num { background: var(--red); color: var(--white); }
.cp-mod.is-done .cp-mod-num { background: #00AA00; color: var(--white); }

.cp-mod-text { flex: 1; min-width: 0; display: block; }

.cp-mod-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-mod.is-active .cp-mod-title { color: var(--white); }
.cp-mod.is-done .cp-mod-title { color: #888; }

.cp-mod-meta { display: block; font-size: 10px; color: #444; margin-top: 2px; }

.cp-sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--paper);
  min-width: 280px;
}

/* ── Main column ── */
.cp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.cp-topbar {
  height: 48px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  background: var(--paper);
  flex-shrink: 0;
}

.cp-toggle {
  background: var(--surface-2);
  border: 1px solid #2A2A2A;
  border-radius: 6px;
  color: var(--white);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-topbar-spacer { flex: 1; }
.cp-topbar-count { font-size: 11px; color: var(--gray-light); }

.cp-minibar {
  width: 80px;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
}

.cp-minibar-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── Module view ── */
.cp-module {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.cp-module-head {
  padding: 24px 28px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cp-module-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.cp-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 6px;
}

.cp-module-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 1px;
  color: var(--white);
  line-height: 1;
  margin: 0;
}

.cp-module-sub { color: var(--gray-light); font-size: 13px; margin-top: 4px; }

.cp-complete-badge {
  background: #001A00;
  border: 1px solid #00AA00;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  color: #00AA00;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.cp-tabs { display: flex; gap: 0; }

.cp-tab {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-light);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.cp-tab:hover { color: var(--white); }
.cp-tab.is-active { color: var(--white); border-bottom-color: var(--red); }

.cp-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 40px;
}

.cp-tab-content::-webkit-scrollbar { width: 4px; }
.cp-tab-content::-webkit-scrollbar-thumb { background: var(--red); border-radius: 2px; }

.cp-tab-content textarea:focus { outline: none; border-color: var(--red) !important; }

/* ── Footer nav (prev / position / complete) ── */
.cp-footbar {
  display: flex;
  align-items: center;
  gap: 16px;
  /* Extra right padding keeps the complete button clear of the floating
     chatbot bubble pinned to the bottom-right corner. */
  padding: 14px 120px 14px 28px;
  border-top: 1px solid var(--border);
  background: var(--paper);
  flex-shrink: 0;
}

.cp-footbar-pos {
  flex: 1;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1px;
  color: #666;
  text-transform: uppercase;
}

.cp-btn {
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  font-family: var(--font-body);
  white-space: nowrap;
}

.cp-btn-primary { background: var(--red); color: var(--white); }
.cp-btn-primary:hover { opacity: 0.85; }

.cp-btn-ghost {
  background: none;
  border: 1px solid #2A2A2A;
  color: var(--gray-light);
}

.cp-btn-ghost:hover:not(:disabled) { color: var(--white); border-color: #444; }
.cp-btn-ghost:disabled { opacity: 0.3; cursor: default; }

.cp-btn-done {
  background: #001A00;
  border: 1px solid #00AA00;
  color: #00AA00;
}

.cp-btn-done:disabled { cursor: default; }

/* Lesson video embed — responsive 16:9 block above the lesson body */
.cp-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

.cp-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Uploaded lesson video — native player in the same 16:9 block */
.cp-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Lesson content that renders its own big header inside the tab
   pane; the player already shows the module title, so the duplicated
   heading is removed at bind time and the description stays. */
.cp-tab-content .module-header { margin-bottom: 24px; padding-bottom: 0; border-bottom: none; }
.cp-tab-content .module-desc { margin-top: 0; }

@media (max-width: 900px) {
  /* Sidebar overlays the lesson on small screens instead of squeezing it. */
  .cp-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 20;
    box-shadow: 8px 0 22px rgba(0, 0, 0, 0.168);
  }
  .cp-module-head { padding: 18px 20px 0; }
  .cp-module-title { font-size: 26px; }
  .cp-tab-content { padding: 18px 20px 32px; }
  .cp-footbar { padding: 12px 100px 12px 16px; gap: 10px; }
  .cp-footbar-pos { display: none; }
  .cp-btn { padding: 11px 14px; font-size: 12px; }
}

/* ============================================================
   COURSES: enrollment UI — sidebar empty state, available courses
   grid on the welcome panel, roadmap view for an enrolled course
   ============================================================ */

.courses-sidebar-empty {
  padding: 20px 16px;
  margin: 4px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--gray-light);
}

.courses-sidebar-empty-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

.courses-sidebar-empty p {
  font-size: 12px;
  line-height: 1.55;
  color: var(--gray-light);
}

.courses-sidebar-browse {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
  text-decoration: none;
  text-align: center;
  transition: color 0.15s, border-color 0.15s;
}

.courses-sidebar-browse:hover {
  color: var(--white);
  border-color: var(--red);
}

/* Course library within the welcome workspace */
.workspace-welcome {
  flex-direction: column;
  justify-content: flex-start;
  padding: 64px 48px 0;
}

.workspace-welcome .welcome-available {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
}

.academy-section-head h2 {
  color: var(--white);
}

/* Library section head — display title on the left, live search on the right */
.library-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.library-head .academy-eyebrow { margin-bottom: 10px; }

.library-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--white);
}

.library-title span { color: var(--red); }

.library-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-mid);
  padding-bottom: 8px;
}

.library-search {
  position: relative;
  width: min(340px, 100%);
}

.library-search input {
  width: 100%;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 13px 54px 13px 20px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.library-search input::placeholder { color: var(--gray-mid); }

.library-search input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.library-search-icon {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

/* Card grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
  gap: 24px;
}

.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.course-card:hover {
  transform: translateY(-4px);
  background: linear-gradient(165deg, var(--red) 0%, #B80D28 55%, #7A0A1D 100%);
  border-color: var(--red);
  box-shadow: 0 18px 48px rgba(227, 24, 55, 0.35);
}

/* Cover — generated brand art; a Firestore `image` field swaps in a photo. */
.course-card-cover {
  position: relative;
  aspect-ratio: 16 / 9.5;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 82% 115%, rgba(227, 24, 55, 0.5), transparent 60%),
    radial-gradient(circle at 8% -12%, rgba(227, 24, 55, 0.18), transparent 50%),
    linear-gradient(150deg, var(--gray-dark) 0%, var(--black-2) 75%);
  background-size: cover;
  background-position: center;
}

.course-card-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 16px);
}

/* Real cover image: trade the line pattern for a legibility scrim. */
.course-card-cover.has-image::before {
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.35));
}

.course-card-cover-title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(34px, 3.6vw, 46px);
  line-height: 0.95;
  text-transform: uppercase;
  text-align: center;
  color: var(--white);
  padding: 0 20px;
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s;
}

.course-card:hover .course-card-cover-title { transform: scale(1.04); }

/* Badges sit under the card title, not over the cover art. */
.course-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -2px;
}

.course-card-badges:empty { display: none; }

.course-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  color: var(--ink);
  backdrop-filter: blur(4px);
}

.course-badge.is-live { background: var(--red); border-color: var(--red); color: #fff; }
.course-badge.is-sale { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--paper); font-weight: 700; }
.course-badge.is-bundle { background: var(--surface-2); border-color: var(--border); color: var(--ink-strong); font-weight: 700; }

/* Body */
.course-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 6px 14px;
}

.course-card-category {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}

.course-card-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
  transition: color 0.2s;
}

.course-card:hover .course-card-title { color: var(--paper); }

.course-card-desc {
  flex: 1;
  font-size: 13px;
  line-height: 1.55;
  color: var(--white-dim);
}

.course-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.course-card-meta span:not(:first-child)::before {
  content: '·';
  margin-right: 8px;
  color: var(--gray-dark);
}

/* Foot — price left, pill CTA right */
.course-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  border-top: 1px solid var(--border);
  padding: 14px 6px 4px;
}

.course-card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}

.course-card-price span {
  font-family: var(--font-display);
  font-size: 27px;
  color: var(--white);
}

.course-card-price s {
  font-size: 13px;
  color: var(--gray-mid);
}

/* Price footnote — its own full-width line under the price + CTA row. */
.course-card-note {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.course-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--red);
  border: 1px solid var(--red);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.course-card-btn:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(227, 24, 55, 0.3);
}

/* "Notify me when live" confirmed state once joined. */
.course-card-btn.available-notify.is-joined,
.course-card-btn:disabled {
  background: transparent;
  border-color: var(--border-red, rgba(227, 24, 55, 0.4));
  color: var(--red);
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Hovered card fills red — recolor its content for legibility on the fill. */
.course-card:hover .course-card-cover {
  background:
    radial-gradient(circle at 82% 115%, rgba(255, 255, 255, 0.22), transparent 60%),
    linear-gradient(150deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.12));
}

.course-card:hover .course-card-category { color: rgba(255, 255, 255, 0.8); }
.course-card:hover .course-card-desc { color: rgba(255, 255, 255, 0.88); }
.course-card:hover .course-card-meta { color: rgba(255, 255, 255, 0.65); }
.course-card:hover .course-card-meta span:not(:first-child)::before { color: rgba(255, 255, 255, 0.4); }
.course-card:hover .course-card-foot { border-top-color: rgba(255, 255, 255, 0.28); }
.course-card:hover .course-card-price s { color: rgba(255, 255, 255, 0.6); }
.course-card:hover .course-card-note { color: rgba(255, 255, 255, 0.7); }

.course-card:hover .course-card-btn {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--red);
}

.course-card:hover .course-card-btn:hover {
  background: var(--white-soft);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.098);
}

.available-empty {
  padding: 22px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--gray-light);
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}

/* Get-started band */
.courses-cta {
  width: 100%;
  max-width: 1560px;
  margin: 96px auto 0;
  padding: 76px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 50% -30%, rgba(227, 24, 55, 0.3), transparent 62%),
    radial-gradient(circle, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    var(--black-2);
  background-size: auto, 22px 22px, auto;
}

.courses-cta-eyebrow {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid var(--border-red);
  border-radius: 999px;
  padding: 6px 16px;
  background: rgba(227, 24, 55, 0.08);
  margin-bottom: 24px;
}

.courses-cta h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 4.6vw, 62px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 18px;
}

.courses-cta h2 span { color: var(--red); }

.courses-cta p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--white-dim);
  max-width: 580px;
  margin: 0 auto 32px;
}

.courses-cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Giant fading brand watermark at the very bottom of the library view */
.courses-watermark {
  margin-top: 80px;
  max-width: 100%;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: clamp(72px, 13.5vw, 220px);
  line-height: 0.8;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(227, 24, 55, 0.8) 0%, rgba(227, 24, 55, 0.15) 70%, transparent 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
  pointer-events: none;
}

/* Roadmap — course landing after clicking an enrolled course */
.workspace-roadmap {
  flex: 1;
  overflow-y: auto;
  padding: 48px 48px 96px;
}

.workspace-roadmap::-webkit-scrollbar { width: 4px; }
.workspace-roadmap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.roadmap-container {
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

.roadmap-hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.roadmap-hero .academy-eyebrow { margin-bottom: 12px; }

.roadmap-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 10px;
}

.roadmap-hero p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--white-dim);
  max-width: 680px;
}

.roadmap-hero-meta {
  margin-top: 28px;
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}

.roadmap-progress {
  padding: 0;
  border: none;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}

.roadmap-hero-stats {
  display: flex;
  gap: 18px;
}

.roadmap-hero-stats > div {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  min-width: 70px;
  text-align: center;
}

.roadmap-stat-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--white);
}

.roadmap-stat-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-top: 2px;
}

.roadmap-hero-cta {
  margin-top: 24px;
}

.roadmap-hero-cta .btn { padding: 12px 22px; }

/* Roadmap steps — vertical journey */
.roadmap-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.roadmap-steps .academy-section-head { margin-bottom: 24px; }

.roadmap-step {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  color: var(--white);
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}

.roadmap-step + .roadmap-step { margin-top: 14px; }

/* Connecting line between steps */
.roadmap-step::before {
  content: '';
  position: absolute;
  left: 49px; /* center of 56px marker column w/ padding */
  top: -14px;
  width: 2px;
  height: 14px;
  background: var(--border);
}

.roadmap-step:first-of-type::before { display: none; }

.roadmap-step:hover {
  border-color: var(--gray-mid);
  background: var(--surface2);
}

.roadmap-step.is-done { border-color: rgba(92,173,92,0.3); }
.roadmap-step.is-current {
  border-color: var(--red);
  background: rgba(227, 24, 55,0.05);
  box-shadow: inset 3px 0 0 var(--red);
}

.roadmap-step-marker {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gray-dark);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-light);
  margin-left: 4px;
}

.roadmap-step.is-done .roadmap-step-marker {
  background: #1c3b1c;
  border-color: rgba(92,173,92,0.5);
  color: #8ad08a;
  font-size: 16px;
}

.roadmap-step.is-current .roadmap-step-marker {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.roadmap-step-body {
  min-width: 0;
}

.roadmap-step-pillar {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-bottom: 4px;
}

.roadmap-step.is-current .roadmap-step-pillar { color: var(--red); }

.roadmap-step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--white);
  line-height: 1.2;
}

.roadmap-step-sub {
  font-size: 13px;
  color: var(--white-dim);
  margin-top: 4px;
  line-height: 1.5;
}

.roadmap-step-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  padding-left: 12px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.roadmap-step.is-done .roadmap-step-cta { color: var(--gray-light); }

@media (max-width: 900px) {
  .workspace-welcome { padding: 40px 22px 0; }
  .courses-cta { margin-top: 64px; padding: 56px 22px; }
  .courses-watermark { margin-top: 56px; }
  .workspace-roadmap { padding: 32px 22px 64px; }
  .roadmap-hero h1 { font-size: 34px; }
  .roadmap-step {
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
  }
  .roadmap-step-cta {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 10px 0 0;
  }
  .roadmap-step-marker { width: 36px; height: 36px; font-size: 12px; }
  .roadmap-step::before { left: 36px; }
}

/* ───────────────────────────────────────────────────────────────────────
   Community channels (Phase 1) — sidebar + channel header + composer
   selector + pin affordance. Builds on the existing .c-* component family. */

.c-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.c-sidebar-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-mid);
  padding: 0 8px 4px;
}
.c-channel-list { display: flex; flex-direction: column; gap: 2px; }
.c-channel-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--gray-light);
  text-decoration: none;
  border-left: 2px solid transparent;
  font-size: 14px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.c-channel-link:hover { background: rgba(0, 0, 0,0.04); color: var(--white); }
.c-channel-link.is-active {
  background: rgba(227, 24, 55,0.10);
  color: var(--white);
  border-left-color: var(--red);
}
.c-channel-emoji { width: 18px; text-align: center; flex-shrink: 0; }
.c-channel-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.c-channel-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.c-channel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display, var(--font-sans));
  font-weight: 600;
  font-size: 18px;
  color: var(--white);
}
.c-channel-title-emoji { font-size: 22px; line-height: 1; }
.c-channel-desc { font-size: 13px; color: var(--gray-light); }

.c-pinned-banner {
  margin-top: 6px;
  background: rgba(227, 24, 55,0.08);
  border: 1px solid rgba(227, 24, 55,0.25);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.c-pinned-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #FF7070;
}
.c-pinned-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: var(--gray-light);
  font-size: 13px;
}
.c-pinned-link:hover { color: var(--white); }
.c-pinned-author { color: var(--white); font-weight: 500; }
.c-pinned-text { color: var(--gray-light); }

.c-channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0,0.06);
  border: 1px solid var(--border);
  color: var(--gray-light);
  margin-left: 6px;
}
.c-channel-pill.is-pinned {
  background: rgba(227, 24, 55,0.12);
  border-color: rgba(227, 24, 55,0.30);
  color: #FF9090;
}

.c-post.is-pinned {
  border-color: rgba(227, 24, 55,0.30);
  background: linear-gradient(180deg, rgba(227, 24, 55,0.04) 0%, transparent 80%);
}

.c-post-menu { display: inline-flex; align-items: center; gap: 4px; }
.c-pin-btn { font-size: 13px; }
.c-pin-btn.is-pinned { color: #FF9090; border-color: rgba(227, 24, 55,0.35); }

.c-composer-channel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-light);
}
.c-composer-channel-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.c-composer-channel-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-size: 13px;
  padding: 5px 8px;
  cursor: pointer;
}
.c-composer-channel-select:focus {
  outline: none;
  border-color: rgba(227, 24, 55,0.5);
}

/* ───────────────────────────────────────────────────────────────────────
   Community leaderboard (Phase 2) — right rail with top members + the
   caller's own level / progress bar. Level pills use a 10-step color ramp
   from gray (Lv 1) → red (Lv 10) so rank is readable at a glance. */

.c-leaderboard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.c-leader-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.c-leader-self {
  background: rgba(0, 0, 0,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.c-leader-self-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.c-leader-self-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.c-leader-self-pts {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--white);
}
.c-leader-self-next {
  font-size: 11px;
  color: var(--gray-light);
}
.c-progress-bar {
  height: 6px;
  background: rgba(0, 0, 0,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.c-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF7070 0%, var(--red) 100%);
  transition: width 0.3s;
}
.c-leader-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.c-leader-row {
  display: grid;
  grid-template-columns: 22px 28px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--gray-light);
  transition: background 0.12s, color 0.12s;
}
.c-leader-row:hover { background: rgba(0, 0, 0,0.04); color: var(--white); }
.c-leader-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  color: var(--gray-mid);
}
.c-leader-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--white);
}
.c-leader-points {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-light);
}
.c-leader-empty {
  font-size: 12px;
  color: var(--gray-mid);
  padding: 12px 0;
  text-align: center;
}

.c-level-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0,0.05);
  color: var(--gray-light);
  white-space: nowrap;
}
/* Level ramp in monochrome: grey deepening to black as levels climb, with
   red reserved for the summit — the one pop in the whole ladder. */
.c-level-1  { color: #9A9A9A; }
.c-level-2  { color: #8A8A8A; border-color: rgba(0,0,0,0.14); }
.c-level-3  { color: #7A7A7A; border-color: rgba(0,0,0,0.18); }
.c-level-4  { color: #666666; border-color: rgba(0,0,0,0.22); }
.c-level-5  { color: #545454; border-color: rgba(0,0,0,0.26); background: rgba(0,0,0,0.03); }
.c-level-6  { color: #424242; border-color: rgba(0,0,0,0.32); background: rgba(0,0,0,0.05); }
.c-level-7  { color: #303030; border-color: rgba(0,0,0,0.38); background: rgba(0,0,0,0.07); }
.c-level-8  { color: #1C1C1C; border-color: rgba(0,0,0,0.46); background: rgba(0,0,0,0.09); }
.c-level-9  { color: var(--paper); border-color: var(--ink-strong); background: var(--ink-strong); }
.c-level-10 { color: #fff; border-color: var(--red); background: var(--red); }

/* ───────────────────────────────────────────────────────────────────────
   Community Phase 3 — bell + notification popover, @mention dropdown,
   inline mention links, new-posts toast, and a flash highlight when a
   notification deeplinks into a specific post. */

.c-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gray-light);
  cursor: pointer;
  padding: 0;
}
.c-bell:hover { color: var(--white); border-color: rgba(227, 24, 55,0.4); }
.c-bell-icon { font-size: 14px; line-height: 1; }
.c-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--paper);
}

.c-notif-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 10px;
  width: min(360px, calc(100vw - 24px));
  max-height: 480px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.154);
  z-index: 50;
  padding: 10px;
}
.c-notif-popover[hidden] { display: none; }
.c-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.c-notif-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-light);
}
.c-notif-mark-all {
  background: transparent;
  border: 0;
  color: var(--red);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
}
.c-notif-mark-all:disabled { color: var(--gray-mid); cursor: default; }
.c-notif-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.c-notif-row {
  display: grid;
  grid-template-columns: 22px 28px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--gray-light);
  cursor: pointer;
  transition: background 0.12s;
}
.c-notif-row:hover { background: rgba(0, 0, 0,0.04); color: var(--white); }
.c-notif-row.unread { background: rgba(227, 24, 55,0.06); }
.c-notif-icon {
  font-size: 14px;
  text-align: center;
  color: var(--gray-light);
}
.c-notif-body { min-width: 0; }
.c-notif-line {
  font-size: 13px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-notif-preview {
  font-size: 12px;
  color: var(--gray-light);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-notif-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray-mid);
  margin-top: 2px;
}
.c-notif-empty {
  text-align: center;
  font-size: 12px;
  color: var(--gray-mid);
  padding: 24px 12px;
}

/* Inline @mention link inside post / comment text. */
.c-mention {
  color: #FF7070;
  font-weight: 500;
  text-decoration: none;
  border-radius: 3px;
  padding: 0 2px;
}
.c-mention:hover {
  text-decoration: underline;
  background: rgba(227, 24, 55,0.10);
}

/* Composer mention autocomplete — anchored under the active textarea. */
.c-mention-dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 19px rgba(0, 0, 0, 0.154);
  z-index: 60;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.c-mention-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-light);
}
.c-mention-option:hover,
.c-mention-option.is-active {
  background: rgba(227, 24, 55,0.12);
  color: var(--white);
}
.c-mention-option-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "X new posts ↑" toast that appears above the feed when new arrivals land
   while the user is scrolled away from the top of the feed. */
.c-new-posts-toast {
  position: sticky;
  top: 12px;
  z-index: 5;
  align-self: center;
  margin: 8px auto 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  border: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(227, 24, 55,0.35);
  display: block;
  width: max-content;
}
.c-new-posts-toast:hover { transform: translateY(-1px); }

/* Brief flash when arriving at a post via a notification deep-link. */
.c-post-flash {
  animation: c-post-flash-keys 1.4s ease-out;
}
@keyframes c-post-flash-keys {
  0%   { box-shadow: 0 0 0 0 rgba(227, 24, 55,0.65); }
  60%  { box-shadow: 0 0 0 12px rgba(227, 24, 55,0); }
  100% { box-shadow: 0 0 0 0 rgba(227, 24, 55,0); }
}

/* ───────────────────────────────────────────────────────────────────────
   Dashboard hero (community polish) — greeting + KPI strip rendered
   above the 3-column grid. Spans all columns via grid-column: 1 / -1
   on .c-shell. Stacks on mobile. */

.c-dashboard-hero {
  background:
    linear-gradient(140deg, rgba(227, 24, 55,0.10) 0%, rgba(227, 24, 55,0) 55%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
}
.c-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 2fr);
  gap: 24px;
  align-items: center;
}
.c-hero-greet { min-width: 0; }
.c-hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-bottom: 6px;
}
.c-hero-title {
  font-family: var(--font-display, var(--font-sans));
  font-size: 26px;
  line-height: 1.15;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 6px;
}
.c-hero-name { color: var(--red); }
.c-hero-sub {
  font-size: 13px;
  color: var(--gray-light);
}
.c-hero-progress {
  margin-top: 10px;
  max-width: 360px;
}
.c-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.c-stat-tile {
  background: rgba(0, 0, 0,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 64px;
}
.c-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.c-stat-value {
  font-family: var(--font-display, var(--font-sans));
  font-size: 22px;
  line-height: 1;
  font-weight: 600;
  color: var(--white);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.c-stat-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--gray-mid);
}

@media (max-width: 1024px) {
  .c-hero-row { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 600px) {
  .c-dashboard-hero { padding: 16px 16px; border-radius: 12px; }
  .c-hero-title { font-size: 20px; }
  .c-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .c-stat-tile { padding: 10px 12px; min-height: 56px; }
  .c-stat-value { font-size: 18px; }
}

/* ───────────────────────────────────────────────────────────────────────
   Channel chips — horizontal scrollable strip rendered at the top of
   the feed when the sidebar collapses on narrow screens. */

.c-channel-chips-scroll {
  display: none;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.c-channel-chips-scroll::-webkit-scrollbar { display: none; }
@media (max-width: 820px) {
  .c-channel-chips-scroll { display: flex; }
}
.c-channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--gray-light);
  font-size: 13px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.c-channel-chip:hover { color: var(--white); }
.c-channel-chip.is-active {
  background: rgba(227, 24, 55,0.16);
  border-color: rgba(227, 24, 55,0.45);
  color: var(--white);
}
.c-channel-chip-emoji { font-size: 13px; }
.c-channel-chip-name { white-space: nowrap; }

/* ───────────────────────────────────────────────────────────────────────
   Skeleton cards — shown while the realtime feed is establishing or
   while a Firestore composite index is still being built after deploy. */

.c-skel {
  border-color: var(--border) !important;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.c-skel-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.c-skel-avatar,
.c-skel-line {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0,0.04) 0%,
    rgba(0, 0, 0,0.10) 50%,
    rgba(0, 0, 0,0.04) 100%
  );
  background-size: 200% 100%;
  animation: c-skel-shimmer 1.4s linear infinite;
  border-radius: 6px;
}
.c-skel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.c-skel-line {
  height: 10px;
}
.c-skel-line-w-25 { width: 25%; }
.c-skel-line-w-40 { width: 40%; }
.c-skel-line-w-60 { width: 60%; }
.c-skel-line-w-80 { width: 80%; }
.c-skel-line-w-90 { width: 90%; }
@keyframes c-skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ───────────────────────────────────────────────────────────────────────
   Polish on existing components: post card hover/spacing, channel
   header weight, composer card padding. */

.c-post {
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.c-post:hover {
  border-color: rgba(227, 24, 55,0.35);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.098);
}

.c-channel-title { font-size: 20px; }
.c-channel-title-emoji { font-size: 26px; }

@media (max-width: 600px) {
  .c-channel-header { padding: 14px 14px; }
  .c-channel-title { font-size: 17px; }
  .c-channel-title-emoji { font-size: 22px; }
  .c-channel-desc { font-size: 12px; }
  .c-composer-card { padding: 14px 14px; }
}

/* ───────────────────────────────────────────────────────────────────────
   Channel polish — meta-tag row under the header description, beefed-up
   empty states for the feed and the leaderboard rail. */

.c-channel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.c-channel-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0,0.03);
  color: var(--gray-light);
}
.c-channel-tag-red {
  border-color: rgba(227, 24, 55,0.35);
  background: rgba(227, 24, 55,0.10);
  color: #FF9090;
}

/* Feed empty state — illustrated card with CTA. Replaces the bare two
   lines of text and gives sparse channels visual weight. */
.c-empty-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 48px 24px;
  background:
    radial-gradient(ellipse at top, rgba(227, 24, 55,0.06) 0%, transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 280px;
}
.c-empty-art {
  font-size: 48px;
  line-height: 1;
  opacity: 0.85;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(227, 24, 55,0.08);
  border: 1px solid rgba(227, 24, 55,0.20);
}
.c-empty-large .c-empty-title {
  font-family: var(--font-display, var(--font-sans));
  font-size: 20px;
  font-weight: 600;
  color: var(--white);
  margin: 0;
}
.c-empty-large .c-empty-body {
  font-size: 13px;
  color: var(--gray-light);
  max-width: 380px;
  margin: 0;
}
.c-empty-cta {
  margin-top: 8px;
}

/* Leaderboard rail empty — small icon + two-line copy. */
.c-leader-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 18px 12px 10px;
}
.c-leader-empty-art {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 2px;
  opacity: 0.85;
}
.c-leader-empty-title {
  font-size: 13px;
  color: var(--white);
  font-weight: 500;
}
.c-leader-empty-body {
  font-size: 11px;
  color: var(--gray-mid);
  line-height: 1.45;
}

/* ───────────────────────────────────────────────────────────────────────
   Right rail wrapper — stacks the group info card on top of the
   leaderboard. Replaces the previous "leaderboard is the grid item"
   layout. The wrapper holds the sticky/align rules; the inner cards
   are pure visual blocks. */

.c-rightrail {
  position: sticky;
  top: 18px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* The rail is NOT hidden on narrow viewports — it restacks below the feed (see
   the .c-shell rules). This override has to live AFTER the base rule above,
   which sets position:sticky; sticky on a full-width stacked block would pin it
   over the feed as you scroll. */
@media (max-width: 1180px) {
  .c-rightrail {
    position: static;
    top: auto;
  }
}

/* Channel header title row — keeps the Invite button opposite the title.
   This button exists because the right rail (which holds the group card's
   own Invite CTA) is display:none below 1180px, so on a laptop or phone the
   header is the only place an invite link can be reached from. */
.c-channel-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.c-channel-titlebar .c-channel-title { flex: 1; min-width: 0; }
.c-channel-invite {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12px;
  white-space: nowrap;
}

/* ───────────────────────────────────────────────────────────────────────
   Group info card — community identity block at the top of the right
   rail. Banner with monogram, name + private-community line, brief
   description, 3-cell stat row, member avatar strip, big CTA button.
   Modeled after the reference Skool screenshot. */

.c-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.c-group-card-banner {
  height: 90px;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(227, 24, 55, 0.16) 0%, transparent 60%),
    linear-gradient(135deg, var(--surface-2) 0%, var(--red-tint) 60%, var(--surface) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.c-group-card-monogram {
  font-family: var(--font-display, var(--font-sans));
  font-weight: 700;
  font-size: 38px;
  letter-spacing: 0.04em;
  color: var(--white);
  text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}
.c-group-card-monogram::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--red);
  margin: 4px auto 0;
}
.c-group-card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.c-group-card-title {
  font-family: var(--font-display, var(--font-sans));
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}
.c-group-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gray-mid);
}
.c-group-card-lock { font-size: 11px; }
.c-group-card-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--gray-light);
  margin: 0;
}
.c-group-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.c-group-card-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.c-group-card-stat-value {
  font-family: var(--font-display, var(--font-sans));
  font-weight: 600;
  font-size: 18px;
  color: var(--white);
  line-height: 1;
}
.c-group-card-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.c-group-card-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.c-group-card-avatar {
  display: inline-flex;
  text-decoration: none;
  border-radius: 50%;
  outline: 2px solid transparent;
  transition: outline-color 0.12s, transform 0.12s;
}
.c-group-card-avatar:hover {
  outline-color: rgba(227, 24, 55,0.55);
  transform: translateY(-1px);
}
.c-group-card-cta {
  margin-top: 4px;
  text-align: center;
  text-decoration: none;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ───────────────────────────────────────────────────────────────────────
   Tabs row — Discussion / Leaderboard / Members / About. Skool-style
   underlined active state. */

.c-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: -2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.c-tabs::-webkit-scrollbar { display: none; }
.c-tab {
  background: transparent;
  border: 0;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--gray-light);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.12s;
}
.c-tab:hover { color: var(--white); }
.c-tab.is-active { color: var(--white); font-weight: 500; }
.c-tab.is-active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
}
@media (max-width: 600px) {
  .c-tab { padding: 9px 12px; font-size: 13px; }
}

/* Tighten the hero a touch so the right-rail group card has visual room
   to breathe without the page feeling top-heavy. */
.c-dashboard-hero { padding: 18px 22px; }
.c-hero-title { font-size: 22px; }
@media (max-width: 600px) {
  .c-dashboard-hero { padding: 14px 14px; }
  .c-hero-title { font-size: 19px; }
}

/* ───────────────────────────────────────────────────────────────────────
   Invite-link modal — appended to <body> on demand. Used by the group
   card's "Invite members" CTA to mint and copy a community invite link. */

.c-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.c-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: calc(100vh - 32px);
  width: 100%;
  max-width: 460px;
  padding: 24px 22px 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.154);
}
.c-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--gray-mid);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.c-modal-close:hover { color: var(--white); background: rgba(0, 0, 0,0.05); }
.c-modal-title {
  font-family: var(--font-display, var(--font-sans));
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  margin: 0;
}
.c-modal-sub {
  font-size: 13px;
  color: var(--gray-light);
  margin: 0;
}
.c-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}

.c-invite-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.c-invite-link-row {
  display: flex;
  gap: 6px;
}
.c-invite-url {
  flex: 1;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  min-width: 0;
}
.c-invite-url:focus { outline: none; border-color: rgba(227, 24, 55,0.5); }
.c-invite-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-mid);
  letter-spacing: 0.04em;
}
.c-invite-actions {
  margin-top: 4px;
  display: flex;
  gap: 8px;
}

/* Owner-only "+ Add channel" footer button at the bottom of the
   channel sidebar. Subtle by default; lights up red on hover. */
.c-channel-add {
  margin-top: 4px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--gray-mid);
  font-size: 12px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.c-channel-add:hover {
  color: var(--white);
  border-color: rgba(227, 24, 55,0.4);
  background: rgba(227, 24, 55,0.06);
}

/* Add-channel modal inputs (reuses the .c-modal shell from the invite
   modal). Stacked layout, full-width inputs. */
.c-ch-input {
  width: 100%;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-size: 14px;
  padding: 10px 12px;
  font-family: var(--font-sans);
}
.c-ch-input:focus { outline: none; border-color: rgba(227, 24, 55,0.5); }

/* ── Private channels ─────────────────────────────────────────────────── */

.c-ch-private {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--gray-light);
  cursor: pointer;
}
.c-ch-private input { margin-top: 2px; flex-shrink: 0; }
.c-ch-hidden-opt { margin-top: 6px; padding-left: 22px; }
.c-ch-private input:disabled + span { opacity: 0.45; }

.c-channel-lock { margin-left: auto; font-size: 11px; opacity: 0.75; }

/* Locked channel panel — replaces composer + feed for non-members. */
.c-locked {
  text-align: center;
  padding: 40px 24px;
}
.c-locked-emoji { font-size: 40px; line-height: 1; }
.c-locked-title {
  margin: 12px 0 8px;
  font-family: var(--font-display, var(--font-sans));
  font-size: 26px;
  color: var(--white);
}
.c-locked-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-mid);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}
.c-locked-desc {
  max-width: 460px;
  margin: 14px auto 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-light);
}
.c-locked-count {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gray-mid);
}
.c-locked-actions { margin-top: 20px; }
.c-locked-pending {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-light);
}
.c-locked-note {
  margin-top: 18px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--gray-mid);
}

/* Staff panel — pending requests + member roster. */
.c-staff-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.c-staff-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin: 10px 0 8px;
}
.c-staff-head:first-child { margin-top: 0; }
.c-staff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.c-staff-row:last-child { border-bottom: none; }
.c-staff-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.c-staff-row .btn { padding: 4px 10px; font-size: 11px; flex-shrink: 0; }
.c-staff-empty {
  font-size: 12px;
  color: var(--gray-mid);
  font-family: var(--font-mono);
  padding: 4px 0 8px;
}
.c-staff-settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.c-staff-settings-actions .btn { padding: 5px 12px; font-size: 11px; }
.c-staff-settings-actions .c-staff-empty { padding: 0; }

/* Inline approve/deny inside a bell notification row. */
.c-notif-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.c-notif-actions button {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--charcoal);
  color: var(--white);
}
.c-notif-approve { background: var(--red); border-color: var(--red); }
.c-notif-actions button:disabled { opacity: 0.5; cursor: default; }
.c-notif-decided {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.c-notif-err { font-size: 10px; color: var(--red); align-self: center; }

/* ── Channel access application form ──────────────────────────────────── */

.c-apply {
  text-align: left;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.c-apply-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-mid);
  text-align: center;
}
.c-apply-field { display: flex; flex-direction: column; gap: 6px; }
.c-apply-label {
  font-size: 13px;
  color: var(--white);
  line-height: 1.4;
}
.c-apply-req {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-left: 4px;
}
.c-apply-input {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
  width: 100%;
  resize: vertical;
}
.c-apply-input:focus { outline: none; border-color: var(--border-red); }
.c-apply-input::placeholder { color: var(--gray-mid); }

/* Applicant answers as shown to staff in the review panel. */
.c-staff-request {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 4px;
}
.c-staff-request:last-child { border-bottom: none; }
.c-staff-request .c-staff-row { border-bottom: none; }
.c-apply-answers {
  margin: 4px 0 0 38px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.c-apply-answer-q {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-bottom: 3px;
}
.c-apply-answer-a {
  font-size: 13px;
  line-height: 1.55;
  color: var(--gray-light);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.c-notif-review {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--red);
}

@media (max-width: 600px) {
  .c-apply-answers { margin-left: 0; }
}

/* ── Custom event date + time picker ────────────────────────────── */
.c-dt-row { display: flex; gap: 8px; }
.c-dt-wrap { position: relative; flex: 1 1 0; min-width: 0; }
.c-dt-field {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-size: 14px;
  font-family: var(--font-sans);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s;
}
.c-dt-field:hover { border-color: rgba(227, 24, 55,0.4); }
.c-dt-field:focus-visible { outline: none; border-color: rgba(227, 24, 55,0.5); }
.c-dt-ic { flex: 0 0 auto; color: var(--gray-mid); }
.c-dt-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-dt-placeholder { color: var(--gray-mid); }

.c-dt-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  background: var(--charcoal, var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.14);
}
.c-dt-pop-time { left: auto; right: 0; }

/* Calendar */
.c-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.c-cal-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
}
.c-cal-nav {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--gray-mid);
  width: 26px;
  height: 26px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.c-cal-nav:hover { color: var(--white); border-color: rgba(227, 24, 55,0.4); }
.c-cal-week,
.c-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 32px);
  gap: 2px;
}
.c-cal-week span {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray-mid);
  padding: 4px 0;
}
.c-cal-cell {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
}
.c-cal-blank { background: transparent; }
.c-cal-day {
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.c-cal-day:hover { background: rgba(0, 0, 0,0.08); }
.c-cal-day.is-today { box-shadow: inset 0 0 0 1px var(--border); }
.c-cal-day.is-sel {
  background: var(--red, var(--red));
  color: #fff;
  font-weight: 600;
}

/* Time columns */
.c-time-cols { display: flex; gap: 6px; }
.c-time-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.c-time-col::-webkit-scrollbar { width: 4px; }
.c-time-col::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.c-time-col-ap { justify-content: flex-start; }
.c-time-opt {
  background: transparent;
  border: none;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.c-time-opt:hover { background: rgba(0, 0, 0,0.08); }
.c-time-opt.is-sel {
  background: var(--red, var(--red));
  color: #fff;
  font-weight: 600;
}
.c-time-done {
  margin-top: 8px;
  width: 100%;
  background: var(--red, var(--red));
  border: none;
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 0;
  cursor: pointer;
}
.c-time-done:hover { filter: brightness(1.1); }
.c-ch-keyhint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-mid);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ───────────────────────────────────────────────────────────────────────
   Topbar search — small icon button in the chip + a centered overlay
   that opens on click or Cmd/Ctrl-K. Bears no default visible text on
   mobile so it doesn't fight the chip's horizontal-scroll strip. */

.c-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gray-light);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.c-search-btn:hover { color: var(--white); border-color: rgba(227, 24, 55,0.4); }
.c-search-icon { font-size: 13px; line-height: 1; }

.c-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 24px;
}
.c-search-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.154);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.c-search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.c-search-icon-lg {
  font-size: 16px;
  line-height: 1;
  color: var(--gray-mid);
}
.c-search-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--white);
  font-size: 16px;
  padding: 4px 0;
  min-width: 0;
}
.c-search-input::placeholder { color: var(--gray-mid); }
.c-search-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-mid);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}
.c-search-results {
  max-height: 60vh;
  overflow-y: auto;
}
.c-search-hint {
  padding: 24px;
  text-align: center;
  color: var(--gray-mid);
  font-size: 13px;
}
.c-search-section {
  padding: 6px 6px 10px;
  border-bottom: 1px solid var(--border);
}
.c-search-section:last-child { border-bottom: 0; }
.c-search-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-mid);
  padding: 8px 10px 4px;
}
.c-search-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--gray-light);
  transition: background 0.12s, color 0.12s;
}
.c-search-row:hover { background: rgba(0, 0, 0,0.04); color: var(--white); }
.c-search-row-body { min-width: 0; }
.c-search-row-title {
  font-size: 13px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-search-row-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray-mid);
  margin-top: 1px;
}
.c-search-row-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray-mid);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .c-search-overlay { padding: 24px 12px; }
  .c-search-input { font-size: 14px; }
  .c-search-kbd { display: none; }
}

/* ───────────────────────────────────────────────────────────────────────
   Events page (Stage 4) — community events list. Reuses the .c-modal
   shell for the create-event modal; layout below is page-local. */

.c-events-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.c-events-hero {
  background:
    linear-gradient(140deg, rgba(227, 24, 55,0.08) 0%, rgba(227, 24, 55,0) 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.c-events-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.c-events-title {
  font-family: var(--font-display, var(--font-sans));
  font-size: 28px;
  line-height: 1.15;
  color: var(--white);
  margin: 0;
}
.c-events-sub {
  font-size: 13px;
  color: var(--gray-light);
  margin: 0;
}
.c-events-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.c-events-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.c-events-tab {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--gray-light);
  font-size: 13px;
  cursor: pointer;
}
.c-events-tab:hover { color: var(--white); }
.c-events-tab.is-active {
  background: rgba(227, 24, 55,0.16);
  color: var(--white);
}
.c-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Eventbrite-style cards: a date badge on the left, stacked content on
   the right with a clear CTA. */
.c-event-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.c-event-card:hover {
  border-color: rgba(227, 24, 55,0.30);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.112);
}
.c-event-cover {
  width: 100%;
  max-height: 280px;
  overflow: hidden;
  background: var(--charcoal);
}
.c-event-cover img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}
.c-event-main {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 20px;
  padding: 20px;
}
.c-event-datebadge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  background: rgba(227, 24, 55,0.10);
  border: 1px solid rgba(227, 24, 55,0.22);
}
.c-ev-month {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.10em;
  color: #FF6B6B;
  text-transform: uppercase;
}
.c-ev-day {
  font-family: var(--font-display, var(--font-sans));
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--white);
}
.c-event-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.c-event-title {
  font-family: var(--font-display, var(--font-sans));
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  text-decoration: none;
}
.c-event-when {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #FF9090;
  letter-spacing: 0.02em;
}
.c-event-loc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-light);
}
.c-event-meta-ic { flex: 0 0 auto; }
.c-event-host {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-mid);
}
.c-event-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--gray-light);
  margin-top: 4px;
}
.c-event-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.c-event-cta { white-space: nowrap; }
.c-event-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
}
.c-event-ctl {
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--border);
  color: var(--gray-light);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.c-event-ctl:hover { color: var(--white); border-color: rgba(227, 24, 55,0.40); }
.c-event-del:hover { color: #FF7070; border-color: rgba(227, 24, 55,0.40); }

/* Event registration */
.c-event-registered {
  background: rgba(40,180,80,0.14);
  border: 1px solid rgba(40,180,80,0.35);
  color: #7CFF9B;
  cursor: default;
}
.c-event-regcount {
  margin-top: 10px;
  align-self: flex-start;
  background: transparent;
  border: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--gray-mid);
  cursor: pointer;
}
.c-event-regcount:hover { color: var(--white); text-decoration: underline; }
.c-reg-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-light);
  cursor: pointer;
}
.c-reg-consent input { margin-top: 3px; flex: 0 0 auto; }
.c-registrants-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.c-registrant-row {
  padding: 10px 12px;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.c-registrant-name { font-size: 14px; color: var(--white); }
.c-registrant-email { font-size: 12px; color: var(--gray-light); }
.c-registrant-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--gray-mid);
  margin-top: 2px;
}

/* Share-to-CRM modal */
.c-share-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--white);
  cursor: pointer;
}
.c-share-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 6px 0 4px 22px;
}
.c-share-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-light);
  cursor: pointer;
}
.c-share-ok {
  font-size: 13px;
  color: #7CFF9B;
  background: rgba(40,180,80,0.10);
  border: 1px solid rgba(40,180,80,0.25);
  border-radius: 6px;
  padding: 8px 10px;
}

/* Flyer / cover upload field in the event modal */
.c-ev-image-field { width: 100%; }
.c-ev-image-drop {
  position: relative;
  width: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--charcoal);
  border: 1px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.12s;
}
.c-ev-image-drop:hover { border-color: rgba(227, 24, 55,0.4); }
.c-ev-image-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}
.c-ev-image-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px;
  color: var(--gray-mid);
  font-size: 13px;
  text-align: center;
}
.c-ev-image-ic { font-size: 24px; }
.c-ev-image-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--gray-mid);
}
.c-ev-image-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.c-ev-image-remove:hover { background: rgba(227, 24, 55,0.7); }

@media (max-width: 720px) {
  .c-event-main { grid-template-columns: 60px 1fr; gap: 14px; padding: 16px; }
  .c-event-datebadge { width: 60px; height: 60px; }
  .c-ev-day { font-size: 24px; }
  .c-events-title { font-size: 22px; }
}









/* ============================================================
   PROFILE PAGE — modernized 2-column layout
============================================================ */
/* Let the profile page use the full desktop width — override the
   1200px cap that console-body inherits from the admin chrome. */
.console-body:has(.profile-shell) {
  max-width: none;
  padding: 24px 40px 80px;
}

.profile-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 36px;
  max-width: none;
  margin: 0;
  padding: 16px 0;
  align-items: start;
}

.profile-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  position: sticky;
  top: 80px;
  text-align: center;
}

.profile-avatar-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 18px;
}
.profile-avatar-wrap .c-avatar {
  width: 140px !important;
  height: 140px !important;
  font-size: 52px !important;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
}
.profile-avatar-edit {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  border: 2px solid var(--black);
  transition: background 0.2s, transform 0.15s;
}
.profile-avatar-edit:hover { background: var(--red-dark); transform: scale(1.05); }
.profile-avatar-status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--red);
  margin-bottom: 12px;
  min-height: 14px;
}

.profile-side-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 4px;
}
.profile-side-role {
  font-size: 13px;
  color: var(--white-dim);
  margin-bottom: 4px;
}
.profile-side-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--gray-light);
  margin-top: 4px;
}

.profile-completion {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: left;
}
.profile-completion-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--gray-light);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.profile-completion-pct { color: var(--red); }
.profile-completion-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.profile-completion-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), #FF4D4F);
  transition: width 0.4s ease;
}
.profile-completion-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--gray-light);
  margin-top: 10px;
}

.profile-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.profile-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 4px 12px;
}
.profile-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-eyebrow::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--red);
}
.profile-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 52px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1;
  margin-bottom: 6px;
}
.profile-title span { color: var(--red); }
.profile-sub {
  font-size: 14px;
  color: var(--white-dim);
}
.profile-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.profile-save-status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--red);
  min-height: 14px;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
  transition: border-color 0.2s;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px 36px;
  align-items: start;
}
.profile-card:hover { border-color: rgba(0, 0, 0,0.14); }

.profile-card-head {
  padding-right: 12px;
  border-right: 1px solid var(--border);
}
.profile-card-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 4px;
}
.profile-card-head p {
  font-size: 13px;
  color: var(--white-dim);
}
.profile-lock {
  font-size: 14px;
  margin-left: 4px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 24px;
}
.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.profile-field-full {
  grid-column: 1 / -1;
}
.profile-field label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-light);
}
.profile-opt {
  color: var(--gray-mid);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 10px;
  margin-left: 6px;
}

.profile-input {
  width: 100%;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--white);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.profile-input::placeholder { color: var(--gray-mid); }
.profile-input:focus {
  border-color: var(--border-red);
  background: var(--surface2);
}
.profile-input:disabled {
  color: var(--gray-mid);
  cursor: not-allowed;
}
.profile-textarea {
  resize: vertical;
  min-height: 90px;
  font-family: var(--font-body);
  line-height: 1.5;
}

.profile-footer-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 4px 24px;
}

/* View mode */
.profile-view-bio {
  font-size: 15px;
  line-height: 1.7;
  color: var(--white-dim);
}
.profile-view-link {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.profile-view-link:last-child { border-bottom: none; }
.profile-view-link-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-light);
}
.profile-view-link-val {
  font-size: 14px;
  color: var(--white);
  word-break: break-word;
}
a.profile-view-link-val {
  color: var(--red);
  text-decoration: none;
  transition: color 0.15s;
}
a.profile-view-link-val:hover { color: var(--white); text-decoration: underline; }

.profile-view-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.profile-view-stat {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.profile-view-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 6px;
}
.profile-view-stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}

@media (max-width: 1100px) {
  .profile-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .profile-card-head {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 14px;
  }
}

@media (max-width: 900px) {
  .profile-shell {
    grid-template-columns: 1fr;
    padding: 20px 12px;
  }
  .profile-side {
    position: static;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .profile-header-actions {
    align-items: flex-start;
  }
}

/* ────────────────────────────────────────────────────────────────
   Course management — sale pricing + generic lesson renderer
   ──────────────────────────────────────────────────────────────── */

.lesson-header { margin-bottom: 22px; }

.lesson-subtitle {
  color: var(--gray-light);
  font-size: 15px;
  margin-top: 6px;
}

.lesson-body {
  color: var(--white-dim);
  line-height: 1.7;
  font-size: 15px;
}
.lesson-body h2, .lesson-body h3 { color: var(--white); margin: 22px 0 10px; }
.lesson-body p { margin: 0 0 14px; }
.lesson-body ul, .lesson-body ol { margin: 0 0 14px 22px; }
.lesson-body li { margin-bottom: 6px; }
.lesson-body blockquote {
  border-left: 3px solid var(--red);
  padding: 8px 16px;
  margin: 16px 0;
  color: var(--gray-light);
  background: rgba(0, 0, 0,0.03);
}
.lesson-body img { max-width: 100%; border-radius: 8px; margin: 12px 0; }
.lesson-body a { color: var(--red); }

/* ════════════════════════════════════════════════════════════════
   GHL-style CRM app shell (sidebar + main) + sales screens
   ════════════════════════════════════════════════════════════════ */
.crm-app { display: flex; min-height: 100vh; background: var(--black); color: var(--white); }

/* Sidebar */
.crm-sidebar {
  width: 236px; flex-shrink: 0;
  background: var(--black-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.crm-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px; text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.crm-sidebar-logo { height: 40px; width: auto; }
.crm-sidebar-brandtext {
  font-family: var(--font-display); font-size: 22px; letter-spacing: 0.08em;
  color: var(--white);
}
.crm-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; flex: 1; overflow-y: auto; }
.crm-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--gray-light); text-decoration: none;
  font-size: 14px; font-weight: 500;
  position: relative; transition: background .15s, color .15s;
}
.crm-nav-item:hover { background: var(--surface); color: var(--white); }
.crm-nav-item.active {
  background: color-mix(in srgb, var(--red) 16%, transparent);
  color: var(--white);
}
.crm-nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--red);
}
.crm-nav-icon { width: 20px; text-align: center; font-size: 15px; opacity: .9; }
.crm-nav-label { flex: 1; }
.crm-nav-soon { cursor: default; opacity: .5; }
.crm-nav-soon:hover { background: transparent; color: var(--gray-light); }
.crm-nav-soon-tag {
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gray-mid);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px;
}
.crm-sidebar-foot { padding: 10px; border-top: 1px solid var(--border); }
.crm-nav-muted { color: var(--gray-mid); font-size: 13px; }

/* Main column + appbar */
.crm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.crm-appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px;
  background: rgba(11, 11, 12, 0.9); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.crm-appbar-title { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.04em; color: var(--white); margin: 0; }
.crm-appbar-spacer { flex: 1; }
.crm-hamburger {
  display: none; background: transparent; border: 1px solid var(--border);
  color: var(--white); border-radius: 8px; font-size: 16px; padding: 4px 10px; cursor: pointer;
}
.crm-content { padding: 22px 26px 64px; flex: 1; }
.crm-drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 38; }

@media (max-width: 900px) {
  .crm-sidebar {
    position: fixed; left: 0; top: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .25s ease;
  }
  .crm-sidebar.open { transform: translateX(0); }
  .crm-hamburger { display: inline-block; }
  .crm-content { padding: 16px 14px 56px; }
}

/* Page intro / toolbar shared by sales screens */
.crm-page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.crm-page-head .crm-toolbar-spacer { flex: 1; }
.crm-section-sub { color: var(--gray-light); font-size: 13px; margin: -6px 0 16px; }

/* ── Dashboard widgets ── */
.crm-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.crm-widget {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 18px;
}
.crm-widget-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-light); }
.crm-widget-value { font-family: var(--font-display); font-size: 34px; letter-spacing: .02em; color: var(--white); margin-top: 6px; line-height: 1; }
.crm-widget-sub { font-size: 12px; color: var(--gray-mid); margin-top: 6px; }
.crm-widget-accent .crm-widget-value { color: var(--red); }
.crm-widget-soon { opacity: .55; }
.crm-widget-soon .crm-widget-value { font-size: 16px; color: var(--gray-mid); font-family: var(--font-body); margin-top: 10px; }

/* ── Opportunities board ── */
.opp-forecast { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 18px; }
.opp-forecast-item .crm-widget-label { display: block; }
.opp-forecast-item .opp-forecast-val { font-family: var(--font-display); font-size: 24px; color: var(--white); }
.opp-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.opp-col { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 250px; width: 250px; flex-shrink: 0; }
.opp-col-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.opp-col-title-row { display: flex; align-items: center; gap: 8px; }
.opp-col-title { font-weight: 600; font-size: 13px; color: var(--white); flex: 1; }
.opp-col-count { font-family: var(--font-mono); font-size: 10px; color: var(--gray-light); background: var(--charcoal); border-radius: 999px; padding: 2px 8px; }
.opp-col-total { font-family: var(--font-mono); font-size: 12px; color: var(--gray-light); margin-top: 4px; }
.opp-col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; transition: background .15s; }
.opp-col-body.crm-col-over { background: color-mix(in srgb, var(--red) 8%, transparent); }
.opp-card {
  display: block; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; text-decoration: none; cursor: grab;
}
.opp-card:hover { border-color: var(--border-red); }
.opp-card.dragging { opacity: .5; }
.opp-card-title { color: var(--white); font-size: 13px; font-weight: 600; }
.opp-card-value { color: var(--red); font-family: var(--font-mono); font-size: 13px; margin-top: 4px; }
.opp-card-sub { color: var(--gray-light); font-family: var(--font-mono); font-size: 10px; margin-top: 5px; }
.opp-col-empty { color: var(--gray-mid); font-size: 12px; text-align: center; padding: 12px 0; }

/* ── Tasks ── */
.task-bucket { margin-bottom: 22px; }
.task-bucket-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.task-bucket-title { font-family: var(--font-display); font-size: 18px; letter-spacing: .03em; color: var(--white); }
.task-bucket-count { font-family: var(--font-mono); font-size: 10px; color: var(--gray-light); background: var(--charcoal); border-radius: 999px; padding: 2px 8px; }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.task-row.done .task-title { text-decoration: line-through; color: var(--gray-mid); }
.task-check {
  width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px; cursor: pointer;
  border: 1.5px solid var(--gray-mid); background: transparent;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px;
}
.task-check.checked { background: var(--red); border-color: var(--red); }
.task-main { flex: 1; min-width: 0; }
.task-title { color: var(--white); font-size: 14px; }
.task-meta { font-family: var(--font-mono); font-size: 10px; color: var(--gray-light); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.task-due-overdue { color: var(--red); }
.task-del { background: transparent; border: 0; color: var(--gray-mid); cursor: pointer; font-size: 16px; }
.task-del:hover { color: var(--red); }
.task-empty { color: var(--gray-mid); font-size: 13px; padding: 6px 0; }
.task-priority-high { box-shadow: inset 3px 0 0 var(--red); }

/* Contact-detail sub-panels reuse */
.crm-subpanel-empty { color: var(--gray-mid); font-size: 13px; padding: 10px 0; }
.crm-mini-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px;
}
.crm-mini-row .crm-mini-main { flex: 1; min-width: 0; }
.crm-mini-title { color: var(--white); font-size: 13px; font-weight: 600; }
.crm-mini-sub { font-family: var(--font-mono); font-size: 10px; color: var(--gray-light); margin-top: 3px; }
.crm-mini-val { color: var(--red); font-family: var(--font-mono); font-size: 12px; }

/* ── Calendar ── */
.cal-grid-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-grid-head > div { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-light); text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { min-height: 96px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; overflow: hidden; }
.cal-cell-empty { background: transparent; border: none; cursor: default; }
.cal-cell:hover:not(.cal-cell-empty) { border-color: var(--border-red); }
.cal-today { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.cal-daynum { font-family: var(--font-mono); font-size: 11px; color: var(--gray-light); margin-bottom: 4px; }
.cal-appt {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--stage-color, var(--red)) 22%, transparent);
  color: var(--white); border-left: 3px solid var(--stage-color, var(--red));
  border-radius: 4px; padding: 3px 5px; margin-bottom: 3px;
  font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-more { font-family: var(--font-mono); font-size: 9px; color: var(--gray-mid); }
@media (max-width: 760px) {
  .cal-cell { min-height: 64px; }
  .cal-appt { font-size: 9px; }
}

/* ── SMS conversations ── */
.sms-wrap { display: flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; height: calc(100vh - 190px); min-height: 420px; }
.sms-list { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface); }
.sms-list-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--border); padding: 12px 14px; cursor: pointer; color: var(--white); }
.sms-list-item:hover { background: var(--surface2); }
.sms-list-item.active { background: color-mix(in srgb, var(--red) 14%, transparent); }
.sms-list-top { display: flex; justify-content: space-between; align-items: center; }
.sms-list-name { font-weight: 600; font-size: 13px; }
.sms-unread { background: var(--red); color: #fff; border-radius: 999px; font-size: 10px; padding: 1px 7px; font-family: var(--font-mono); }
.sms-list-preview { color: var(--gray-light); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sms-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sms-thread-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: baseline; }
.sms-thread-name { color: var(--white); font-weight: 600; text-decoration: none; }
.sms-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.sms-bubble { max-width: 75%; padding: 8px 12px; border-radius: 12px; font-size: 14px; word-break: break-word; }
.sms-in { align-self: flex-start; background: var(--surface2); color: var(--white); border-bottom-left-radius: 3px; }
.sms-out { align-self: flex-end; background: var(--red); color: #fff; border-bottom-right-radius: 3px; }
.sms-bubble-meta { font-family: var(--font-mono); font-size: 9px; opacity: .7; margin-top: 4px; }
.sms-composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.sms-composer .c-input { flex: 1; margin: 0; }
.sms-thread-mini { display: flex; flex-direction: column; height: 380px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
@media (max-width: 760px) { .sms-list { width: 130px; } .sms-wrap { height: calc(100vh - 160px); } }

/* ════════════════════════════════════════════════════════════════
   Public "What's Coming" (pre-order / interest) page
   ════════════════════════════════════════════════════════════════ */
.pre-shell { max-width: 1440px; margin: 0 auto; padding: 48px 20px 80px; color: var(--white); }
.pre-hero { text-align: center; margin-bottom: 40px; }
.pre-brand { display: inline-block; }
.pre-logo { height: 72px; width: auto; margin-bottom: 14px; }
.pre-hero h1 { font-family: var(--font-display); font-size: 56px; letter-spacing: 0.04em; margin: 12px 0 6px; }
.pre-hero h1 span { color: var(--red); }
.pre-sub { color: var(--gray-light); font-size: 16px; max-width: 560px; margin: 0 auto; }
.pre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.pre-card { display: flex; flex-direction: column; gap: 8px; position: relative; }
.pre-card-img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; }
.pre-card-badge { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.pre-card-title { font-family: var(--font-display); font-size: 24px; letter-spacing: .02em; color: var(--white); margin: 0; }
.pre-card-sum { color: var(--gray-light); font-size: 14px; flex: 1; }
.pre-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.pre-card-price { font-family: var(--font-mono); font-size: 16px; color: var(--white); }
.pre-card-price.muted { color: var(--gray-mid); }
.pre-card-count { font-family: var(--font-mono); font-size: 11px; color: var(--gray-light); }
.pre-empty { grid-column: 1/-1; text-align: center; color: var(--gray-light); padding: 40px 0; }
.pre-early { margin-top: 36px; text-align: center; }
.pre-early h2 { font-family: var(--font-display); font-size: 30px; letter-spacing: .03em; margin: 0 0 6px; }
.pre-early-sub { color: var(--gray-light); margin-bottom: 18px; }
.pre-inline-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }
.pre-inline-form .c-input { max-width: 240px; margin: 0; }
.pre-consent { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-light); }
.pre-msg { margin-top: 12px; font-size: 14px; }
.pre-msg.ok { color: #56D4A8; }
.pre-msg.err { color: var(--red); }
.pre-foot { text-align: center; margin-top: 40px; }
.pre-modal-sub { color: var(--gray-light); font-size: 13px; margin: -6px 0 12px; }

/* Product image uploader (manage-products modal) */
.p-img-uploader { display: flex; gap: 14px; align-items: flex-start; }
.p-img-preview {
  width: 96px; height: 96px; flex-shrink: 0; border-radius: 10px; overflow: hidden;
  background: var(--charcoal); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.p-img-preview img { width: 100%; height: 100%; object-fit: cover; }
.p-img-preview span { color: var(--gray-mid); font-size: 11px; }
.p-img-controls { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.p-img-btn { align-self: flex-start; cursor: pointer; }
.p-img-controls .c-input { margin: 0; }

/* ════════════════════════════════════════════════════════════════
   Course landing page (/course.html) — Udemy-style course detail,
   in 1P brand. All classes namespaced `cl-`.
   ════════════════════════════════════════════════════════════════ */

#cl-root { display: block; color: var(--white); font-family: var(--font-body); }
.cl-loading { padding: 80px 20px; text-align: center; color: var(--gray-light); }

/* ── Hero band ── */
.cl-hero { background: var(--black-2); border-bottom: 1px solid var(--border); }
.cl-hero-inner {
  max-width: 1440px; margin: 0 auto; padding: 36px 32px 40px; width: 100%;
}
/* Leave visual room for the sticky purchase card that overlaps the hero. */
.cl-hero-main { max-width: calc(100% - 420px); }
.cl-breadcrumb {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--gray-light); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap;
}
.cl-breadcrumb a { color: var(--red); text-decoration: none; }
.cl-breadcrumb a:hover { text-decoration: underline; }
.cl-breadcrumb span { color: var(--gray-mid); }
.cl-title {
  font-family: var(--font-display); font-size: 46px; line-height: 1.02;
  letter-spacing: 0.02em; margin: 0 0 12px;
}
.cl-subtitle { font-size: 18px; color: var(--white-dim); max-width: 720px; margin: 0 0 18px; line-height: 1.5; }
.cl-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--gray-light); align-items: center; }
.cl-meta a { color: var(--red); }
.cl-badge-sale, .cl-badge-new {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; background: var(--red); color: #fff;
}
.cl-badge-new { background: rgba(227, 24, 55,0.14); color: var(--red); border: 1px solid var(--border-red); }

.cl-strip {
  display: inline-flex; gap: 0; margin-top: 22px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.cl-strip-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 26px; border-right: 1px solid var(--border); min-width: 130px;
}
.cl-strip-cell:last-child { border-right: 0; }
.cl-strip-big { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--white); }
.cl-stars { color: var(--red); font-size: 12px; letter-spacing: 2px; }
.cl-strip-label { font-size: 11px; color: var(--gray-light); }

/* ── Two-column body ── */
.cl-body { max-width: 1440px; margin: 0 auto; padding: 32px 32px 96px; width: 100%; }
.cl-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
.cl-main { min-width: 0; }

.cl-h2 {
  font-family: var(--font-display); font-size: 26px; letter-spacing: 0.03em;
  margin: 0 0 16px; color: var(--white);
}
.cl-block { margin-bottom: 40px; }
.cl-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 26px 28px; margin-bottom: 40px;
}

/* What you'll learn */
.cl-learn-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px;
}
.cl-learn-grid li { display: flex; gap: 12px; font-size: 14px; color: var(--white-dim); line-height: 1.5; }
.cl-check { color: var(--red); font-weight: 700; flex-shrink: 0; }

/* The 1% Method */
.cl-method {
  background: linear-gradient(140deg, rgba(227, 24, 55,0.07) 0%, rgba(227, 24, 55,0) 55%), var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 26px 28px;
}
.cl-method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.cl-method-num { font-family: var(--font-mono); font-size: 12px; color: var(--red); }
.cl-method-step h3 {
  font-family: var(--font-display); font-size: 19px; letter-spacing: 0.04em; margin: 6px 0 6px;
}
.cl-method-step p { font-size: 13px; color: var(--gray-light); line-height: 1.55; margin: 0; }

/* This course includes */
.cl-includes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.cl-includes ul { list-style: none; margin: 0; padding: 0; }
.cl-includes li {
  display: flex; gap: 12px; align-items: baseline; font-size: 14px;
  color: var(--white-dim); padding: 7px 0;
}
.cl-inc-icon { width: 20px; flex-shrink: 0; text-align: center; opacity: 0.85; }

/* Course content accordion */
.cl-cur-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 13px; color: var(--gray-light); margin-bottom: 12px; flex-wrap: wrap;
}
.cl-expand {
  background: none; border: 0; color: var(--red); font-family: var(--font-body);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 0;
}
.cl-expand:hover { text-decoration: underline; }
.cl-accordion { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cl-sec { border-bottom: 1px solid var(--border); }
.cl-sec:last-child { border-bottom: 0; }
.cl-sec summary {
  list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 16px 18px; background: var(--surface); font-weight: 600; font-size: 14.5px;
  user-select: none;
}
.cl-sec summary::-webkit-details-marker { display: none; }
.cl-sec summary:hover { background: var(--surface2); }
.cl-sec-chev { color: var(--gray-light); transition: transform 0.15s ease; font-size: 16px; }
.cl-sec[open] .cl-sec-chev { transform: rotate(90deg); color: var(--red); }
.cl-sec-title { flex: 1; min-width: 0; }
.cl-sec-meta { font-size: 12px; color: var(--gray-light); font-weight: 400; white-space: nowrap; }
.cl-lessons { list-style: none; margin: 0; padding: 6px 0; background: var(--black-2); }
.cl-lessons li {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 46px;
  font-size: 13.5px; color: var(--white-dim);
}
.cl-lessons li:hover { background: rgba(0, 0, 0,0.02); }
.cl-lesson-icon { flex-shrink: 0; opacity: 0.7; font-size: 11px; width: 16px; }
.cl-lesson-title { flex: 1; min-width: 0; }
.cl-lesson-dur { font-family: var(--font-mono); font-size: 11px; color: var(--gray-mid); white-space: nowrap; }
.cl-lesson-tag {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; white-space: nowrap;
}
.cl-lesson-tag.is-practice { background: rgba(227, 24, 55,0.12); color: var(--red); border: 1px solid var(--border-red); }
.cl-lesson-tag.is-assess { background: rgba(0, 0, 0,0.06); color: var(--gray-light); border: 1px solid var(--border); }

/* Requirements + description */
.cl-bullets { margin: 0; padding-left: 20px; color: var(--white-dim); font-size: 14px; line-height: 1.7; }
.cl-bullets li { margin-bottom: 8px; }
.cl-desc { position: relative; color: var(--white-dim); font-size: 14.5px; line-height: 1.7; }
.cl-desc p { margin: 0 0 14px; }
.cl-desc.is-clamped { max-height: 300px; overflow: hidden; }
.cl-desc-fade {
  display: none; position: absolute; inset: auto 0 0 0; height: 90px;
  background: linear-gradient(rgba(255, 255, 255, 0), var(--paper));
}
.cl-desc.is-clamped .cl-desc-fade { display: block; }

/* Instructor */
.cl-instructor { display: flex; gap: 20px; align-items: flex-start; }
.cl-instructor-avatar {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 28px; letter-spacing: 0.05em;
}
.cl-instructor-name { font-size: 17px; font-weight: 700; }
.cl-instructor-title { font-size: 13px; color: var(--red); margin: 3px 0 10px; }
.cl-instructor-bio { font-size: 14px; color: var(--white-dim); line-height: 1.65; margin: 0; max-width: 640px; }

/* Members also explore */
.cl-more { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cl-more-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  text-decoration: none; color: var(--white); border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.cl-more-row:last-child { border-bottom: 0; }
.cl-more-row:hover { background: var(--surface2); }
.cl-more-thumb {
  width: 56px; height: 42px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(140deg, rgba(227, 24, 55,0.35), rgba(227, 24, 55,0.08)), var(--charcoal);
  border: 1px solid var(--border-red);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 16px; color: #ff9b9c;
}
.cl-more-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cl-more-title { font-weight: 600; font-size: 14.5px; }
.cl-more-badge { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--gray-light); text-transform: uppercase; }
.cl-more-price { font-family: var(--font-mono); font-size: 14px; font-weight: 700; white-space: nowrap; }
.cl-more-price s { color: var(--gray-mid); font-weight: 400; margin-right: 6px; }

/* ── Sticky purchase card ── */
.cl-buy {
  position: sticky; top: 90px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.126);
  margin-top: -170px; /* overlap the hero band, Udemy-style */
}
.cl-buy-media {
  height: 180px; position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background:
    radial-gradient(120% 130% at 15% 10%, rgba(227, 24, 55,0.5) 0%, rgba(227, 24, 55,0) 55%),
    linear-gradient(150deg, #1c0405 0%, var(--black-2) 70%);
  border-bottom: 1px solid var(--border);
}
.cl-buy-media-mark {
  font-family: var(--font-display); font-size: 40px; letter-spacing: 0.05em; color: #fff;
  text-shadow: 0 4px 30px rgba(227, 24, 55,0.55);
}
.cl-buy-media-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-light); }
.cl-buy-body { padding: 22px 24px 24px; }
.cl-price { display: flex; align-items: baseline; gap: 12px; }
.cl-price-now { font-family: var(--font-mono); font-size: 32px; font-weight: 700; }
.cl-price-was { color: var(--gray-mid); font-size: 16px; }
.cl-price-note { font-size: 12px; color: var(--gray-light); margin-top: 4px; }
.cl-soon-note { font-size: 12px; color: var(--red); margin-top: 8px; }
.cl-cta {
  display: block; width: 100%; margin-top: 16px; padding: 14px 18px;
  background: var(--red); color: #fff; border: 0; border-radius: 8px;
  font-family: var(--font-body); font-size: 15px; font-weight: 700; cursor: pointer;
  text-align: center; text-decoration: none; transition: background 0.15s ease, transform 0.1s ease;
}
.cl-cta:hover { background: var(--red-dark); }
.cl-cta:active { transform: scale(0.99); }
.cl-cta[disabled] { opacity: 0.7; cursor: default; }
.cl-cta-msg { font-size: 12px; color: var(--red); margin-top: 8px; min-height: 14px; }
.cl-buy-perks { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); }
.cl-buy-perks li { font-size: 12.5px; color: var(--gray-light); padding: 4px 0 4px 20px; position: relative; }
.cl-buy-perks li::before { content: '✓'; position: absolute; left: 0; color: var(--red); font-weight: 700; }
.cl-buy-links {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.cl-coupon { font-size: 12px; color: var(--gray-light); text-decoration: underline dotted; cursor: help; }
.cl-share {
  background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--white-dim);
  font-family: var(--font-body); font-size: 12px; font-weight: 600; padding: 6px 12px; cursor: pointer;
}
.cl-share:hover { border-color: var(--border-red); color: var(--red); }

/* ── Responsive — single column below 1100px; mobile keeps compact type ── */
@media (max-width: 1100px) {
  .cl-hero-main { max-width: none; }
  .cl-cols { grid-template-columns: 1fr; gap: 28px; }
  .cl-buy { position: static; margin-top: 0; order: -1; max-width: 520px; }
}
@media (max-width: 760px) {
  .cl-hero-inner { padding: 24px 18px 28px; }
  .cl-body { padding: 22px 18px 72px; }
  .cl-title { font-size: 34px; }
  .cl-subtitle { font-size: 15.5px; }
  .cl-strip { display: flex; flex-wrap: wrap; }
  .cl-strip-cell { flex: 1 1 33%; min-width: 100px; padding: 12px 10px; }
  .cl-learn-grid, .cl-includes, .cl-method-grid { grid-template-columns: 1fr; }
  .cl-card, .cl-method { padding: 20px 18px; }
  .cl-sec-meta { display: none; }
  .cl-lessons li { padding-left: 34px; }
  .cl-lesson-tag { display: none; }
  .cl-instructor { flex-direction: column; }
}

/* Back-to-courses link at the top of the course landing hero */
.cl-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--red);
  text-decoration: none; margin-bottom: 14px;
}
.cl-back-arrow { color: var(--red); font-size: 15px; transition: transform 0.15s ease; }
.cl-back:hover { color: var(--white); }
.cl-back:hover .cl-back-arrow { color: var(--white); }
.cl-back:hover .cl-back-arrow { transform: translateX(-3px); }

/* ══════════════════════════════════════════════════════════════════════════
   Certificate of completion
   Two surfaces: the "you finished" panel inside the player / roadmap, and the
   printable sheet on /certificate.html.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Course-complete panel ─────────────────────────────────────────────── */

.course-done {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 28px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--border-red);
  border-radius: 14px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(227, 24, 55, 0.16), transparent 60%),
    var(--black-2);
}

.course-done.is-compact { margin: 0 0 28px; }

.course-done-mark {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 20px;
}

.course-done-text { flex: 1; min-width: 220px; }

.course-done-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

.course-done-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 4px;
}

.course-done-sub { color: var(--gray-light); font-size: 13px; line-height: 1.5; }

.course-done-btn {
  flex-shrink: 0;
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.course-done-btn:hover { background: var(--red-dark); transform: translateY(-1px); }

/* ── Certificate page ──────────────────────────────────────────────────── */

.cert-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.cert-loading, .cert-note { color: var(--gray-light); font-size: 13px; }
.cert-note { margin-top: 16px; text-align: center; }
.cert-note a { color: var(--red); }

.cert-message {
  max-width: 620px;
  margin: 40px auto;
  padding: 36px 32px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--black-2);
}

.cert-message h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.cert-message p { color: var(--gray-light); font-size: 14px; line-height: 1.6; }
.cert-message-actions { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.cert-actions {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Style picker ──────────────────────────────────────────────────────── */

.cert-styles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.cert-styles-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-right: 4px;
}

.cert-style {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--black-2);
  color: var(--gray-light);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.cert-style:hover { border-color: var(--border-red); color: var(--white); }

.cert-style[aria-pressed="true"] {
  border-color: var(--red);
  color: var(--white);
}

.cert-style-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  /* Two halves: the sheet colour and its accent. */
  background: linear-gradient(135deg, var(--sw-a) 0 50%, var(--sw-b) 50% 100%);
}

/* ── The sheet ─────────────────────────────────────────────────────────────
   The award, rendered from the approved design. Every measurement is in cqw
   (a percentage of the sheet's own width) with a px fallback for browsers
   without container queries, so the proportions survive a phone, a desktop
   and a sheet of paper without a second layout.

   Colour is entirely in the custom properties below, so a style variant is a
   palette swap on the sheet element and nothing else. */

/* One palette: ink on white paper, red as punctuation. This is the base rather
   than a modifier because Classic is now the only style — certificates are
   printed, so a white sheet is always correct. `.is-classic` is kept below as a
   no-op so any markup still emitting the class keeps working. */
.cert-sheet,
.cert-sheet.is-classic {
  --cert-bg: #FFFFFF;
  --cert-face: #FFFFFF;
  --cert-ink: #1A1A1A;
  --cert-body: #3C3C3C;
  --cert-muted: #8A8A8A;
  --cert-accent: var(--red);
  --cert-name: var(--red);
  --cert-wedge: #1A1A1A;
  --cert-line: rgba(0, 0, 0, 0.85);
  --cert-rule: rgba(0, 0, 0, 0.45);
  --cert-dot: rgba(0, 0, 0, 0.32);
  --cert-watermark: rgba(0, 0, 0, 0.035);
  --cert-sigline: rgba(0, 0, 0, 0.55);

  container-type: inline-size;
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.4%;
  background: var(--cert-bg);
  overflow: hidden;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.12);
}

/* The two solid corner wedges. */
.cert-sheet::before,
.cert-sheet::after {
  content: '';
  position: absolute;
  width: 8.5%;
  aspect-ratio: 1;
  background: var(--cert-wedge);
}
.cert-sheet::before { top: 0; left: 0; clip-path: polygon(0 0, 100% 0, 0 100%); z-index: 2; }
.cert-sheet::after { right: 0; bottom: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); z-index: 2; }

/* Frame + face draw a chamfered hairline outline: the frame is the line, the
   face sits 1px inside it. A border alone can't turn a corner diagonally. */
.cert-frame {
  position: relative;
  z-index: 1;
  padding: 1px;
  background: var(--cert-line);
  clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 34px 100%, 0 calc(100% - 34px));
  clip-path: polygon(0 0, calc(100% - 3.4cqw) 0, 100% 3.4cqw, 100% 100%, 3.4cqw 100%, 0 calc(100% - 3.4cqw));
}

.cert-face {
  position: relative;
  /* The spacer and the content share one grid cell, so the row is the taller of
     the two: the design's 3:2 shape is a floor, and an unusually long course
     title makes the sheet taller instead of spilling out of the frame.
     (aspect-ratio can't do this — it pins the height and lets content overflow.) */
  display: grid;
  background: var(--cert-face);
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 33px) 0, 100% 33px, 100% 100%, 33px 100%, 0 calc(100% - 33px));
  clip-path: polygon(0 0, calc(100% - 3.3cqw) 0, 100% 3.3cqw, 100% 100%, 3.3cqw 100%, 0 calc(100% - 3.3cqw));
}

.cert-face::before {
  content: '';
  grid-area: 1 / 1;
  padding-top: 64.9%;
}

/* Dot field, fading out across the left third. */
.cert-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--cert-dot) 0.9px, transparent 0.9px);
  background-size: 13px 13px;
  -webkit-mask-image: linear-gradient(100deg, #000 0%, transparent 42%);
  mask-image: linear-gradient(100deg, #000 0%, transparent 42%);
  opacity: 0.55;
}

.cert-watermark {
  position: absolute;
  top: 50%;
  left: 62%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 300px;
  font-size: 34cqw;
  line-height: 0.8;
  letter-spacing: 0.02em;
  color: var(--cert-watermark);
  pointer-events: none;
}

.cert-hatch {
  position: absolute;
  width: 100px;
  width: 9.5cqw;
  height: 12px;
  height: 1.15cqw;
  background: repeating-linear-gradient(114deg,
    var(--cert-accent) 0 2px, transparent 2px 7px);
}
.cert-hatch-tr { top: 2.6cqw; right: 3.2cqw; }
.cert-hatch-bl { bottom: 2.6cqw; left: 3.2cqw; }

/* ── Content ──────────────────────────────────────────────────────────── */

.cert-inner {
  position: relative;
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.2cqw 6cqw 2.6cqw;
}

.cert-brand { margin-bottom: 1.5cqw; }

.cert-brand-mark {
  font-family: var(--font-display);
  font-size: 58px;
  font-size: 5.4cqw;
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--cert-ink);
}

.cert-brand-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-size: 1.15cqw;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cert-ink);
  margin-top: 0.5cqw;
}

.cert-brand-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  font-size: 1.15cqw;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--cert-accent);
}

/* Small caps line flanked by rules, per the design. */
.cert-ruled {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6cqw;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  font-size: 1.15cqw;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--cert-ink);
}

.cert-ruled::before,
.cert-ruled::after {
  content: '';
  height: 1px;
  width: 9cqw;
  background: var(--cert-accent);
}

.cert-ruled.is-red {
  color: var(--cert-accent);
  font-size: 19px;
  font-size: 1.8cqw;
  letter-spacing: 0.3em;
}

.cert-title {
  font-family: var(--font-display);
  font-size: 92px;
  font-size: 8.7cqw;
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--cert-ink);
  margin: 0.9cqw 0 0.4cqw;
}

.cert-name {
  font-family: var(--font-display);
  font-size: 50px;
  font-size: 4.8cqw;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cert-name);
  padding-bottom: 0.7cqw;
  margin: 1.8cqw auto 1.1cqw;
  max-width: 82%;
  border-bottom: 1px solid var(--cert-line);
}

.cert-lead {
  font-family: var(--font-mono);
  font-size: 11px;
  font-size: 1.05cqw;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cert-muted);
}

.cert-course {
  font-family: var(--font-display);
  font-size: 32px;
  font-size: 3.1cqw;
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cert-ink);
  margin: 0.6cqw auto 0.7cqw;
  max-width: 86%;
}

.cert-body {
  font-size: 13px;
  font-size: 1.25cqw;
  line-height: 1.55;
  color: var(--cert-body);
  max-width: 62%;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.cert-foot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  margin-top: 2.1cqw;
  padding-top: 1.7cqw;
  border-top: 1px solid var(--cert-rule);
}

.cert-foot-col {
  flex: 1;
  min-width: 0;
  padding: 0 1cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4cqw;
}

.cert-foot-col + .cert-foot-col { border-left: 1px solid var(--cert-rule); }

.cert-foot-icon {
  width: 26px;
  width: 2.5cqw;
  color: var(--cert-accent);
  margin-bottom: 0.2cqw;
}
.cert-foot-icon svg { width: 100%; height: auto; display: block; }

.cert-foot-val {
  font-size: 14px;
  font-size: 1.35cqw;
  color: var(--cert-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cert-foot-val.is-mono { font-family: var(--font-mono); letter-spacing: 0.06em; }

/* The signatures. Great Vibes is loaded on /certificate.html; the cursive
   fallback keeps them reading as a signature if it never arrives. */
.cert-foot-sig {
  font-family: 'Great Vibes', 'Snell Roundhand', 'Apple Chancery', cursive;
  font-size: 30px;
  font-size: 2.9cqw;
  line-height: 1.1;
  color: var(--cert-ink);
  white-space: nowrap;
  padding-bottom: 0.5cqw;
  margin-bottom: 0.4cqw;
  border-bottom: 1px solid var(--cert-sigline);
  width: 100%;
}

.cert-foot-sig.is-monogram { font-size: 38px; font-size: 3.6cqw; letter-spacing: 0.02em; }

.cert-foot-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  font-size: 0.88cqw;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--cert-muted);
  line-height: 1.45;
}

.cert-foot-lbl.is-red { color: var(--cert-accent); font-weight: 700; letter-spacing: 0.1em; }

.cert-tagline {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.8cqw;
  margin-top: 1.7cqw;
  font-family: var(--font-mono);
  font-size: 11px;
  font-size: 1.05cqw;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cert-ink);
}

.cert-tagline span + span { padding-left: 1.8cqw; border-left: 1px solid var(--cert-rule); }

@media (max-width: 720px) {
  .cert-page { padding: 24px 12px 60px; }
}

/* ── Print ─────────────────────────────────────────────────────────────────
   Landscape, sheet only. Everything else on the page is chrome. */

@media print {
  @page { size: landscape; margin: 0.35in; }

  body { background: #fff !important; }

  .cert-noprint,
  .academy-header,
  .cert-actions,
  .cert-styles,
  .cert-note,
  #chatbot-root,
  .consent-banner { display: none !important; }

  .cert-page { padding: 0; max-width: none; }

  .cert-sheet {
    max-width: none;
    width: 100%;
    box-shadow: none;
    /* The dark styles are mostly background: without this browsers drop every
       fill and print an empty rectangle. */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
