/* ==========================================================================
   BizSim — Main CSS
   Design System & Complete Component Library
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES
   ========================================================================== */

:root {
  /* Color Palette — Command-line Chic / freeCodeCamp */
  --color-bg:              #0a0a23;   /* gray-90: deepest background        */
  --color-surface:         #1b1b32;   /* gray-85: secondary background      */
  --color-surface-2:       #2a2a40;   /* gray-80: surface / editor          */
  --color-border:          #3b3b4f;   /* gray-75: borders / subtle          */
  --color-primary:         #99c9ff;   /* blue-light: links / interactive    */
  --color-primary-hover:   #7ab4f0;
  --color-primary-glow:    rgba(153, 201, 255, 0.12);
  --color-cta:             #f1be32;   /* yellow: primary CTA / buttons      */
  --color-cta-hover:       #e5b020;
  --color-cta-text:        #0a0a23;   /* dark text on yellow CTA            */
  --color-success:         #acd157;   /* green-light: completion / strings  */
  --color-success-glow:    rgba(172, 209, 87, 0.12);
  --color-warning:         #f1be32;   /* yellow: warnings / classes         */
  --color-warning-glow:    rgba(241, 190, 50, 0.12);
  --color-danger:          #ffadad;   /* red-light: errors / destructive    */
  --color-danger-glow:     rgba(255, 173, 173, 0.12);
  --color-text:            #f5f6f7;   /* gray-05: primary foreground        */
  --color-text-muted:      #b8b8c4;   /* 7:1+ contrast on all dark surfaces  */
  --color-text-subtle:     #a8a8b8;   /* 7:1+ on bg/surface, 6:1 on surface-2 */
  --color-sidebar:         #0a0a23;   /* gray-90: sidebar background        */
  --color-sidebar-active:  #1b1b32;   /* gray-85: active nav item           */
  --color-focus:           #198eee;   /* blue-mid: focus ring (all elements) */

  /* Typography */
  --font-heading: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'Fira Mono', Menlo, Consolas, monospace;

  /* Spacing Scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Border Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:          0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:          0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg:          0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-primary: 0 0 16px rgba(153, 201, 255, 0.2);
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;   /* 18px via html root */
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

ul,
ol {
  list-style: none;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
}


/* ==========================================================================
   3. LAYOUT SHELL
   ========================================================================== */

.layout-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--color-sidebar);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.main-content {
  flex: 1;
  overflow-y: auto;
  background-color: var(--color-bg);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.main-content::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.page-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-8);
}


/* ==========================================================================
   4. SIDEBAR COMPONENTS
   ========================================================================== */

/* Logo */
.sidebar-logo {
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-logo-name,
.logo-text {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.sidebar-logo-tagline,
.logo-tagline {
  font-size: 11px;
  color: var(--color-text-subtle);
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* Scenario Pill */
.sidebar-scenario-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) var(--space-5);
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.sidebar-scenario-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  flex-shrink: 0;
}

.sidebar-scenario-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: var(--space-2) 0;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-5);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  border-left: 3px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.sidebar-nav-item:hover:not(.locked) {
  background-color: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.sidebar-nav-item.active {
  border-left-color: var(--color-primary);
  background-color: var(--color-sidebar-active);
  color: var(--color-text);
}

.sidebar-nav-item.locked {
  color: var(--color-text-subtle);
  cursor: not-allowed;
  opacity: 0.6;
}

.sidebar-nav-item.done {
  color: var(--color-success);
}

.sidebar-nav-icon,
.nav-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.sidebar-nav-label,
.nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav-status,
.nav-status {
  font-size: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.sidebar-nav-item.done .sidebar-nav-status::after {
  content: '✓';
  color: var(--color-success);
}

.sidebar-nav-item.locked .sidebar-nav-status::after {
  content: '🔒';
  font-size: 11px;
}

/* Divider */
.sidebar-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-4) var(--space-5);
}

/* Footer */
.sidebar-footer {
  padding: var(--space-5);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}


/* ==========================================================================
   5. HEALTH SCORE RING
   ========================================================================== */

.score-ring-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.score-ring-label {
  font-size: 11px;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.score-ring {
  width: 80px;
  height: 80px;
  overflow: visible;
}

.score-ring-track {
  fill: none;
  stroke: var(--color-surface-2);
  stroke-width: 6;
}

.score-ring-fill {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring-num {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  font-family: var(--font-heading);
  line-height: 1;
}

.score-ring-denom {
  display: block;
  font-size: 10px;
  color: var(--color-text-muted);
}


/* ==========================================================================
   6. PAGE HEADER
   ========================================================================== */

.page-header {
  margin-bottom: var(--space-8);
}

.page-header-meta {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--space-3);
}

.page-header-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: var(--space-2);
}

.page-header-subtitle {
  font-size: 16px;
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 640px;
}

/* Step Indicator */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: var(--space-6);
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  flex-shrink: 0;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.step-dot span {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text-muted);
  font-family: var(--font-mono, monospace);
}

.step-dot.active,
.step-dot--active {
  width: 28px;
  height: 28px;
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.step-dot.active span,
.step-dot--active span {
  color: #fff;
}

.step-dot.done,
.step-dot--done {
  background-color: var(--color-success);
  border-color: var(--color-success);
  width: 28px;
  height: 28px;
}

.step-dot.done span,
.step-dot--done span {
  color: #fff;
}

.step-dot--upcoming {
  background-color: var(--color-surface);
  border-color: var(--color-border);
}

.step-connector {
  flex: 1;
  height: 0;
  border-top: 1px dashed var(--color-border);
  min-width: var(--space-4);
}


/* ==========================================================================
   7. CARDS
   ========================================================================== */

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.card-elevated {
  background-color: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.card-interactive {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.card-interactive:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-primary);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.card-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.card-body {
  /* main content area — no default styles, flexible */
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
}


/* ==========================================================================
   8. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Variants */
.btn-primary {
  background-color: var(--color-cta);
  color: var(--color-cta-text);
  border-color: var(--color-cta);
  font-weight: 700;
}

.btn-primary:hover {
  background-color: var(--color-cta-hover);
  border-color: var(--color-cta-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-surface);
  border-color: var(--color-text-muted);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}

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

.btn-danger {
  background-color: var(--color-danger-glow);
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.btn-danger:hover {
  background-color: rgba(255, 173, 173, 0.22);
  border-color: var(--color-danger);
}

.btn-success {
  background-color: var(--color-success-glow);
  color: var(--color-success);
  border-color: var(--color-success);
  font-weight: 700;
}

.btn-success:hover {
  background-color: rgba(172, 209, 87, 0.22);
  border-color: var(--color-success);
}

/* Sizes */
.btn-sm {
  padding: 6px var(--space-3);
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px var(--space-8);
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn-full {
  width: 100%;
}

.btn[disabled],
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Icon-only button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  font-size: 16px;
  flex-shrink: 0;
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
  font-size: 14px;
}


/* ==========================================================================
   9. BADGES & TAGS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--color-primary-glow);
  color: var(--color-primary);
  border: 1px solid rgba(153, 201, 255, 0.3);
}

.badge-success {
  background-color: var(--color-success-glow);
  color: var(--color-success);
  border: 1px solid rgba(172, 209, 87, 0.3);
}

.badge-warning {
  background-color: var(--color-warning-glow);
  color: var(--color-warning);
  border: 1px solid rgba(241, 190, 50, 0.3);
}

.badge-danger {
  background-color: var(--color-danger-glow);
  color: var(--color-danger);
  border: 1px solid rgba(255, 173, 173, 0.3);
}

.badge-neutral {
  background-color: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.badge-lg {
  padding: 6px 14px;
  font-size: 14px;
}

/* Tag buttons for multi-select */
.tag-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background-color: transparent;
  color: var(--color-text-muted);
  transition: all 0.15s ease;
  user-select: none;
}

.tag-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background-color: var(--color-primary-glow);
}

.tag-btn.active {
  background-color: var(--color-primary);
  color: var(--color-bg);
  border-color: var(--color-primary);
}


/* ==========================================================================
   10. FORM ELEMENTS
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-label-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.form-input {
  display: block;
  width: 100%;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: var(--color-text-subtle);
}

.form-input:hover {
  border-color: var(--color-text-muted);
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.form-textarea {
  display: block;
  width: 100%;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100px;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  appearance: none;
}

.form-textarea::placeholder {
  color: var(--color-text-subtle);
}

.form-textarea:hover {
  border-color: var(--color-text-muted);
}

.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.form-select {
  display: block;
  width: 100%;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 40px 10px 14px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-select:hover {
  border-color: var(--color-text-muted);
}

.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.form-select option {
  background-color: var(--color-surface-2);
  color: var(--color-text);
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  line-height: 1.4;
}

.form-error {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.input-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.input-group .form-label {
  flex-shrink: 0;
  margin-bottom: 0;
  min-width: 100px;
}

.input-group .form-input {
  flex: 1;
}


/* ==========================================================================
   11. RANGE SLIDERS
   ========================================================================== */

.range-group {
  width: 100%;
}

.range-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.range-header-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.range-header-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
  min-width: 48px;
  text-align: right;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    to right,
    var(--color-primary) var(--slider-fill, 50%),
    var(--color-surface-2) var(--slider-fill, 50%)
  );
  outline: none;
  cursor: pointer;
  margin: var(--space-2) 0;
  transition: background 0.05s;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px rgba(153, 201, 255, 0.15);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px rgba(153, 201, 255, 0.22);
  transform: scale(1.1);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px rgba(153, 201, 255, 0.15);
}

.range-slider::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-1);
}

.range-labels span {
  font-size: 11px;
  color: var(--color-text-subtle);
}


/* ==========================================================================
   12. PROGRESS ELEMENTS
   ========================================================================== */

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary), #60A5FA);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

.progress-fill-success {
  background: linear-gradient(90deg, var(--color-success), #34D399);
}

.progress-fill-warning {
  background: linear-gradient(90deg, var(--color-warning), #FCD34D);
}

.progress-bar-labeled {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.progress-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-bar-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.progress-bar-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-mono);
}

/* Module progress item (for results page) */
.module-progress-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.module-progress-item:last-child {
  border-bottom: none;
}

.module-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.module-progress-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  flex: 1;
}

.module-progress-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-mono);
  min-width: 48px;
  text-align: right;
}


/* ==========================================================================
   13. DATA TABLE
   ========================================================================== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th {
  background-color: var(--color-surface-2);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 10px var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}

.data-table th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background-color 0.1s ease;
}

.data-table tbody tr:hover td {
  background-color: var(--color-surface-2);
}

/* Table wrapper with scroll */
.data-table-wrapper {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}


/* ==========================================================================
   14. ALERT / FEEDBACK PANELS
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border-radius: var(--radius-md);
  padding: 14px var(--space-4);
  border-left: 3px solid transparent;
}

.alert-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.alert-body {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  line-height: 1.5;
}

.alert-success {
  background-color: var(--color-success-glow);
  border-left-color: var(--color-success);
}

.alert-success .alert-title {
  color: var(--color-success);
}

.alert-warning {
  background-color: var(--color-warning-glow);
  border-left-color: var(--color-warning);
}

.alert-warning .alert-title {
  color: var(--color-warning);
}

.alert-danger {
  background-color: var(--color-danger-glow);
  border-left-color: var(--color-danger);
}

.alert-danger .alert-title {
  color: var(--color-danger);
}

.alert-info {
  background-color: var(--color-primary-glow);
  border-left-color: var(--color-primary);
}

.alert-info .alert-title {
  color: var(--color-primary);
}


/* ==========================================================================
   15. MODAL
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
}

.modal-box {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.modal-close {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.modal-body {
  margin-bottom: var(--space-6);
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}


/* ==========================================================================
   16. DRAG & DROP
   ========================================================================== */

.drag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.drag-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.drag-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-primary);
}

.drag-card:active {
  cursor: grabbing;
}

.drag-card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.drag-card.correct-placed {
  border-color: var(--color-success);
  background-color: var(--color-success-glow);
}

.drag-card.incorrect-placed {
  border-color: var(--color-danger);
  background-color: var(--color-danger-glow);
}

.drop-zones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.drop-zone {
  background-color: var(--color-surface-2);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  min-height: 150px;
  padding: var(--space-3);
  transition: border-color 0.15s ease, background-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.drop-zone.highlight {
  border-color: var(--color-primary);
  background-color: var(--color-primary-glow);
}

.drop-zone-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-2);
}

.drop-zone-count {
  /* inherits .badge styles, apply .badge.badge-primary in HTML */
  align-self: flex-start;
}


/* ==========================================================================
   17. SCORE DISPLAY
   ========================================================================== */

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-6);
  text-align: center;
}

.score-number {
  font-size: 64px;
  font-weight: 800;
  color: var(--color-primary);
  font-family: var(--font-heading);
  line-height: 1;
  letter-spacing: -2px;
}

.score-label {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  font-weight: 500;
}

.score-breakdown {
  width: 100%;
  max-width: 400px;
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.score-breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

.score-breakdown-item:last-child {
  border-bottom: none;
}

.score-breakdown-activity {
  color: var(--color-text-muted);
}

.score-breakdown-points {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-success);
}

.score-badge-awarded {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  background-color: var(--color-primary-glow);
  border: 1px solid rgba(153, 201, 255, 0.22);
  border-radius: var(--radius-xl);
}

.score-badge-icon {
  font-size: 48px;
  line-height: 1;
}

.score-badge-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.score-badge-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
}


/* ==========================================================================
   18. UNIT ECONOMICS CALCULATOR
   ========================================================================== */

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.calc-input-group {
  margin-bottom: var(--space-5);
}

.calc-input-group .form-label {
  font-size: 13px;
  color: var(--color-text-muted);
}

.calc-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.calc-result-card {
  background-color: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.calc-result-value {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-heading);
  line-height: 1;
  color: var(--color-text);
}

.calc-result-value.positive {
  color: var(--color-success);
}

.calc-result-value.warning {
  color: var(--color-warning);
}

.calc-result-value.negative {
  color: var(--color-danger);
}

.calc-result-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-result-status {
  /* use badge classes in HTML */
}


/* ==========================================================================
   19. SCENARIO CARDS
   ========================================================================== */

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.scenario-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.scenario-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--scenario-color, var(--color-primary));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.scenario-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-primary);
  border-color: var(--color-primary);
}

.scenario-card.selected {
  border: 2px solid var(--color-primary);
  box-shadow: var(--shadow-glow-primary);
}

.scenario-card-accent {
  /* handled via ::before pseudo-element + --scenario-color var */
}

.scenario-card-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: var(--space-4);
  display: block;
}

.scenario-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.2;
}

.scenario-card-industry {
  margin-bottom: var(--space-3);
}

.scenario-card-description {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-4);
}

.scenario-card-difficulty {
  /* use badge classes in HTML */
}

.scenario-select-check {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--color-bg);
  font-weight: 800;
  box-shadow: var(--shadow-glow-primary);
}

.scenario-card.selected .scenario-select-check {
  display: flex;
}


/* ==========================================================================
   20. LEAN CANVAS GRID
   ========================================================================== */

.canvas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "problem solution uvp channels customer-segments"
    "problem key-metrics uvp channels customer-segments"
    "cost-structure cost-structure revenue-streams revenue-streams unfair-advantage";
  gap: 2px;
  background-color: var(--color-border);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.canvas-cell {
  background-color: var(--color-surface-2);
  padding: var(--space-4);
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.canvas-cell[data-area="problem"] {
  grid-area: problem;
}
.canvas-cell[data-area="solution"] {
  grid-area: solution;
}
.canvas-cell[data-area="uvp"] {
  grid-area: uvp;
}
.canvas-cell[data-area="channels"] {
  grid-area: channels;
}
.canvas-cell[data-area="customer-segments"] {
  grid-area: customer-segments;
}
.canvas-cell[data-area="key-metrics"] {
  grid-area: key-metrics;
}
.canvas-cell[data-area="cost-structure"] {
  grid-area: cost-structure;
}
.canvas-cell[data-area="revenue-streams"] {
  grid-area: revenue-streams;
}
.canvas-cell[data-area="unfair-advantage"] {
  grid-area: unfair-advantage;
}

.canvas-cell-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-2);
  flex-shrink: 0;
}

.canvas-cell textarea {
  flex: 1;
  border: none;
  background-color: transparent;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  outline: none;
  width: 100%;
  font-family: var(--font-body);
}

.canvas-cell textarea::placeholder {
  color: var(--color-text-subtle);
  font-size: 12px;
}


/* ==========================================================================
   21. GTM MOTION CARDS
   ========================================================================== */

.motion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.motion-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.motion-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-primary);
}

.motion-card.selected {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow-primary);
  background-color: var(--color-primary-glow);
}

.motion-card-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: var(--space-3);
  display: block;
}

.motion-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.motion-card-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}

.motion-card-examples {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}


/* ==========================================================================
   22. INTERVIEW SIMULATION
   ========================================================================== */

.interview-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.interview-bubble {
  background-color: var(--color-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  font-size: 15px;
  color: var(--color-text);
  line-height: 1.6;
  position: relative;
}

.interview-bubble.interviewer {
  border-left: 3px solid var(--color-primary);
}

.interview-bubble.customer {
  border-left: 3px solid var(--color-success);
}

.interview-bubble-name {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--space-2);
}

.interview-bubble.interviewer .interview-bubble-name {
  color: var(--color-primary);
}

.interview-bubble.customer .interview-bubble-name {
  color: var(--color-success);
}

.interview-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: var(--space-3);
}

.interview-option {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.5;
}

.interview-option:hover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-glow);
}

.interview-option.selected {
  border-color: var(--color-primary);
  background-color: var(--color-primary-glow);
}

.interview-option.correct {
  border-color: var(--color-success);
  background-color: var(--color-success-glow);
  color: var(--color-text);
}

.interview-option.incorrect {
  border-color: var(--color-danger);
  background-color: var(--color-danger-glow);
  color: var(--color-text);
}


/* ==========================================================================
   23. MODULE NAVIGATION BAR
   ========================================================================== */

.module-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-8);
  margin-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.module-nav-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  background-color: transparent;
  text-decoration: none;
}

.module-nav-back:hover {
  background-color: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.module-nav-back::before {
  content: '←';
  font-size: 16px;
}

.module-nav-next {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background-color: var(--color-primary);
  color: var(--color-bg);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-primary);
  transition: all 0.15s ease;
  text-decoration: none;
}

.module-nav-next:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-glow-primary);
  text-decoration: none;
}

.module-nav-next::after {
  content: '→';
  font-size: 16px;
}


/* ==========================================================================
   24. LANDING PAGE — HERO
   ========================================================================== */

.hero {
  text-align: center;
  padding: var(--space-16) var(--space-10);
  max-width: 800px;
  margin: 0 auto;
}

.hero-eyebrow {
  margin-bottom: var(--space-4);
  display: inline-block;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}

.hero-title span {
  background: linear-gradient(135deg, var(--color-primary), var(--color-success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}

/* How It Works section */
.how-it-works {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  padding: var(--space-10) var(--space-8);
}

.how-it-works-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
}

.how-it-works-icon {
  font-size: 40px;
  line-height: 1;
}

.how-it-works-number {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-glow);
  border: 1px solid rgba(153, 201, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
}

.how-it-works-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.how-it-works-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-10);
  letter-spacing: -0.5px;
}


/* ==========================================================================
   25. RESULTS PAGE
   ========================================================================== */

.results-hero {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}

.viability-rating {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.viability-label {
  font-size: 16px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.recommendation-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.recommendation-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.recommendation-item:last-child {
  border-bottom: none;
}

.recommendation-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.timeline-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--space-6) 0;
  overflow-x: auto;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 80px;
}

.timeline-step-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--color-bg);
  font-weight: 700;
  flex-shrink: 0;
}

.timeline-step-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
  font-weight: 500;
}

.timeline-connector {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--color-success), var(--color-primary));
  min-width: 24px;
  margin-bottom: 20px;
  flex-shrink: 0;
}


/* ==========================================================================
   26. UTILITY CLASSES
   ========================================================================== */

/* Colors */
.text-primary  { color: var(--color-primary) !important; }
.text-success  { color: var(--color-success) !important; }
.text-warning  { color: var(--color-warning) !important; }
.text-danger   { color: var(--color-danger) !important; }
.text-muted    { color: var(--color-text-muted) !important; }
.text-subtle   { color: var(--color-text-subtle) !important; }

/* Typography */
.font-mono   { font-family: var(--font-mono) !important; }
.font-bold   { font-weight: 700 !important; }
.font-medium { font-weight: 500 !important; }
.font-heavy  { font-weight: 800 !important; }

/* Font sizes */
.text-sm   { font-size: 13px !important; }
.text-base { font-size: 15px !important; }
.text-lg   { font-size: 18px !important; }
.text-xl   { font-size: 24px !important; }
.text-2xl  { font-size: 32px !important; }

/* Flexbox */
.flex          { display: flex !important; }
.flex-col      { display: flex; flex-direction: column !important; }
.flex-between  { display: flex; align-items: center; justify-content: space-between !important; }
.flex-center   { display: flex; align-items: center; justify-content: center !important; }
.items-center  { align-items: center !important; }
.items-start   { align-items: flex-start !important; }
.flex-wrap     { flex-wrap: wrap !important; }
.flex-1        { flex: 1 !important; }

/* Gap */
.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }
.gap-6 { gap: var(--space-6) !important; }
.gap-8 { gap: var(--space-8) !important; }

/* Margin top */
.mt-1  { margin-top: var(--space-1) !important; }
.mt-2  { margin-top: var(--space-2) !important; }
.mt-4  { margin-top: var(--space-4) !important; }
.mt-6  { margin-top: var(--space-6) !important; }
.mt-8  { margin-top: var(--space-8) !important; }
.mt-10 { margin-top: var(--space-10) !important; }

/* Margin bottom */
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }

/* Padding */
.p-4 { padding: var(--space-4) !important; }
.p-6 { padding: var(--space-6) !important; }
.p-8 { padding: var(--space-8) !important; }

/* Width */
.w-full  { width: 100% !important; }
.w-auto  { width: auto !important; }

/* Borders */
.rounded      { border-radius: var(--radius-md) !important; }
.rounded-lg   { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* Display */
.hidden      { display: none !important; }
.block       { display: block !important; }
.inline      { display: inline !important; }
.inline-flex { display: inline-flex !important; }

/* Accessibility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Misc */
.text-center  { text-align: center !important; }
.text-right   { text-align: right !important; }
.overflow-hidden { overflow: hidden !important; }
.relative    { position: relative !important; }
.absolute    { position: absolute !important; }
.cursor-pointer { cursor: pointer !important; }
.select-none { user-select: none !important; }
.border-top  { border-top: 1px solid var(--color-border) !important; }
.border-bottom { border-bottom: 1px solid var(--color-border) !important; }


/* ==========================================================================
   27. RESPONSIVE — MOBILE
   ========================================================================== */

@media (max-width: 768px) {
  /* Layout */
  .layout-shell {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-2) 0;
  }

  .sidebar-logo {
    padding: var(--space-3) var(--space-4);
    border-bottom: none;
    border-right: 1px solid var(--color-border);
    flex-shrink: 0;
  }

  .sidebar-logo-tagline {
    display: none;
  }

  .sidebar-scenario-pill {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    padding: 0 var(--space-2);
    flex: 1;
    gap: var(--space-1);
    align-items: center;
  }

  .sidebar-nav-item {
    flex-direction: column;
    padding: var(--space-2) var(--space-3);
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    font-size: 12px;
    gap: var(--space-1);
  }

  .sidebar-nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--color-primary);
    background-color: var(--color-sidebar-active);
  }

  .sidebar-nav-status {
    display: none;
  }

  .sidebar-divider {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .main-content {
    overflow-y: auto;
    flex: 1;
  }

  /* Page wrapper */
  .page-wrapper {
    padding: var(--space-6) var(--space-4);
  }

  /* Grids → single column */
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .canvas-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "problem"
      "solution"
      "uvp"
      "channels"
      "customer-segments"
      "key-metrics"
      "cost-structure"
      "revenue-streams"
      "unfair-advantage";
  }

  .drag-grid {
    grid-template-columns: 1fr;
  }

  .drop-zones {
    grid-template-columns: 1fr;
  }

  .motion-grid {
    grid-template-columns: 1fr;
  }

  .calc-grid {
    grid-template-columns: 1fr;
  }

  .calc-result-grid {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .how-it-works {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-4);
  }

  /* Hero */
  .hero {
    padding: var(--space-10) var(--space-4);
  }

  .hero-title {
    font-size: 36px;
    letter-spacing: -0.5px;
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  /* Module nav */
  .module-nav {
    flex-direction: column;
    gap: var(--space-3);
  }

  .module-nav-back,
  .module-nav-next {
    width: 100%;
    justify-content: center;
  }

  /* Score number */
  .score-number {
    font-size: 48px;
  }

  .viability-rating {
    font-size: 36px;
  }
}

@media (max-width: 480px) {
  .how-it-works {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   28. SPEC ALIASES & SUPPLEMENTAL CLASSES
   The following adds exact token names and class names from the PRD spec
   that complement (alias or extend) the design system above.
   ========================================================================== */

/* --- Token aliases for cross-agent compatibility ---
   The primary tokens use variant suffixes (e.g. --radius-lg, --shadow-md).
   These aliases expose the short names required by the spec so that any
   HTML/JS referencing them works without modification.                      */
:root {
  --sidebar-width: 240px;
  --radius:        10px;   /* maps to --radius-md */
  --shadow:        0 4px 6px -1px rgba(0,0,0,0.3);
  --shadow-lg:     0 10px 25px -5px rgba(0,0,0,0.4);
  --transition:    150ms ease;
  /* Convenience color aliases */
  --color-primary-glow: rgba(153, 201, 255, 0.12);
}

/* --- score-ring-value ---
   Alias for the large number rendered inside the SVG ring via foreignObject
   or as an absolutely positioned element. Maps to .score-ring-number.      */
.score-ring-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  display: block;
  text-align: center;
}

/* --- hero-section ---
   Named alias for the full-width hero on index.html (the existing .hero
   class targets a constrained container; this covers the outer wrapper).   */
.hero-section {
  text-align: center;
  padding: var(--space-16) var(--space-10) var(--space-12);
  position: relative;
  overflow: hidden;
}

/* --- Scenario card alias classes ---
   The existing scenario card uses -card-industry / -card-difficulty.
   Add the short alias names the spec references.                            */
.scenario-badge {
  /* Positioned badge (difficulty/category) — absolute top-right of card */
  position: absolute;
  top: 14px;
  right: 14px;
}

.scenario-industry {
  /* Inline industry tag beneath card title — alias for .scenario-card-industry */
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  background-color: var(--color-primary-glow);
  border: 1px solid rgba(153, 201, 255, 0.18);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  margin-top: 4px;
  margin-bottom: 10px;
}

/* --- Scenario pill in sidebar ---
   Small pill showing the active scenario name.                              */
.scenario-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background-color: var(--color-primary-glow);
  border: 1px solid rgba(153, 201, 255, 0.15);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  width: 100%;
  justify-content: center;
  margin-top: var(--space-3);
}

.scenario-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-primary);
  flex-shrink: 0;
}

/* --- Step line (step indicator connector) ---
   Horizontal line between step dots.                                        */
.step-line {
  flex: 1;
  height: 2px;
  background-color: var(--color-border);
  transition: background-color var(--transition);
}

.step-line.done {
  background-color: var(--color-success);
}

/* --- Module intro brief ---
   Conceptual intro text shown before an activity.                           */
.module-intro {
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-5);
  background-color: rgba(153, 201, 255, 0.05);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* --- Activity header row ---
   Activity number label + title + points badge in one row.                 */
.activity-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.activity-number {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.activity-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
  margin: 0;
}

/* Points badge attached to activity header */
.points-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  background-color: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-warning);
  flex-shrink: 0;
}

/* --- Activity body ---
   Container for the interactive content inside an activity card.           */
.activity-body {
  margin-top: var(--space-4);
}

/* --- Feedback panel ---
   Result panel that appears after a user submits an answer.                */
.feedback-panel {
  display: none;
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-6);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.feedback-panel.visible {
  display: block;
}

.feedback-score-display {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-success);
  line-height: 1;
  margin-bottom: 4px;
}

.feedback-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--space-4);
}

/* --- Bottom navigation ---
   Prev / Next buttons at the foot of module pages.                         */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-8);
  gap: var(--space-3);
}

.bottom-nav-left  { display: flex; gap: var(--space-2); }
.bottom-nav-right { display: flex; gap: var(--space-2); }

/* --- Card grid ---
   Responsive auto-fit card grid.                                            */
.card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* --- How-step short aliases ---
   Aliases for .how-it-works-step and .how-it-works-icon.                   */
.how-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
}

.how-step-icon {
  width: 56px;
  height: 56px;
  background-color: var(--color-primary-glow);
  border: 1px solid rgba(153, 201, 255, 0.18);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.how-step-num {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
}

.how-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.how-step-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* --- Badge gallery (results page) ---
   Flex wrapping row of earned badges.                                       */
.badge-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-4) 0;
}

.earned-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  min-width: 80px;
}

.earned-badge-icon {
  width: 56px;
  height: 56px;
  background-color: var(--color-primary-glow);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.earned-badge-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  max-width: 88px;
  line-height: 1.3;
}

/* --- Confetti particles (CSS-only burst) ---
   8 particles; JS adds .confetti-wrap + these elements on badge award.     */
.confetti-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
}

/* --- Additional utility aliases ---
   Classes referenced in the PRD spec not yet present in section 26.        */
.font-semibold    { font-weight: 600 !important; }
.justify-between  { justify-content: space-between !important; }
.justify-center   { justify-content: center !important; }
.items-end        { align-items: flex-end !important; }
.max-w-md         { max-width: 448px !important; }
.max-w-lg         { max-width: 512px !important; }
.text-xs          { font-size: 12px !important; }
.mt-3             { margin-top: var(--space-3) !important; }
.mt-5             { margin-top: var(--space-5) !important; }
.mb-3             { margin-bottom: var(--space-3) !important; }
.mb-5             { margin-bottom: var(--space-5) !important; }
.gap-5            { gap: var(--space-5) !important; }
.visible          { visibility: visible !important; }
.invisible        { visibility: hidden !important; }

/* --- Page header supplement ---
   Ensures .page-header margin is consistent with the spec.                 */
.page-header {
  margin-bottom: var(--space-8);
}

.page-header p {
  color: var(--color-text-muted);
  font-size: 16px;
  margin-top: var(--space-2);
  margin-bottom: 0;
}

/* --- Responsive supplements for new classes --- */
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    flex-direction: column-reverse;
    gap: var(--space-2);
  }

  .bottom-nav .btn {
    width: 100%;
    justify-content: center;
  }

  .activity-header {
    flex-wrap: wrap;
  }
}
