/* ========================================
   ClanDi — Maremoto × Didasko Editorial Design
   Palette: Maremoto 2025 brand guide
     Active: Black + White + Green (primary accent) + Yellow (secondary)
     Available for variety: Blue, Amber (used in feature cards / states)
     Retired in ClanDi UI: Pink, Red (red kept as "gap" indicator only)
   Brand rule: one color as base, only black or white type over it.
   Typography: Source Serif 4 (headings) + DM Sans (body)
   ======================================== */

:root {
  /* Neutrals */
  --black: #000000;
  --white: #ffffff;
  --off-white: #fafaf8;
  --gray-50: #fafafa;
  --gray-100: #f0f0ee;
  --gray-200: #e0e0dc;
  --gray-300: #c8c8c4;
  --gray-400: #9a9a96;
  --gray-500: #6e6e6a;
  --gray-600: #484844;

  /* Maremoto Brand Palette — restricted to ClanDi's chosen subset.
     Active: black, white, green, yellow (+ tints + cream/sand neutrals).
     Maremoto's full brand also includes pink, red, blue, amber — those
     do NOT appear in ClanDi UI. Red kept only as the dedicated --gap
     indicator (semantic: missing-thing-needs-attention). */
  --green: #009f57;            /* Maremoto Green — primary engagement accent */
  --green-light: #2bbb7c;
  --green-dark: #00733f;
  --yellow: #fbed4f;           /* Maremoto Yellow — completion accent */
  --yellow-light: #fff185;
  --yellow-dark: #c2b521;

  /* Semantic */
  --text-primary: var(--black);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-400);
  --gap: #ff374d;              /* Maremoto Red — gap/missing indicator only */
  --found: var(--yellow);
  --stub-color: var(--yellow-dark);
  --warning-color: var(--yellow-dark);

  /* Soft pastel tints (Didasko-style card surfaces — green / yellow only) */
  --tint-green-soft: #e8f9f0;
  --tint-green: #c8eadb;
  --tint-yellow-soft: #fffce0;
  --tint-yellow: #fef9b8;
  --tint-cream: #fdfaf2;
  --tint-sand: #f5efe6;

  /* Typography */
  --display: 'Rubik Mono One', 'Impact', 'Helvetica Neue', sans-serif;
  --sans: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* --serif kept as alias for backward-compat in places that haven't been
     migrated yet; resolves to the bold display font. */
  --serif: 'Work Sans', Georgia, serif;

  /* Radii — tightened (Didasko-style flat, less puffy) */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Layout */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 0px;
  --topbar-h: 72px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Backwards-compat aliases — pink retired, now points to green.
     Will be removed in a later commit once all call sites migrate. */
  --pink: var(--green);
  --pink-light: var(--green-light);
  --pink-dark: var(--green-dark);
  --tint-pink: var(--tint-green-soft);
  --tint-mint: var(--tint-green-soft);
}

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

body {
  font-family: var(--sans);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15.5px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--off-white);
  /* Subtle dot grid texture (CSS-only, no asset request) */
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'kern', 'liga', 'tnum';
}

/* Sidebar + topbar + footer sit on a slightly opaquer surface so the
   dot grid stays subtle on the working area but visible in margins. */
.sidebar, .topbar, .app-footer { background: var(--off-white); }

body::before, body::after { display: none; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========== Cards ========== */
.glass-panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.glass-panel::before { display: none; }

.glass-panel:hover { box-shadow: var(--shadow-md); }

.glass-panel > * { position: relative; z-index: 1; }

.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header .iridescent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.panel-content {
  padding: 1.25rem 1.5rem;
}

/* ========== Header ========== */
header {
  padding: 1.5rem 0 0.5rem;
}

header .glass-panel {
  max-width: 960px;
  margin: 0 auto 1rem;
}

header h1 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--black);
}

header h1 span {
  color: var(--pink);
  -webkit-text-fill-color: var(--pink);
  background: none;
}

header p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 0.25rem;
}

main { padding: 0 0 2rem; }

/* ========== Tabs ========== */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 1rem;
  padding: 3px;
  background: var(--gray-100);
  border-radius: var(--radius-pill);
  border: 1px solid var(--gray-200);
  width: fit-content;
}

.tab {
  padding: 8px 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  transition: all var(--transition);
}

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

.tab.active {
  background: var(--black);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ========== Forms ========== */
.search-panel {
  display: none;
  margin-bottom: 1rem;
}

.search-panel.active { display: block; }

.form-row {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 180px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--black);
  outline: none;
  transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.form-group input::placeholder {
  color: var(--gray-400);
}

.form-group select option {
  background: var(--white);
  color: var(--black);
}

.form-group textarea {
  border-radius: var(--radius-md);
  resize: vertical;
  min-height: 100px;
}

/* ========== Buttons ========== */
.btn {
  padding: 10px 24px;
  background: var(--black);
  color: var(--white);
  border: 1.5px solid var(--black);
  border-radius: var(--radius-md);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  text-transform: none;
}

.btn::before { display: none; }

.btn:hover {
  background: var(--gray-600);
  border-color: var(--gray-600);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--white);
  color: var(--black);
  border: 1.5px solid var(--gray-200);
  box-shadow: none;
}

.btn-secondary::before { display: none; }

.btn-secondary:hover {
  border-color: var(--black);
  background: var(--white);
  box-shadow: none;
  transform: translateY(-1px);
}

.btn-sm { padding: 6px 16px; font-size: 12px; }
.btn-lg { padding: 14px 36px; font-size: 16px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ========== Stats ========== */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  padding: 12px 18px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat-value.gap { color: var(--gap); }
.stat-value.found { color: var(--green); }
.stat-value.stub { color: var(--stub-color); }
.stat-value.warning-val { color: var(--warning-color); }

/* ========== Results Table ========== */
.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.results-table th {
  background: var(--gray-50);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gray-500);
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  transition: all var(--transition);
}

.results-table th:hover { background: var(--gray-100); color: var(--black); }

.results-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
  color: var(--black);
}

.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: rgba(0, 159, 87, 0.04); }

.results-table a {
  color: var(--green-dark);
  text-decoration: none;
  transition: color var(--transition);
}
.results-table a:hover { color: var(--pink); text-decoration: underline; }

/* ========== Badges ========== */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge::before { display: none; }

.badge.missing {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge.exists {
  background: #ecfdf5;
  color: var(--green-dark);
  border: 1px solid #a7f3d0;
}

.badge.stub {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge.warning {
  background: #faf5ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
  margin: 2px 0;
}

/* ========== Priority Scores ========== */
.priority-score {
  display: inline-block;
  padding: 2px 10px;
  border: 1.5px solid;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
}

.priority-high {
  background: #fef2f2;
  color: var(--gap);
  border-color: #fecaca;
}

.priority-med {
  background: #fffbeb;
  color: var(--stub-color);
  border-color: #fde68a;
}

.priority-low {
  background: #ecfdf5;
  color: var(--green);
  border-color: #a7f3d0;
}

/* ========== Loading ========== */
.loading {
  text-align: center;
  padding: 2rem;
}

.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--gray-200);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar {
  margin-top: 1rem;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--gray-100);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--green);
}

.progress-fill::before { display: none; }

@keyframes progress {
  0% { width: 10%; }
  50% { width: 80%; }
  100% { width: 10%; }
}

@keyframes iridescent-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#results-area { display: none; }

.error-msg {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.direction-hint {
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 0.75rem;
}

.direction-hint strong {
  color: var(--black);
}

/* ========== Credit ========== */
.credit {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 0.25rem;
}
.credit a {
  color: var(--pink);
  text-decoration: none;
}
.credit a:hover {
  color: var(--pink-dark);
  text-decoration: underline;
}

/* ========== Help Modal ========== */
.help-modal-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.help-modal {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem 2.5rem;
  position: relative;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

.help-close {
  position: absolute;
  top: 1rem; right: 1.25rem;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}
.help-close:hover { color: var(--black); }

.help-modal h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--black);
}

.help-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--gray-100);
}
.help-section:last-of-type { border-bottom: none; }

.help-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.help-section p { color: var(--gray-500); font-size: 14px; margin-bottom: 0.4rem; }
.help-section dl { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; }
.help-section dt { font-weight: 700; font-size: 13px; color: var(--black); }
.help-section dd { font-size: 13px; color: var(--gray-500); }
.help-section ul { list-style: none; padding: 0; }
.help-section ul li { font-size: 13px; color: var(--gray-500); padding: 0.25rem 0 0.25rem 1.2rem; position: relative; }
.help-section ul li::before {
  content: '';
  position: absolute; left: 0; top: 0.65rem;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pink);
}

.help-footer {
  text-align: center; font-size: 12px; color: var(--gray-400);
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}
.help-footer a { color: var(--pink); text-decoration: none; }

/* ========== Navigation ========== */
.clandi-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--off-white);
  border-bottom: 1px solid var(--gray-200);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
}

.nav-logo {
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-clan { color: var(--black); }
.logo-di {
  color: var(--pink);
  -webkit-text-fill-color: var(--pink);
  background: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-link {
  padding: 6px 12px;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.nav-link:hover { color: var(--black); background: var(--gray-100); }
.nav-link.active {
  color: var(--black);
  background: var(--white);
  font-weight: 600;
  border: 1px solid var(--gray-200);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1rem;
}

.nav-user { display: flex; align-items: center; gap: 0.5rem; }
.nav-username { color: var(--black) !important; font-weight: 600; }

.lang-toggle {
  background: var(--white);
  border: 1px solid var(--gray-200);
  color: var(--black);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.lang-toggle:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
}

/* ========== Footer ========== */
.clandi-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--gray-400);
  font-size: 13px;
  border-top: 1px solid var(--gray-200);
  margin-top: 3rem;
}

.clandi-footer a { color: var(--green-dark); text-decoration: none; }
.clandi-footer a:hover { text-decoration: underline; }

/* ========== Page Header ========== */
.page-header { padding: 2rem 0 1.25rem; }

.page-header h1 {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--black);
  -webkit-text-fill-color: var(--black);
  background: none;
}

.page-header p { color: var(--gray-500); margin-top: 0.35rem; font-size: 15px; }

/* ========== Sections ========== */
.hero,
.dashboard-welcome { padding: 2rem 0 1.5rem; }

.community-stats,
.mission-dashboard { padding: 1.5rem 0; }

.features-section { padding: 1.5rem 0; }

.your-progress { padding: 1.5rem 0; }

.community-needs { padding: 1.5rem 0; }

.momentum-section { padding: 1.5rem 0; }

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ========== Landing Page ========== */
.hero { padding-top: 3rem; padding-bottom: 2.5rem; }
.hero-panel { text-align: center; background: transparent !important; border: none !important; box-shadow: none !important; }

.hero-title {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--black);
  -webkit-text-fill-color: var(--black);
  background: none;
}

.hero-subtitle {
  color: var(--gray-500);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto 2rem;
  line-height: 1.7;
  font-weight: 400;
}

.hero-cta { margin-bottom: 1rem; }
.hero-cta .btn { padding: 14px 32px; font-size: 15px; }
.hero-invite { color: var(--gray-400); font-size: 13px; font-style: italic; }

.section-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.25rem;
  color: var(--black);
  text-transform: none;
  letter-spacing: -0.01em;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card .panel-content { text-align: center; padding: 2rem 1.5rem; }
.stat-card .stat-value { font-size: 2rem; }

.mission-text { color: var(--gray-500); font-size: 1.05rem; line-height: 1.9; }
.mission-section { margin-bottom: 0; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.feature-card { transition: all 0.3s ease; }
.feature-card .panel-content { text-align: center; padding: 2rem 1.5rem; }
.feature-icon { font-size: 2.4rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--black); text-transform: none; }
.feature-card p { color: var(--gray-500); font-size: 0.9rem; line-height: 1.6; }

/* ========== Dashboard ========== */
.welcome-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.welcome-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--black); letter-spacing: -0.02em; }

.level-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.level-badge::before { display: none; }

.level-newcomer { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }
.level-editor { background: #ecfdf5; color: var(--green-dark); border: 1px solid #a7f3d0; }
.level-contributor { background: #fdf2f8; color: var(--pink-dark); border: 1px solid #fbcfe8; }
.level-mentor { background: #faf5ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.level-leader { background: var(--black); color: var(--white); border: 1px solid var(--black); }

/* Platform permissions role pills (separate from gamification levels) */
.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.role-administrator { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.role-organizer { background: #fef0f6; color: var(--pink-dark); border: 1px solid #fbcfe8; }
.role-wiki_mentor { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.role-editing_member { background: #ecfdf5; color: var(--green-dark); border: 1px solid #a7f3d0; }
.role-new_member { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }

/* Compact nav variant */
.nav-role-badge { margin-right: 6px; font-size: 10px; padding: 1px 7px; }

/* WikiPersona pill — shown on profile next to role/level badges */
.persona-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--tint-yellow);
  color: var(--black);
  border: 1.5px solid var(--black);
  text-decoration: none;
  vertical-align: middle;
  transition: transform 0.1s, box-shadow 0.15s;
}
.persona-pill:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.persona-pill > span:first-child { font-size: 13px; }

.welcome-streak {
  text-align: center;
  padding: 0.75rem 1.25rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.streak-number { font-size: 1.8rem; font-weight: 900; color: var(--green); }
.streak-label { display: block; font-size: 0.7rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }

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

/* Progress Ring */
.progress-ring-container { text-align: center; margin-bottom: 1rem; }
.progress-ring { width: 120px; height: 120px; margin: 0 auto; position: relative; }
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--gray-100); stroke-width: 8; }
.progress-ring-fill { fill: none; stroke: var(--green); stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray 0.8s ease; }
.progress-ring-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.progress-ring-value { font-size: 1.8rem; font-weight: 900; color: var(--black); }
.progress-ring-label { font-size: 0.9rem; color: var(--gray-400); }
.progress-caption { color: var(--gray-400); font-size: 0.85rem; margin-top: 0.5rem; }

/* Badge Grid */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.75rem; }

.badge-item {
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
}

.badge-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }

.badge-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.badge-name { font-size: 0.7rem; color: var(--gray-500); font-weight: 600; }

/* Quick Links */
.quick-links { display: flex; flex-direction: column; gap: 0.5rem; }

.quick-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  color: var(--black);
  text-decoration: none;
  font-size: 0.9rem; font-weight: 600;
  transition: all var(--transition);
}

.quick-link:hover { background: var(--white); border-color: var(--black); transform: translateX(4px); }
.quick-link-icon { font-size: 1.2rem; }

/* Community Needs */
.needs-list { display: flex; flex-direction: column; gap: 0.5rem; }

.need-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  color: var(--black);
  text-decoration: none; font-size: 0.9rem;
  transition: all var(--transition);
}

.need-item:hover { background: var(--white); border-color: var(--black); transform: translateX(4px); }

.need-priority {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}

.need-priority::before { display: none; }

.need-priority.priority-high { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.need-priority.priority-med { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.need-arrow { margin-left: auto; color: var(--gray-400); }

/* Momentum */
.momentum-grid { display: flex; gap: 4px; align-items: flex-end; height: 80px; padding: 0.5rem 0; }
.momentum-week { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 8px; }
.momentum-bar { width: 100%; min-height: 4px; background: var(--gray-100); border-radius: 4px 4px 0 0; transition: all var(--transition); }
.momentum-week.active .momentum-bar {
  background: var(--green);
}
.momentum-week.active .momentum-bar::before { display: none; }
.momentum-caption { text-align: center; margin-top: 0.75rem; color: var(--gray-500); font-size: 0.85rem; }

/* ========== Training Page ========== */
.training-progress-bar .progress-header {
  display: flex; justify-content: space-between; margin-bottom: 0.5rem;
  font-size: 0.85rem; color: var(--gray-500);
}

.progress-count { font-weight: 700; color: var(--green); }

.progress-bar-track {
  height: 8px;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-pill);
  overflow: hidden;
  padding: 0;
}

.progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--radius-pill);
  transition: width 0.8s ease;
}

.progress-bar-fill::before { display: none; }

/* Skill Tree */
.skill-tracks { display: flex; flex-direction: column; gap: 1.5rem; }
.skill-track { display: flex; align-items: center; gap: 1.5rem; }

.track-label {
  font-size: 0.75rem; font-weight: 700; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.08em;
  min-width: 140px; text-align: right;
}

.track-nodes { display: flex; align-items: center; gap: 0; }

.skill-node {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1rem;
  cursor: default; transition: all var(--transition);
  position: relative;
}

.skill-node::before { display: none; }

.skill-node.locked {
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  color: var(--gray-400);
}

.skill-node.available {
  background: var(--pink);
  border: 2px solid var(--pink);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(251, 55, 159, 0.35);
  animation: pulse-glow 2s ease-in-out infinite;
}

.skill-node.completed {
  background: var(--green);
  border: 2px solid var(--green);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(0, 159, 87, 0.3);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 16px rgba(251, 55, 159, 0.35); }
  50% { box-shadow: 0 4px 24px rgba(251, 55, 159, 0.55); }
}

.skill-connector { width: 40px; height: 3px; background: var(--gray-200); border-radius: 2px; }
.skill-connector.completed { background: var(--green); }

/* Module Cards */
.module-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; cursor: pointer; transition: background var(--transition);
}
.module-header:hover { background: var(--gray-50); }
.module-header-left { display: flex; align-items: center; gap: 1rem; }

.module-status {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.9rem; flex-shrink: 0;
}

.module-status::before { display: none; }

.module-status.locked { background: var(--gray-100); border: 2px solid var(--gray-200); color: var(--gray-400); }
.module-status.available { background: var(--pink); border: 2px solid var(--pink); color: var(--white); }
.module-status.completed { background: var(--green); border: 2px solid var(--green); color: var(--white); }

.module-title { font-family: var(--serif); font-size: 1rem; font-weight: 700; color: var(--black); }
.module-track { font-size: 0.8rem; color: var(--gray-400); margin-top: 0.15rem; }
.module-expand-icon { color: var(--gray-400); font-size: 0.8rem; transition: transform var(--transition); }
.module-card.expanded .module-expand-icon { transform: rotate(180deg); }
.module-body { border-top: 1px solid var(--gray-100); }

.module-content {
  padding: 1.5rem; color: var(--black); line-height: 1.8;
}

.module-content h4 { font-size: 1rem; color: var(--pink); margin: 1.25rem 0 0.5rem; font-weight: 700; }
.module-content h4:first-child { margin-top: 0; }
.module-content p { margin-bottom: 0.75rem; }
.module-content ol, .module-content ul { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.module-content li { margin-bottom: 0.35rem; }
.module-content code { background: var(--gray-100); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: var(--black); }

.module-videos { padding: 0 1.5rem 1rem; }
.module-videos h4 { font-size: 0.85rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.video-link { display: block; padding: 0.5rem 0; color: var(--pink); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.video-link:hover { color: var(--pink-dark); }

.module-actions { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-100); }
.module-action-hint { font-size: 0.85rem; margin-top: 0.5rem; min-height: 1.2em; color: var(--gray-500); }

/* Quiz */
.module-quiz { padding: 1.5rem; border-top: 1px solid var(--gray-100); }
.quiz-header h4 { font-size: 1rem; color: var(--black); margin-bottom: 0.25rem; font-weight: 900; text-transform: uppercase; }
.quiz-intro { font-size: 0.85rem; color: var(--gray-400); margin-bottom: 1.25rem; }

.quiz-question { margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--gray-100); }
.quiz-question:last-of-type { border-bottom: none; }
.question-text { font-weight: 700; margin-bottom: 0.75rem; font-size: 0.95rem; color: var(--black); }
.quiz-options { display: flex; flex-direction: column; gap: 0.4rem; }

.quiz-option {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer; transition: all var(--transition);
  font-size: 0.9rem; color: var(--black);
}

.quiz-option:hover { border-color: var(--gray-300); background: var(--white); }
.quiz-option input[type="radio"] { display: none; }

.option-marker {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--gray-300); flex-shrink: 0;
  transition: all var(--transition); position: relative;
}

.quiz-option.selected .option-marker {
  border-color: var(--pink);
  background: var(--pink);
}

.quiz-option.selected .option-marker::after {
  content: ''; position: absolute; top: 4px; left: 4px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--white);
}

.quiz-option.selected { border-color: var(--pink); background: rgba(251, 55, 159, 0.05); }

.quiz-option.correct {
  border-color: var(--green) !important;
  background: rgba(0, 159, 87, 0.06) !important;
}
.quiz-option.correct .option-marker { border-color: var(--green) !important; background: var(--green) !important; }

.quiz-option.wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.05) !important;
  animation: shake 0.4s ease;
}
.quiz-option.wrong .option-marker { border-color: #ef4444 !important; background: #ef4444 !important; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.question-feedback { font-size: 0.8rem; margin-top: 0.4rem; min-height: 1em; padding-left: 0.5rem; }
.quiz-result { margin-top: 0.5rem; font-weight: 600; min-height: 1em; }

/* ========== Tracker Page ========== */
.issue-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.issue-bar-row { display: flex; align-items: center; gap: 0.75rem; }
.issue-label { font-size: 0.85rem; color: var(--gray-500); min-width: 150px; text-align: right; font-weight: 600; }
.issue-bar-track { flex: 1; height: 8px; background: var(--gray-100); border: none; border-radius: var(--radius-pill); overflow: hidden; }
.issue-bar-fill { height: 100%; background: var(--green); border-radius: var(--radius-pill); transition: width 0.8s ease; }
.issue-bar-fill::before { display: none; }
.issue-count { font-size: 0.85rem; font-weight: 700; color: var(--black); min-width: 30px; }

/* Contributions */
.contrib-list { display: flex; flex-direction: column; gap: 0.5rem; }

.contrib-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.contrib-item:hover { background: var(--white); border-color: var(--gray-300); }

.contrib-type {
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.contrib-type::before { display: none; }

.contrib-type.type-created { background: #ecfdf5; color: var(--green-dark); border: 1px solid #a7f3d0; }
.contrib-type.type-edited { background: var(--gray-100); color: var(--black); border: 1px solid var(--gray-200); }
.contrib-type.type-translated { background: #fdf2f8; color: var(--pink-dark); border: 1px solid #fbcfe8; }

.contrib-info { flex: 1; min-width: 0; }
.contrib-title { color: var(--black); text-decoration: none; font-weight: 600; font-size: 0.9rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib-title:hover { color: var(--pink); }
.contrib-meta { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.15rem; }
.contrib-views { font-size: 0.8rem; font-weight: 700; color: var(--green-dark); white-space: nowrap; }

/* ========== Profile Page ========== */
.profile-header { display: flex; align-items: center; gap: 1.25rem; }

.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 900; color: var(--white);
  flex-shrink: 0;
}

.profile-avatar::before { display: none; }

.profile-details h2 { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--black); letter-spacing: -0.02em; }
.profile-meta { color: var(--gray-500); font-size: 0.85rem; margin-top: 0.25rem; }
.profile-meta a { color: var(--pink); text-decoration: none; }
.profile-meta a:hover { color: var(--pink-dark); text-decoration: underline; }

/* Badge Showcase */
.badge-showcase { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.badge-showcase.faded { opacity: 0.5; }

.badge-card {
  text-align: center; padding: 1.25rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.badge-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); border-color: var(--pink); }
.badge-card.locked { opacity: 0.5; }

.badge-icon-lg { font-size: 2rem; margin-bottom: 0.5rem; }
.badge-card-name { font-size: 0.85rem; font-weight: 700; color: var(--black); margin-bottom: 0.25rem; }
.badge-card-desc { font-size: 0.75rem; color: var(--gray-500); line-height: 1.4; }
.badge-card-date { font-size: 0.7rem; color: var(--gray-400); margin-top: 0.5rem; font-style: italic; }

/* Props */
.props-list { display: flex; flex-direction: column; gap: 0.5rem; }
.prop-item {
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; gap: 1rem;
}
.prop-from { font-weight: 700; color: var(--pink); font-size: 0.85rem; white-space: nowrap; }
.prop-message { flex: 1; color: var(--black); font-size: 0.9rem; }
.prop-date { font-size: 0.75rem; color: var(--gray-400); white-space: nowrap; }
.prop-form { max-width: 500px; }

.empty-state { color: var(--gray-400); font-style: italic; text-align: center; padding: 1rem; }

/* ========== Locked Module Overlay ========== */
.module-locked-msg {
  padding: 3px 12px;
  background: var(--gray-100);
  color: var(--gray-500);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
  .form-row { flex-direction: column; }
  .stats { flex-direction: column; gap: 0.5rem; }
  .results-header { flex-direction: column; gap: 0.75rem; align-items: start; }
  header h1 { font-size: 1.6rem; }
  .tabs { flex-direction: column; width: 100%; border-radius: var(--radius-md); }
  .tab { text-align: center; }
  .help-modal { padding: 1.5rem; max-height: 90vh; }
  .help-section dl { grid-template-columns: 1fr; }

  .nav-hamburger { display: flex; }
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: 54px; left: 0; right: 0;
    background: var(--off-white);
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200); gap: 0.25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }
  .nav-links.open { display: flex; }
  .nav-right { margin-left: 0; flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .nav-user { justify-content: space-between; }

  .hero-title { font-size: 1.6rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .welcome-row { flex-direction: column; align-items: start; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .skill-track { flex-direction: column; align-items: start; gap: 0.5rem; }
  .track-label { text-align: left; min-width: auto; }
  .module-header { flex-direction: column; align-items: start; gap: 0.5rem; }
  .issue-bar-row { flex-direction: column; align-items: start; }
  .issue-label { text-align: left; min-width: auto; }
  .contrib-item { flex-direction: column; align-items: start; }
  .profile-header { flex-direction: column; text-align: center; }
  .badge-showcase { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .prop-item { flex-direction: column; align-items: start; gap: 0.5rem; }
}

/* ============================================================
   App Shell — Didasko-inspired sidebar + topbar layout
   Sidebar (240px) on the left; main column with sticky topbar.
   Mobile (≤900px): sidebar slides in over content from the left.
   ============================================================ */

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background: var(--off-white);
}

/* Hide the legacy nav on app shell */
.app-shell .clandi-nav,
.app-shell .clandi-footer { display: none; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--off-white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 60;
  padding: 1.25rem 0.875rem 1rem;
}

.sidebar-header {
  padding: 0.5rem 0.75rem 1.5rem;
  display: flex;
  align-items: center;
}

.sidebar-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.sidebar-logo img {
  display: block;
  height: 28px;
  width: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--gray-500);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

/* Notification dot for sidebar items */
.sb-link[data-notify]::after {
  content: attr(data-notify);
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--green);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}
.sb-link.active[data-notify]::after { background: var(--yellow); color: var(--black); }

.sb-link:hover {
  color: var(--text-primary);
  background: var(--gray-100);
}

.sb-link.active {
  background: var(--black);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.sb-link.active .sb-icon {
  filter: brightness(0) invert(1);
  opacity: 1;
}

.sb-link.sb-link-disabled {
  color: var(--gray-400);
  cursor: not-allowed;
  opacity: 0.65;
}

.sb-icon {
  flex-shrink: 0;
  opacity: 0.62;
  transition: opacity var(--transition), filter var(--transition);
}

.sb-link:hover .sb-icon { opacity: 0.92; }

.sb-lock {
  margin-left: auto;
  opacity: 0.7;
}

.sidebar-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 12px 8px;
}

.sb-login {
  margin: 4px 8px 0;
  width: calc(100% - 16px);
}

.sidebar-footer {
  padding: 1rem 0.875rem 0.25rem;
  border-top: 1px solid var(--gray-200);
}

.sb-footer-links {
  font-size: 12px;
  margin: 0 0 6px;
  letter-spacing: 0.04em;
}
.sb-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}
.sb-footer-links a:hover { color: var(--green-dark); }

.sb-built-by {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.sb-built-by a {
  color: var(--text-secondary);
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}

.sb-built-by a:hover {
  color: var(--green-dark);
}

/* ===== Main column ===== */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--off-white);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 28px;
  background: var(--off-white);
  border-bottom: 1px solid var(--gray-200);
  min-height: var(--topbar-h);
}

.topbar-left {
  flex: 1;
  min-width: 0;
}

.topbar-page-title { display: flex; flex-direction: column; gap: 2px; }
.page-title-line { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; color: var(--text-primary); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-pill);
  cursor: not-allowed;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-muted);
  min-width: 220px;
  opacity: 0.85;
}

.topbar-search:disabled { background: var(--white); }

.topbar-icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.85;
  transition: background var(--transition);
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--tint-green);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--gray-200);
  transition: transform var(--transition);
}

.topbar-avatar:hover { transform: scale(1.05); }

.content {
  flex: 1;
  padding: 1.5rem 28px 2rem;
  max-width: 1200px;
  width: 100%;
}

.app-footer {
  padding: 1rem 28px 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--off-white);
  font-size: 12px;
  color: var(--text-muted);
}

.app-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 700;
}

.app-footer a:hover { color: var(--green-dark); }

/* Mobile sidebar trigger */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 70;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 55;
  opacity: 0;
  transition: opacity var(--transition);
}

@media (max-width: 900px) {
  .sidebar-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-scrim { display: block; opacity: 1; }
  .topbar { padding-left: 64px; }
  .content { padding-left: 1rem; padding-right: 1rem; }
  .app-footer { padding-left: 1rem; padding-right: 1rem; }
  .topbar-search { display: none; }
}

@media (max-width: 600px) {
  .topbar-icon-btn { display: none; }
  .topbar-page-title .page-title-line { font-size: 1.15rem; }
  .topbar { padding-right: 14px; gap: 6px; }
  .lang-toggle { padding: 6px 10px; }
}

/* Public shell (logged out) — keep the topbar opaque so sticky-scroll content
   doesn't bleed through on pages like training modules. The landing page uses
   its own landing-shell variant below to drop the border. */
.app-shell-public .topbar { background: var(--off-white); }

/* ============================================================
   Landing shell — sidebar hidden by default, hamburger toggle
   reveals it sliding in from the left over the content.
   ============================================================ */

.app-shell.landing-shell .sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 80;
  box-shadow: var(--shadow-lg);
}
.app-shell.landing-shell.sidebar-open .sidebar { transform: translateX(0); }
.app-shell.landing-shell.sidebar-open .sidebar-scrim { display: block; opacity: 1; }
.app-shell.landing-shell .sidebar-toggle {
  display: inline-flex;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 70;
}
.app-shell.landing-shell .app-main { margin-left: 0; }
.app-shell.landing-shell .topbar {
  padding-left: 72px;
  background: transparent;
  border-bottom: 0;
}
.app-shell.landing-shell .content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px 3rem;
}
.app-shell.landing-shell .app-footer { background: transparent; border-top: 0; padding: 1rem 32px 1.5rem; }
.landing-wordmark { display: inline-flex; align-items: center; }
.landing-wordmark img { height: 30px; width: auto; }

@media (max-width: 720px) {
  .app-shell.landing-shell .content { padding: 0 16px 2rem; }
  .app-shell.landing-shell .topbar { padding-left: 64px; padding-right: 14px; }
}

/* ============================================================
   LANDING PAGE — bold marketing layout
   3px black borders, heavy caps headlines, mixed card sizes
   ============================================================ */

/* HERO — centered single-column */
.lp-hero {
  padding: 3rem 0 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lp-hero-eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--black);
  background: var(--yellow);
  border: 2px solid var(--black);
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}
.lp-hero-title {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 400; /* Rubik Mono One ships only at 400 — already heavy */
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--black);
  margin: 0 0 1.25rem;
}
.lp-hero-title em { font-style: normal; color: var(--green); }
.lp-hero-sub {
  font-family: var(--sans);
  font-size: clamp(15px, 1.4vw, 17px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 0 1.75rem;
}
.lp-hero-cta {
  display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 1rem;
  align-items: center; justify-content: center;
}
.lp-hero-note {
  font-size: 13px; color: var(--text-muted); margin: 0.5rem 0 0;
  display: inline-flex; align-items: center; gap: 6px;
}
.lp-hero-note::before {
  content: '⏳';
  font-size: 14px;
  filter: grayscale(0.3);
}

/* Bold landing buttons — Didasko-style yellow primary + black border */
.lp-btn-bold {
  background: var(--yellow);
  color: var(--black);
  border: 2.5px solid var(--black);
  border-radius: 6px;
  padding: 12px 24px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14.5px;
  text-transform: none;
  box-shadow: 3px 3px 0 var(--black);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  text-decoration: none;
  display: inline-block;
}
.lp-btn-bold:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--black);
  background: var(--yellow);
}
.lp-btn-bold:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--black);
}
.lp-btn-secondary {
  background: transparent;
  color: var(--black);
  border: none;
  padding: 12px 4px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
  transition: transform 0.1s ease;
}
.lp-btn-secondary:hover {
  transform: translateX(2px);
  background: transparent;
  border: none;
  color: var(--black);
  box-shadow: none;
}
.lp-btn-secondary::after { content: '→'; transition: transform 0.15s ease; }
.lp-btn-secondary:hover::after { transform: translateX(3px); }

/* Hero visual — small offset tiles */
.lp-hero-visual {
  position: relative;
  height: 380px;
  min-height: 320px;
}
@media (max-width: 920px) { .lp-hero-visual { height: 320px; } }

.lp-hero-tile {
  position: absolute;
  border: 3px solid var(--black);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 6px 6px 0 var(--black);
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: rotate(-2deg);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.lp-hero-tile:hover { transform: rotate(-2deg) translate(-2px, -2px); box-shadow: 8px 8px 0 var(--black); }
.lp-hero-tile-yellow {
  background: var(--yellow);
  width: 220px; height: 200px;
  top: 0; left: 8%;
  transform: rotate(-4deg);
  z-index: 3;
}
.lp-hero-tile-yellow:hover { transform: rotate(-4deg) translate(-2px, -2px); }
.lp-hero-tile-green {
  background: var(--tint-green);
  width: 200px; height: 180px;
  top: 30%; right: 4%;
  transform: rotate(3deg);
  z-index: 2;
}
.lp-hero-tile-green:hover { transform: rotate(3deg) translate(-2px, -2px); }
.lp-hero-tile-black {
  background: var(--black);
  color: var(--white);
  width: 220px; height: 130px;
  bottom: 0; left: 30%;
  transform: rotate(-1deg);
  z-index: 1;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.lp-hero-tile-black:hover { transform: rotate(-1deg) translate(-2px, -2px); }
.lp-hero-tile img { display: block; max-width: 100%; }
.lp-tile-label {
  display: flex; flex-direction: column;
  font-family: var(--sans);
}
.lp-tile-eyebrow {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  opacity: 0.65;
}
.lp-tile-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.lp-tile-stat { display: flex; flex-direction: column; gap: 2px; }
.lp-tile-stat-num {
  font-family: var(--serif);
  font-size: 36px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--yellow);
}
.lp-tile-stat-label {
  font-family: var(--sans);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--white);
}

/* SOCIAL PROOF / STATS STRIP */
.lp-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 1.25rem 0;
  border-top: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
  margin: 1rem 0 3rem;
  flex-wrap: wrap;
}
.lp-stat { text-align: center; }
.lp-stat-num {
  font-family: var(--display);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--black);
}
.lp-stat-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 4px;
}
.lp-stat-sep { font-family: var(--serif); font-size: 28px; color: var(--green); font-weight: 700; }

/* SECTION HEADER */
.lp-section-head { margin-bottom: 1.75rem; }
.lp-section-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}
.lp-section-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--black);
  max-width: 720px;
  margin: 0;
}

/* KEY FEATURES — 3-col asymmetric grid */
.lp-features { padding: 1rem 0 3rem; }
.lp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  grid-auto-flow: dense;
}
@media (max-width: 920px) {
  .lp-grid { grid-template-columns: 1fr 1fr; }
  .lp-card-wide { grid-column: span 2; }
}
@media (max-width: 600px) {
  .lp-grid { grid-template-columns: 1fr; }
  .lp-card-wide { grid-column: span 1; }
}

/* Bold card — heavy black border, less rounded (more bauhaus) */
.lp-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 24px 26px 26px;
  border: 3px solid var(--black);
  border-radius: 8px;
  text-decoration: none;
  color: var(--black);
  position: relative;
  min-height: 200px;
  box-shadow: 5px 5px 0 var(--black);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.lp-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--black);
}
.lp-card:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--black);
}

.lp-card-yellow { background: var(--yellow); }
.lp-card-green { background: var(--tint-green); }
.lp-card-white { background: var(--white); }
.lp-card-black { background: var(--black); color: var(--white); }
.lp-card-black .lp-card-arrow,
.lp-card-black .lp-card-title,
.lp-card-black .lp-card-desc { color: var(--white); }

.lp-card-wide { grid-column: span 2; }
.lp-card-wide.lp-card-yellow,
.lp-card-wide.lp-card-green,
.lp-card-wide.lp-card-black {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}
/* Variant: no illustration well — text-led black CTA card */
.lp-card-no-illu.lp-card-wide {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 32px 36px;
}
.lp-card-no-illu .lp-card-arrow-big {
  font-family: var(--display);
  font-size: 56px;
  color: var(--yellow);
  align-self: center;
  margin-top: 0;
  line-height: 1;
}
.lp-card-no-illu:hover .lp-card-arrow-big { transform: translateX(8px); }
.lp-card-no-illu.lp-card-black .lp-card-title { color: var(--yellow); font-size: clamp(20px, 2.2vw, 26px); }
.lp-card-no-illu.lp-card-black .lp-card-desc { color: var(--white); opacity: 0.85; }
.lp-card-illu {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 6px;
  padding: 16px;
  height: 100%;
  min-height: 140px;
}
.lp-card-black .lp-card-illu { background: var(--white); }
.lp-card-illu img { display: block; max-width: 100%; }

.lp-card-text { display: flex; flex-direction: column; gap: 8px; }
.lp-card-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(18px, 2vw, 22px);
  text-transform: uppercase;
  letter-spacing: -0.005em;
  line-height: 1.1;
  color: var(--black);
}
.lp-card-title-sm {
  font-family: var(--display);
  font-weight: 400;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  line-height: 1.15;
  color: var(--black);
}
.lp-card-desc {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}
.lp-card-desc-sm {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 8px 0 12px;
}
.lp-card-arrow {
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 700;
  color: var(--black);
  align-self: flex-end;
  margin-top: auto;
  transition: transform 0.15s ease;
}
.lp-card:hover .lp-card-arrow { transform: translateX(6px); }

/* DEEP SECTIONS */
.lp-deep { padding: 1rem 0; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.lp-deep-card {
  background: var(--white);
  border: 3px solid var(--black);
  border-radius: 10px;
  padding: 2.5rem 2.5rem;
  box-shadow: 6px 6px 0 var(--black);
  transition: box-shadow 0.6s ease;
}
.lp-deep-card-tinted { background: var(--tint-yellow); }
.lp-deep-card-dark { background: var(--black); color: var(--white); box-shadow: 8px 8px 0 var(--green); }
.lp-deep.is-highlighted .lp-deep-card { box-shadow: 12px 12px 0 var(--yellow); }

.lp-deep-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--green-dark);
  margin-bottom: 1rem;
}
.lp-deep-eyebrow-light { color: var(--yellow); }

.lp-deep-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.lp-deep-grid-flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
@media (max-width: 800px) {
  .lp-deep-grid, .lp-deep-grid-flip { grid-template-columns: 1fr; }
  .lp-deep-card { padding: 1.75rem; }
}

.lp-deep-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.1;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: var(--black);
}
.lp-deep-title-light { color: var(--white); }
.lp-deep-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}
.lp-deep-desc-light { color: rgba(255, 255, 255, 0.85); }
.lp-deep-meta { font-size: 13px; color: var(--text-muted); }
.lp-deep-meta em { color: var(--green-dark); font-style: italic; font-weight: 600; }

.lp-deep-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}
.lp-deep-list li {
  font-size: 14px;
  font-weight: 600;
  position: relative;
  padding-left: 18px;
}
.lp-deep-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 8px; height: 8px;
  background: var(--green);
  transform: translateY(-50%);
  border-radius: 50%;
}
.lp-deep-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint-green);
  border: 3px solid var(--black);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 5px 5px 0 var(--black);
}
.lp-deep-card-tinted .lp-deep-visual { background: var(--white); }
.lp-deep-card-dark .lp-deep-visual { background: var(--yellow); border-color: var(--yellow); box-shadow: 6px 6px 0 var(--green); }

/* FINAL CTA */
.lp-final { padding: 2rem 0 3rem; }
.lp-final-card {
  background: var(--yellow);
  border: 3px solid var(--black);
  border-radius: 10px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 6px 6px 0 var(--black);
}

/* ABOUT US section */
.lp-about { padding: 1rem 0 3rem; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.lp-about-card {
  background: var(--white);
  border: 3px solid var(--black);
  border-radius: 10px;
  padding: 2.5rem 2.5rem;
  box-shadow: 6px 6px 0 var(--black);
}
@media (max-width: 720px) { .lp-about-card { padding: 1.75rem; } }

.lp-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 2.5rem;
  margin-top: 1.5rem;
}
@media (max-width: 720px) { .lp-about-grid { grid-template-columns: 1fr; gap: 1.5rem; } }

.lp-about-sub {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green-dark);
  margin: 0 0 0.5rem;
}
.lp-about-body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}
.lp-about-body a { color: var(--green-dark); font-weight: 700; text-decoration: underline; }
.lp-about-body a:hover { color: var(--black); }

/* Sidebar landing variant — minimal text links, no icons */
.sb-link-landing {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.sb-link-landing:hover { background: var(--gray-100); color: var(--black); }
.lp-final-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.1;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  color: var(--black);
}
.lp-final-sub {
  font-size: 15px;
  line-height: 1.5;
  color: var(--black);
  opacity: 0.78;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

/* Highlight pulse on anchor scroll-to */
.lp-deep.is-highlighted, .lp-final.is-highlighted {
  animation: lp-highlight 1.4s ease-out;
}
@keyframes lp-highlight {
  0% { transform: scale(1); }
  20% { transform: scale(1.005); }
  100% { transform: scale(1); }
}

/* Update inherited container behavior: pages inside .content shouldn't double-pad */
.app-main .container {
  max-width: none;
  padding: 0;
  margin: 0;
}

/* ============================================================
   Motion — scroll-reveal + magnetic hover (driven by motion.js)
   ============================================================ */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .wave, .rail-profile-ring, .rail-profile-ring::before, .rail-profile-ring .rail-avatar {
    animation: none !important;
  }
}

/* Magnetic-hover smoothing */
[data-magnetic] {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow var(--transition);
  transform-style: preserve-3d;
  perspective: 800px;
  will-change: transform;
}

/* ============================================================
   Topbar greeting variant — bigger, more dramatic
   ============================================================ */
.topbar-greeting { display: flex; flex-direction: column; gap: 2px; }
.topbar-greeting-line {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.8vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.topbar-greeting-sub { font-size: 13px; color: var(--text-secondary); margin: 0; font-weight: 400; }
.topbar-subtitle { font-size: 13px; color: var(--text-secondary); margin: 0; font-weight: 400; }

.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.4s ease-in-out infinite;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
}

/* ============================================================
   Dashboard layout — main column + right rail
   ============================================================ */

.dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .dash-layout { grid-template-columns: minmax(0, 1fr); }
}

.dash-main { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

.dash-row { display: grid; gap: 1rem; }
.dash-row-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 800px) { .dash-row-2 { grid-template-columns: 1fr; } }

/* ===== Three feature cards ===== */
.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 800px) { .feature-row { grid-template-columns: 1fr; } }

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 280px;
  padding: 0;
  border-radius: var(--radius-xl);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.feature-card-green { background: var(--tint-green); }
.feature-card-yellow { background: var(--tint-yellow); }
.feature-card-cream { background: var(--tint-cream); border: 1px solid var(--gray-200); }
.feature-card-green-soft { background: var(--tint-green-soft); }
.feature-card-yellow-soft { background: var(--tint-yellow-soft); }

.feature-card-locked { opacity: 0.85; }

/* Illustration well — full-width hero of the card */
.feature-card-illu {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  margin: 14px 14px 0;
  padding: 16px;
  min-height: 130px;
  position: relative;
}
.feature-card-illu img { display: block; max-width: 100%; height: auto; }

.feature-card-body {
  padding: 16px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature-card-eyebrow {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  opacity: 0.55;
}

.feature-card-title {
  font-family: var(--serif);
  font-size: clamp(22px, 2.3vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 2px;
}

.feature-card-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-primary);
}
.feat-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-pill);
  font-weight: 700;
}
.feat-stat strong { font-weight: 700; }
.feat-stat-label { opacity: 0.75; font-size: 12.5px; }
.feat-stat-locked { opacity: 0.7; }

/* ===== Stat tiles (Didasko-style) ===== */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 800px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }

.stat-tile {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-tile-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-tile-value {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-primary);
}

/* ===== Generic dashboard card (replaces glass-panel for new layout) ===== */
.dash-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.dash-card:hover { box-shadow: var(--shadow-md); }

.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.dash-card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-primary);
}

.dash-card-action {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.dash-card-action:hover { color: var(--green-dark); }

.dash-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}
.dash-empty-cta { display: block; margin-top: 6px; font-style: normal; font-weight: 700; color: var(--text-primary); text-decoration: none; }

/* ===== Feed (refreshed) ===== */
.feed-list { display: flex; flex-direction: column; gap: 10px; }
.feed-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--gray-50); border-radius: var(--radius-md); font-size: 14px; line-height: 1.5; }
.feed-icon { font-size: 18px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.feed-text { flex: 1; min-width: 0; }
.feed-text a { color: var(--text-primary); font-weight: 700; text-decoration: none; }
.feed-text a:hover { color: var(--green-dark); }
.feed-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* ===== My campaigns list ===== */
.my-camps-list { display: flex; flex-direction: column; gap: 8px; }
.my-camp-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--gray-50); border-radius: var(--radius-md); text-decoration: none; color: var(--text-primary); }
.my-camp-row:hover { background: var(--tint-green-soft); }
.my-camp-row-name { font-weight: 700; font-size: 14px; }
.my-camp-row-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; }

/* ===== Training progress block ===== */
.training-progress-block {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}
.training-progress-block .progress-ring-container { flex-shrink: 0; }
.training-progress-block .progress-ring { width: 92px; height: 92px; }
.training-progress-block .progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.training-progress-block .progress-ring-bg { fill: none; stroke: var(--gray-200); stroke-width: 7; }
.training-progress-block .progress-ring-fill { fill: none; stroke: var(--yellow-dark); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray var(--transition); }
.training-progress-block .progress-ring-text { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.progress-ring { position: relative; }
.progress-ring-text .progress-ring-value { font-family: var(--serif); font-size: 28px; font-weight: 700; }
.progress-ring-text .progress-ring-label { font-size: 13px; color: var(--text-muted); }

.training-progress-copy { flex: 1; }
.tp-headline { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.01em; }
.tp-sub { font-size: 13px; color: var(--text-secondary); margin: 0; }

/* ===== Right rail ===== */
.dash-rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--topbar-h) + 16px); }
@media (max-width: 1100px) { .dash-rail { position: static; } }

.rail-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 18px 18px;
  box-shadow: var(--shadow-sm);
}

.rail-profile { text-align: center; }
.rail-profile-photo { display: flex; justify-content: center; margin-bottom: 12px; }
.rail-profile-ring {
  width: 88px; height: 88px; border-radius: 50%;
  padding: 4px;
  background: var(--green);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.rail-profile-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--green);
  opacity: 0;
  animation: ring-pulse 2.8s ease-out infinite;
}
@keyframes ring-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.18); opacity: 0; }
}
.rail-avatar {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 32px; font-weight: 700;
  color: var(--text-primary);
  border: 2px solid var(--white);
}
.rail-profile-name { font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.rail-profile-handle { font-size: 12px; color: var(--text-muted); margin-top: 2px; margin-bottom: 12px; }
.rail-profile-badges { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.rail-profile-edit { display: inline-block; }

.rail-card-head { margin-bottom: 10px; }
.rail-card-title { font-family: var(--serif); font-size: 14px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }

.rail-list { display: flex; flex-direction: column; gap: 6px; }
.rail-list-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: var(--gray-50); border-radius: var(--radius-md); text-decoration: none; color: var(--text-primary); font-size: 13px; }
.rail-list-item:hover { background: var(--tint-green-soft); }
.rail-list-name { font-weight: 700; line-height: 1.25; }
.rail-list-meta { font-size: 11px; color: var(--text-muted); }

.rail-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 4px 0; }
.rail-empty a { color: var(--green-dark); font-weight: 700; text-decoration: none; }

.rail-prop { padding: 8px 10px; background: var(--gray-50); border-radius: var(--radius-md); font-size: 12px; }
.rail-prop-from { font-weight: 700; color: var(--green-dark); }
.rail-prop-msg { color: var(--text-secondary); font-style: italic; margin-top: 2px; }

.rail-discord { background: var(--tint-cream); border: 1px solid var(--gray-200); text-align: center; }
.rail-discord-icon { font-size: 28px; margin-bottom: 6px; }
.rail-discord-text { font-size: 12px; color: var(--text-primary); margin-bottom: 10px; line-height: 1.45; }
.rail-discord-cta { background: var(--black); border-color: var(--black); color: var(--white); }
.rail-discord-cta:hover { background: var(--gray-600); border-color: var(--gray-600); }

/* ============================================================
   Dashboard texture: activity bar chart + arc gauge + leader board + to-do
   ============================================================ */

/* Weekly activity SVG bar chart */
.activity-chart-wrap { position: relative; }
.activity-chart { width: 100%; height: auto; display: block; }
.activity-bar rect:last-of-type { transition: fill 0.15s; cursor: pointer; }
.activity-bar:hover rect:last-of-type { fill: #00733f; }
.activity-bar:hover rect:first-of-type { fill: var(--tint-green-soft); opacity: 1; }
#activityTip { transition: opacity 0.15s; }

.activity-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.activity-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Performance arc gauge */
.gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; }
.gauge { width: 100%; max-width: 240px; height: auto; }
.gauge-meta { text-align: center; padding: 0 8px; }
.gauge-headline { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; }
.gauge-sub { font-size: 13px; color: var(--text-secondary); margin: 0 0 10px; line-height: 1.45; }

/* Leader board */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lb-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 2fr) 80px 80px 80px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  transition: background var(--transition);
}
.lb-row:not(.lb-row-head):hover { background: var(--tint-green-soft); }
.lb-row-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 4px;
}
.lb-rank { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.lb-rank-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 12px;
}
.lb-rank-arrow { font-size: 10px; }
.lb-rank-arrow.up { color: var(--green); }
.lb-rank-arrow.down { color: var(--gap); }
.lb-rank-arrow.flat { color: var(--gray-300); }
.lb-name { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.lb-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--tint-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.lb-display {
  display: flex; flex-direction: column; min-width: 0;
}
.lb-display strong { font-weight: 700; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-handle { font-size: 11px; color: var(--text-muted); }
.lb-stat { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.lb-points { color: var(--green-dark); }

@media (max-width: 800px) {
  .lb-row { grid-template-columns: 40px minmax(0, 2fr) 60px 60px; }
  .lb-modules { display: none; }
}

/* Onboarding to-do list (right rail) */
.todo-card { background: var(--white); }
.todo-head { margin-bottom: 12px; }

.todo-list { display: flex; flex-direction: column; gap: 6px; }
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.todo-item:hover { background: var(--tint-green-soft); border-color: var(--green); transform: translateX(2px); }
.todo-item.done { opacity: 0.65; }
.todo-item.done .todo-label { text-decoration: line-through; }

.todo-check {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  background: var(--white);
  color: var(--ink);
  transition: all var(--transition);
}
.todo-item.done .todo-check {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}
.todo-item:hover:not(.done) .todo-check { border-color: var(--green); }

.todo-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.todo-label {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
}
.todo-time {
  font-size: 11px;
  color: var(--gap);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.todo-item.done .todo-time { color: var(--green-dark); }

/* ============================================================
   Landing page (public)
   ============================================================ */

.landing-hero {
  margin-top: 0.5rem;
}

.landing-hero-card {
  background: var(--tint-green);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2.5rem;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-md);
}

.landing-hero-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-dark);
  margin-bottom: 1rem;
}

.landing-hero-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5.2vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  max-width: 820px;
  margin: 0 auto 0.6rem;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}
.landing-hero-title em { font-style: italic; color: var(--green-dark); font-weight: 600; }

/* Wave underline beneath the hero title — nods to the ClanDi wordmark's "Di" wave */
.landing-hero-title::after {
  content: '';
  display: block;
  width: 96px;
  height: 14px;
  margin: 14px auto 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 14" fill="none" stroke="%23009f57" stroke-width="3" stroke-linecap="round"><path d="M2 7 Q 14 1 26 7 T 50 7 T 74 7 T 94 7"/></svg>');
  background-repeat: no-repeat;
  background-size: contain;
}

.landing-hero-subtitle {
  font-family: var(--sans);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.55;
  color: var(--text-primary);
  opacity: 0.78;
  max-width: 620px;
  margin: 0 auto 1.75rem;
}

.landing-hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.landing-hero-fineprint {
  font-size: 13px;
  color: var(--text-primary);
  opacity: 0.72;
}

.landing-hero-fineprint p { margin: 0; }
.landing-hero-fineprint p + p { margin-top: 4px; }
.landing-hero-discord {
  color: var(--green-dark);
  text-decoration: underline;
  font-weight: 600;
}

.landing-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 1.25rem 0;
}

@media (max-width: 720px) {
  .landing-stats { grid-template-columns: 1fr; }
}

.stat-tile-tinted {
  background: var(--tint-yellow-soft);
  border-color: transparent;
}

/* Tracker page — top row composes the gauge card + 3 personal stat tiles */
.tracker-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.tracker-gauge-card { display: flex; flex-direction: column; }
.tracker-gauge-card .gauge-wrap { flex: 1; justify-content: center; }
.tracker-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.stat-tile-yellow {
  background: var(--tint-yellow);
  border: 2px solid var(--black);
  box-shadow: 4px 4px 0 var(--black);
}
.stat-tile-yellow:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--black);
}

.tracker-refresh-row {
  margin-top: 1rem;
  padding: 12px 18px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
}
.tracker-refresh-row .btn { margin-left: auto; }

@media (max-width: 900px) {
  .tracker-top { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .tracker-stats { grid-template-columns: 1fr 1fr; }
  .tracker-stats .stat-tile:last-child { grid-column: span 2; }
}

.landing-mission {
  margin: 1.25rem 0;
}

.landing-mission-card {
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.landing-mission-card::before {
  content: '';
  position: absolute;
  left: -40px; top: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle at center, var(--green) 0%, transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}
.landing-mission-card::after {
  content: '';
  position: absolute;
  right: -50px; bottom: -50px;
  width: 240px; height: 240px;
  background: radial-gradient(circle at center, var(--yellow) 0%, transparent 60%);
  opacity: 0.35;
  pointer-events: none;
}

.landing-mission-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--yellow);
  margin-bottom: 0.75rem;
}

.landing-mission-body {
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 720px;
  margin: 0 auto;
  color: var(--white);
}

.landing-features {
  margin: 2rem 0 1.25rem;
}

.landing-section-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 1000px) {
  .landing-features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .landing-features-grid { grid-template-columns: 1fr; }
}

.landing-feature {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.landing-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.landing-feature-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
}

.landing-feature-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 0;
  color: var(--text-primary);
}

.landing-feature-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  opacity: 0.75;
  margin: 0;
}

.landing-final {
  margin: 1.25rem 0 0;
}

.landing-final-card {
  background: var(--tint-yellow);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  text-align: center;
}

.landing-final-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.landing-final-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  opacity: 0.78;
  max-width: 540px;
  margin: 0 auto 1.25rem;
}

/* ============================================================
   Page header (used across find-gaps, members, campaigns, tracker)
   Refresh into a Didasko-style row.
   ============================================================ */

.page-header {
  padding: 1rem 0 1.25rem;
}

.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 720px;
}

/* ============================================================
   Glass panel — softer Didasko look
   ============================================================ */

.glass-panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.glass-panel:hover { box-shadow: var(--shadow-md); }

.panel-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--gray-100);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-content { padding: 22px; }

/* Tabs (Find Gaps, Impact view, etc.) */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1rem;
  padding: 4px;
  background: var(--gray-100);
  border-radius: var(--radius-pill);
  border: none;
  width: fit-content;
}

.tab {
  padding: 8px 18px;
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.tab:hover { color: var(--text-primary); background: var(--white); }

.tab.active {
  background: var(--black);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

/* Buttons — softer rounded pill style */
.btn {
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.btn-lg { padding: 14px 30px; font-size: 15px; }
.btn-sm { padding: 7px 16px; font-size: 13px; }

/* Results table — softer rounded corners + tinted hover row */
.results-table {
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.results-table tbody tr:hover { background: var(--tint-green-soft); }

/* Badge refresh — make pill-shaped, neutral */
.badge {
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  letter-spacing: 0.04em;
}
.badge.exists, .badge.found { background: var(--tint-yellow); color: var(--yellow-dark); border: 1px solid var(--yellow-dark); }
.badge.missing, .badge.gap { background: #ffe5e9; color: var(--gap); border: 1px solid #ffb5be; }
.badge.stub { background: var(--tint-yellow-soft); color: var(--yellow-dark); border: 1px solid var(--yellow-dark); }
.badge.warning { background: var(--tint-yellow-soft); color: var(--yellow-dark); border: 1px solid var(--yellow); }

/* Find Gaps: campaign bar refresh */
.campaign-bar {
  border-radius: var(--radius-xl) !important;
  border: 1px solid var(--gray-200) !important;
}
.campaign-bar.active {
  background: var(--tint-green-soft) !important;
  border-color: var(--green) !important;
}

/* Find Gaps bulk-bar — black pill */
.bulk-bar {
  border-radius: var(--radius-pill) !important;
}

/* Member directory cards — softer hover */
.member-card { border-radius: var(--radius-xl) !important; transition: transform var(--transition), box-shadow var(--transition), background var(--transition); }
.member-card:hover { background: var(--tint-green-soft); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Campaign list cards — softer hover */
.camp-card { border-radius: var(--radius-xl) !important; }
.camp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.camp-vis.public { background: var(--tint-green); color: var(--green-dark); }
.camp-vis.private { background: var(--gray-100); color: var(--gray-600); }
.camp-card-title { font-family: var(--serif); }

/* Campaign detail panels */
.cdetail-card { border-radius: var(--radius-xl) !important; box-shadow: none; }
.pill.public { background: var(--tint-green); color: var(--green-dark); }
.pill.private { background: var(--gray-100); color: var(--gray-600); }
.pill.status-active { background: var(--tint-yellow); color: var(--yellow-dark); }
.pill.status-paused { background: var(--tint-cream); color: var(--text-secondary); }
.pill.status-completed { background: var(--gray-100); color: var(--gray-600); }

/* Priority pills inside campaign queue */
.priority-score { border-radius: var(--radius-pill); }
.priority-high { background: var(--tint-green); color: var(--green-dark); border: 1px solid var(--green); }
.priority-med { background: var(--tint-yellow); color: var(--yellow-dark); border: 1px solid var(--yellow-dark); }
.priority-low { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }

/* Members directory filter row */
.members-filters { border-radius: var(--radius-xl) !important; }

/* Profile page (member detail) sidebar cards */
.mprofile-card { border-radius: var(--radius-xl) !important; }
.mprofile-avatar {
  background: var(--tint-green) !important;
}
.member-avatar {
  background: var(--tint-green) !important;
}

/* ============================================================
   Tracker page
   ============================================================ */

.issue-chart {
  width: 100%;
  height: auto;
  display: block;
}

.contrib-list { display: flex; flex-direction: column; gap: 10px; }
.contrib-item-new {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}

.contrib-pill {
  display: inline-block;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--tint-green-soft);
  color: var(--green-dark);
  border: 1px solid var(--green);
  margin-top: 1px;
  white-space: nowrap;
}
.contrib-pill.type-translated { background: var(--tint-yellow-soft); color: var(--yellow-dark); border-color: var(--yellow-dark); }
.contrib-pill.type-created { background: var(--tint-green); color: var(--green-dark); border-color: var(--green-dark); }

.contrib-info-new { flex: 1; min-width: 0; }
.contrib-title-new {
  display: block;
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contrib-title-new:hover { color: var(--green-dark); text-decoration: underline; }
.contrib-meta-new {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  display: block;
  margin-top: 2px;
}

.impact-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.impact-stat {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.impact-stat-value {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.impact-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 4px;
}

.impact-subhead {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  letter-spacing: -0.01em;
}

@media (max-width: 800px) {
  .dash-row[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* ============================================================
   Profile page
   ============================================================ */

.profile-hero-card {
  background: var(--tint-green);
  border-radius: var(--radius-xl);
  padding: 2rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}
.profile-hero-photo { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.avatar-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.avatar-upload-btn { cursor: pointer; }
.avatar-remove-btn { background: none; border: 0; color: var(--text-secondary); font-size: 12px; cursor: pointer; padding: 2px 6px; text-decoration: underline; }
.avatar-remove-btn:hover { color: var(--gap, #c0392b); }
.avatar-status { font-size: 12px; min-height: 16px; text-align: center; }
.profile-hero-meta { flex: 1; min-width: 200px; }
.profile-hero-name {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}
.profile-hero-handle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 12px;
}
.profile-hero-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.profile-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.badge-tile {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 16px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.badge-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.badge-tile-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--tint-green);
}
.badge-tile-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.badge-tile-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 6px;
}
.badge-tile-date {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.badge-tile-locked {
  background: var(--gray-50);
  opacity: 0.7;
}
.badge-tile-locked .badge-tile-icon {
  background: var(--gray-100);
  color: var(--text-muted);
}

.badges-grid-locked { margin-top: 0.75rem; }
.profile-coming-head {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem;
}

.props-list { display: flex; flex-direction: column; gap: 10px; }
.prop-item-new {
  background: var(--tint-yellow-soft);
  border: 1px solid var(--yellow-dark);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.prop-item-from {
  font-weight: 700;
  font-size: 13px;
  color: var(--green-dark);
  margin-bottom: 4px;
}
.prop-item-display {
  font-weight: 400;
  color: var(--text-secondary);
}
.prop-item-msg {
  font-style: italic;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 6px;
}
.prop-item-date {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.prop-form-new label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.prop-form-new input,
.prop-form-new select,
.prop-form-new textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 12px;
}
.prop-form-new textarea { resize: vertical; min-height: 80px; }

/* ============================================================
   Accessibility — visible focus rings + aria-current
   ============================================================ */

/* Screen-reader-only text. Visually invisible but exposed to assistive tech.
   Use for buttons whose visible content is just an icon or two-letter code
   (e.g. the language toggle says "EN" — sighted users read context, but
   a screen reader needs an explicit "Switch language" label). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* Use focus-visible so mouse clicks don't show the ring,
   only keyboard focus does. */
*:focus { outline: none; }
*:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Active sidebar nav: aria-current is the source of truth for screen readers */
.sb-link[aria-current="page"] {
  background: var(--black);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.sb-link[aria-current="page"] .sb-icon {
  filter: brightness(0) invert(1);
  opacity: 1;
}

/* Buttons get tinted outline on focus */
.btn:focus-visible,
.btn-secondary:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

/* Sidebar links — green ring on focus */
.sb-link:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: -3px;
  background: var(--gray-100);
}

/* Skip-to-content link for keyboard users */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--black);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 700;
  z-index: 200;
  transition: top var(--transition);
}
.skip-to-content:focus { top: 0; }

/* ============================================================
   Final responsive sweep
   ============================================================ */

@media (max-width: 600px) {
  .feature-row { gap: 10px; }
  .feature-card { min-height: 220px; }
  .feature-card-illu { min-height: 100px; }
  .stat-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-tile-value { font-size: 22px; }
  .topbar-greeting-line { font-size: 1.25rem; }
  .topbar { padding: 14px 16px 14px 60px; }
  .content { padding: 1rem; }
  .landing-hero-card { padding: 2.5rem 1.5rem; }
  .landing-mission-card { padding: 2rem 1.5rem; }
  .landing-final-card { padding: 1.75rem 1.5rem; }
  .profile-hero-card { padding: 1.5rem; gap: 1rem; }
}

@media (max-width: 900px) and (min-width: 601px) {
  .dash-rail { display: none; }
  /* Right rail content already exists in main column too on smaller screens */
}

/* ============================================================
   Campaign resources panel — used on both campaign detail and
   per-article detail pages. Self-contained styles so the
   _resources_panel.html include drops in cleanly.
   ============================================================ */

.campaign-resources {
  margin-top: 2rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.resources-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.resources-title {
  font-family: var(--serif);
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.resource-form {
  display: none;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 1.25rem;
  box-shadow: 4px 4px 0 var(--black);
}
.resource-form.open { display: block; }
.resource-form label {
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 10px 0 4px;
}
.resource-form label:first-child { margin-top: 0; }
.resource-form input,
.resource-form select,
.resource-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
}
.resource-form textarea { resize: vertical; min-height: 60px; }
.resource-form-actions { display: flex; gap: 8px; margin-top: 14px; }
.resource-helper { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.resource-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.resource-card:hover { border-color: var(--gray-400); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.resource-card.resource-type-image { border-left: 4px solid var(--green); }
.resource-card.resource-type-source { border-left: 4px solid var(--black); }
.resource-card.resource-type-note { border-left: 4px solid var(--yellow); }

.resource-card-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px;
}
.resource-type-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--gray-100); color: var(--text-secondary);
}
.resource-article-tag {
  font-size: 10px; padding: 2px 6px;
  background: var(--tint-yellow); color: var(--black);
  border-radius: var(--radius-pill);
  border: 1px solid var(--black);
  font-weight: 600;
}
.resource-delete {
  margin-left: auto;
  background: none; border: 0;
  color: var(--text-muted);
  font-size: 18px; line-height: 1;
  cursor: pointer; padding: 2px 6px;
}
.resource-delete:hover { color: var(--gap, #c0392b); }

.resource-card-title {
  font-size: 14px; font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px;
}

.resource-image-link { display: block; margin-bottom: 8px; }
.resource-image-link img {
  width: 100%; height: auto;
  max-height: 180px; object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.resource-body {
  font-size: 13px; line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}
.resource-body a { color: var(--green-dark); font-weight: 600; }

.resource-meta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 11px; color: var(--text-muted);
  border-top: 1px solid var(--gray-100);
}

.resource-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 1.5rem 1rem;
}

/* ============================================================
   Campaign discussion / comments panel
   ============================================================ */

.campaign-comments {
  margin-top: 2rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.comments-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 1rem;
}
.comments-title {
  font-family: var(--serif);
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.comments-count {
  font-size: 12px; font-variant-numeric: tabular-nums;
  padding: 1px 8px; border-radius: 999px;
  background: var(--gray-100); color: var(--text-secondary);
}

.comment-form {
  margin-bottom: 1.25rem;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}
.comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: inherit; font-size: 14px;
  resize: vertical;
}
.comment-form-actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.comment-discord-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer;
  margin-right: auto;
}
.comment-discord-toggle input { cursor: pointer; }
.comment-discord-disabled {
  font-size: 12px; color: var(--text-muted);
  font-style: italic;
  margin-right: auto;
}

.comment-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.comment-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}
.comment-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--tint-green);
  border: 1.5px solid var(--black);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-size: 13px; font-weight: 400; color: var(--black);
  overflow: hidden; flex-shrink: 0;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }

.comment-body-wrap { flex: 1; min-width: 0; }
.comment-meta {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 13px;
}
.comment-meta strong { font-weight: 700; }
.comment-handle { color: var(--text-muted); font-size: 12px; }
.comment-time { color: var(--text-muted); font-size: 12px; }
.comment-discord-badge {
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--tint-yellow); color: var(--black);
  border: 1px solid var(--black);
}
.comment-delete {
  margin-left: auto;
  background: none; border: 0;
  color: var(--text-muted);
  font-size: 16px; line-height: 1;
  cursor: pointer; padding: 2px 6px;
}
.comment-delete:hover { color: var(--gap, #c0392b); }

.comment-body {
  font-size: 14px; line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 1.5rem 1rem;
}
