/* === Design tokens === */
:root {
  --bg: #f6f7fb;
  --bg-card: #ffffff;
  --bg-elevated: #fafbfd;
  --ink: #0a0e1c;
  --ink-2: #2d3650;
  --ink-3: #6b7390;
  --ink-4: #a3aac4;
  --line: #e8eaf2;
  --line-2: #d2d7e6;
  --accent: #4f46e5;
  --accent-2: #ff7a59;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --warn: #d97706;
  --warn-soft: #fef4dc;
  --good: #10b981;
  --good-soft: #d1fae5;
  --bad: #ef4444;
  --bad-soft: #fee2e2;
  --display: "Bricolage Grotesque", "Manrope", "Helvetica Neue", sans-serif;
  --serif: "Bricolage Grotesque", "Helvetica Neue", sans-serif;
  --sans: "Manrope", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", "SF Mono", "Menlo", monospace;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 20, 50, 0.04), 0 1px 1px rgba(15, 20, 50, 0.03);
  --shadow-md: 0 4px 10px -2px rgba(15, 20, 50, 0.06), 0 2px 4px -2px rgba(15, 20, 50, 0.04);
  --shadow-lg: 0 16px 40px -12px rgba(15, 20, 50, 0.14), 0 6px 12px -4px rgba(15, 20, 50, 0.06);
  --shadow-pop: 0 24px 60px -20px rgba(79, 70, 229, 0.25), 0 10px 22px -8px rgba(15, 20, 50, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(at 100% 0%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(255, 122, 89, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
}

/* === App shell === */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0a0e1c;
  color: #e6e8f5;
  padding: 28px 22px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.brand {
  margin-bottom: 28px;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #f5f6fc;
}
.brand-mark::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #ff7a59 100%);
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.4);
}
.brand-mark::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.95);
  margin-left: 7px;
  margin-top: 9px;
  border-radius: 2px;
}
.brand-sub {
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: #8590b8;
  margin-top: 6px;
  margin-left: 36px;
  font-weight: 500;
}

.nav-section-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7595;
  margin: 18px 0 8px;
  font-weight: 600;
}

.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr 18px;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  margin: 0 -10px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.3;
  color: #c5cae0;
  transition: all 0.15s;
  text-align: left;
  border: 0;
  background: transparent;
  width: calc(100% + 20px);
  font-family: inherit;
  font-weight: 500;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #f5f6fc; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(79, 70, 229, 0.1) 100%);
  color: #f5f6fc;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.25);
}
.nav-item-num {
  font-family: var(--mono);
  font-size: 11px;
  color: #6b7595;
  font-weight: 500;
}
.nav-item.active .nav-item-num { color: #a5a8f0; }
.nav-item-check {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid #3a4060;
  display: inline-block;
  transition: all 0.2s;
}
.nav-item-check.done {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #6b7595;
  line-height: 1.55;
}
.sidebar-foot strong { color: #c5cae0; font-weight: 600; }

.progress-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
  margin: 14px 0 8px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px;
}

/* === Main content === */
.main {
  padding: 40px 56px 80px;
  max-width: 1100px;
}

.main-head {
  padding-bottom: 22px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.crumb {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 500;
  text-transform: none;
}
h1.section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 42px;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 12px;
  color: var(--ink);
}
.section-lede {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 64ch;
  margin: 0;
  line-height: 1.55;
}
.section-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
  font-weight: 500;
}
.section-meta span { display: inline-flex; align-items: center; gap: 6px; }
.section-meta .dot { width: 4px; height: 4px; background: var(--ink-4); border-radius: 50%; }

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}
.card-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}
.card-sub {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--mono);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}

/* === Form === */
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
label.lbl {
  display: block;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 7px;
}
input.txt, textarea.txt, select.txt {
  width: 100%;
  border: 1px solid var(--line-2);
  background: var(--bg-card);
  padding: 11px 13px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  resize: vertical;
  font-feature-settings: "tnum" 1, "cv11" 1;
  transition: all 0.15s;
}
input.txt:hover, textarea.txt:hover, select.txt:hover { border-color: var(--ink-4); }
input.txt:focus, textarea.txt:focus, select.txt:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.txt { min-height: 80px; line-height: 1.5; }
.help {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 6px;
  line-height: 1.45;
}

/* === Buttons === */
.btn {
  border: 0;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: #1a1f33; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--accent);
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.35);
}
.btn.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.45);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--bg-elevated); border-color: var(--ink-4); transform: translateY(-1px); }
.btn.small { padding: 7px 12px; font-size: 12.5px; }
.btn.danger {
  background: transparent;
  border: 1px solid var(--bad);
  color: var(--bad);
  box-shadow: none;
}
.btn.danger:hover { background: var(--bad-soft); }
.btn.icon {
  width: 30px; height: 30px; padding: 0;
  justify-content: center; align-items: center;
  border: 1px solid var(--line-2);
  background: var(--bg-card);
  color: var(--ink-2);
  box-shadow: none;
}
.btn.icon:hover { background: var(--bg-elevated); transform: none; box-shadow: var(--shadow-sm); }

.foot-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* === Lesson callout === */
.lesson {
  background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 50%, #4f46e5 100%);
  color: #ecedfb;
  padding: 20px 24px;
  border-radius: var(--r-lg);
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  box-shadow: 0 8px 24px -8px rgba(79, 70, 229, 0.4);
}
.lesson-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: #c7d2fe;
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 11px;
  border-radius: 50px;
  white-space: nowrap;
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.lesson-body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: #ecedfb;
}
.lesson-body strong { color: #fff; font-weight: 700; }

/* === Tag/Pill === */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 4px 10px;
  border-radius: 50px;
  background: var(--bg-elevated);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.pill.ok { background: var(--good-soft); color: #047857; border-color: rgba(16, 185, 129, 0.3); }
.pill.warn { background: var(--warn-soft); color: #b45309; border-color: rgba(217, 119, 6, 0.3); }
.pill.bad { background: var(--bad-soft); color: #b91c1c; border-color: rgba(239, 68, 68, 0.3); }
.pill.info { background: var(--accent-soft); color: var(--accent); border-color: rgba(79, 70, 229, 0.25); }

/* === Landing === */
.landing-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  margin-bottom: 56px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.landing-hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 62px;
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 18px 0 22px;
  color: var(--ink);
}
.landing-hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-hero p.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 28px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  font-weight: 500;
}

.hero-side {
  background: linear-gradient(155deg, #0a0e1c 0%, #1a1f4d 60%, #312e81 100%);
  color: #e6e8f5;
  padding: 32px;
  border-radius: var(--r-xl);
  align-self: start;
  box-shadow: var(--shadow-pop);
  position: relative;
  overflow: hidden;
}
.hero-side::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255, 122, 89, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-side h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 22px;
  color: #f5f6fc;
  letter-spacing: -0.01em;
  position: relative;
}
.hero-side ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: hero;
  position: relative;
}
.hero-side ol li {
  counter-increment: hero;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: baseline;
  font-size: 13.5px;
  color: #c5cae0;
}
.hero-side ol li::before {
  content: "0" counter(hero);
  font-family: var(--mono);
  font-size: 10px;
  color: #818cf8;
  font-weight: 500;
}
.hero-side ol li:first-child { border-top: 0; }
.hero-side ol li span.max {
  font-family: var(--mono);
  font-size: 10px;
  color: #818cf8;
  font-weight: 500;
}

.strengths {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.strength {
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--bg-card);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.strength::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.strength:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.strength:hover::before { opacity: 0.6; }
.strength-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0;
  margin-bottom: 10px;
  font-weight: 500;
  position: relative;
}
.strength h4 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 8px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  position: relative;
}
.strength p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  position: relative;
}

/* === SWOT === */
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
  position: relative;
}
.swot-quadrant {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.swot-quadrant.s { background: linear-gradient(180deg, #d1fae5 0%, var(--bg-card) 50%); }
.swot-quadrant.w { background: linear-gradient(180deg, #fee2e2 0%, var(--bg-card) 50%); }
.swot-quadrant.o { background: linear-gradient(180deg, #eef0ff 0%, var(--bg-card) 50%); }
.swot-quadrant.t { background: linear-gradient(180deg, #fef4dc 0%, var(--bg-card) 50%); }
.swot-letter {
  font-family: var(--display);
  font-size: 52px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 4px;
}
.swot-letter.s { color: #10b981; }
.swot-letter.w { color: #ef4444; }
.swot-letter.o { color: var(--accent); }
.swot-letter.t { color: #d97706; }
.swot-name {
  font-size: 12.5px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.swot-items { flex: 1; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.swot-item {
  background: white;
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}
.swot-item button {
  background: transparent;
  border: 0;
  color: var(--ink-4);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.swot-item button:hover { color: var(--bad); }
.swot-add {
  border: 1.5px dashed var(--line-2);
  background: transparent;
  border-radius: 8px;
  padding: 8px 12px;
  width: 100%;
  font-size: 13px;
  color: var(--ink-3);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
}
.swot-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.swot-input {
  display: flex; gap: 6px;
}
.swot-input input {
  flex: 1;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  background: white;
}
.swot-input input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* === SMART validator === */
.smart-row {
  display: grid;
  grid-template-columns: 36px 100px 1fr 90px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.smart-row:first-child { border-top: 0; }
.smart-letter {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.smart-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.smart-desc {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.45;
}
.smart-state { text-align: right; }

/* === Activities table === */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.tbl td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl td input, .tbl td select {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
}
.tbl td input:focus, .tbl td select:focus {
  outline: 0;
  background: var(--bg-elevated);
  border-color: var(--line-2);
}
.tbl td input:hover, .tbl td select:hover {
  background: var(--bg-elevated);
}

/* === GANTT === */
.gantt-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}
.gantt {
  min-width: 760px;
  display: grid;
  grid-template-columns: 220px repeat(12, 1fr) 30px;
  border-bottom: 1px solid var(--line);
}
.gantt-cell {
  border-right: 1px solid var(--line);
  padding: 8px;
  min-height: 36px;
  font-size: 12px;
  display: flex;
  align-items: center;
}
.gantt-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-elevated);
  justify-content: center;
}
.gantt-row {
  display: contents;
}
.gantt-name {
  background: var(--bg-card);
  font-weight: 500;
  font-size: 12px;
}
.gantt-name input {
  border: 0;
  background: transparent;
  width: 100%;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
}
.gantt-month {
  cursor: pointer;
  position: relative;
  background: var(--bg-card);
}
.gantt-month:hover { background: var(--bg-elevated); }
.gantt-month.on {
  background: var(--accent);
}
.gantt-month.on::after {
  content: "";
  position: absolute;
  inset: 4px 0;
  background: var(--accent);
}
.gantt-month.start.on::after {
  border-radius: 4px 0 0 4px;
  left: 4px;
}
.gantt-month.end.on::after {
  border-radius: 0 4px 4px 0;
  right: 4px;
}
.gantt-month.single.on::after {
  border-radius: 4px;
  inset: 4px;
}

/* === Budget === */
.budget-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.budget-stat {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.budget-stat-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
  margin-bottom: 8px;
  font-weight: 500;
}
.budget-stat-val {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum" 1;
  line-height: 1;
}
.budget-stat-val .unit {
  font-size: 13px;
  color: var(--ink-3);
  font-family: var(--sans);
  margin-left: 4px;
  font-weight: 500;
}

.budget-row {
  display: grid;
  grid-template-columns: 28px 1fr 120px 110px 32px;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.budget-row:first-of-type { border-top: 0; }
.budget-row .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.budget-row .title {
  font-size: 13px;
  font-weight: 500;
}
.budget-row .desc {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
  line-height: 1.4;
}
.budget-row .range {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.budget-row input.pct {
  width: 100%;
  text-align: right;
  font-family: var(--mono);
  font-size: 14px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--bg-elevated);
}
.budget-row .status-indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--good);
}
.budget-row .status-indicator.warn { background: var(--warn); }
.budget-row .status-indicator.bad { background: var(--bad); }

/* === Risk matrix === */
.risk-matrix-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.risk-y-axis {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
  display: flex;
  align-items: center;
}
.risk-matrix {
  display: grid;
  grid-template-columns: 60px repeat(5, 1fr);
  grid-template-rows: repeat(5, 70px) 26px;
  gap: 0;
}
.risk-y-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  text-align: right;
  padding-right: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.risk-cell {
  border: 1px solid white;
  padding: 6px;
  font-size: 11px;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: flex-start;
}
.risk-cell.s1 { background: #cde6c8; }
.risk-cell.s2 { background: #ddeacc; }
.risk-cell.s3 { background: #fbeed6; }
.risk-cell.s4 { background: #f3cab0; }
.risk-cell.s5 { background: #e8a59a; }
.risk-x-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  text-align: center;
  padding-top: 6px;
}
.risk-chip {
  background: white;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 50px;
  padding: 2px 8px;
  font-size: 10px;
  cursor: pointer;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}
.risk-chip:hover { background: var(--ink); color: white; }

.risk-list { margin-top: 18px; }

/* === Org chart === */
.org-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.org-row {
  display: flex;
  gap: 22px;
  justify-content: center;
  position: relative;
}
.org-row + .org-row {
  margin-top: 32px;
}
.org-row + .org-row::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  width: 1px;
  height: 14px;
  background: var(--line-2);
}
.org-node {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 16px;
  min-width: 180px;
  position: relative;
}
.org-node.lead { background: var(--ink); color: #f5f1e6; border-color: var(--ink); }
.org-node-role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.org-node.lead .org-node-role { color: #c1b8a3; }
.org-node-name {
  font-size: 13px;
  font-weight: 500;
}
.org-node input {
  border: 0;
  background: transparent;
  width: 100%;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: inherit;
}

/* === Export / preview === */
.preview-doc {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 56px 64px;
  font-family: "Times New Roman", "Times", serif;
  font-size: 13px;
  line-height: 1.55;
  color: #1a1a1a;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 12px 30px -12px rgba(0,0,0,0.12);
}
.preview-doc h1 {
  font-size: 22px;
  margin: 0 0 8px;
  font-weight: 700;
}
.preview-doc h2 {
  font-size: 15px;
  margin: 26px 0 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
}
.preview-doc p { margin: 0 0 10px; }
.preview-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px;
  font-size: 12px;
}
.preview-doc table th,
.preview-doc table td {
  border: 1px solid #aaa;
  padding: 6px 8px;
  text-align: left;
}
.preview-doc table th { background: #eee; font-weight: 700; }

/* === Word/page counter === */
.counter {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 6px;
}
.counter .over { color: var(--bad); font-weight: 700; }

/* === Banner === */
.banner-warn {
  background: var(--warn-soft);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 13.5px;
  color: #92400e;
  margin-bottom: 16px;
  line-height: 1.5;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.banner-warn::before {
  content: "!";
  font-family: var(--display);
  font-weight: 700;
  width: 20px; height: 20px;
  background: #d97706;
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

/* misc */
.divider-thick { border-top: 1px solid var(--line); margin: 20px 0; }
.muted { color: var(--ink-3); }
.tight { margin: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ============================================================
   PHASE 1 — Commercial landing & module navigation
   ============================================================ */

/* === Sidebar — modules nav === */
.nav-home {
  margin-bottom: 4px;
}

.nav-module-group {
  margin: 2px -10px;
}
.nav-module {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
  background: transparent;
  border: 0;
  color: #d4cdb9;
  text-align: left;
  width: 100%;
  transition: background 0.12s;
}
.nav-module:hover { background: #25221c; color: #f5f1e6; }
.nav-module.expanded { background: #2f2b22; color: #f5f1e6; }
.nav-module-code {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #8a8270;
  border: 1px solid #3a342a;
  padding: 3px 5px;
  border-radius: 3px;
  text-align: center;
  background: rgba(0,0,0,0.2);
}
.nav-module.expanded .nav-module-code,
.nav-module.active .nav-module-code {
  color: #f5f1e6;
  border-color: #5c5444;
  background: #1a1814;
}
.nav-module-name {
  font-size: 13px;
  line-height: 1.25;
}
.nav-module-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8270;
  padding: 2px 5px;
  border-radius: 3px;
  background: #1a1814;
}
.nav-module-tag.active-tag {
  background: #2d6a3e;
  color: #def0d8;
}
.nav-module.soon {
  opacity: 0.78;
}

.nav-sub {
  display: flex;
  flex-direction: column;
  margin: 4px 0 6px;
  padding-left: 8px;
  border-left: 1px solid #2a261e;
  margin-left: 18px;
}
.nav-sub-item {
  display: grid;
  grid-template-columns: 24px 1fr 16px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin: 1px 0;
  cursor: pointer;
  border-radius: 5px;
  font-family: inherit;
  background: transparent;
  border: 0;
  color: #b8b0a0;
  text-align: left;
  font-size: 12px;
  width: 100%;
  transition: background 0.12s;
}
.nav-sub-item:hover { background: #25221c; color: #f5f1e6; }
.nav-sub-item.active { background: #2f2b22; color: #f5f1e6; }
.nav-sub-num {
  font-family: var(--mono);
  font-size: 10px;
  color: #8a8270;
}
.nav-sub-item.active .nav-sub-num { color: #f5f1e6; }
.nav-sub-label {
  line-height: 1.3;
}

/* === Landing — hero side updates === */
.market-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid #2a261e;
}
.market-stat:first-of-type { border-top: 0; }
.market-stat .ms-val {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  color: #f5f6fc;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.market-stat .ms-lbl {
  font-size: 12px;
  color: #a5acc8;
  line-height: 1.4;
}

/* === Landing — sections === */
.lp-section {
  margin: 56px 0;
}
.lp-section-head {
  margin-bottom: 24px;
  max-width: 64ch;
}
.lp-h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 36px;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 10px 0 0;
}
.lp-lede {
  margin: 14px 0 0;
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.6;
}

/* === Module overview grid === */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.module-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: 14px;
  padding: 22px 24px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.module-card:hover {
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.module-card.active {
  background: linear-gradient(180deg, #fdfcf8 0%, var(--bg-card) 100%);
  border-color: var(--ink-3);
}
.module-card.soon {
  opacity: 0.85;
}
.module-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.module-code {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  background: var(--bg-elevated);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--line-2);
}
.module-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 4px 0 0;
}
.module-blurb {
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}
.module-cta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: auto;
}

/* === Compare table === */
.compare-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
}
.compare-row {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr 1.2fr 0.8fr 1.4fr;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  align-items: center;
  font-size: 13px;
}
.compare-row:first-child { border-top: 0; }
.compare-row.compare-head {
  background: var(--bg-elevated);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.compare-row > div:nth-child(1) { font-weight: 500; }

/* === Pricing === */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.price-card {
  border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.price-card.featured {
  border: 1.5px solid var(--ink);
  background: var(--bg-card);
}
.price-badge {
  position: absolute;
  top: -10px;
  left: 24px;
  background: var(--ink);
  color: #f5f1e6;
  padding: 4px 10px;
  border-radius: 50px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.price-tier {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.price-amount {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 18px;
}
.price-amount .price-unit {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
  margin-left: 4px;
}
.price-feats {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  flex: 1;
}
.price-feats li {
  padding: 8px 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
  border-top: 1px solid var(--line);
  padding-left: 22px;
  position: relative;
}
.price-feats li:first-child { border-top: 0; }
.price-feats li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--good);
  font-weight: 700;
}

/* === B2B card === */
.b2b-card {
  background: #1d2152;
  color: #e7e9fa;
  padding: 40px 44px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: center;
}
.b2b-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.b2b-stat {
  background: rgba(255,255,255,0.06);
  padding: 16px 18px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.08);
}
.b2b-stat-val {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
}
.b2b-stat-lbl {
  font-size: 12px;
  color: #b3b8e0;
  margin-top: 6px;
  line-height: 1.4;
}

/* === M2 Overview — tool grid === */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.tool-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 18px 20px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s;
}
.tool-card:hover {
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.tool-card.done {
  background: linear-gradient(180deg, #def0d8 0%, var(--bg-card) 80%);
  border-color: #b2d4af;
}
.tool-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.tool-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  background: var(--bg-elevated);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--line-2);
}
.tool-group {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: 1;
}
.tool-check {
  color: var(--good);
  font-weight: 700;
}
.tool-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.tool-desc {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* === Coming soon — hero === */
.soon-hero {
  margin-bottom: 24px;
}
.soon-hero-bg {
  background: linear-gradient(135deg, #1d2152 0%, #2d3578 50%, #4f5a9c 100%);
  border-radius: 16px;
  padding: 60px 56px 56px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.soon-hero-bg::before,
.soon-hero-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.soon-hero-bg::before {
  width: 240px; height: 240px;
  top: -80px; right: -40px;
}
.soon-hero-bg::after {
  width: 140px; height: 140px;
  bottom: -50px; left: 30%;
}
.soon-code {
  font-family: var(--display);
  font-size: 96px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
  position: relative;
  z-index: 1;
}
.soon-mark {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #b3b8e0;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 14px;
  border-radius: 50px;
  position: relative;
  z-index: 1;
}

/* === Feature grid (coming soon) === */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.feature-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.feature-item:first-child,
.feature-item:nth-child(2) { border-top: 0; padding-top: 0; }
.feature-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.feature-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--ink);
}
.feature-desc {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
}

/* Tweaks for the existing landing-hero so it works on smaller screens */
@media (max-width: 1100px) {
  .module-grid, .pricing-grid, .feature-grid { grid-template-columns: 1fr; }
  .compare-row { grid-template-columns: 1fr; gap: 4px; }
  .compare-row.compare-head { display: none; }
  .b2b-card { grid-template-columns: 1fr; padding: 28px; }
  .landing-hero { grid-template-columns: 1fr; gap: 32px; }
  .landing-hero h1 { font-size: 42px; }
}


/* ============================================================
   PHASE 2 — Module 1 styles
   ============================================================ */

/* === M1 Overview === */
.m1-progress-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.lesson-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 22px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.lesson-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at 100% 0%, var(--accent-soft) 0%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}
.lesson-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.lesson-card.done {
  background: linear-gradient(135deg, #ecfdf5 0%, var(--bg-card) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}
.lesson-card-icon {
  font-size: 26px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.lesson-card.done .lesson-card-icon { color: var(--good); }
.lesson-card-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}
.lesson-card-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 4px 0 6px;
}
.lesson-card-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 0 14px;
}
.lesson-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}
.lesson-card-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.m1-cta {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  box-shadow: var(--shadow-pop);
}
.m1-cta h3 { color: #fff; }
.m1-cta p { color: #d8d9f5 !important; }
.m1-cta .btn.primary {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 4px 12px -2px rgba(0,0,0,0.2);
}
.m1-cta .btn.primary:hover { background: #f5f5ff; }

/* === Definitions === */
.def-stack { display: flex; flex-direction: column; gap: 20px; }

.def-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: var(--bg-card);
}
.def-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 500;
  transition: all 0.15s;
}
.def-tab:hover { background: var(--bg-elevated); }
.def-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(79, 70, 229, 0.25);
}
.def-tab-num { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.def-tab.active .def-tab-num { color: var(--accent); }
.def-tab.viewed .def-tab-check { color: var(--good); margin-left: 4px; font-weight: 700; }

.def-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  animation: defReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes defReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.def-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
}
.def-card-indigo::before { background: linear-gradient(90deg, #4f46e5 0%, #818cf8 100%); }
.def-card-coral::before { background: linear-gradient(90deg, #ff7a59 0%, #fb923c 100%); }
.def-card-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.def-word {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 14px;
  color: var(--ink);
}
.def-card-coral .def-word { color: #c2410c; }
.def-card-indigo .def-word { color: #3730a3; }
.def-short {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-2);
  margin: 0 0 28px;
  letter-spacing: -0.015em;
  max-width: 50ch;
}
.def-detail {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
.def-detail p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
  grid-column: 1 / -1;
}
.def-counter {
  background: var(--warn-soft);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
}
.def-counter-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #92400e;
  margin-bottom: 4px;
}
.def-counter-text { color: #78350f; line-height: 1.5; }
.def-example {
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.def-example-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.def-example-text { color: var(--ink); line-height: 1.5; font-style: italic; }
.def-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
}

/* === PERT === */
.pert-canvas-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(var(--bg-elevated), var(--bg-elevated)),
    radial-gradient(circle at 20px 20px, var(--line) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px;
  background-position: 0 0, 0 0;
  background-color: var(--bg-elevated);
  padding: 8px;
}
.pert-canvas { display: block; }

.pert-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pert-table-head, .pert-row {
  display: grid;
  grid-template-columns: 60px 1.6fr 80px 1fr 40px;
  gap: 10px;
  align-items: center;
}
.pert-table-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.pert-row {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.pert-code, .pert-name, .pert-dur {
  border: 1px solid transparent;
  background: transparent;
  padding: 7px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  width: 100%;
}
.pert-code { font-weight: 700; font-family: var(--mono); }
.pert-code:hover, .pert-name:hover, .pert-dur:hover { background: var(--bg-elevated); }
.pert-code:focus, .pert-name:focus, .pert-dur:focus {
  outline: 0;
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pert-deps { display: flex; gap: 5px; flex-wrap: wrap; }
.pert-dep-chip {
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--bg-elevated);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-3);
  transition: all 0.12s;
}
.pert-dep-chip:hover { border-color: var(--accent); color: var(--accent); }
.pert-dep-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* === Eisenhower === */
.eis-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
.eis-pool {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 20px;
}
.eis-pool-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  min-height: 60px;
}
.eis-task {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: all 0.12s;
}
.eis-task:hover { border-color: var(--accent); }
.eis-task:active { cursor: grabbing; }
.eis-task.placed { font-size: 12.5px; padding: 7px 9px; }
.eis-grip { color: var(--ink-4); font-size: 12px; line-height: 1; cursor: grab; }
.eis-remove {
  background: transparent;
  border: 0;
  color: var(--ink-4);
  cursor: pointer;
  font-size: 12px;
}
.eis-remove:hover { color: var(--bad); }
.eis-add {
  display: flex;
  gap: 6px;
}
.eis-add input {
  flex: 1;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-family: inherit;
}
.eis-add input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.eis-matrix {
  position: relative;
  padding: 0 0 24px 24px;
}
.eis-axis-x {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-align: center;
  margin-bottom: 8px;
  font-weight: 600;
}
.eis-axis-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  position: absolute;
  left: 0;
  top: 36px;
  bottom: 0;
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  font-weight: 600;
}
.eis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 460px;
}
.eis-quadrant {
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.15s;
  border: 2px solid transparent;
}
.eis-quadrant.drag-over {
  border-color: var(--accent);
  background-color: var(--accent-soft) !important;
  transform: scale(1.005);
}
.eis-q1 { background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%); }
.eis-q2 { background: linear-gradient(135deg, #ddd6fe 0%, #ede9fe 100%); }
.eis-q3 { background: linear-gradient(135deg, #fed7aa 0%, #ffedd5 100%); }
.eis-q4 { background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%); }
.eis-q-head { display: flex; flex-direction: column; gap: 2px; }
.eis-q-label {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.eis-q1 .eis-q-label { color: #b91c1c; }
.eis-q2 .eis-q-label { color: #5b21b6; }
.eis-q3 .eis-q-label { color: #c2410c; }
.eis-q4 .eis-q-label { color: #374151; }
.eis-q-desc {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--ink-3);
}
.eis-q-tasks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 80px;
}
.eis-q-advice {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.4;
  padding-top: 8px;
  border-top: 1px dashed rgba(0,0,0,0.1);
  font-style: italic;
}

.eis-mini-tag {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
}
.eis-mini-tag.eis-q1 { background: #fee2e2; color: #b91c1c; }
.eis-mini-tag.eis-q2 { background: #ddd6fe; color: #5b21b6; }
.eis-mini-tag.eis-q3 { background: #fed7aa; color: #c2410c; }
.eis-mini-tag.eis-q4 { background: #e5e7eb; color: #374151; }

/* === Organigrame === */
.orgs-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}
.org-block {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.org-block-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.org-block-num {
  width: 40px; height: 40px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}
.org-block-num.accent { background: var(--accent); }
.org-block-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}
.org-block-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

.org-diagram {
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 18px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
}
.org-level {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
}
.org-level::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 1px;
  height: 10px;
  background: var(--line-2);
}
.org-level-1::before { display: none; }
.org-box {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  text-align: center;
  background: white;
  border: 1px solid var(--line);
}
.org-box.ceo { background: var(--ink); color: #fff; border-color: var(--ink); padding: 10px 18px; font-weight: 600; }
.org-box.manager { background: var(--accent-soft); color: var(--accent); border-color: rgba(79, 70, 229, 0.2); font-weight: 600; }
.org-box.ic { font-size: 10.5px; padding: 6px 10px; }

.matrix-grid {
  display: grid;
  grid-template-columns: 90px 1fr 1fr 1fr;
  gap: 6px;
  width: 100%;
}
.matrix-header {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 6px 4px;
  text-align: center;
}
.matrix-row-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  padding: 14px 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.matrix-cell {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.matrix-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
}
.matrix-dot.p1 { background: var(--accent); }
.matrix-dot.p2 { background: var(--accent-2); }
.matrix-dot.p3 { background: var(--good); }
.matrix-legend {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  font-style: italic;
}

.org-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.org-pros, .org-cons {
  background: var(--bg-elevated);
  padding: 14px 16px;
  border-radius: 10px;
}
.org-pc-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.org-pc-label.good { color: var(--good); }
.org-pc-label.bad { color: var(--bad); }
.org-pros ul, .org-cons ul {
  margin: 0;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.org-pros li, .org-cons li { margin-bottom: 4px; }
.org-when {
  background: var(--accent-soft);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--accent);
  line-height: 1.5;
}
.org-when strong { color: #312e81; }

.org-subtype {
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.org-subtype.highlight {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-card) 100%);
  border-color: rgba(79, 70, 229, 0.25);
}
.org-subtype-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.org-subtype p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* === Glossary === */
.glossary-controls {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.glossary-search {
  margin-bottom: 12px;
}
.cat-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cat-pill {
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid var(--line-2);
  background: var(--bg-elevated);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.12s;
}
.cat-pill:hover { border-color: var(--ink-3); }
.cat-pill.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.glossary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.glossary-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.glossary-item[open] {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.glossary-item summary {
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.glossary-item summary::-webkit-details-marker { display: none; }
.g-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.g-term {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.g-cat {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 50px;
  font-weight: 600;
}
.g-def {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.g-example {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.g-example-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  padding-top: 2px;
}

/* === Quiz === */
.quiz-result {
  background: linear-gradient(135deg, #ecfdf5 0%, var(--bg-card) 100%);
  border: 2px solid var(--good);
  border-radius: var(--r-xl);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}
.quiz-result.fail {
  background: linear-gradient(135deg, #fef2f2 0%, var(--bg-card) 100%);
  border-color: var(--bad);
}
.quiz-result-num {
  font-family: var(--display);
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--good);
}
.quiz-result.fail .quiz-result-num { color: var(--bad); }
.quiz-result-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.quiz-result-sub {
  font-size: 13.5px;
  color: var(--ink-2);
}

.quiz-progress-bar-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  margin-bottom: 18px;
  position: sticky;
  top: 12px;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
}
/* Bottom variant — not sticky, just sits at the end of the questions */
.quiz-progress-bar-card.quiz-progress-bottom {
  position: static;
  margin-top: 24px;
  margin-bottom: 24px;
}

.quiz-questions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quiz-q {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.quiz-q.q-correct { border-color: rgba(16, 185, 129, 0.4); }
.quiz-q.q-incorrect { border-color: rgba(239, 68, 68, 0.4); }
.quiz-q-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}
.quiz-q-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}
.quiz-q-text {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.quiz-q-mark {
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}
.quiz-q-mark.ok { color: var(--good); }
.quiz-q-mark.bad { color: var(--bad); }

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.quiz-opt {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.12s;
}
.quiz-opt:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.quiz-opt.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.quiz-opt.correct {
  border-color: var(--good);
  background: var(--good-soft);
  color: #047857;
}
.quiz-opt.incorrect {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: #b91c1c;
}
.quiz-opt:disabled { cursor: default; }
.quiz-opt-letter {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 1.5px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}
.quiz-opt.selected .quiz-opt-letter,
.quiz-opt.correct .quiz-opt-letter,
.quiz-opt.incorrect .quiz-opt-letter {
  background: currentColor;
  color: white;
  border-color: currentColor;
}
.quiz-opt-mark { color: var(--good); font-weight: 700; }

.quiz-explain {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.quiz-explain strong { color: var(--accent); }

@media (max-width: 1100px) {
  .lesson-grid { grid-template-columns: 1fr; }
  .orgs-compare { grid-template-columns: 1fr; }
  .eis-wrap { grid-template-columns: 1fr; }
  .eis-pool { position: static; }
  .def-detail { grid-template-columns: 1fr; }
}


/* ============================================================
   Hero title — new "construind" highlight + dark mode + Options
   ============================================================ */

.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 62px;
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 18px 0 22px;
  color: var(--ink);
}
.hero-title .hl {
  position: relative;
  display: inline-block;
  color: var(--accent);
  font-style: italic;
  font-weight: 700;
  padding: 0 2px;
}
.hero-title .hl-underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  width: 100%;
  height: 14px;
  color: var(--accent-2);
  pointer-events: none;
}
/* override the old gradient text-fill from .landing-hero h1 em */
.landing-hero h1.hero-title em { all: revert; }

/* Options button at bottom of sidebar */
.options-btn {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: #c5cae0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
}
.options-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f5f6fc;
}
.options-btn .gear {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
}
.options-btn .gear::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
}
.options-btn .chevron {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.7;
}

.options-panel {
  margin-top: 8px;
  background: #14182a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  animation: optionsSlide 0.2s ease-out;
}
@keyframes optionsSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.options-label {
  font-size: 12px;
  font-weight: 600;
  color: #c5cae0;
}
.theme-segment {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.theme-segment button {
  background: transparent;
  border: 0;
  color: #8a91b0;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s;
}
.theme-segment button:hover { color: #f5f6fc; }
.theme-segment button.active {
  background: #4f46e5;
  color: white;
  box-shadow: 0 2px 6px -2px rgba(79, 70, 229, 0.6);
}
.theme-segment .ico {
  width: 12px; height: 12px;
  display: inline-block;
  border-radius: 50%;
}
.theme-segment .ico.sun { background: #fbbf24; box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.25); }
.theme-segment .ico.moon {
  background: #1e293b;
  position: relative;
  border: 1px solid #475569;
}
.theme-segment .ico.moon::after {
  content: "";
  position: absolute;
  top: -1px; right: 1px;
  width: 7px; height: 7px;
  background: var(--bg-card, #fff);
  border-radius: 50%;
}

/* ============================================================
   DARK MODE — token overrides
   ============================================================ */

:root[data-theme="dark"] {
  --bg: #0a0e1c;
  --bg-card: #14182a;
  --bg-elevated: #1a1f33;
  --ink: #f5f6fc;
  --ink-2: #c5cae0;
  --ink-3: #8a91b0;
  --ink-4: #5c6480;
  --line: #252a40;
  --line-2: #353b54;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.15);
  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.15);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] body {
  background-image:
    radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(255, 122, 89, 0.05) 0px, transparent 50%);
}

/* Adjust gradients/colored backgrounds that don't auto-flip */
:root[data-theme="dark"] .swot-quadrant.s { background: linear-gradient(180deg, rgba(52, 211, 153, 0.2) 0%, var(--bg-card) 60%); }
:root[data-theme="dark"] .swot-quadrant.w { background: linear-gradient(180deg, rgba(248, 113, 113, 0.2) 0%, var(--bg-card) 60%); }
:root[data-theme="dark"] .swot-quadrant.o { background: linear-gradient(180deg, rgba(129, 140, 248, 0.2) 0%, var(--bg-card) 60%); }
:root[data-theme="dark"] .swot-quadrant.t { background: linear-gradient(180deg, rgba(251, 191, 36, 0.2) 0%, var(--bg-card) 60%); }
:root[data-theme="dark"] .swot-item { background: var(--bg-elevated); }

:root[data-theme="dark"] .eis-q1 { background: linear-gradient(135deg, rgba(248, 113, 113, 0.25) 0%, rgba(248, 113, 113, 0.1) 100%); }
:root[data-theme="dark"] .eis-q2 { background: linear-gradient(135deg, rgba(129, 140, 248, 0.25) 0%, rgba(129, 140, 248, 0.1) 100%); }
:root[data-theme="dark"] .eis-q3 { background: linear-gradient(135deg, rgba(251, 146, 60, 0.25) 0%, rgba(251, 146, 60, 0.1) 100%); }
:root[data-theme="dark"] .eis-q4 { background: linear-gradient(135deg, rgba(148, 163, 184, 0.25) 0%, rgba(148, 163, 184, 0.1) 100%); }
:root[data-theme="dark"] .eis-q1 .eis-q-label { color: #fca5a5; }
:root[data-theme="dark"] .eis-q2 .eis-q-label { color: #c7d2fe; }
:root[data-theme="dark"] .eis-q3 .eis-q-label { color: #fed7aa; }
:root[data-theme="dark"] .eis-q4 .eis-q-label { color: #cbd5e1; }
:root[data-theme="dark"] .eis-task { background: var(--bg-elevated); color: var(--ink); }
:root[data-theme="dark"] .eis-mini-tag.eis-q1 { background: rgba(248, 113, 113, 0.2); color: #fca5a5; }
:root[data-theme="dark"] .eis-mini-tag.eis-q2 { background: rgba(129, 140, 248, 0.2); color: #c7d2fe; }
:root[data-theme="dark"] .eis-mini-tag.eis-q3 { background: rgba(251, 146, 60, 0.2); color: #fed7aa; }
:root[data-theme="dark"] .eis-mini-tag.eis-q4 { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

:root[data-theme="dark"] .lesson { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%); }
:root[data-theme="dark"] .lesson-card.done { background: linear-gradient(135deg, rgba(52, 211, 153, 0.15) 0%, var(--bg-card) 100%); }
:root[data-theme="dark"] .m1-progress-card { background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.15) 100%); }

:root[data-theme="dark"] .quiz-result {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15) 0%, var(--bg-card) 100%);
}
:root[data-theme="dark"] .quiz-result.fail {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.15) 0%, var(--bg-card) 100%);
}
:root[data-theme="dark"] .quiz-opt { background: var(--bg-elevated); }
:root[data-theme="dark"] .quiz-opt-letter { background: var(--bg-card); color: var(--ink-3); }
:root[data-theme="dark"] .quiz-opt.correct { background: rgba(52, 211, 153, 0.15); color: #34d399; }
:root[data-theme="dark"] .quiz-opt.incorrect { background: rgba(248, 113, 113, 0.15); color: #f87171; }

:root[data-theme="dark"] .def-card { background: var(--bg-card); }
:root[data-theme="dark"] .def-counter { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
:root[data-theme="dark"] .def-counter-label { color: #fbbf24; }
:root[data-theme="dark"] .def-counter-text { color: #fde68a; }
:root[data-theme="dark"] .def-example { background: rgba(129, 140, 248, 0.15); }

:root[data-theme="dark"] .org-box { background: var(--bg-elevated); color: var(--ink-2); }
:root[data-theme="dark"] .org-box.ceo { background: #1a1f33; color: var(--ink); }
:root[data-theme="dark"] .org-box.manager { background: rgba(99, 102, 241, 0.2); color: #c7d2fe; border-color: rgba(129, 140, 248, 0.3); }
:root[data-theme="dark"] .org-diagram { background: rgba(0,0,0,0.2); }
:root[data-theme="dark"] .matrix-cell, :root[data-theme="dark"] .matrix-row-label { background: var(--bg-elevated); }
:root[data-theme="dark"] .org-pros, :root[data-theme="dark"] .org-cons { background: rgba(0,0,0,0.2); }
:root[data-theme="dark"] .org-when { background: rgba(129, 140, 248, 0.15); color: #c7d2fe; }
:root[data-theme="dark"] .org-when strong { color: #e0e7ff; }
:root[data-theme="dark"] .org-subtype { background: var(--bg-elevated); }
:root[data-theme="dark"] .org-subtype.highlight { background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, var(--bg-card) 100%); }

:root[data-theme="dark"] .banner-warn {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}
:root[data-theme="dark"] .banner-warn::before { background: #fbbf24; color: #14182a; }

:root[data-theme="dark"] .m1-cta { background: linear-gradient(135deg, #0c0f1f 0%, #1e1b4b 50%, #312e81 100%); }
:root[data-theme="dark"] .m1-cta .btn.primary { background: var(--accent); color: #14182a; }

:root[data-theme="dark"] .preview-doc {
  background: var(--bg-elevated);
  color: var(--ink);
}

:root[data-theme="dark"] .b2b-card { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%); }

:root[data-theme="dark"] .price-card.featured { border-color: var(--accent); }
:root[data-theme="dark"] .price-badge { background: var(--accent); color: #14182a; }

:root[data-theme="dark"] .pert-canvas-wrap {
  background:
    linear-gradient(var(--bg-elevated), var(--bg-elevated)),
    radial-gradient(circle at 20px 20px, var(--line) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px;
}
:root[data-theme="dark"] .pert-canvas rect[fill="#ffffff"] { fill: var(--bg-elevated); }
:root[data-theme="dark"] .pert-canvas text { fill: var(--ink-2) !important; }
:root[data-theme="dark"] .pert-canvas text[fill="#0a0e1c"] { fill: var(--ink) !important; }

:root[data-theme="dark"] .compare-table { background: var(--bg-card); }
:root[data-theme="dark"] .compare-row.compare-head { background: var(--bg-elevated); }

:root[data-theme="dark"] .module-card.active {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-card) 100%);
}

:root[data-theme="dark"] .feature-item:hover {
  background: var(--bg-elevated);
}

:root[data-theme="dark"] input.txt, 
:root[data-theme="dark"] textarea.txt, 
:root[data-theme="dark"] select.txt {
  background: var(--bg-elevated);
  color: var(--ink);
  border-color: var(--line-2);
}
:root[data-theme="dark"] input.txt:focus,
:root[data-theme="dark"] textarea.txt:focus { box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2); }

:root[data-theme="dark"] .swot-input input,
:root[data-theme="dark"] .eis-add input { background: var(--bg-elevated); color: var(--ink); border-color: var(--line-2); }

:root[data-theme="dark"] .btn { background: var(--accent); color: #0a0e1c; }
:root[data-theme="dark"] .btn:hover { background: var(--accent-hover); }
:root[data-theme="dark"] .btn.primary { background: var(--accent); color: #0a0e1c; }
:root[data-theme="dark"] .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
:root[data-theme="dark"] .btn.ghost:hover { background: var(--bg-elevated); }
:root[data-theme="dark"] .btn.icon { background: var(--bg-elevated); border-color: var(--line-2); color: var(--ink-2); }
:root[data-theme="dark"] .btn.danger { background: transparent; color: var(--bad); }

:root[data-theme="dark"] .strength { background: var(--bg-card); }
:root[data-theme="dark"] .strength::before { background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, transparent 50%); }
:root[data-theme="dark"] .strength-num { color: var(--accent); }

:root[data-theme="dark"] .glossary-item[open] { box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
:root[data-theme="dark"] .g-cat { background: rgba(129, 140, 248, 0.2); color: #c7d2fe; }

:root[data-theme="dark"] .nav-sub { border-left-color: rgba(255, 255, 255, 0.1); }


/* ============================================================
   PHASE 3 — Module 3 Simulator
   ============================================================ */

.m3-resume-banner {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(79, 70, 229, 0.25);
  border-radius: var(--r-xl);
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

/* === Scenario cards === */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}
.scenario-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
}
.scenario-indigo::before { background: linear-gradient(90deg, #4f46e5 0%, #818cf8 100%); }
.scenario-coral::before { background: linear-gradient(90deg, #ff7a59 0%, #fbbf24 100%); }
.scenario-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.scenario-icon {
  font-size: 36px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.scenario-coral .scenario-icon { color: var(--accent-2); }
.scenario-difficulty {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 4px;
}
.diff-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line-2);
}
.diff-dot.on { background: var(--accent); }
.scenario-coral .diff-dot.on { background: var(--accent-2); }
.scenario-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 4px 0;
}
.scenario-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.scenario-blurb {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0 0 14px;
}
.scenario-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.scenario-stats > div {
  text-align: center;
  display: flex;
  flex-direction: column;
}
.scenario-stats strong {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.scenario-stats span {
  font-size: 10.5px;
  color: var(--ink-3);
  font-family: var(--mono);
}
.scenario-cta {
  margin-top: auto;
  justify-content: center;
}

/* === Sim Dashboard (KPIs) === */
.sim-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  position: sticky;
  top: 12px;
  z-index: 10;
  background: var(--bg);
  padding: 10px 0;
}
.stat-bar {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}
.stat-bar.danger {
  border-color: var(--bad);
  background: linear-gradient(135deg, var(--bad-soft) 0%, var(--bg-card) 100%);
}
.stat-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.stat-bar-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}
.stat-bar-value {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-feature-settings: "tnum" 1;
}
.stat-bar-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-indigo { background: linear-gradient(90deg, #4f46e5 0%, #818cf8 100%); }
.stat-coral { background: linear-gradient(90deg, #ff7a59 0%, #fbbf24 100%); }
.stat-good { background: linear-gradient(90deg, #10b981 0%, #34d399 100%); }
.stat-purple { background: linear-gradient(90deg, #a855f7 0%, #c084fc 100%); }
.stat-bar.danger .stat-bar-fill {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

/* === Sim event card === */
.sim-event {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px 36px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  animation: simSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes simSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.sim-event-head {
  margin-bottom: 14px;
}
.sim-event-day {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.sim-event-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.1;
}
.sim-event-context {
  font-size: 15.5px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 70ch;
}

.sim-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sim-choice {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}
.sim-choice:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
}
.sim-choice.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.sim-choice.dimmed { opacity: 0.45; }
.sim-choice:disabled { cursor: default; }
.sim-choice-letter {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
}
.sim-choice.selected .sim-choice-letter {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.sim-choice-label {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: var(--ink);
}
.sim-choice-blurb {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.sim-choice-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.fx {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 50px;
}
.fx.good { background: var(--good-soft); color: #047857; }
.fx.bad { background: var(--bad-soft); color: #b91c1c; }

.sim-feedback {
  margin-top: 20px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sim-feedback-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.sim-feedback-text {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.55;
}
.sim-feedback .btn { align-self: flex-end; }

/* === Sim history === */
.sim-history {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.sim-history summary {
  padding: 14px 20px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
  list-style: none;
}
.sim-history summary::-webkit-details-marker { display: none; }
.sim-history[open] summary {
  border-bottom: 1px solid var(--line);
}
.sim-history-list {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sim-history-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
}
.sim-history-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  padding-top: 2px;
}
.sim-history-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.sim-history-choice {
  font-size: 12.5px;
  color: var(--accent);
  font-family: var(--mono);
}

/* === Report === */
.report-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 28px 32px;
  border-radius: var(--r-xl);
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}
.report-good { background: linear-gradient(135deg, #ecfdf5 0%, var(--bg-card) 60%); border: 2px solid var(--good); }
.report-info { background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-card) 60%); border: 2px solid var(--accent); }
.report-warn { background: linear-gradient(135deg, var(--warn-soft) 0%, var(--bg-card) 60%); border: 2px solid var(--warn); }
.report-bad { background: linear-gradient(135deg, var(--bad-soft) 0%, var(--bg-card) 60%); border: 2px solid var(--bad); }

.report-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.report-score-num {
  font-family: var(--display);
  font-size: 96px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--ink);
}
.report-good .report-score-num { color: var(--good); }
.report-info .report-score-num { color: var(--accent); }
.report-warn .report-score-num { color: var(--warn); }
.report-bad .report-score-num { color: var(--bad); }
.report-score-max {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink-3);
}

.report-grade-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 6px;
}
.report-grade-val {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.report-stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.report-stat-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 8px;
}
.report-stat-val {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.report-stat-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* === AI report === */
.ai-loading {
  text-align: center;
  padding: 30px 0;
  color: var(--ink-3);
}
.ai-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.ai-report {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 12px;
  padding: 22px 26px;
}
.ai-report p {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}
.ai-report p:last-child { margin-bottom: 0; }

/* === Report history === */
.report-history {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.report-history-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.report-history-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  width: 32px; height: 32px;
  background: white;
  border: 1.5px solid var(--accent-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.report-history-event {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}
.report-history-choice {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}
.report-history-feedback {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 8px;
  font-style: italic;
}
.report-history-fx {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Dark mode adjustments */
:root[data-theme="dark"] .scenario-card { background: var(--bg-card); }
:root[data-theme="dark"] .sim-event { background: var(--bg-card); }
:root[data-theme="dark"] .stat-bar { background: var(--bg-card); }
:root[data-theme="dark"] .sim-choice { background: var(--bg-elevated); }
:root[data-theme="dark"] .sim-choice-letter { background: var(--bg-card); }
:root[data-theme="dark"] .sim-feedback { background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, var(--bg-card) 100%); }
:root[data-theme="dark"] .ai-report { background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, var(--bg-card) 100%); }
:root[data-theme="dark"] .report-history-item { background: var(--bg-elevated); }
:root[data-theme="dark"] .report-history-num { background: var(--bg-card); }
:root[data-theme="dark"] .report-good { background: linear-gradient(135deg, rgba(52, 211, 153, 0.15) 0%, var(--bg-card) 60%); }
:root[data-theme="dark"] .report-info { background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, var(--bg-card) 60%); }
:root[data-theme="dark"] .report-warn { background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, var(--bg-card) 60%); }
:root[data-theme="dark"] .report-bad { background: linear-gradient(135deg, rgba(248, 113, 113, 0.15) 0%, var(--bg-card) 60%); }
:root[data-theme="dark"] .fx.good { background: rgba(52, 211, 153, 0.2); color: #34d399; }
:root[data-theme="dark"] .fx.bad { background: rgba(248, 113, 113, 0.2); color: #f87171; }
:root[data-theme="dark"] .sim-dashboard { background: var(--bg); }

@media (max-width: 1100px) {
  .scenarios-grid { grid-template-columns: 1fr; }
  .sim-dashboard { grid-template-columns: 1fr 1fr; }
  .report-stats { grid-template-columns: 1fr 1fr; }
  .report-header { grid-template-columns: 1fr; text-align: center; }
}


/* ============================================================
   PHASE 4 — Module 4: Gamification, Mock Exam, Certificate
   ============================================================ */

/* === Markdown light styling (AI report) === */
.ai-report .md-numbered {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
}
.ai-report .md-num {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  background: white;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(79, 70, 229, 0.2);
}

/* === Theme segment SVG sizing === */
.theme-segment button svg { flex-shrink: 0; }

/* === Profile card === */
.profile-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4f46e5 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  box-shadow: var(--shadow-pop);
  position: relative;
  overflow: hidden;
}
.profile-card::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(255, 122, 89, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.profile-rank {
  width: 80px; height: 80px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.profile-rank-num {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}
.profile-info { position: relative; z-index: 1; }
.profile-name {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 10px;
}
.profile-xp-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.profile-xp-row span { color: #c7cffc !important; }
.profile-xp-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  overflow: hidden;
}
.profile-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24 0%, #ff7a59 50%, #fbbf24 100%);
  border-radius: 50px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

/* === Module progress strips === */
.m4-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.m4-prog-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.m4-prog-card.mock {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-card) 100%);
  border-color: rgba(79, 70, 229, 0.2);
}
.m4-prog-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.m4-prog-code {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 7px;
  border-radius: 4px;
}
.m4-prog-name {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
}
.m4-prog-val {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.m4-prog-bar {
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}
.m4-prog-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 4px;
  transition: width 0.5s;
}
.m4-prog-cta {
  margin-top: 4px;
  justify-content: center;
}

/* === Badges grid === */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.badge {
  background: var(--bg-elevated);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 20px 16px 18px;
  text-align: center;
  position: relative;
  transition: all 0.2s;
}
.badge.earned {
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}
.badge.earned:hover { transform: translateY(-2px); }
.badge.locked { opacity: 0.45; filter: grayscale(60%); }
.badge-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 10px;
  color: var(--ink-4);
}
.badge.earned.tier-bronze .badge-icon { color: #b45309; text-shadow: 0 0 14px rgba(217, 119, 6, 0.3); }
.badge.earned.tier-silver .badge-icon { color: #4f46e5; text-shadow: 0 0 14px rgba(79, 70, 229, 0.3); }
.badge.earned.tier-gold .badge-icon { color: #d97706; text-shadow: 0 0 18px rgba(251, 191, 36, 0.5); }
.badge.earned.tier-platinum .badge-icon { color: #a855f7; text-shadow: 0 0 20px rgba(168, 85, 247, 0.5); }
.badge.earned {
  border-color: transparent;
}
.badge.earned.tier-bronze { border-color: rgba(217, 119, 6, 0.3); background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, var(--bg-card) 100%); }
.badge.earned.tier-silver { border-color: rgba(79, 70, 229, 0.3); background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, var(--bg-card) 100%); }
.badge.earned.tier-gold { border-color: rgba(251, 191, 36, 0.4); background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, var(--bg-card) 100%); }
.badge.earned.tier-platinum { border-color: rgba(168, 85, 247, 0.4); background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, var(--bg-card) 100%); }
.badge-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.badge-desc {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.4;
}
.badge-tier-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 50px;
}
.badge.tier-bronze .badge-tier-tag { background: rgba(180, 83, 9, 0.15); color: #b45309; }
.badge.tier-silver .badge-tier-tag { background: rgba(79, 70, 229, 0.15); color: #4f46e5; }
.badge.tier-gold .badge-tier-tag { background: rgba(217, 119, 6, 0.18); color: #b45309; }
.badge.tier-platinum .badge-tier-tag { background: rgba(168, 85, 247, 0.18); color: #a855f7; }

/* === Certificate criteria === */
.cert-criteria {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cert-crit {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-2);
}
.cert-crit.done {
  background: var(--good-soft);
  color: #064e3b;
}
.cert-check {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-4);
  text-align: center;
}
.cert-crit.done .cert-check { color: var(--good); }
.cert-status {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.cert-crit.done .cert-status { color: var(--good); }

/* === Exam prep === */
.exam-prep-card {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--r-xl);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.exam-start-btn { padding: 14px 26px; font-size: 15px; }
.exam-prev {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}
.exam-prev-score {
  font-family: var(--display);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

/* === Exam in progress: bar === */
.exam-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 14px 0;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.exam-bar-progress {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.exam-bar-fill { display: flex; align-items: center; }
.exam-timer {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  padding: 10px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-feature-settings: "tnum" 1;
}
.exam-timer.danger {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: #b91c1c;
  animation: pulseDanger 1s ease-in-out infinite;
}
@keyframes pulseDanger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.exam-timer-icon { font-size: 14px; }

/* === Exam question card === */
.exam-question-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px 36px;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}
.exam-q-text {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0 0 22px;
}
.exam-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* === Exam nav dots === */
.exam-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-top: 14px;
}
.exam-nav-dots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.exam-dot {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--line-2);
  background: var(--bg-elevated);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.exam-dot:hover { border-color: var(--accent); color: var(--accent); }
.exam-dot.answered {
  background: var(--good-soft);
  border-color: var(--good);
  color: var(--good);
}
.exam-dot.current {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* === Exam results === */
.exam-result {
  background: linear-gradient(135deg, #ecfdf5 0%, var(--bg-card) 100%);
  border: 2px solid var(--good);
  border-radius: var(--r-xl);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}
.exam-result.fail {
  background: linear-gradient(135deg, #fef2f2 0%, var(--bg-card) 100%);
  border-color: var(--bad);
}
.exam-result.distinction {
  background: linear-gradient(135deg, #fef3c7 0%, var(--bg-card) 100%);
  border-color: #d97706;
}
.exam-result-num {
  font-family: var(--display);
  font-size: 96px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--good);
}
.exam-result.fail .exam-result-num { color: var(--bad); }
.exam-result.distinction .exam-result-num { color: #d97706; }
.exam-result-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.exam-result-sub {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

.exam-cats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.exam-cat-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.exam-cat-name {
  font-size: 13px;
  font-weight: 600;
}
.exam-cat-score {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}
.exam-cat-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}
.exam-cat-bar > div {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s;
}

.exam-review {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exam-rev-item {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.exam-rev-item.ok { border-left: 4px solid var(--good); }
.exam-rev-item.bad { border-left: 4px solid var(--bad); }
.exam-rev-item summary {
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}
.exam-rev-item summary::-webkit-details-marker { display: none; }
.exam-rev-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 8px;
  border-radius: 5px;
}
.exam-rev-q {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
}
.exam-rev-mark {
  font-size: 18px;
  font-weight: 700;
}
.exam-rev-item.ok .exam-rev-mark { color: var(--good); }
.exam-rev-item.bad .exam-rev-mark { color: var(--bad); }
.exam-rev-body {
  padding: 14px 18px;
  background: var(--bg-card);
  border-top: 1px solid var(--line);
}
.exam-rev-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-elevated);
}
.exam-rev-opt.correct { background: var(--good-soft); }
.exam-rev-opt.incorrect { background: var(--bad-soft); }
.exam-rev-letter {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  color: var(--ink-3);
}
.exam-rev-explain {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* === Certificate === */
.cert-locked {
  text-align: center;
  padding: 50px 40px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}
.cert-locked-icon { font-size: 56px; }

.cert-prep {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: end;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}
.cert-prep-row { flex: 1; }

.cert-doc {
  background:
    linear-gradient(135deg, #fefce8 0%, #fff9db 100%),
    repeating-linear-gradient(45deg, transparent, transparent 60px, rgba(180, 83, 9, 0.03) 60px, rgba(180, 83, 9, 0.03) 62px);
  border: 1px solid #d4a373;
  outline: 1px solid #d4a373;
  outline-offset: 6px;
  border-radius: 4px;
  padding: 60px 80px;
  position: relative;
  margin-bottom: 24px;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,0.18);
  color: #3f2e0e;
  font-family: "Georgia", "Times New Roman", serif;
  text-align: center;
  min-height: 600px;
}
.cert-corner {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 2px solid #b45309;
}
.cert-tl { top: 16px; left: 16px; border-right: 0; border-bottom: 0; }
.cert-tr { top: 16px; right: 16px; border-left: 0; border-bottom: 0; }
.cert-bl { bottom: 16px; left: 16px; border-right: 0; border-top: 0; }
.cert-br { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }
.cert-seal {
  position: absolute;
  top: 40px;
  right: 60px;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, #d97706 0%, #b45309 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.35), inset 0 -4px 0 rgba(0,0,0,0.15);
}
.cert-seal-inner {
  width: 72px;
  height: 72px;
  border: 2px solid #fef3c7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cert-seal-text {
  font-family: "Georgia", serif;
  font-size: 13px;
  font-weight: 700;
  color: #fef3c7;
  text-align: center;
  letter-spacing: 0.05em;
  line-height: 1.1;
}
.cert-header {
  margin-bottom: 30px;
}
.cert-eyebrow {
  font-family: "Georgia", serif;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #92400e;
}
.cert-title {
  font-family: "Georgia", serif;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #3f2e0e;
  margin: 0 0 30px;
  font-style: italic;
}
.cert-line {
  font-size: 14px;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  color: #6b4f1a;
}
.cert-name {
  font-family: "Brush Script MT", "Lucida Handwriting", "Snell Roundhand", cursive;
  font-size: 56px;
  color: #3f2e0e;
  margin: 14px 0 26px;
  font-weight: 400;
  border-bottom: 2px solid #b45309;
  padding-bottom: 14px;
  display: inline-block;
  min-width: 60%;
}
.cert-body {
  font-size: 15px;
  line-height: 1.7;
  color: #3f2e0e;
  margin: 0 auto 36px;
  max-width: 60ch;
}
.cert-body strong { color: #92400e; font-weight: 700; }
.cert-meta {
  display: flex;
  justify-content: space-around;
  margin: 36px 0 32px;
  gap: 24px;
}
.cert-meta-block { text-align: center; }
.cert-meta-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #92400e;
  margin-bottom: 4px;
}
.cert-meta-val {
  font-size: 14px;
  font-weight: 700;
  color: #3f2e0e;
  font-family: "Georgia", serif;
}
.cert-signature {
  margin-top: 36px;
  display: inline-block;
}
.cert-sig-line {
  width: 240px;
  border-top: 1.5px solid #3f2e0e;
  margin: 0 auto 6px;
}
.cert-sig-label {
  font-family: "Georgia", serif;
  font-size: 12px;
  color: #3f2e0e;
  font-weight: 700;
}
.cert-sig-label span {
  font-weight: 400;
  font-style: italic;
  color: #6b4f1a;
}
.cert-footer {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px dashed #d4a373;
  font-size: 11px;
  color: #6b4f1a;
  font-style: italic;
  line-height: 1.5;
}

/* Print certificate */
@media print {
  body { background: white; }
  .sidebar, .main-head, .cert-prep, .foot-actions, .crumb, .section-meta { display: none !important; }
  .main { padding: 0 !important; max-width: none !important; }
  .cert-doc {
    box-shadow: none;
    margin: 0;
    page-break-inside: avoid;
  }
}

/* Dark mode adjustments */
:root[data-theme="dark"] .badge { background: var(--bg-elevated); }
:root[data-theme="dark"] .badge.earned { background: var(--bg-card); }
:root[data-theme="dark"] .m4-prog-card { background: var(--bg-card); }
:root[data-theme="dark"] .m4-prog-bar { background: var(--bg-elevated); }
:root[data-theme="dark"] .exam-question-card { background: var(--bg-card); }
:root[data-theme="dark"] .exam-bar { background: var(--bg); }
:root[data-theme="dark"] .exam-timer { background: var(--bg-card); }
:root[data-theme="dark"] .exam-nav { background: var(--bg-card); }
:root[data-theme="dark"] .exam-rev-item { background: var(--bg-elevated); }
:root[data-theme="dark"] .exam-rev-body { background: var(--bg-card); }
:root[data-theme="dark"] .exam-rev-opt { background: var(--bg-card); }
:root[data-theme="dark"] .cert-crit { background: var(--bg-elevated); }
:root[data-theme="dark"] .cert-crit.done { background: rgba(52, 211, 153, 0.15); color: #34d399; }
:root[data-theme="dark"] .cert-prep { background: var(--bg-card); }
:root[data-theme="dark"] .exam-prev-score { color: var(--accent); }
:root[data-theme="dark"] .exam-prep-card { background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, var(--bg-card) 100%); }
:root[data-theme="dark"] .exam-result { background: linear-gradient(135deg, rgba(52, 211, 153, 0.15) 0%, var(--bg-card) 100%); }
:root[data-theme="dark"] .exam-result.fail { background: linear-gradient(135deg, rgba(248, 113, 113, 0.15) 0%, var(--bg-card) 100%); }
:root[data-theme="dark"] .exam-result.distinction { background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, var(--bg-card) 100%); }
:root[data-theme="dark"] .exam-result-num { color: #34d399; }
:root[data-theme="dark"] .exam-result.fail .exam-result-num { color: #f87171; }
:root[data-theme="dark"] .exam-result.distinction .exam-result-num { color: #fbbf24; }
:root[data-theme="dark"] .ai-report .md-num { background: var(--bg-card); }

@media (max-width: 1100px) {
  .m4-progress-grid { grid-template-columns: 1fr 1fr; }
  .badges-grid { grid-template-columns: 1fr 1fr; }
  .cert-doc { padding: 40px 30px; }
  .cert-name { font-size: 40px; }
  .cert-title { font-size: 30px; }
  .exam-bar { grid-template-columns: 1fr; gap: 10px; }
  .exam-prep-card { grid-template-columns: 1fr; }
  .exam-result { grid-template-columns: 1fr; text-align: center; }
}


/* ============================================================
   RESPONSIVE — Sidebar collapse/expand + mobile drawer
   ============================================================ */

/* Base app already grid 280px + 1fr — extend it */
.app {
  --sidebar-w: 270px;
  --sidebar-collapsed-w: 64px;
  grid-template-columns: var(--sidebar-w) 1fr;
  transition: grid-template-columns 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.app.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-w) 1fr;
}

/* === Sidebar restructure === */
.sidebar {
  background: #0a0e1c;
  color: #e6e8f5;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  width: var(--sidebar-w);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 16px;
}
.sidebar.collapsed .sidebar-inner { padding: 20px 10px 14px; }

/* Top: brand + toggle */
.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 22px;
  position: relative;
}
.brand {
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  padding: 4px 0;
  flex: 1;
  min-width: 0;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #f5f6fc;
}
.brand-mark::before, .brand-mark::after { all: unset; }
.brand-mark-glyph {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #ff7a59 100%);
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.4);
}
.brand-mark-glyph::after {
  content: "";
  position: absolute;
  inset: 8px 8px auto auto;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.95);
}
.brand-mark-name { white-space: nowrap; }
.brand-sub {
  font-size: 11px;
  letter-spacing: 0;
  color: #8590b8;
  margin-top: 5px;
  margin-left: 38px;
  font-weight: 500;
}

/* Hide name+sub when collapsed (icon only) */
.sidebar.collapsed .brand-mark-name,
.sidebar.collapsed .brand-sub { display: none; }
.sidebar.collapsed .brand { display: flex; justify-content: center; }

/* Toggle button */
.sidebar-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c5cae0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  padding: 0;
}
.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.sidebar.collapsed .sidebar-toggle {
  position: absolute;
  right: -14px;
  top: 32px;
  background: #14182a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 5;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* === Nav === */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item, .nav-module {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
  color: #c5cae0;
  transition: all 0.15s;
  text-align: left;
  border: 0;
  background: transparent;
  width: 100%;
  font-family: inherit;
  font-weight: 500;
  min-height: 36px;
}
.nav-item:hover, .nav-module:hover { background: rgba(255, 255, 255, 0.05); color: #f5f6fc; }
.nav-item.active, .nav-module.expanded {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(79, 70, 229, 0.1) 100%);
  color: #f5f6fc;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.25);
}
.nav-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
}
.nav-item.active .nav-icon,
.nav-module.expanded .nav-icon { color: #a5acf0; }
.nav-label { white-space: nowrap; }

.nav-module-code {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #818cf8;
  font-weight: 700;
  min-width: 22px;
}
.nav-module-name {
  font-size: 13px;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-module-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7595;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}
.nav-module-tag.active-tag {
  background: #10b981;
  color: #022c1f;
  font-weight: 700;
}
.nav-module.soon { opacity: 0.78; }

.nav-section-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7595;
  margin: 18px 0 6px 4px;
  font-weight: 600;
}

/* Collapsed mode: hide labels, center icons */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-module-name,
.sidebar.collapsed .nav-module-tag,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-sub,
.sidebar.collapsed .m2-mini-progress,
.sidebar.collapsed .chevron,
.sidebar.collapsed .sidebar-note,
.sidebar.collapsed .options-panel { display: none; }

.sidebar.collapsed .nav-item,
.sidebar.collapsed .nav-module,
.sidebar.collapsed .options-btn {
  justify-content: center;
  padding: 11px 0;
}
.sidebar.collapsed .nav-module-code {
  display: block;
  font-size: 9px;
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: rgba(0,0,0,0.4);
  padding: 1px 4px;
  border-radius: 3px;
}
.sidebar.collapsed .nav-module-group { position: relative; }
.sidebar.collapsed .nav-module {
  position: relative;
  padding: 11px 4px;
}

/* Sub nav (expanded) */
.nav-sub {
  display: flex;
  flex-direction: column;
  margin: 2px 0 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 18px;
}
.nav-sub-item {
  display: grid;
  grid-template-columns: 24px 1fr 16px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin: 1px 0;
  cursor: pointer;
  border-radius: 5px;
  font-family: inherit;
  background: transparent;
  border: 0;
  color: #b8b0a0;
  text-align: left;
  font-size: 12px;
  width: 100%;
  transition: background 0.12s;
}
.nav-sub-item:hover { background: rgba(255, 255, 255, 0.05); color: #f5f6fc; }
.nav-sub-item.active { background: rgba(99, 102, 241, 0.18); color: #f5f6fc; }
.nav-sub-num { font-family: var(--mono); font-size: 10px; color: #8590b8; }
.nav-sub-item.active .nav-sub-num { color: #c7cffc; }
.nav-sub-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-check {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid #3a4060;
  display: inline-block;
}
.nav-item-check.done {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

/* === Flyout (hover when collapsed) === */
.nav-flyout {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  background: #14182a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  min-width: 230px;
  z-index: 100;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: flyoutIn 0.15s ease-out;
}
@keyframes flyoutIn {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}
.nav-flyout-head {
  font-family: var(--mono);
  font-size: 11px;
  color: #818cf8;
  font-weight: 700;
  padding: 6px 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.nav-flyout-head .nav-module-code {
  font-size: 10px;
  display: inline;
  position: static;
  background: rgba(99, 102, 241, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
}
.nav-flyout-head span:nth-child(2) {
  font-family: var(--display);
  font-size: 14px;
  color: #f5f6fc;
}

/* === M2 mini progress === */
.m2-mini-progress {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.m2-mini-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7595;
  margin-bottom: 6px;
  font-weight: 600;
}
.m2-mini-val {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: #f5f6fc;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

/* === Sidebar foot === */
.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-note {
  font-size: 11px;
  color: #6b7595;
  line-height: 1.55;
  margin-bottom: 12px;
}
.sidebar-note strong { color: #c5cae0; font-weight: 600; display: block; margin-bottom: 4px; }

.options-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #c5cae0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
  margin: 0;
}
.options-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f5f6fc;
}
.options-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
}
.options-btn .chevron {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.7;
}

/* === Mobile topbar (hidden on desktop) === */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 60;
  background: #0a0e1c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  align-items: center;
  gap: 14px;
}
.topbar-burger {
  background: transparent;
  border: 0;
  color: #f5f6fc;
  cursor: pointer;
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0;
}
.topbar-burger:hover { background: rgba(255, 255, 255, 0.06); }
.topbar-brand {
  background: transparent;
  border: 0;
  color: #f5f6fc;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.topbar-brand .brand-mark-glyph {
  width: 24px; height: 24px;
}

.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 45;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet portrait — auto collapse, narrower padding */
@media (max-width: 1100px) {
  .main { padding: 32px 32px 60px; }
  .lp-h2 { font-size: 28px; }
  .landing-hero { gap: 32px; }
  .landing-hero h1, .hero-title { font-size: 48px; }
  h1.section-title { font-size: 34px; }
}

/* Mobile + small tablet — drawer mode */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr;
  }
  .topbar { display: flex; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.4);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  /* In mobile drawer mode, treat as expanded regardless of collapsed state */
  .sidebar.collapsed {
    width: 280px !important;
  }
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-module-name,
  .sidebar.collapsed .nav-module-tag,
  .sidebar.collapsed .nav-section-label,
  .sidebar.collapsed .nav-sub,
  .sidebar.collapsed .m2-mini-progress,
  .sidebar.collapsed .chevron,
  .sidebar.collapsed .sidebar-note,
  .sidebar.collapsed .options-panel,
  .sidebar.collapsed .brand-mark-name,
  .sidebar.collapsed .brand-sub { display: revert !important; }
  .sidebar.collapsed .nav-item,
  .sidebar.collapsed .nav-module,
  .sidebar.collapsed .options-btn {
    justify-content: flex-start;
    padding: 9px 10px;
  }
  .sidebar.collapsed .sidebar-toggle { display: none; }

  .app.mobile-open .mobile-backdrop { display: block; }

  .main { padding: 24px 20px 60px; max-width: none; }

  .landing-hero { grid-template-columns: 1fr; gap: 28px; padding-bottom: 32px; margin-bottom: 36px; }
  .landing-hero h1, .hero-title { font-size: 38px; line-height: 1.05; }
  h1.section-title { font-size: 28px; }
  .lp-section { margin: 36px 0; }
  .lp-section-head { margin-bottom: 18px; }
  .lp-h2 { font-size: 24px; }
  .section-lede { font-size: 14.5px; }

  .strengths, .module-grid, .pricing-grid, .feature-grid,
  .tool-grid, .scenarios-grid, .badges-grid, .lesson-grid,
  .m4-progress-grid, .report-stats, .sim-dashboard,
  .orgs-compare { grid-template-columns: 1fr !important; gap: 12px; }

  .badges-grid { grid-template-columns: 1fr 1fr !important; }

  .b2b-card { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
  .compare-table { font-size: 12px; }
  .compare-row { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
  .compare-row.compare-head { display: none; }
  .compare-row > div:nth-child(1) { font-weight: 700; font-size: 14px; }

  .card { padding: 18px; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }

  /* SWOT — stack 1 col */
  .swot-grid { grid-template-columns: 1fr; }

  /* Eisenhower */
  .eis-wrap { grid-template-columns: 1fr; }
  .eis-pool { position: static; }
  .eis-grid { grid-template-columns: 1fr; min-height: auto; }

  /* PERT — scroll horizontally */
  .pert-canvas-wrap { padding: 4px; }
  .pert-table-head, .pert-row {
    grid-template-columns: 50px 1fr 60px;
    gap: 6px;
  }
  .pert-table-head > :nth-child(4),
  .pert-table-head > :nth-child(5),
  .pert-row > :nth-child(4),
  .pert-row > :nth-child(5) { display: none; }

  /* Sim event */
  .sim-event { padding: 22px 20px; }
  .sim-event-title { font-size: 22px; }
  .sim-choice { padding: 12px 14px; grid-template-columns: 28px 1fr; gap: 10px; }

  /* Exam */
  .exam-bar { grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 14px; }
  .exam-question-card { padding: 22px 20px; }
  .exam-q-text { font-size: 18px; }
  .exam-nav-dots { gap: 3px; }
  .exam-dot { width: 24px; height: 24px; font-size: 10px; }
  .exam-prep-card { grid-template-columns: 1fr; padding: 22px 20px; }
  .exam-result { grid-template-columns: 1fr; gap: 16px; text-align: center; padding: 22px 20px; }
  .exam-result-num { font-size: 64px; }

  /* Profile / M4 */
  .profile-card { padding: 22px 20px; grid-template-columns: 1fr; text-align: center; gap: 14px; }
  .profile-card .profile-rank { margin: 0 auto; }
  .profile-xp-row { flex-direction: column; gap: 4px; }

  /* Report header */
  .report-header { grid-template-columns: 1fr; gap: 16px; padding: 22px 20px; }
  .report-score-num { font-size: 64px; }
  .report-stats { grid-template-columns: 1fr 1fr; }

  /* Resume banner */
  .m3-resume-banner { grid-template-columns: 1fr; padding: 18px 20px; gap: 12px; }
  .m1-progress-card { grid-template-columns: 1fr; padding: 20px; gap: 16px; }
  .m1-cta { grid-template-columns: 1fr; padding: 22px 20px; gap: 16px; }

  /* Tabs */
  .def-tabs { gap: 4px; padding: 6px; }
  .def-tab { padding: 6px 8px; font-size: 12px; }
  .def-card { padding: 24px 22px; }
  .def-word { font-size: 28px; }
  .def-short { font-size: 18px; }
  .def-detail { grid-template-columns: 1fr; gap: 14px; }

  /* Org diagrams */
  .org-pros-cons { grid-template-columns: 1fr; }
  .matrix-grid { grid-template-columns: 80px 1fr 1fr 1fr; }
  .scenarios-grid { gap: 14px; }
  .scenario-card { padding: 22px 20px; }
  .scenario-stats { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Budget */
  .budget-summary { grid-template-columns: 1fr; }
  .budget-row { grid-template-columns: 24px 1fr 100px 28px; gap: 8px; padding: 10px 0; }
  .budget-row .range { display: none; }

  /* Gantt scroll */
  .gantt { min-width: 600px; }

  /* Certificate */
  .cert-doc { padding: 30px 20px; min-height: auto; }
  .cert-title { font-size: 28px; }
  .cert-name { font-size: 36px; min-width: 80%; }
  .cert-meta { flex-direction: column; gap: 14px; }
  .cert-seal { top: 16px; right: 16px; width: 56px; height: 56px; }
  .cert-seal-inner { width: 44px; height: 44px; }
  .cert-seal-text { font-size: 9px; }
}

/* Phone — even tighter */
@media (max-width: 560px) {
  .main { padding: 20px 14px 50px; }
  .landing-hero h1, .hero-title { font-size: 32px; }
  h1.section-title { font-size: 24px; }
  .lp-h2 { font-size: 22px; }
  .section-lede { font-size: 14px; }
  .card { padding: 16px 14px; border-radius: 12px; }
  .card-title { font-size: 17px; }

  .module-card { padding: 18px 16px; }
  .module-name { font-size: 20px; }
  .strength { padding: 18px 16px; }
  .strength h4 { font-size: 16px; }

  .price-card { padding: 22px 20px; }
  .price-amount { font-size: 34px; }

  .btn { padding: 10px 14px; font-size: 13px; }

  .swot-quadrant { padding: 16px 14px; min-height: 180px; }
  .swot-letter { font-size: 38px; }

  .eis-quadrant { padding: 14px; }
  .eis-q-label { font-size: 14px; }

  .badges-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .badge { padding: 16px 12px; }
  .badge-icon { font-size: 30px; }
  .badge-name { font-size: 13px; }
  .badge-desc { font-size: 11px; }

  .quiz-q { padding: 18px 16px; }
  .quiz-q-text { font-size: 16px; }
  .quiz-opt { padding: 10px 12px; font-size: 13px; }

  .report-stats { grid-template-columns: 1fr; }
  .report-stat-val { font-size: 26px; }

  .preview-doc { padding: 30px 20px; }

  /* Hide some heavy detailing on small screens */
  .scenario-stats { font-size: 12px; }
  .stat-bar-value { font-size: 15px; }
  .stat-bar-label { font-size: 10px; }

  .cert-title { font-size: 22px; }
  .cert-name { font-size: 28px; }
  .cert-body { font-size: 13px; }

  /* AI report */
  .ai-report .md-numbered { grid-template-columns: 28px 1fr; gap: 8px; }
  .ai-report .md-num { width: 28px; height: 28px; font-size: 16px; }
}

/* Dark mode adjustments for mobile bits */
:root[data-theme="dark"] .topbar { background: var(--bg-card); border-bottom-color: var(--line); }

/* Override old sidebar-related styles that may conflict */
.sidebar-foot strong { display: block; }


/* ============================================================
   FLUID RESPONSIVE OVERRIDES — clamp() typography + overflow safety
   These rules take precedence (defined last) and scale smoothly.
   ============================================================ */

/* No horizontal overflow EVER at body level */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Main column max width fluid */
.main {
  max-width: 100%;
  padding: clamp(16px, 4vw, 56px) clamp(14px, 4vw, 56px) clamp(40px, 8vw, 80px);
}

/* === Fluid typography === */
.landing-hero h1, .hero-title {
  font-size: clamp(30px, 6.2vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
h1.section-title {
  font-size: clamp(24px, 4.4vw, 42px);
  line-height: 1.08;
}
.lp-h2 {
  font-size: clamp(22px, 3.6vw, 36px);
}
.section-lede, .landing-hero p.lede {
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.6;
}
.card-title { font-size: clamp(16px, 2vw, 20px); }
.module-name, .scenario-title { font-size: clamp(18px, 2.4vw, 24px); }
.profile-name { font-size: clamp(22px, 3.2vw, 30px); }
.budget-stat-val, .report-stat-val, .stat-bar-value {
  font-size: clamp(20px, 2.8vw, 32px);
}
.exam-result-num, .report-score-num {
  font-size: clamp(54px, 9vw, 96px);
}
.def-word { font-size: clamp(24px, 4vw, 36px); }
.def-short { font-size: clamp(16px, 2.2vw, 22px); }
.sim-event-title { font-size: clamp(20px, 3vw, 28px); }
.sim-event-context { font-size: clamp(14px, 1.6vw, 15.5px); }

/* === Grids that adapt with auto-fit instead of fixed columns === */
.strengths {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.module-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.lesson-grid, .scenarios-grid, .pricing-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.badges-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 45%), 1fr));
}
.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.m4-progress-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}
.sim-dashboard {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 45%), 1fr));
}
.report-stats {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 45%), 1fr));
}
.budget-summary {
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}
.orgs-compare {
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
}

/* Landing hero — only side-by-side when there's room */
.landing-hero {
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 56px);
}
@media (min-width: 900px) {
  .landing-hero { grid-template-columns: 1.2fr 1fr; }
}

/* === Overflow safety on common containers === */
.card, .module-card, .strength, .lesson-card, .scenario-card,
.tool-card, .price-card, .budget-stat, .stat-bar,
.profile-card, .badge, .quiz-q, .sim-event,
.exam-question-card, .exam-result, .report-header,
.def-card, .org-block, .cert-doc, .preview-doc {
  max-width: 100%;
  min-width: 0;
}

/* Tables that need horizontal scroll */
.gantt-wrap, .pert-canvas-wrap, .compare-table {
  max-width: 100%;
  overflow-x: auto;
}
.preview-doc table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.compare-table { font-size: clamp(11px, 1.5vw, 14px); }

/* === Forms — full width on mobile === */
@media (max-width: 700px) {
  .field-row, .field-row-3 { grid-template-columns: 1fr !important; }
  .pert-table-head, .pert-row {
    grid-template-columns: 40px 1fr 56px !important;
  }
  .pert-table-head > :nth-child(4),
  .pert-table-head > :nth-child(5),
  .pert-row > :nth-child(4),
  .pert-row > :nth-child(5) { display: none !important; }
  .pert-deps, .pert-row > .btn { display: none !important; }
}

/* === Sidebar — make sure sticky width respects collapse === */
.app { display: grid; }

/* Below 1100px on desktop — keep sidebar, just narrow main padding */
@media (max-width: 1100px) and (min-width: 901px) {
  .lp-section { margin: clamp(28px, 6vw, 56px) 0; }
}

/* === Mobile drawer below 900px === */
@media (max-width: 900px) {
  .app, .app.sidebar-collapsed {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr;
  }
  .topbar { display: flex !important; }

  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(85vw, 320px) !important;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 70;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.4);
  }
  .sidebar.mobile-open { transform: translateX(0); }

  /* Always expanded inside mobile drawer */
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-module-name,
  .sidebar.collapsed .nav-module-tag,
  .sidebar.collapsed .nav-section-label,
  .sidebar.collapsed .nav-sub,
  .sidebar.collapsed .m2-mini-progress,
  .sidebar.collapsed .chevron,
  .sidebar.collapsed .sidebar-note,
  .sidebar.collapsed .brand-mark-name,
  .sidebar.collapsed .brand-sub { display: revert !important; }
  .sidebar.collapsed .nav-item,
  .sidebar.collapsed .nav-module,
  .sidebar.collapsed .options-btn {
    justify-content: flex-start !important;
    padding: 9px 10px !important;
  }
  .sidebar.collapsed .sidebar-toggle { display: none !important; }
  .sidebar.collapsed .nav-module-code {
    position: static !important;
    background: rgba(99, 102, 241, 0.2) !important;
    padding: 2px 6px !important;
  }
  .sidebar.collapsed .nav-flyout { display: none !important; }

  .app.mobile-open .mobile-backdrop { display: block !important; }
}

/* === Card-specific responsive adjustments === */
@media (max-width: 700px) {
  .m1-progress-card, .m1-cta, .m3-resume-banner,
  .exam-prep-card, .b2b-card, .profile-card, .report-header,
  .exam-result {
    grid-template-columns: 1fr !important;
    text-align: left;
    gap: 16px;
    padding: 20px 18px;
  }
  .profile-card { text-align: center; }
  .profile-card .profile-rank { margin: 0 auto; }
  .profile-xp-row { flex-direction: column; gap: 4px; align-items: flex-start; }

  .compare-row { grid-template-columns: 1fr !important; gap: 4px; padding: 12px 14px; }
  .compare-row.compare-head { display: none !important; }
  .compare-row > div:nth-child(1) { font-weight: 700; font-size: 14px; }

  /* SWOT stacks */
  .swot-grid { grid-template-columns: 1fr; }
  /* Eisenhower stacks */
  .eis-wrap { grid-template-columns: 1fr; }
  .eis-pool { position: static; }
  .eis-grid { grid-template-columns: 1fr; min-height: auto; }

  /* Definitions — tabs scroll */
  .def-tabs { overflow-x: auto; flex-wrap: nowrap; padding: 6px; }
  .def-tab { flex-shrink: 0; }
  .def-detail { grid-template-columns: 1fr; }
  .def-card { padding: 24px 20px; }

  /* Strengths */
  .strength { padding: 18px 16px; }

  /* Cards */
  .card { padding: 18px 16px; border-radius: 12px; }

  /* Foot actions */
  .foot-actions { flex-direction: column; gap: 10px; align-items: stretch; }
  .foot-actions .btn { justify-content: center; }

  /* Section meta wraps */
  .section-meta { flex-wrap: wrap; gap: 8px; }

  /* Quiz */
  .quiz-q-head { grid-template-columns: 1fr; gap: 8px; }
  .quiz-q-num { justify-self: start; }
  .quiz-opt { grid-template-columns: 24px 1fr; gap: 8px; padding: 10px 12px; }

  /* Sim choices */
  .sim-choice { grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 14px; }
  .sim-event { padding: 22px 18px; }
  .sim-feedback { padding: 16px 18px; }

  /* Exam bar stacks */
  .exam-bar {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas: "progress timer" "fill fill";
    gap: 10px;
  }
  .exam-bar-progress { grid-area: progress; }
  .exam-timer { grid-area: timer; justify-self: end; }
  .exam-bar-fill { grid-area: fill; }
  .exam-question-card { padding: 22px 18px; }
  .exam-nav { flex-direction: column; gap: 12px; align-items: stretch; padding: 14px; }
  .exam-nav .btn { width: 100%; justify-content: center; }
  .exam-nav-dots { justify-content: center; flex-wrap: wrap; }
  .exam-dot { width: 26px; height: 26px; font-size: 10px; }

  /* Budget rows */
  .budget-row {
    grid-template-columns: 24px 1fr 80px 24px;
    gap: 6px;
    padding: 10px 0;
  }
  .budget-row .range { display: none; }
  .budget-row .desc { font-size: 11px; }

  /* PERT — show graph as scroll, hide deps editor on mobile */
  .pert-canvas-wrap { padding: 4px; }

  /* Buttons */
  .btn { padding: 9px 14px; font-size: 13px; }
  .btn.small { padding: 7px 11px; font-size: 12px; }

  /* Org diagrams */
  .org-pros-cons { grid-template-columns: 1fr; }
  .matrix-grid { grid-template-columns: 70px 1fr 1fr 1fr; }
  .matrix-header { font-size: 10px; }
  .matrix-row-label { padding: 10px 6px; font-size: 10px; }

  /* Certificate */
  .cert-prep { flex-direction: column; align-items: stretch; }
  .cert-doc {
    padding: clamp(20px, 5vw, 60px) clamp(14px, 4vw, 80px);
    min-height: auto;
  }
  .cert-title { font-size: clamp(24px, 5vw, 42px); }
  .cert-name { font-size: clamp(28px, 7vw, 56px); min-width: 80%; }
  .cert-body { font-size: 13px; }
  .cert-meta { flex-direction: column; gap: 14px; }
  .cert-seal { top: 14px; right: 14px; width: 56px; height: 56px; }
  .cert-seal-inner { width: 44px; height: 44px; }
  .cert-seal-text { font-size: 9px; }

  /* Preview doc */
  .preview-doc { padding: 30px 20px; }

  /* Eisenhower */
  .eis-quadrant { padding: 14px; min-height: 140px; }
  .eis-q-label { font-size: 13px; }
  .eis-q-desc { font-size: 10px; }

  /* AI report */
  .ai-report { padding: 18px; }
  .ai-report .md-numbered { grid-template-columns: 28px 1fr; gap: 8px; }
  .ai-report .md-num { width: 26px; height: 26px; font-size: 14px; }
}

/* Phone === */
@media (max-width: 480px) {
  .main { padding: 16px 12px 40px; }
  .topbar { padding: 10px 14px; }
  .cert-doc { padding: 24px 16px; outline-offset: 4px; }
  .cert-corner { width: 36px; height: 36px; }
  .module-card, .scenario-card, .lesson-card { padding: 18px 16px; }
  .lp-section { margin: 28px 0; }
  .lp-section-head { margin-bottom: 16px; }
  .field { margin-bottom: 12px; }

  /* Hide non-essential decoration */
  .hero-side::before, .strength::before, .scenario-card::before { display: none; }

  /* Aspect ratio fix for scenario stats */
  .scenario-stats { grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; }
  .scenario-stats strong { font-size: 15px; }
  .scenario-stats span { font-size: 10px; }
}


/* ============================================================
   POLISH — Collapsed sidebar icons + responsive table fixes
   ============================================================ */

/* In collapsed mode, hide the M1/M2/... code text since the icon
   is the primary signal; keep tag (Activ/Soon) hidden too. */
.sidebar.collapsed .nav-module .nav-module-code {
  display: none;
}
.sidebar.collapsed .nav-module {
  padding: 12px 0;
}
.sidebar.collapsed .nav-icon {
  width: 100%;
  height: 24px;
}

/* Stronger highlight on collapsed active module */
.sidebar.collapsed .nav-module.expanded {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28) 0%, rgba(79, 70, 229, 0.16) 100%);
}

/* === Gantt responsive — keep grid intact, scroll horizontally === */
.gantt-wrap {
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.gantt-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, transparent, var(--bg-card));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
@media (max-width: 900px) {
  .gantt-wrap::after { opacity: 1; }
  .gantt { min-width: 680px; }
  .gantt-cell { font-size: 11px; padding: 6px; }
  .gantt-name { font-size: 11px; padding: 6px 8px; min-height: 36px; }
  .gantt-name input { font-size: 11px; }
}

/* Compare table at mobile — keep header text visible per row */
@media (max-width: 700px) {
  .compare-row {
    padding: 14px 16px !important;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
  }
  .compare-row > div:not(:first-child) {
    font-size: 13px;
    color: var(--ink-3);
  }
  .compare-row > div:not(:first-child)::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-4);
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}

/* Risk matrix — scroll horizontal */
@media (max-width: 700px) {
  .risk-matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .risk-matrix { min-width: 480px; }
}

/* Budget rows scale */
@media (max-width: 700px) {
  .budget-row {
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 14px 0;
  }
  .budget-row > .num { display: none; }
  .budget-row .desc { font-size: 12px; margin-bottom: 6px; }
  .budget-row input.pct {
    width: 100%;
    text-align: left;
  }
  .budget-row .status-indicator {
    position: absolute;
    right: 8px;
    top: 16px;
  }
  .budget-row { position: relative; }
}

/* Tables in preview-doc scroll on mobile */
.preview-doc { overflow-x: auto; }
@media (max-width: 700px) {
  .preview-doc { padding: 24px 18px; font-size: 12px; }
  .preview-doc h1 { font-size: 18px; }
  .preview-doc h2 { font-size: 13px; }
}

/* Risk cards — narrow to single column */
@media (max-width: 700px) {
  .risk-card .field-row { grid-template-columns: 1fr !important; }
}

/* PERT table — show all cols on tablet, hide deps on phone */
@media (max-width: 560px) {
  .pert-table-head, .pert-row {
    grid-template-columns: 40px 1fr 56px !important;
    gap: 6px;
  }
  .pert-table-head > :nth-child(4),
  .pert-table-head > :nth-child(5),
  .pert-row > :nth-child(4),
  .pert-row > :nth-child(5) { display: none !important; }
  .pert-table::after {
    content: "Editează dependențele pe desktop pentru control complet";
    display: block;
    text-align: center;
    color: var(--ink-3);
    font-size: 11px;
    font-style: italic;
    padding: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--line);
  }
}

/* ============================================================
   WAVE 1 — Animated hero rotator
   ============================================================ */
.hero-rotator {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  font-style: italic;
  font-weight: 700;
  color: var(--accent);
}
.hero-rotator-word {
  display: inline-block;
  position: relative;
  animation: rotatorIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes rotatorIn {
  0% { opacity: 0; transform: translateY(12px); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.hero-rotator-underline {
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -8px;
  width: 104%;
  height: 14px;
  color: var(--accent-2);
  pointer-events: none;
}

/* ============================================================
   WAVE 1 — Inline PERT demo on landing
   ============================================================ */
.demo-section {
  margin: 56px 0;
}
.demo-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.demo-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
}
.demo-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.demo-head h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(20px, 2.5vw, 26px);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.demo-head p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-3);
  max-width: 56ch;
}
.demo-pill {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 50px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.demo-pill::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.demo-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-elevated) 100%);
  border-radius: 12px;
  margin: 16px 0;
}
.demo-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.demo-stat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-weight: 600;
}
.demo-stat-val {
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1;
}
.demo-stat-val.critical { color: var(--bad); }
.demo-stat-val.accent { color: var(--accent); }

.demo-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  gap: 14px;
  flex-wrap: wrap;
}
.demo-hint {
  font-size: 13px;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   WAVE 1 — ROI Calculator
   ============================================================ */
.roi-calc {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow-md);
}
.roi-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 24px;
}
@media (max-width: 600px) {
  .roi-controls { grid-template-columns: 1fr; gap: 18px; }
}
.roi-slider-row label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.roi-slider-row .slider-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.roi-slider-row .slider-val {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.roi-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 6px;
  background: var(--bg-elevated);
  outline: none;
}
.roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
  border: 3px solid white;
}
.roi-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
  border: 3px solid white;
}
.roi-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.roi-bar {
  display: grid;
  grid-template-columns: 180px 1fr 110px;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: 10px;
}
@media (max-width: 600px) {
  .roi-bar { grid-template-columns: 1fr; gap: 8px; padding: 14px 16px; }
}
.roi-bar.pmh {
  background: linear-gradient(135deg, var(--good-soft) 0%, var(--bg-card) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
}
.roi-name {
  font-size: 13px;
  font-weight: 600;
}
.roi-name strong { display: block; }
.roi-name span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: none;
}
.roi-bar.pmh .roi-name strong { color: var(--good); }
.roi-bar-fill-track {
  height: 14px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}
.roi-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.roi-bar.pmh .roi-bar-fill {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}
.roi-cost {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-align: right;
  font-feature-settings: "tnum" 1;
}
@media (max-width: 600px) { .roi-cost { text-align: left; } }

.roi-summary {
  margin-top: 24px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #fff;
  border-radius: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  box-shadow: var(--shadow-pop);
}
@media (max-width: 600px) {
  .roi-summary { grid-template-columns: 1fr; text-align: center; }
}
.roi-savings-num {
  font-family: var(--display);
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fbbf24;
}
.roi-savings-num .currency {
  font-size: 0.6em;
  color: #c7cffc;
  margin-left: 4px;
}
.roi-savings-text {
  color: #d8d9f5;
  line-height: 1.5;
}
.roi-savings-text strong { color: #fff; font-size: 15px; }

/* Dark mode for ROI/demo */
:root[data-theme="dark"] .demo-card { background: var(--bg-card); }
:root[data-theme="dark"] .roi-calc { background: var(--bg-card); }
:root[data-theme="dark"] .roi-bar { background: var(--bg-elevated); }
:root[data-theme="dark"] .roi-bar-fill-track { background: var(--bg-card); }
:root[data-theme="dark"] .roi-slider::-webkit-slider-thumb { border-color: var(--bg-card); }
:root[data-theme="dark"] .roi-slider::-moz-range-thumb { border-color: var(--bg-card); }
:root[data-theme="dark"] .demo-stats-strip { background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, var(--bg-elevated) 100%); }


/* ============================================================
   MOBILE FIX — scope collapsed-only styles to desktop, scroll lock
   ============================================================ */

/* Restrict collapsed-mode visual overrides to desktop only */
@media (min-width: 901px) {
  .sidebar.collapsed .nav-module .nav-module-code { display: none; }
  .sidebar.collapsed .nav-module { padding: 12px 0; }
  .sidebar.collapsed .nav-icon { width: 100%; height: 24px; }
}

/* On mobile, drawer is ALWAYS fully expanded (ignore collapsed prop) */
@media (max-width: 900px) {
  .sidebar.collapsed .nav-module .nav-module-code { display: inline !important; }
  .sidebar.collapsed .nav-module { padding: 9px 10px !important; }
  .sidebar.collapsed .nav-icon { width: 24px !important; height: 24px !important; }
  .sidebar.collapsed .brand { justify-content: flex-start !important; display: block !important; }
  .sidebar.collapsed .brand-mark-name { display: inline !important; }
  .sidebar.collapsed .brand-sub { display: block !important; }
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-module-name,
  .sidebar.collapsed .nav-module-tag,
  .sidebar.collapsed .nav-section-label,
  .sidebar.collapsed .m2-mini-progress,
  .sidebar.collapsed .chevron,
  .sidebar.collapsed .sidebar-note {
    display: revert !important;
  }
  .sidebar.collapsed .options-btn { padding: 9px 10px !important; justify-content: flex-start !important; }
}

/* === Scroll lock when mobile drawer is open === */
body.no-scroll {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Mobile backdrop must cover full viewport, prevent scroll behind */
.mobile-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 60 !important;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  touch-action: none;
  overscroll-behavior: contain;
}

/* On mobile, prevent main from horizontal shift */
@media (max-width: 900px) {
  .main {
    transition: none;
  }
  .app.mobile-open .main {
    /* freeze position but keep visible */
    overflow: hidden;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   AUTH UI — modal + button (added in Phase 0)
   ───────────────────────────────────────────────────────────────────────── */

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: auth-fade-in 0.18s ease-out;
}
@keyframes auth-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.auth-modal {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 32px 28px 24px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: auth-slide-up 0.22s ease-out;
}
@keyframes auth-slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-modal-close:hover {
  background: var(--bg);
  color: var(--ink);
}
.auth-modal-head {
  margin-bottom: 22px;
}
.auth-modal-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.auth-modal-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-label span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-error {
  font-size: 13px;
  color: var(--danger, #e74c3c);
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.25);
  border-radius: 6px;
  padding: 8px 12px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-providers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-provider-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px !important;
  font-size: 14px;
}
.auth-fineprint {
  margin-top: 18px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}
.auth-sent {
  text-align: center;
  padding: 12px 0;
}
.auth-sent-icon {
  font-size: 44px;
  margin-bottom: 12px;
}
.auth-sent-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}
.auth-sent-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 18px;
}

/* CTA button (logged-out state) */
.auth-cta-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}
.auth-cta-btn:hover {
  background: var(--accent-2, var(--accent));
  filter: brightness(1.08);
}
.auth-cta-icon {
  font-size: 14px;
}

/* User button (logged-in state) */
.auth-user-wrap {
  position: relative;
}
.auth-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 24px;
  cursor: pointer;
  font-size: 13px;
}
.auth-user-btn:hover {
  background: var(--bg);
}
.auth-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}
.auth-user-name {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-admin-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
}
.auth-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 101;
  overflow: hidden;
}
.auth-menu-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.auth-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.auth-menu-item:hover {
  background: var(--bg);
}

/* Auth slot positioning in sidebar and topbar */
.sidebar-auth-slot {
  padding: 8px 12px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.sidebar-auth-slot .auth-cta-btn,
.sidebar-auth-slot .auth-user-btn {
  width: 100%;
  justify-content: flex-start;
}
.topbar-auth-slot {
  margin-left: auto;
  padding-right: 8px;
}
.topbar-auth-slot .auth-user-name {
  display: none;  /* save space on mobile */
}
@media (min-width: 600px) {
  .topbar-auth-slot .auth-user-name {
    display: inline;
  }
}

/* Consent checkboxes in auth modal */
.auth-consent {
  margin: 16px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.auth-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
  color: var(--ink-2);
}
.auth-consent-row input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
}
.auth-consent-row a {
  color: var(--accent);
  text-decoration: underline;
}
.auth-consent-required {
  color: var(--danger, #e74c3c);
  font-size: 11px;
  margin-left: 4px;
}

/* Privacy/Settings panel */
.privacy-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 20px;
}
.privacy-panel h3 {
  font-family: var(--display);
  font-size: 17px;
  margin: 0 0 8px;
}
.privacy-panel p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 14px;
}
.privacy-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.privacy-danger-zone {
  border-color: rgba(231, 76, 60, 0.3);
  background: rgba(231, 76, 60, 0.04);
}
.btn-danger {
  background: var(--danger, #e74c3c);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.btn-danger:hover {
  filter: brightness(0.95);
}

/* Footer with legal links */
.site-footer {
  margin-top: 60px;
  padding: 24px 28px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.site-footer-links {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.site-footer-links a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────────────────
   Scroll-to-top floating button
   ───────────────────────────────────────────────────────────────────────── */

.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(20px) scale(0.85);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), background 0.15s;
  z-index: 200;
}
.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.scroll-top-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px) scale(1.05);
}
.scroll-top-btn:active {
  transform: translateY(0) scale(0.96);
}
.scroll-top-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Move up when the AI tutor FAB is also visible (Phase 3) */
@media (max-width: 600px) {
  .scroll-top-btn {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   M4 Mock Exam — always-visible submit panel
   ───────────────────────────────────────────────────────────────────────── */

.exam-submit-panel {
  margin-top: 18px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  bottom: 16px;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.exam-submit-info {
  font-size: 14px;
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────────────────
   HISTORY PAGE — stats, tabs, list of attempts/runs
   ───────────────────────────────────────────────────────────────────────── */

.history-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.history-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}
.history-stat-num {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}
.history-stat-num.history-stat-num-sm {
  font-size: 20px;
  text-transform: capitalize;
}
.history-stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 2px;
}
.history-stat-sub {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.history-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.history-tab {
  background: transparent;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.history-tab:hover { color: var(--ink); }
.history-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.history-item.open {
  border-color: var(--accent);
}
.history-item-head {
  display: grid;
  grid-template-columns: 36px 1fr auto 20px;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
}
.history-item-head:hover { background: var(--bg); }
.history-item-icon {
  width: 36px;
  height: 36px;
  background: var(--bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--accent);
}
.history-item-main { min-width: 0; }
.history-item-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}
.history-item-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}
.history-item-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.history-score-num {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.history-score-num.pass { color: var(--success, #27ae60); }
.history-score-num.fail { color: var(--danger, #e74c3c); }
.history-item-chev {
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.2s;
}
.history-item.open .history-item-chev { color: var(--accent); }

.history-detail {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.history-detail-summary {
  padding: 14px 0;
  font-size: 13px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.history-detail-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.history-q, .history-decision {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 13px;
}
.history-decision {
  grid-template-columns: 32px 1fr;
}
.history-q.ok { background: rgba(39, 174, 96, 0.06); }
.history-q.bad { background: rgba(231, 76, 60, 0.06); }
.history-q-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.history-q-text { color: var(--ink-2); line-height: 1.4; }
.history-q-cat {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.history-q-mark {
  font-weight: 700;
  font-size: 14px;
}
.history-q.ok .history-q-mark { color: var(--success, #27ae60); }
.history-q.bad .history-q-mark { color: var(--danger, #e74c3c); }

/* Mobile */
@media (max-width: 600px) {
  .history-item-head {
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
  }
  .history-item-chev { display: none; }
  .history-q, .history-decision {
    grid-template-columns: 28px 1fr auto;
  }
  .history-q-cat { display: none; }
}

/* ─────────────────────────────────────────────────────────────────────────
   M2 Multi-project manager
   ───────────────────────────────────────────────────────────────────────── */

.m2-projects-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 24px;
}
.m2-projects-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.m2-projects-empty {
  padding: 24px 4px;
  text-align: center;
  color: var(--muted);
}
.m2-projects-empty p { margin-bottom: 12px; }
.m2-projects-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.m2-project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  transition: border-color 0.15s;
}
.m2-project-row:hover {
  border-color: var(--accent);
}
.m2-project-row.active {
  border-color: var(--accent);
  background: var(--accent-soft, rgba(99, 102, 241, 0.06));
}
.m2-project-main {
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 4px 6px;
  color: var(--ink);
}
.m2-project-main:disabled {
  cursor: default;
}
.m2-project-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.m2-project-active-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent);
  color: white;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}
.m2-project-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.m2-project-actions {
  display: flex;
  gap: 4px;
}
.m2-project-actions .btn.small {
  padding: 4px 10px;
  font-size: 13px;
  min-height: 28px;
}
