:root {
  --bg: #090d16;
  --surface: #101626;
  --surface-raised: #162035;
  --surface-hover: #1c2944;
  --border: #233152;
  --border-light: #2e406b;
  --text: #e8ecf8;
  --text-muted: #95a3c3;
  --text-dim: #67789e;
  --primary: #805ad5;
  --primary-glow: rgba(128, 90, 213, 0.25);
  --accent: #38b2ac;
  --accent-glow: rgba(56, 178, 172, 0.25);
  --warning: #f6ad55;
  --danger: #fc8181;
  --ok: #48bb78;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  background: linear-gradient(135deg, #805ad5, #38b2ac);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.title-group h1 {
  font-size: 19px;
  font-weight: 600;
  color: #fff;
}

.title-group p {
  font-size: 13px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar-wrap {
  width: 140px;
  height: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #805ad5, #38b2ac);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 75px;
}

/* Layout */
.layout-container {
  display: flex;
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* Stepper Sidebar */
.stepper-panel {
  width: 320px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 77px);
  position: sticky;
  top: 77px;
}

.stepper-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 0 8px;
}

.lesson-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-nav-title {
  font-size: 12px;
  font-weight: 600;
  color: #a0aec0;
  padding: 6px 8px 2px;
}

.step-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 7px 10px;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.step-nav-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.step-nav-btn.active {
  background: var(--surface-raised);
  border-color: var(--border-light);
  color: #fff;
  font-weight: 500;
}

.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-hover);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.step-nav-btn.active .step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.step-nav-btn.completed .step-dot {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

/* Content Panel */
.content-panel {
  flex: 1;
  padding: 32px 40px;
  max-width: 820px;
  overflow-y: auto;
}

.step-section {
  display: none;
}

.step-section.active {
  display: block;
}

.step-header {
  margin-bottom: 24px;
}

.step-meta {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  margin-bottom: 6px;
}

.step-title {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.step-lead {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Comparison Tables */
.table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

table.comp-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 14px;
}

table.comp-table th, table.comp-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

table.comp-table th {
  background: var(--surface-raised);
  font-weight: 600;
  color: #fff;
}

table.comp-table tr:last-child td {
  border-bottom: none;
}

/* Callout Boxes */
.callout {
  background: var(--surface);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.callout.warning {
  border-left-color: var(--warning);
}

.callout.accent {
  border-left-color: var(--accent);
}

.callout-title {
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  font-size: 14px;
}

.callout p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Code & Pre Blocks */
pre.diagram-box, pre.code-block {
  background: #080c14;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: #81e6d9;
  overflow-x: auto;
  margin: 16px 0;
}

/* Checkpoint Card */
.checkpoint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 28px 0;
}

.checkpoint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.checkpoint-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface-hover);
  color: var(--text-muted);
}

.checkpoint-badge.verified {
  background: rgba(72, 187, 120, 0.2);
  color: var(--ok);
  border: 1px solid rgba(72, 187, 120, 0.4);
}

.checkpoint-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.checkpoint-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.checkpoint-actions {
  display: flex;
  gap: 12px;
}

.btn-verify {
  background: var(--surface-raised);
  border: 1px solid var(--border-light);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-verify:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.btn-verify.active {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

/* Navigation Buttons */
.step-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn-nav {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-nav:hover {
  background: var(--surface-hover);
  color: #fff;
  border-color: var(--border-light);
}

.btn-nav.primary {
  background: linear-gradient(135deg, #805ad5, #38b2ac);
  border: none;
  color: #fff;
}

/* Coach Widget Panel */
.coach-panel {
  width: 340px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 77px);
  position: sticky;
  top: 77px;
}

.coach-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.coach-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #805ad5, #38b2ac);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
}

.coach-title h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.coach-title p {
  font-size: 11px;
  color: var(--text-dim);
}

.coach-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
  min-height: 240px;
}

.coach-msg {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.45;
}

.coach-msg.bot {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 2px;
}

.coach-msg.user {
  background: #2b6cb0;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.coach-input-group {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.coach-input {
  flex: 1;
  background: #080c14;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
}

.coach-input:focus {
  outline: none;
  border-color: var(--primary);
}

.coach-btn {
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 1100px) {
  .coach-panel {
    display: none;
  }
}

@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
  }
  .stepper-panel {
    width: 100%;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .content-panel {
    padding: 20px 16px;
  }
}


/* Checkpoint Green Checkmark on Menu Items (Right-aligned) */
.nav-item a,
.step-nav-item,
.step-nav-btn,
.nav-item-btn,
.nav-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  position: relative !important;
}

.nav-item.completed a::after,
.step-nav-item.completed::after,
.step-nav-btn.completed::after,
.nav-item-btn.completed::after,
.nav-link.completed::after {
  content: " \2713" !important;
  margin-left: auto !important;
  color: #22c55e !important;
  font-weight: 800 !important;
  font-size: 1.15rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
}
