/* ============================================
   WorkflowForge - Layout & Components
   ============================================ */

/* ---- App Shell ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.main-content {
  flex: 1;
  min-height: 100vh;
  position: relative;
  transition: margin-right var(--duration-slow) var(--ease-out);
}

.main-content.sidebar-open {
  margin-right: var(--sidebar-width);
}

/* ---- Background Effects ---- */
.bg-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
  animation: bgPulse 15s ease-in-out infinite alternate;
}

.bg-gradient::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -20%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.04) 0%, transparent 60%);
  animation: bgPulse 20s ease-in-out infinite alternate-reverse;
}

@keyframes bgPulse {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 3%) scale(1.1); }
}

/* ---- Grid Pattern Overlay ---- */
.grid-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.015;
  background-image: 
    linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ---- Progress Bar ---- */
.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1000;
  background: var(--bg-secondary);
  padding-top: env(safe-area-inset-top);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #8b5cf6, #a78bfa);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transition: width var(--duration-slow) var(--ease-out);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  width: 20px;
  height: 7px;
  background: rgba(167, 139, 250, 0.6);
  border-radius: var(--radius-full);
  filter: blur(4px);
  animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ---- Step Navigation Dots ---- */
.step-nav {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  z-index: 100;
  box-shadow: var(--shadow-lg);
  margin-bottom: env(safe-area-inset-bottom, 0px);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

.step-dot:hover {
  background: var(--text-tertiary);
  transform: scale(1.3);
}

.step-dot.active {
  width: 28px;
  background: var(--accent-primary);
}

.step-dot.completed {
  background: var(--accent-success);
}

/* ---- Step Container ---- */
.step {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.step.active {
  display: flex;
  flex-direction: column;
  animation: stepFadeIn var(--duration-slow) var(--ease-out);
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-content {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-12) var(--space-8);
  width: 100%;
}

/* ---- Typography ---- */
.heading-xl {
  font-size: var(--text-6xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.heading-lg {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

.heading-md {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

.heading-sm {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

.subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 560px;
}

.text-sm {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.text-xs {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 32px;
  border-radius: var(--radius-xl);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary::before {
  background: linear-gradient(135deg, var(--accent-primary-hover), #8b5cf6);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-secondary::before {
  background: var(--bg-card-hover);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.btn-lg {
  padding: 18px 40px;
  font-size: var(--text-lg);
  border-radius: var(--radius-2xl);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 50%);
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

.card-selected {
  border-color: var(--accent-primary) !important;
  box-shadow: var(--shadow-card-hover), 0 0 0 1px var(--accent-primary), var(--shadow-glow);
  background: var(--accent-primary-soft);
}

.card-selected::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  animation: checkPop var(--duration-normal) var(--ease-spring);
}

@keyframes checkPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ---- Industry Cards Grid ---- */
.industry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.industry-card {
  cursor: pointer;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.industry-card .icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--accent-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  transition: all var(--duration-normal) var(--ease-out);
}

.industry-card:hover .icon-wrap {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.1);
}

.industry-card .card-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.industry-card .card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ---- Business Size Cards ---- */
.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.size-card {
  cursor: pointer;
  padding: var(--space-8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.size-card .icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--accent-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  transition: all var(--duration-normal) var(--ease-out);
}

.size-card:hover .icon-wrap,
.size-card.card-selected .icon-wrap {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.1);
}

.size-card .badge {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

/* ---- Business Model Cards ---- */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.model-card {
  cursor: pointer;
  padding: var(--space-6);
}

/* ---- Goal Chips ---- */
.goals-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
  justify-content: center;
}

.goal-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  user-select: none;
}

.goal-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.goal-chip.selected {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.goal-chip .chip-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.goal-chip.selected .chip-icon {
  opacity: 1;
}

/* ---- Workflow Blueprint ---- */
.blueprint-container {
  margin-top: var(--space-12);
  padding: var(--space-8);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  position: relative;
  overflow: hidden;
}

.blueprint-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.workflow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  padding: var(--space-4) 0;
  position: relative;
  z-index: 1;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 0;
  animation: workflowStepIn var(--duration-slow) var(--ease-out) both;
}

.workflow-node {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  white-space: nowrap;
  transition: all var(--duration-normal) var(--ease-out);
}

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

.workflow-node .node-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.workflow-arrow {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--border-strong), var(--accent-primary));
  position: relative;
  flex-shrink: 0;
}

.workflow-arrow::after {
  content: '';
  position: absolute;
  right: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent-primary);
  border-bottom: 2px solid var(--accent-primary);
  transform: rotate(-45deg);
}

@keyframes workflowStepIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- Module Explorer ---- */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.module-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

.module-header {
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.module-header .module-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--accent-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.module-header .module-info {
  flex: 1;
}

.module-header .module-name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
}

.module-header .module-stats {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.module-header .expand-icon {
  color: var(--text-muted);
  transition: transform var(--duration-normal) var(--ease-out);
}

.module-card.expanded .expand-icon {
  transform: rotate(180deg);
}

.module-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--ease-out);
}

.module-card.expanded .module-body {
  max-height: 500px;
}

.module-body-inner {
  padding: 0 var(--space-6) var(--space-6);
}

.module-section-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-2);
  margin-top: var(--space-3);
}

.module-items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.module-item {
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* ---- Application Preview ---- */
.app-preview-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.app-preview-toolbar {
  height: 36px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  gap: var(--space-2);
}

.app-preview-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
}

.app-preview-dot.red { background: #ff5f57; }
.app-preview-dot.yellow { background: #febc2e; }
.app-preview-dot.green { background: #28c840; }

.app-preview-url {
  flex: 1;
  margin-left: var(--space-4);
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 400px;
}

.app-preview-body {
  display: flex;
  min-height: 500px;
}

.app-sidebar {
  width: var(--app-sidebar-width);
  background: var(--bg-tertiary);
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-4) 0;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 600px;
}

.app-sidebar-section {
  margin-bottom: var(--space-3);
}

.app-sidebar-section-title {
  font-size: 10px;
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  padding: var(--space-2) var(--space-4);
}

.app-sidebar-item {
  padding: 8px var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: all var(--duration-fast);
}

.app-sidebar-item:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.app-sidebar-item.active {
  color: var(--accent-primary);
  background: var(--accent-primary-soft);
}

.app-sidebar-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.app-main {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
  max-height: 600px;
}

.app-main-header {
  margin-bottom: var(--space-6);
}

.app-main-header h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-1);
}

.app-main-header p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.stat-card .stat-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-1);
}

.stat-card .stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.stat-card .stat-change {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  margin-top: var(--space-1);
}

.stat-card .stat-change.positive { color: var(--accent-success); }
.stat-card .stat-change.negative { color: var(--accent-error); }

/* ---- Data Table ---- */
.data-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table-wrapper::-webkit-scrollbar {
  height: 4px;
}

.data-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-full);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table tr:hover td {
  background: var(--bg-card);
  color: var(--text-primary);
}

.data-table .status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.status-badge.confirmed, .status-badge.paid {
  background: var(--accent-success-soft);
  color: var(--accent-success);
}

.status-badge.pending, .status-badge.processing {
  background: var(--accent-warning-soft);
  color: var(--accent-warning);
}

.status-badge.overdue {
  background: var(--accent-error-soft);
  color: var(--accent-error);
}

/* ---- Architecture Visualization ---- */
.arch-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-8) 0;
}

.arch-layer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  animation: archLayerIn var(--duration-slow) var(--ease-out) both;
}

.arch-node {
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  text-align: center;
  min-width: 100px;
  transition: all var(--duration-normal) var(--ease-out);
}

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

.arch-arrow {
  width: 2px;
  height: 24px;
  background: linear-gradient(180deg, var(--border-strong), var(--accent-primary));
  position: relative;
}

.arch-arrow::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--accent-primary);
  border-bottom: 2px solid var(--accent-primary);
  transform: rotate(-45deg);
}

@keyframes archLayerIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Summary Grid ---- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.summary-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.summary-item .summary-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-2);
}

.summary-item .summary-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.summary-item .summary-sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ---- Counter Animation ---- */
.animated-counter {
  font-variant-numeric: tabular-nums;
}

/* ---- Welcome Step ---- */
.welcome-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: var(--space-8);
}

.welcome-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-8);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
  animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.welcome-logo svg {
  width: 40px;
  height: 40px;
  color: white;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.welcome-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--accent-success);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ---- Sidebar ---- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-out);
}

.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.live-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--bg-glass-border);
  z-index: 99;
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out);
  overflow-y: auto;
  padding: var(--space-6);
  overscroll-behavior: contain;
}

.live-sidebar.visible {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
}

.sidebar-section {
  margin-bottom: var(--space-6);
}

.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-3);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}

.sidebar-item .check {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--accent-success-soft);
  color: var(--accent-success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-item .check svg {
  width: 12px;
  height: 12px;
}

.sidebar-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.sidebar-stat .label {
  color: var(--text-tertiary);
}

.sidebar-stat .value {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.sidebar-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  width: 44px;
  height: 44px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

.sidebar-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border-strong);
  transform: scale(1.05);
}

.sidebar-toggle:active {
  transform: scale(0.95);
}

.sidebar-toggle.shifted {
  right: calc(var(--sidebar-width) + 16px);
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  border-color: var(--border-accent);
}

/* ---- Loading States ---- */
.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Spinner ---- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Section Headers ---- */
.step-header {
  text-align: center;
  margin-bottom: var(--space-4);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
}

.step-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--space-3);
}

/* ---- Navigation Buttons ---- */
.step-nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-subtle);
}

/* ---- Generate Button ---- */
.generate-btn {
  padding: 20px 48px;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
  color: white;
  border-radius: var(--radius-2xl);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
  transition: all var(--duration-normal) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.generate-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

.generate-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ---- Completion Screen ---- */
.completion-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  gap: var(--space-6);
}

.completion-icon {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: var(--accent-success-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-success);
  animation: completionPop var(--duration-slow) var(--ease-spring);
}

@keyframes completionPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ============================================
   Responsive — Desktop First
   ============================================ */

/* ---- Large Desktop (default) ---- */
.main-content.sidebar-open {
  margin-right: var(--sidebar-width);
}

/* ---- Tablet / Small Desktop (< 1200px) ---- */
@media (max-width: 1200px) {
  .industry-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Tablet (< 1024px) ---- */
@media (max-width: 1024px) {
  .main-content.sidebar-open {
    margin-right: 0;
  }
  
  .sidebar-toggle.shifted {
    right: 16px;
    top: 16px;
    z-index: 101;
  }
  
  .app-sidebar {
    width: 200px;
  }
  
  .app-preview-url {
    max-width: 280px;
  }
  
  .heading-xl {
    font-size: var(--text-5xl);
  }
  
  .heading-lg {
    font-size: var(--text-3xl);
  }
  
  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---- Mobile Landscape / Small Tablet (< 768px) ---- */
@media (max-width: 768px) {
  .heading-xl {
    font-size: var(--text-4xl);
  }
  
  .heading-lg {
    font-size: var(--text-2xl);
  }
  
  .heading-md {
    font-size: var(--text-xl);
  }
  
  .subtitle {
    font-size: var(--text-base);
  }
  
  .step-content {
    padding: var(--space-8) var(--space-6);
  }
  
  /* Industry grid */
  .industry-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: var(--space-3);
  }
  
  .industry-card {
    padding: var(--space-4);
  }
  
  .industry-card .icon-wrap {
    width: 40px;
    height: 40px;
  }
  
  /* Size grid */
  .size-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  
  .size-card {
    padding: var(--space-6);
  }
  
  .size-card .icon-wrap {
    width: 52px;
    height: 52px;
  }
  
  /* Model grid */
  .model-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }
  
  .model-card {
    padding: var(--space-5);
  }
  
  /* Goals */
  .goals-grid {
    gap: var(--space-2);
  }
  
  .goal-chip {
    padding: 8px 14px;
    font-size: var(--text-xs);
  }
  
  /* Modules */
  .modules-grid {
    grid-template-columns: 1fr;
  }
  
  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  
  .stat-card {
    padding: var(--space-3);
  }
  
  .stat-card .stat-value {
    font-size: var(--text-xl);
  }
  
  /* App preview */
  .app-preview-container {
    border-radius: var(--radius-lg);
  }
  
  .app-preview-body {
    flex-direction: column;
  }
  
  .app-sidebar {
    width: 100%;
    max-height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-3) 0;
  }
  
  .app-sidebar-section {
    margin-bottom: var(--space-2);
  }
  
  .app-sidebar-section-title {
    padding: var(--space-1) var(--space-3);
    font-size: 9px;
  }
  
  .app-sidebar-item {
    padding: 6px var(--space-3);
    font-size: var(--text-xs);
  }
  
  .app-sidebar-item svg {
    width: 14px;
    height: 14px;
  }
  
  .app-main {
    padding: var(--space-4);
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .app-main-header h2 {
    font-size: var(--text-xl);
  }
  
  .app-preview-toolbar {
    height: 32px;
  }
  
  .app-preview-dot {
    width: 10px;
    height: 10px;
  }
  
  .app-preview-url {
    max-width: 200px;
    font-size: 10px;
    padding: 3px 8px;
  }
  
  /* Data table */
  .data-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table {
    min-width: 500px;
  }
  
  .data-table th,
  .data-table td {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    white-space: nowrap;
  }
  
  /* Summary */
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  
  .summary-item {
    padding: var(--space-4);
  }
  
  .summary-item .summary-value {
    font-size: var(--text-xl);
  }
  
  /* Workflow */
  .workflow-steps {
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
  }
  
  .workflow-node {
    padding: 8px 14px;
    font-size: var(--text-xs);
    gap: var(--space-2);
  }
  
  .workflow-node .node-icon {
    width: 24px;
    height: 24px;
  }
  
  .workflow-arrow {
    width: 24px;
  }
  
  /* Architecture */
  .arch-container {
    gap: var(--space-2);
  }
  
  .arch-node {
    padding: 10px 16px;
    font-size: var(--text-xs);
    min-width: 80px;
  }
  
  .arch-arrow {
    height: 18px;
  }
  
  /* Blueprint */
  .blueprint-container {
    padding: var(--space-5);
  }
  
  /* Step nav */
  .step-nav {
    bottom: 16px;
    padding: 8px 16px;
    gap: 6px;
  }
  
  .step-dot {
    width: 6px;
    height: 6px;
  }
  
  .step-dot.active {
    width: 22px;
  }
  
  /* Buttons */
  .btn-lg {
    padding: 14px 28px;
    font-size: var(--text-base);
  }
  
  .step-nav-buttons {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
  }
  
  /* Welcome */
  .welcome-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-xl);
  }
  
  .welcome-logo svg {
    width: 32px;
    height: 32px;
  }
  
  .generate-btn {
    padding: 16px 36px;
    font-size: var(--text-base);
  }
}

/* ---- Mobile Portrait (< 480px) ---- */
@media (max-width: 480px) {
  .step-content {
    padding: var(--space-6) var(--space-4);
  }
  
  .heading-xl {
    font-size: var(--text-3xl);
  }
  
  .heading-lg {
    font-size: var(--text-xl);
  }
  
  .heading-md {
    font-size: var(--text-lg);
  }
  
  .subtitle {
    font-size: var(--text-sm);
    max-width: 100%;
  }
  
  /* Industry grid - 2 columns */
  .industry-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
  
  .industry-card {
    padding: var(--space-3);
    gap: var(--space-2);
  }
  
  .industry-card .icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
  }
  
  .industry-card .icon-wrap svg {
    width: 18px;
    height: 18px;
  }
  
  .industry-card .card-title {
    font-size: var(--text-sm);
  }
  
  .industry-card .card-desc {
    font-size: 11px;
    display: none;
  }
  
  /* Size grid */
  .size-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
  
  .size-card {
    padding: var(--space-4);
    gap: var(--space-2);
  }
  
  .size-card .icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
  }
  
  .size-card .badge {
    font-size: 10px;
  }
  
  .size-card .card-title {
    font-size: var(--text-sm);
  }
  
  .size-card .card-desc {
    font-size: 11px;
  }
  
  /* Model grid */
  .model-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  
  .model-card {
    padding: var(--space-4);
  }
  
  /* Goals */
  .goals-grid {
    gap: var(--space-2);
    padding: 0 var(--space-1);
  }
  
  .goal-chip {
    padding: 7px 12px;
    font-size: 11px;
    border-radius: var(--radius-lg);
  }
  
  .goal-chip .chip-icon {
    width: 14px;
    height: 14px;
  }
  
  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
  
  .stat-card {
    padding: var(--space-3);
    border-radius: var(--radius-md);
  }
  
  .stat-card .stat-label {
    font-size: 10px;
  }
  
  .stat-card .stat-value {
    font-size: var(--text-lg);
  }
  
  .stat-card .stat-change {
    font-size: 10px;
  }
  
  /* Summary */
  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
  
  .summary-item {
    padding: var(--space-3);
    border-radius: var(--radius-lg);
  }
  
  .summary-item .summary-label {
    font-size: 10px;
  }
  
  .summary-item .summary-value {
    font-size: var(--text-lg);
  }
  
  /* App preview */
  .app-preview-url {
    display: none;
  }
  
  .app-main {
    padding: var(--space-3);
    max-height: 350px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .app-main-header h2 {
    font-size: var(--text-lg);
  }
  
  .app-main-header p {
    font-size: var(--text-xs);
  }
  
  /* Blueprint */
  .blueprint-container {
    padding: var(--space-4);
  }
  
  .blueprint-container h3 {
    font-size: var(--text-base);
  }
  
  /* Workflow */
  .workflow-node {
    padding: 6px 10px;
    font-size: 10px;
  }
  
  .workflow-node .node-icon {
    width: 20px;
    height: 20px;
  }
  
  .workflow-arrow {
    width: 16px;
  }
  
  /* Architecture */
  .arch-node {
    padding: 8px 12px;
    font-size: 10px;
    min-width: 70px;
  }
  
  /* Step nav dots */
  .step-nav {
    bottom: 12px;
    padding: 6px 12px;
    gap: 5px;
  }
  
  .step-dot {
    width: 5px;
    height: 5px;
  }
  
  .step-dot.active {
    width: 18px;
  }
  
  /* Buttons */
  .btn {
    padding: 12px 24px;
    font-size: var(--text-sm);
  }
  
  .btn-lg {
    padding: 12px 24px;
    font-size: var(--text-sm);
  }
  
  .step-nav-buttons {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
  }
  
  .step-header {
    margin-bottom: var(--space-3);
  }
  
  .step-number {
    width: 28px;
    height: 28px;
    font-size: var(--text-xs);
    margin-bottom: var(--space-3);
  }
  
  /* Welcome */
  .welcome-center {
    min-height: 70vh;
    padding: var(--space-6);
  }
  
  .welcome-logo {
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-6);
  }
  
  .welcome-logo svg {
    width: 28px;
    height: 28px;
  }
  
  .welcome-badge {
    font-size: var(--text-xs);
    padding: 4px 12px;
  }
  
  .generate-btn {
    padding: 14px 28px;
    font-size: var(--text-sm);
    gap: var(--space-2);
  }
  
  .generate-btn svg {
    width: 18px;
    height: 18px;
  }
  
  /* Completion screen */
  .completion-icon {
    width: 80px;
    height: 80px;
  }
  
  .completion-icon svg {
    width: 36px;
    height: 36px;
  }
}

/* ---- Very Small Screens (< 360px) ---- */
@media (max-width: 360px) {
  .step-content {
    padding: var(--space-4) var(--space-3);
  }
  
  .heading-xl {
    font-size: var(--text-2xl);
  }
  
  .heading-lg {
    font-size: var(--text-lg);
  }
  
  .industry-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
  
  .industry-card .card-title {
    font-size: var(--text-xs);
  }
  
  .size-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .size-card .card-title {
    font-size: var(--text-xs);
  }
  
  .goal-chip {
    padding: 6px 10px;
    font-size: 10px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .step-nav {
    bottom: 8px;
    padding: 5px 10px;
    gap: 4px;
  }
  
  .step-dot {
    width: 4px;
    height: 4px;
  }
  
  .step-dot.active {
    width: 16px;
  }
}

/* ---- Sidebar Responsive Overrides ---- */
@media (max-width: 1024px) {
  .live-sidebar {
    width: min(320px, 85vw);
  }
  
  .sidebar-toggle.shifted {
    right: 16px;
    z-index: 101;
    background: var(--bg-card);
    border-color: var(--border-strong);
  }
}

@media (max-width: 768px) {
  .live-sidebar {
    width: min(300px, 88vw);
  }
  
  .sidebar-toggle {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
  
  .sidebar-toggle.shifted {
    right: 16px;
  }
}

@media (max-width: 480px) {
  .live-sidebar {
    width: 100vw;
    padding: var(--space-4);
    border-left: none;
  }
  
  .sidebar-toggle {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    z-index: 101;
  }
  
  .sidebar-toggle.shifted {
    right: 12px;
    background: var(--bg-card);
    border-color: var(--border-strong);
  }
}

/* ---- App Preview Sidebar Horizontal Scroll on Mobile ---- */
@media (max-width: 480px) {
  .app-sidebar {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    gap: 0;
    padding: var(--space-2) var(--space-3);
    max-height: 120px;
    scroll-snap-type: x mandatory;
  }
  
  .app-sidebar-section {
    min-width: max-content;
    flex-shrink: 0;
    margin-bottom: 0;
    scroll-snap-align: start;
  }
  
  .app-sidebar-item {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* ---- Touch-friendly interactive elements ---- */
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
  }
  
  .goal-chip {
    min-height: 40px;
  }
  
  .step-dot {
    min-width: 24px;
    min-height: 24px;
    padding: 8px;
  }
  
  .step-dot.active {
    min-width: 36px;
  }
  
  .sidebar-toggle {
    min-width: 44px;
    min-height: 44px;
  }
  
  .industry-card,
  .size-card,
  .model-card {
    min-height: 44px;
  }
  
  .app-sidebar-item {
    min-height: 36px;
  }
}

/* ============================================
   Additional Micro-Interactions & Polish
   ============================================ */

/* Focus states */
.btn:focus-visible,
.goal-chip:focus-visible,
.step-dot:focus-visible,
.industry-card:focus-visible,
.size-card:focus-visible,
.model-card:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Card stagger animation */
.industry-card,
.size-card,
.model-card,
.module-card,
.summary-item {
  animation: cardStagger var(--duration-slow) var(--ease-out) both;
}

.industry-card:nth-child(1), .size-card:nth-child(1), .model-card:nth-child(1) { animation-delay: 0ms; }
.industry-card:nth-child(2), .size-card:nth-child(2), .model-card:nth-child(2) { animation-delay: 50ms; }
.industry-card:nth-child(3), .size-card:nth-child(3), .model-card:nth-child(3) { animation-delay: 100ms; }
.industry-card:nth-child(4), .size-card:nth-child(4), .model-card:nth-child(4) { animation-delay: 150ms; }
.industry-card:nth-child(5) { animation-delay: 200ms; }
.industry-card:nth-child(6) { animation-delay: 250ms; }
.industry-card:nth-child(7) { animation-delay: 300ms; }
.industry-card:nth-child(8) { animation-delay: 350ms; }
.industry-card:nth-child(9) { animation-delay: 400ms; }
.industry-card:nth-child(10) { animation-delay: 450ms; }
.industry-card:nth-child(11) { animation-delay: 500ms; }
.industry-card:nth-child(12) { animation-delay: 550ms; }

.summary-item:nth-child(1) { animation-delay: 0ms; }
.summary-item:nth-child(2) { animation-delay: 60ms; }
.summary-item:nth-child(3) { animation-delay: 120ms; }
.summary-item:nth-child(4) { animation-delay: 180ms; }
.summary-item:nth-child(5) { animation-delay: 240ms; }
.summary-item:nth-child(6) { animation-delay: 300ms; }
.summary-item:nth-child(7) { animation-delay: 360ms; }
.summary-item:nth-child(8) { animation-delay: 420ms; }

.module-card:nth-child(1) { animation-delay: 0ms; }
.module-card:nth-child(2) { animation-delay: 50ms; }
.module-card:nth-child(3) { animation-delay: 100ms; }
.module-card:nth-child(4) { animation-delay: 150ms; }
.module-card:nth-child(5) { animation-delay: 200ms; }
.module-card:nth-child(6) { animation-delay: 250ms; }
.module-card:nth-child(7) { animation-delay: 300ms; }
.module-card:nth-child(8) { animation-delay: 350ms; }
.module-card:nth-child(9) { animation-delay: 400ms; }
.module-card:nth-child(10) { animation-delay: 450ms; }

@keyframes cardStagger {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Goal chip stagger */
.goal-chip {
  animation: chipPop var(--duration-normal) var(--ease-spring) both;
}

.goal-chip:nth-child(1) { animation-delay: 0ms; }
.goal-chip:nth-child(2) { animation-delay: 30ms; }
.goal-chip:nth-child(3) { animation-delay: 60ms; }
.goal-chip:nth-child(4) { animation-delay: 90ms; }
.goal-chip:nth-child(5) { animation-delay: 120ms; }
.goal-chip:nth-child(6) { animation-delay: 150ms; }
.goal-chip:nth-child(7) { animation-delay: 180ms; }
.goal-chip:nth-child(8) { animation-delay: 210ms; }
.goal-chip:nth-child(9) { animation-delay: 240ms; }
.goal-chip:nth-child(10) { animation-delay: 270ms; }
.goal-chip:nth-child(11) { animation-delay: 300ms; }
.goal-chip:nth-child(12) { animation-delay: 330ms; }
.goal-chip:nth-child(13) { animation-delay: 360ms; }
.goal-chip:nth-child(14) { animation-delay: 390ms; }
.goal-chip:nth-child(15) { animation-delay: 420ms; }
.goal-chip:nth-child(16) { animation-delay: 450ms; }
.goal-chip:nth-child(17) { animation-delay: 480ms; }
.goal-chip:nth-child(18) { animation-delay: 510ms; }

@keyframes chipPop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Sidebar toggle pulse */
.sidebar-toggle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-lg);
  background: var(--accent-primary);
  opacity: 0;
  transition: opacity var(--duration-normal);
  z-index: -1;
}

.sidebar-toggle:hover::before {
  opacity: 0.08;
}

/* Stat card counter animation */
.stat-value {
  font-variant-numeric: tabular-nums;
}

/* Workflow node pulse */
.workflow-node {
  animation: workflowNodeIn var(--duration-slow) var(--ease-out) both;
}

@keyframes workflowNodeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* App preview tab active indicator */
.app-sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent-primary);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.app-sidebar-item {
  position: relative;
}

/* Architecture node hover glow */
.arch-node:hover {
  background: var(--bg-card-hover);
}

/* Generate button ripple effect */
.generate-btn {
  position: relative;
  overflow: hidden;
}

.generate-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.generate-btn:hover::after {
  transform: translateX(100%);
}

/* Welcome title gradient animation */
.heading-xl {
  background-size: 200% auto;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- Smooth page transitions ---- */
.step.active {
  animation: stepEnter var(--duration-slow) var(--ease-out);
  will-change: opacity, transform;
}

@keyframes stepEnter {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Scroll containment ---- */
.app-main {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.app-sidebar {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.live-sidebar {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ---- Touch action hints ---- */
.btn,
.goal-chip,
.industry-card,
.size-card,
.model-card,
.step-dot,
.module-header,
.app-sidebar-item {
  touch-action: manipulation;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .bg-gradient::before,
  .bg-gradient::after {
    animation: none;
  }
  
  .welcome-logo {
    animation: none;
  }
}

/* Table row hover */
.data-table tbody tr {
  transition: background var(--duration-fast);
}

/* Print styles */
@media print {
  .step-nav, .sidebar-toggle, .live-sidebar, .progress-bar-container, .bg-gradient, .grid-pattern {
    display: none !important;
  }
  
  .main-content {
    margin-right: 0 !important;
  }
  
  body {
    background: white;
    color: #1a1a1a;
  }
}
