:root {
  --bg: #070a0e;
  --surface: #0e141b;
  --surface-raised: #151e28;
  --surface-hover: #1c2734;
  --border: #233446;
  --border-light: #2d435b;
  --text: #eef3f9;
  --text-muted: #9aa8ba;
  --text-dim: #6b7a8f;
  --primary: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.25);
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.25);
  --warning: #f59e0b;
  --danger: #ef4444;
  --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.5;
  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: 1400px;
  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, #10b981, #f59e0b);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  width: 40px;
  height: 40px;
  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;
  background: var(--surface-raised);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-bar-bg {
  width: 120px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 32px;
}

/* Main Layout */
.main-layout {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  max-width: 1540px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  gap: 24px;
  padding: 24px;
}

@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 240px 1fr;
  }
  .coach-sidebar {
    position: fixed;
    right: -360px;
    top: 73px;
    bottom: 0;
    width: 340px;
    z-index: 90;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.5);
  }
  .coach-sidebar.open {
    right: 0;
  }
}

@media (max-width: 860px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .steps-sidebar {
    display: none;
  }
}

/* Left Sidebar - Steps List */
.steps-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 90px;
  height: calc(100vh - 114px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 8px;
}

.step-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
}

.step-nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.step-nav-item.active {
  background: var(--surface-raised);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.step-nav-item.completed {
  color: var(--text);
}

.step-nav-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

.step-nav-item.active .step-nav-badge {
  background: var(--primary);
  color: #fff;
}

.step-nav-item.completed .step-nav-badge {
  background: var(--accent);
  color: #fff;
}

/* Content Area */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Global OS Selector Card */
.os-selector-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.os-selector-info h2 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.os-selector-info p {
  font-size: 13px;
  color: var(--text-muted);
}

.os-btn-group {
  display: flex;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.os-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.os-tab-btn:hover {
  color: var(--text);
}

.os-tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Step Cards */
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: none;
}

.step-card.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-card-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.step-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.step-number-tag {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.step-time-est {
  font-size: 12px;
  color: var(--text-dim);
}

.step-card-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.step-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.6;
}

.step-card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.instruction-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.instruction-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.instruction-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Code Snippet Box */
.terminal-card {
  background: #040609;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.terminal-header {
  background: #0a0f16;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #233446;
}

.terminal-shell-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-btn {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: var(--surface-hover);
  color: #fff;
}

.copy-btn.copied {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.terminal-body {
  padding: 14px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: #d1dcec;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-body .cmd-prompt {
  color: var(--primary);
  user-select: none;
}

.terminal-body .cmd-comment {
  color: var(--text-dim);
  font-style: italic;
}

/* Callout Box */
.callout {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.callout.info {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

.callout.warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
}

.callout-icon {
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 2px;
}

/* Verification Checkpoint */
.checkpoint-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.checkpoint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkpoint-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.checkpoint-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--border);
  color: var(--text-dim);
}

.checkpoint-badge.verified {
  background: var(--primary);
  color: #fff;
}

.checkpoint-prompt {
  font-size: 13.5px;
  color: var(--text-muted);
}

.checkpoint-input-group {
  display: flex;
  gap: 10px;
}

.checkpoint-input {
  flex: 1;
  background: #070a0e;
  border: 1px solid var(--border);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease;
}

.checkpoint-input:focus {
  border-color: var(--primary);
}

.checkpoint-input.valid {
  border-color: var(--primary);
}

.checkpoint-input.invalid {
  border-color: var(--danger);
}

.btn-verify {
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.btn-verify:hover {
  background: #059669;
}

.checkpoint-feedback {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: none;
  line-height: 1.5;
}

.checkpoint-feedback.success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.checkpoint-feedback.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

/* Card Footer / Navigation */
.step-card-footer {
  padding: 18px 28px;
  background: var(--surface-raised);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-nav {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-prev {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-prev:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-prev:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-next {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
}

.btn-next:hover:not(:disabled) {
  background: #059669;
}

.btn-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Run It Later Reference Card */
.reference-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reference-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reference-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.ref-box {
  background: #040609;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-box-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ref-box-cmd {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #fff;
  background: var(--surface);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  word-break: break-all;
}

.ref-box-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Right Sidebar - Ask Orbit Coach */
.coach-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 114px);
  position: sticky;
  top: 90px;
  overflow: hidden;
}

.coach-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-raised);
}

.coach-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coach-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.coach-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.coach-status {
  font-size: 11px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary-glow);
}

.coach-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-bubble {
  max-width: 90%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.bot {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  align-self: flex-start;
  color: var(--text);
  border-bottom-left-radius: 2px;
}

.chat-bubble.user {
  background: var(--primary);
  align-self: flex-end;
  color: #fff;
  border-bottom-right-radius: 2px;
}

.coach-faqs-section {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #080d14;
}

.coach-faqs-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.quick-questions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.quick-q-btn {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-q-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--primary);
}

.coach-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-raised);
  display: flex;
  gap: 8px;
}

.coach-input {
  flex: 1;
  background: #070a0e;
  border: 1px solid var(--border);
  color: #fff;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
}

.coach-input:focus {
  border-color: var(--primary);
}

.coach-send-btn {
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.coach-send-btn:hover {
  background: #059669;
}

/* Mobile Float Toggle */
.mobile-coach-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px var(--primary-glow);
  cursor: pointer;
  z-index: 1000;
}

@media (max-width: 1200px) {
  .mobile-coach-toggle {
    display: flex;
  }
}

/* Tab visibility */
[data-os] {
  display: none;
}

[data-os].os-visible {
  display: block;
}


/* 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;
}
