:root {
  /* Brand palette — black, red, white only. Grays are neutral supporting tones. */
  --red: #E60306;
  --red-dark: #B30205;
  --red-light: #FDECEC;
  --black: #0A0A0A;
  --charcoal: #171717;
  --gray-dark: #262626;
  --gray-mid: #737373;
  --gray-light: #A3A3A3;
  --border: #262626;
  --surface: #141414;
  --surface2: #1C1C1C;
  --white: #FFFFFF;
  --white-dim: rgba(255,255,255,0.7);
  --white-soft: #F5F5F5;
  /* Legacy accent retained as neutral white so existing UI using it stays on palette. */
  --accent: #FFFFFF;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
}

* { 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;
}

.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(204,27,27,0.12);
  border-color: rgba(204,27,27,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;
}

.tag-p1 { background: rgba(83,74,183,0.2); color: #9B93E8; }
.tag-p2 { background: rgba(29,158,117,0.2); color: #56D4A8; }
.tag-p3 { background: rgba(186,117,23,0.2); color: #F0B83A; }
.tag-all { background: rgba(204,27,27,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 {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
  border: none;
}

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

.btn-ghost:hover {
  border-color: var(--gray-mid);
  color: var(--white);
}

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

.btn-primary:hover { background: var(--red-dark); }

.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(204,27,27,0.08);
  border: 1px solid rgba(204,27,27,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(204,27,27,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(204,27,27,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(--accent);
  padding: 16px 20px;
  margin: 28px 0;
  background: rgba(232,197,71,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(204,27,27,0.5);
  background: rgba(204,27,27,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(204,27,27,0.08); border-color: rgba(204,27,27,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: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-link {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid rgba(232,197,71,0.3);
  border-radius: 4px;
}

.user-chip-link:hover { background: rgba(232,197,71,0.08); }

.auth-shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(204,27,27,0.12), transparent 60%),
    radial-gradient(900px 400px at 100% 110%, rgba(232,197,71,0.06), transparent 60%),
    var(--black);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-bottom: 6px;
}

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

.auth-sub {
  font-size: 13px;
  color: var(--gray-light);
  margin-bottom: 26px;
}

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

.auth-form input {
  width: 100%;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  padding: 11px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.15s;
}

.auth-form input:focus { border-color: rgba(204,27,27,0.5); }

.auth-form .btn { width: 100%; padding: 11px 18px; font-size: 14px; }
.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(204,27,27,0.12);
  border: 1px solid rgba(204,27,27,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: var(--charcoal);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

/* 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-email { display: none; }
  .user-chip > .c-bell { flex-shrink: 0; }
}

.console-body {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.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(255,255,255,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(204,27,27,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(232,197,71,0.15); color: var(--accent); }
.pill-muted { background: rgba(160,160,160,0.15); color: var(--gray-light); }
.pill-red { background: rgba(204,27,27,0.2); color: #FF7070; }

.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 {
  max-width: 1320px;
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 24px;
  align-items: start;
}
.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; }
  .c-leaderboard { display: none; }
}
@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-leaderboard { display: none; }
}

.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(204,27,27,0.35), rgba(232,197,71,0.18));
  color: #fff;
}
.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(204,27,27,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(204,27,27,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(204,27,27,0.12);
  border: 1px solid rgba(204,27,27,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(204,27,27,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: rgba(232,197,71,0.18); color: var(--accent); }
.c-role-admin { background: rgba(204,27,27,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: rgba(232,197,71,0.12); color: var(--accent); }
.c-scope-company { background: rgba(83,74,183,0.2); color: #9B93E8; }

.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(255,255,255,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(204,27,27,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(204,27,27,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(204,27,27,0.14);
  border-color: rgba(204,27,27,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: #fff; }

/* 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(204,27,27,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(204,27,27,0.08); border-color: rgba(204,27,27,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(204,27,27,0.08);
  border: 1px solid rgba(204,27,27,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(230,3,6,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(230,3,6,0.18); }
  50%      { box-shadow: 0 0 0 7px rgba(230,3,6,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; }
}

/* ============================================================
   THE ONE PERCENT 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(10,10,10,0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.academy-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}

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

.academy-brand-mark {
  width: 44px;
  height: 44px;
  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: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--white);
}

.academy-brand-line2 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-top: 4px;
}

.academy-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.academy-tab {
  padding: 10px 16px;
  border-radius: 6px;
  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 {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 32px 96px;
  width: 100%;
}

.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: 700;
  font-size: 56px;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 18px;
}

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

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

.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: 40px;
  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: 56px;
}

.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 */
.academy-split {
  display: grid;
  grid-template-columns: 1.3fr 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 { width: 36px; height: 36px; }
  .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; }
  /* Row 2: tabs fill full width */
  .academy-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 4px;
    padding-bottom: 4px;
  }
  .academy-tab { padding: 8px 12px; font-size: 12px; flex-shrink: 0; }
  .academy-continue { grid-template-columns: 1fr; }
}

.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 1P-CLC), main swaps to that course's content.
   ============================================================ */

body.academy-course {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 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(230,3,6,0.06);
  border-color: rgba(230,3,6,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(230,3,6,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;
  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(230,3,6,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;
}

.welcome-inner {
  max-width: 680px;
}

.welcome-inner h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 64px;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--white);
  margin-bottom: 20px;
}

.welcome-inner h1 span { color: var(--red); }

.welcome-inner p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--white-dim);
  max-width: 600px;
}

.welcome-inner .academy-tagline { max-width: 600px; }

.welcome-hint {
  margin-top: 40px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-light);
  display: inline-block;
}

/* 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: 1120px;
  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-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;
  }
  .welcome-inner h1 { font-size: 40px; }
  .workspace-welcome { padding: 40px 24px; }
  .course-soon-card { padding: 40px 24px; }
  .course-soon-card h2 { font-size: 30px; }
}

/* ============================================================
   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);
}

/* Available Courses section within the welcome workspace */
.workspace-welcome {
  flex-direction: column;
  justify-content: flex-start;
  padding: 56px 48px 72px;
}

.welcome-inner {
  margin: 0 auto 48px;
  width: 100%;
  max-width: 1120px;
}

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

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

.available-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.available-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, transform 0.2s;
}

.available-card:hover {
  border-color: var(--gray-mid);
  transform: translateY(-2px);
}

.available-card.is-soon { opacity: 0.78; }

.available-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.available-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.available-badge.is-live { background: var(--red); color: #fff; }
.available-badge.is-soon { background: var(--gray-dark); color: var(--gray-light); }

.available-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-mid);
}

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

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

.available-card-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.available-card-pricenote {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-top: -6px;
}

.available-card-actions {
  margin-top: 4px;
  display: flex;
  gap: 8px;
}

.available-card-actions .btn { width: 100%; justify-content: center; }

.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;
}

/* 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(230,3,6,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 64px; }
  .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(255,255,255,0.04); color: var(--white); }
.c-channel-link.is-active {
  background: rgba(204,27,27,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(204,27,27,0.08);
  border: 1px solid rgba(204,27,27,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(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--gray-light);
  margin-left: 6px;
}
.c-channel-pill.is-pinned {
  background: rgba(204,27,27,0.12);
  border-color: rgba(204,27,27,0.30);
  color: #FF9090;
}

.c-post.is-pinned {
  border-color: rgba(204,27,27,0.30);
  background: linear-gradient(180deg, rgba(204,27,27,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(204,27,27,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(204,27,27,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(255,255,255,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(255,255,255,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(255,255,255,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(255,255,255,0.05);
  color: var(--gray-light);
  white-space: nowrap;
}
.c-level-1  { color: #B8B8B8; }
.c-level-2  { color: #C5BC9D; border-color: rgba(197,188,157,0.30); }
.c-level-3  { color: #D9C77A; border-color: rgba(217,199,122,0.32); }
.c-level-4  { color: #E5B95F; border-color: rgba(229,185,95,0.34); }
.c-level-5  { color: #EFA050; border-color: rgba(239,160,80,0.36); background: rgba(239,160,80,0.06); }
.c-level-6  { color: #F38560; border-color: rgba(243,133,96,0.38); background: rgba(243,133,96,0.07); }
.c-level-7  { color: #F36F58; border-color: rgba(243,111,88,0.42); background: rgba(243,111,88,0.08); }
.c-level-8  { color: #EE5450; border-color: rgba(238,84,80,0.45); background: rgba(238,84,80,0.10); }
.c-level-9  { color: #E0383E; border-color: rgba(224,56,62,0.50); background: rgba(224,56,62,0.12); }
.c-level-10 { color: #FFD56F; border-color: rgba(255,213,111,0.55); background: rgba(204,27,27,0.18); }

/* ───────────────────────────────────────────────────────────────────────
   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(204,27,27,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 #1a1a1a;
}

.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 40px rgba(0,0,0,0.55);
  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(255,255,255,0.04); color: var(--white); }
.c-notif-row.unread { background: rgba(204,27,27,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(204,27,27,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 28px rgba(0,0,0,0.55);
  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(204,27,27,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(204,27,27,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(204,27,27,0.65); }
  60%  { box-shadow: 0 0 0 12px rgba(204,27,27,0); }
  100% { box-shadow: 0 0 0 0 rgba(204,27,27,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(204,27,27,0.10) 0%, rgba(204,27,27,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(255,255,255,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(204,27,27,0.16);
  border-color: rgba(204,27,27,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(255,255,255,0.04) 0%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,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(204,27,27,0.35);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.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(255,255,255,0.03);
  color: var(--gray-light);
}
.c-channel-tag-red {
  border-color: rgba(204,27,27,0.35);
  background: rgba(204,27,27,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(204,27,27,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(204,27,27,0.08);
  border: 1px solid rgba(204,27,27,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;
}
@media (max-width: 1180px) {
  .c-rightrail { display: none; }
}

/* ───────────────────────────────────────────────────────────────────────
   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(204,27,27,0.45) 0%, transparent 60%),
    linear-gradient(135deg, #1a1a1a 0%, #2a1212 60%, #1a0808 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(204,27,27,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;
  width: 100%;
  max-width: 460px;
  padding: 24px 22px 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}
.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(255,255,255,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;
}

.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(204,27,27,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(204,27,27,0.4);
  background: rgba(204,27,27,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(204,27,27,0.5); }
.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(204,27,27,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 60px rgba(0,0,0,0.55);
  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(255,255,255,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: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.c-events-hero {
  background:
    linear-gradient(140deg, rgba(204,27,27,0.08) 0%, rgba(204,27,27,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(204,27,27,0.16);
  color: var(--white);
}
.c-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.c-event-card {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.c-event-card:hover {
  border-color: rgba(204,27,27,0.30);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.c-event-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #FF9090;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.c-event-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.c-event-title {
  font-family: var(--font-display, var(--font-sans));
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}
.c-event-host {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-mid);
}
.c-event-desc {
  font-size: 13px;
  color: var(--gray-light);
  margin-top: 2px;
}
.c-event-loc {
  font-size: 12px;
  color: var(--gray-light);
}
.c-event-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.c-event-cta { white-space: nowrap; }
.c-event-del {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gray-mid);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}
.c-event-del:hover { color: #FF7070; border-color: rgba(204,27,27,0.40); }

@media (max-width: 720px) {
  .c-event-card { grid-template-columns: 1fr; gap: 8px; padding: 14px; }
  .c-event-date { color: #FF9090; }
  .c-event-actions { justify-content: flex-start; }
  .c-events-title { font-size: 22px; }
}








