/* JFJ Affiliate Portal — design tokens + global styles */

:root {
  /* Type */
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'JetBrains Mono', Menlo, monospace;

  /* Light mode (default) */
  --bg:        oklch(98.8% 0.005 90);
  --canvas:    oklch(96.5% 0.006 90);
  --surface:   oklch(100% 0 0);
  --surface-2: oklch(95.5% 0.005 90);
  --surface-3: oklch(92% 0.006 90);
  --ink:       oklch(18% 0.01 270);
  --ink-2:     oklch(38% 0.01 270);
  --ink-3:     oklch(58% 0.01 270);
  --ink-4:     oklch(72% 0.008 270);
  --line:      oklch(90% 0.005 270);
  --line-2:    oklch(94% 0.004 270);

  --accent:    oklch(58% 0.16 155);
  --accent-2:  oklch(52% 0.16 155);
  --accent-soft: oklch(95% 0.05 155);
  --accent-on-soft: oklch(34% 0.12 155);
  --ink-on-accent: oklch(99% 0 0);

  --pos:       oklch(58% 0.16 155);
  --neg:       oklch(58% 0.18 25);
  --warn:      oklch(70% 0.16 75);

  --radius-lg: 12px;
  --radius:    8px;
  --radius-sm: 4px;

  --shadow-sm: 0 1px 0 oklch(85% 0.01 270 / 0.5);
  --shadow:    0 1px 0 oklch(85% 0.01 270 / 0.5), 0 8px 24px -10px oklch(50% 0.02 270 / 0.12);
  --shadow-lg: 0 1px 0 oklch(85% 0.01 270 / 0.5), 0 24px 48px -16px oklch(50% 0.02 270 / 0.18);
}

[data-theme="dark"] {
  --bg:        oklch(15% 0.012 250);
  --canvas:    oklch(13% 0.012 250);
  --surface:   oklch(18% 0.014 250);
  --surface-2: oklch(22% 0.014 250);
  --surface-3: oklch(26% 0.014 250);
  --ink:       oklch(98% 0.005 90);
  --ink-2:     oklch(78% 0.01 250);
  --ink-3:     oklch(60% 0.01 250);
  --ink-4:     oklch(45% 0.012 250);
  --line:      oklch(28% 0.014 250);
  --line-2:    oklch(24% 0.014 250);

  --accent:    oklch(72% 0.18 155);
  --accent-2:  oklch(78% 0.18 155);
  --accent-soft: oklch(28% 0.07 155);
  --accent-on-soft: oklch(82% 0.16 155);
  --ink-on-accent: oklch(15% 0.02 155);

  --shadow-sm: 0 1px 0 oklch(8% 0.01 250 / 0.5);
  --shadow:    0 1px 0 oklch(8% 0.01 250 / 0.5), 0 8px 24px -10px oklch(0% 0 0 / 0.4);
  --shadow-lg: 0 1px 0 oklch(8% 0.01 250 / 0.5), 0 24px 48px -16px oklch(0% 0 0 / 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 28px; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 20px; letter-spacing: -0.015em; }
h3 { font-size: 14px; }
p { margin: 0; color: var(--ink-2); }

.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---- App shell ---- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 56px 1fr;
  height: 100vh;
  background: var(--canvas);
}
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.01em; font-size: 15px;
  width: 220px;
}
.brand-mark { display: flex; align-items: center; }
.brand-name { display: flex; align-items: baseline; gap: 7px; }
.brand-suffix { font-weight: 400; color: var(--ink-3); font-size: 12px; letter-spacing: 0; }

.topbar-search {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink-3);
}
.topbar-search input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-family: inherit; font-size: 13px; color: var(--ink);
}
.topbar-search kbd {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--surface);
}

.topbar-spacer { flex: 1; }

.role-toggle {
  display: inline-flex; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
}
.role-toggle button {
  border: 0; background: transparent;
  padding: 4px 12px; font-size: 12px; font-weight: 500; color: var(--ink-3);
  border-radius: 5px; letter-spacing: 0.01em;
}
.role-toggle button.active {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px oklch(0% 0 0 / 0.06);
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  font-size: 12px; color: var(--ink-2);
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--ink-on-accent);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}

/* ---- Side rail ---- */
.rail {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.rail-section {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); padding: 16px 8px 6px; font-weight: 500;
}
.rail-section:first-child { padding-top: 0; }
.rail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 7px;
  font-size: 13px; color: var(--ink-2); font-weight: 500;
  cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left;
}
.rail-item:hover { background: var(--surface-2); color: var(--ink); }
.rail-item.active { background: var(--surface-2); color: var(--ink); }
.rail-item.active .rail-icon { color: var(--accent); }
.rail-icon { color: var(--ink-3); display: flex; }
.rail-count {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  color: var(--ink-3); padding: 1px 6px; background: var(--surface-2); border-radius: 4px;
}
.rail-item.active .rail-count { background: var(--surface-3); }

.rail-entity {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 22px; border-radius: 6px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  border: 0; background: transparent; width: 100%; text-align: left;
}
.rail-entity:hover { background: var(--surface-2); }
.rail-entity.active { background: var(--surface-2); color: var(--ink); }
.rail-entity-dot { width: 6px; height: 6px; border-radius: 50%; }
.rail-entity-meta {
  margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--ink-4);
}

.rail-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.rail-cert-card {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  display: flex; flex-direction: column; gap: 8px;
}
.rail-cert-title { font-size: 12px; font-weight: 600; }
.rail-cert-bar {
  height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden;
}
.rail-cert-bar div { height: 100%; background: var(--accent); }
.rail-cert-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* ---- Main scroll ---- */
.main {
  overflow-y: auto;
  position: relative;
}
.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 32px 64px;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.page-head .crumbs {
  font-size: 12px; color: var(--ink-3); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.page-head .crumbs button {
  border: 0; background: transparent; padding: 0; color: var(--ink-3);
  font: inherit; cursor: pointer;
}
.page-head .crumbs button:hover { color: var(--ink); }
.page-actions { display: flex; gap: 8px; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.card-title { font-size: 13px; color: var(--ink); }
.card-body { padding: 18px; }
.card-body-flush { padding: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 7px;
  font-weight: 500; font-size: 13px; letter-spacing: -0.005em;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.btn-md { height: 32px; padding: 0 14px; }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-full { width: 100%; }
.btn-icon { display: flex; }

.btn-primary { background: var(--accent); color: var(--ink-on-accent); }
.btn-primary:hover { background: var(--accent-2); }

.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--line); }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-danger { background: transparent; color: var(--neg); border-color: var(--line); }
.btn-danger:hover { background: oklch(96% 0.04 25); border-color: oklch(80% 0.10 25); }

[data-theme="dark"] .btn-danger:hover { background: oklch(28% 0.07 25); }

/* ---- Pills, chips ---- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill-dot { width: 5px; height: 5px; border-radius: 50%; }

.entity-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 8px; border-radius: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap;
}
.entity-chip.ec-md { height: 24px; padding: 0 10px; font-size: 11px; }
.entity-chip.ec-lg { height: 28px; padding: 0 12px; font-size: 12px; letter-spacing: 0.02em; text-transform: none; }
.entity-chip-dot { width: 5px; height: 5px; border-radius: 50%; }

.stage-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px 0 4px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
}
.stage-pill-num {
  width: 16px; height: 16px; border-radius: 50%;
  background: oklch(0% 0 0 / 0.05); display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}

/* ---- KPI ---- */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.kpi {
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}
.kpi:last-child { border-right: 0; }
.kpi-label { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; margin-top: 8px; line-height: 1; }
.kpi-sub { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.kpi-delta { font-size: 11px; font-family: var(--mono); }
.kpi-delta.pos { color: var(--pos); }
.kpi-delta.neg { color: var(--neg); }
.kpi-subtext { font-size: 11px; color: var(--ink-3); }

/* ---- Stage bar ---- */
.stagebar {
  display: flex; gap: 3px;
}
.sb-seg {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--surface-3);
}
.sb-seg.reached { background: var(--ink-3); }
.sb-seg.current { background: var(--accent); }
.sb-seg.won.reached { background: var(--accent); }
.sb-seg.stalled { background: var(--warn); }

/* ---- Tables ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; font-weight: 500; font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.tbl tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl .right { text-align: right; }

/* ---- Tabs ---- */
.tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.tab {
  border: 0; background: transparent;
  padding: 12px 18px; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-color: var(--accent); }

/* ---- Helpers ---- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-4); }
.between { justify-content: space-between; }
.center { justify-content: center; }
.middle { align-items: center; }
.ml-auto { margin-left: auto; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-12-8 { grid-template-columns: 12fr 8fr; gap: 16px; }
.grid-7-5 { grid-template-columns: 7fr 5fr; gap: 16px; }
.size-12 { font-size: 12px; } .size-13 { font-size: 13px; } .size-14 { font-size: 14px; }
.weight-5 { font-weight: 500; } .weight-6 { font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* ---- Misc ---- */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--surface-2); color: var(--ink-2);
}
.tag.pos { background: var(--accent-soft); color: var(--accent-on-soft); }
.tag.warn { background: oklch(96% 0.06 75); color: oklch(38% 0.13 75); }
.tag.neg { background: oklch(96% 0.06 25); color: oklch(38% 0.13 25); }
[data-theme="dark"] .tag.warn { background: oklch(28% 0.08 75); color: oklch(82% 0.16 75); }
[data-theme="dark"] .tag.neg { background: oklch(28% 0.08 25); color: oklch(82% 0.16 25); }

/* ---- Onboarding overlay ---- */
.onb {
  position: fixed; inset: 0; z-index: 100;
  background: oklch(0% 0 0 / 0.4);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.onb-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  width: 100%; max-width: 560px; padding: 32px;
  box-shadow: var(--shadow-lg);
}
.onb-step-dots { display: flex; gap: 6px; margin-bottom: 20px; }
.onb-step-dots div { height: 4px; flex: 1; background: var(--surface-3); border-radius: 2px; }
.onb-step-dots div.active { background: var(--accent); }
.onb h2 { font-size: 22px; margin-bottom: 8px; }
.onb p { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.onb-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; }

/* ---- Toast ---- */
.toast-stack {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--bg);
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastin 0.2s ease-out;
}
@keyframes toastin {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Quiz ---- */
.quiz-shell { max-width: 720px; margin: 0 auto; }
.quiz-progress {
  display: flex; gap: 4px; margin-bottom: 24px;
}
.quiz-progress div { height: 3px; flex: 1; background: var(--surface-3); border-radius: 2px; }
.quiz-progress div.done { background: var(--accent); }
.quiz-progress div.current { background: var(--ink-2); }
.quiz-q { font-size: 22px; line-height: 1.35; letter-spacing: -0.015em; margin-bottom: 24px; }
.quiz-opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; background: var(--surface);
  font-size: 14px; transition: border-color 0.12s, background 0.12s;
}
.quiz-opt:hover { border-color: var(--ink-3); }
.quiz-opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.quiz-opt-letter {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; flex-shrink: 0;
}
.quiz-opt.selected .quiz-opt-letter { background: var(--accent); color: var(--ink-on-accent); border-color: transparent; }

/* ---- Pipeline ---- */
.pipe-board {
  display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px; align-items: start;
}
.pipe-col {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column;
}
.pipe-col-head {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
}
.pipe-col-count { margin-left: auto; font-family: var(--mono); color: var(--ink-3); font-size: 11px; }
.pipe-col-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pipe-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; transition: border-color 0.12s, transform 0.12s;
}
.pipe-card:hover { border-color: var(--ink-3); }
.pipe-card.stalled { border-color: var(--warn); border-style: dashed; }
.pipe-card-name { font-weight: 600; font-size: 13px; }
.pipe-card-co { font-size: 11.5px; color: var(--ink-3); }
.pipe-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
}

/* ---- Leaderboard ---- */
.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line-2);
}
.lb-row:last-child { border-bottom: 0; }
.lb-row.you { background: var(--accent-soft); }
.lb-rank {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-2);
}
.lb-rank.top { background: oklch(85% 0.14 90); color: oklch(28% 0.10 90); }
.lb-rank.top.r2 { background: oklch(86% 0.02 270); color: oklch(34% 0.01 270); }
.lb-rank.top.r3 { background: oklch(82% 0.10 50); color: oklch(34% 0.10 50); }
.lb-name { display: flex; align-items: center; gap: 10px; }
.lb-handle { color: var(--ink-3); font-size: 12px; font-family: var(--mono); }
.lb-bar {
  width: 120px; height: 4px; border-radius: 2px;
  background: var(--surface-3); overflow: hidden;
}
.lb-bar div { height: 100%; background: var(--ink-2); }
.lb-row.you .lb-bar div { background: var(--accent); }
.lb-gmv { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }

/* ---- Asset card ---- */
.asset-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.12s;
}
.asset-card:hover { border-color: var(--ink-3); }
.asset-kind {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
}
.asset-title { font-weight: 600; font-size: 13px; }
.asset-copy {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.5;
  white-space: pre-wrap;
  background: var(--surface-2); padding: 10px 12px; border-radius: 6px;
  font-family: var(--mono); font-size: 11.5px;
  max-height: 110px; overflow: hidden;
  position: relative;
}
.asset-copy::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 30px;
  background: linear-gradient(180deg, transparent, var(--surface-2));
}
.asset-foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--ink-3); font-family: var(--mono);
}

/* ---- Training ---- */
.module-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--line-2);
}
.module-row:last-child { border-bottom: 0; }
.module-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; flex-shrink: 0;
}
.module-row.done .module-num { background: var(--accent); color: var(--ink-on-accent); }
.module-row.current .module-num { background: var(--ink); color: var(--bg); }
.module-row.locked { opacity: 0.5; }
.module-title { font-weight: 500; font-size: 13.5px; }
.module-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: auto; }

/* ---- Link generator ---- */
.link-display {
  font-family: var(--mono); font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  word-break: break-all;
}
.link-display .link-url { flex: 1; color: var(--ink); }

/* ---- Announcement ---- */
.ann-row {
  padding: 16px 18px; border-bottom: 1px solid var(--line-2);
  display: flex; gap: 14px;
}
.ann-row:last-child { border-bottom: 0; }
.ann-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ann-row.high .ann-icon { background: var(--accent-soft); color: var(--accent-on-soft); }
.ann-title { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.ann-meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-bottom: 8px; letter-spacing: 0.02em; }
.ann-body { font-size: 13px; color: var(--ink-2); line-height: 1.55; }

/* ---- Hype ribbon ---- */
.hype {
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 60%, var(--accent-2) 100%);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex; align-items: center; gap: 22px;
  position: relative; overflow: hidden;
}
[data-theme="dark"] .hype {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface) 50%, var(--accent-soft) 100%);
  color: var(--ink);
}
.hype-eyebrow {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0.7;
}
.hype-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.hype-meta { font-family: var(--mono); font-size: 11.5px; opacity: 0.85; margin-top: 6px; display: flex; gap: 16px; }
.hype-cta { margin-left: auto; }

/* ---- Page heading display ---- */
.welcome {
  display: flex; align-items: flex-end; gap: 16px;
  margin-bottom: 6px;
}
.welcome-name {
  font-size: 32px; letter-spacing: -0.025em; font-weight: 600; line-height: 1;
}
.welcome-sub { color: var(--ink-3); font-size: 14px; padding-bottom: 2px; }

/* Scrollbar */
.main::-webkit-scrollbar, .rail::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb, .rail::-webkit-scrollbar-thumb {
  background: var(--surface-3); border-radius: 5px; border: 2px solid var(--bg);
}
.main::-webkit-scrollbar-track, .rail::-webkit-scrollbar-track { background: transparent; }
