/* Page-specific tokens */
:root {
  --color-success: #4ade80;
  --color-warning: #fbbf24;
  --color-error: #f87171;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms;
  --transition-normal: 300ms;
}

/* Body overrides for build page */
body {
  display: flex;
  flex-direction: column;
}

/* ============ HEADER OVERRIDES ============ */
header {
  padding: 0.75rem 0;
  background: rgba(8, 6, 26, 0.8);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo { font-size: 1.35rem; }
.logo-dot { width: 5px; height: 5px; }

.header-divider {
  width: 1px;
  height: 18px;
  background: var(--border-medium);
}

.header-product {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.header-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.header-back:hover { color: var(--brand-secondary); }
.header-back svg { width: 16px; height: 16px; }

/* ============ STEPPER BAR ============ */
.stepper-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0;
  position: sticky;
  top: 49px;
  z-index: 90;
}

.stepper-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: stretch;
}

.stepper-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 0.75rem;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  position: relative;
  transition: color var(--transition-normal) var(--ease-out);
  white-space: nowrap;
  text-align: left;
}

.stepper-step::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-primary);
  transform: scaleX(0);
  transition: transform var(--transition-normal) var(--ease-out);
}

.stepper-step:hover { color: var(--text-secondary); }

.stepper-step.active {
  color: var(--brand-primary);
}
.stepper-step.active::after { transform: scaleX(1); }

.stepper-step.completed {
  color: var(--text-secondary);
  cursor: pointer;
}

.stepper-step.disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid var(--border-medium);
  color: var(--text-muted);
  transition: all var(--transition-normal) var(--ease-out);
}

.stepper-step.active .step-number {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--bg-base);
}

.stepper-step.completed .step-number {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--bg-base);
}

.step-label { pointer-events: none; }

/* Checkmark for completed steps */
.step-check {
  display: none;
}
.stepper-step.completed .step-check { display: block; }
.stepper-step.completed .step-num { display: none; }

/* Mobile stepper */
.stepper-mobile {
  display: none;
  padding: 0.75rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.stepper-mobile-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stepper-mobile-progress {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.stepper-mobile-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.stepper-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  background: transparent;
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.stepper-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  background: transparent;
  transition: all 0.2s ease;
}
.stepper-dot {
  border: none;
  background: none;
}
.stepper-dot.active::after {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}
.stepper-dot.completed::after {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
}
.stepper-dot.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.stepper-dot:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 50%;
}

/* Progress track */
.stepper-progress {
  height: 2px;
  background: var(--border-subtle);
  position: relative;
}
.stepper-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  transition: width 0.5s var(--ease-out);
  border-radius: 0 1px 1px 0;
}

/* ============ MAIN CONTENT AREA ============ */
.content-area {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 2rem 2rem;
  position: relative;
}

/* Step panels */
.step-panel {
  display: none;
  animation: stepFadeIn var(--transition-normal) var(--ease-out) both;
}
.step-panel.active { display: block; }

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

.step-header {
  margin-bottom: 2rem;
}
.step-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.step-header p {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 300;
}

/* ============ FOOTER NAVIGATION ============ */
.step-footer {
  position: sticky;
  bottom: 0;
  background: rgba(8, 6, 26, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  padding: 1rem 0;
  z-index: 80;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal) var(--ease-out);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}
.btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--brand-primary);
  color: var(--bg-base);
}
.btn-primary:not(:disabled):hover {
  background: #b89dfc;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(167, 139, 250, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-medium);
}
.btn-secondary:not(:disabled):hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 0.7rem 1rem;
}
.btn-ghost:not(:disabled):hover {
  color: var(--text-secondary);
}

.btn-copper {
  background: var(--brand-secondary);
  color: var(--bg-base);
}
.btn-copper:not(:disabled):hover {
  background: var(--brand-secondary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(217, 174, 131, 0.3);
}

/* ============ FORM ELEMENTS ============ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  outline: none;
}
.form-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-input::placeholder {
  color: var(--text-muted);
}

/* ============ CARDS / PANELS ============ */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* ============ LOADING STATES ============ */
.loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 26, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  border-radius: var(--radius-lg);
}
.loading-overlay.active { display: flex; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-medium);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============ TOAST MESSAGES ============ */
.toast-container {
  position: fixed;
  bottom: 5rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s var(--ease-spring) both;
  max-width: 380px;
}
.toast.success { border-left: 3px solid var(--color-success); }
.toast.error { border-left: 3px solid var(--color-error); }
.toast.info { border-left: 3px solid var(--brand-primary); }

.toast.leaving {
  animation: toastOut 0.25s var(--ease-out) both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* ============ SKIP WARNING BADGE ============ */
.skip-warning {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-warning);
  background: rgba(251, 191, 36, 0.1);
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.skip-warning svg { width: 12px; height: 12px; }

/* ============ PLACEHOLDER CONTENT ============ */
.step-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 300;
  text-align: center;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
}

/* ============ STEP 1: COLOR + NAME ============ */
.step1-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.step1-inputs { display: flex; flex-direction: column; gap: 1.5rem; }

/* Color picker row */
.color-picker-group {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.color-picker-group .form-group { flex: 1; margin-bottom: 0; }

.color-hex-input {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.color-native-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border-medium);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}
.color-native-wrap:hover { border-color: var(--brand-primary); }

.color-native-wrap input[type="color"] {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  border: none;
  cursor: pointer;
  background: none;
}

.btn-random-color {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-random-color:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-glow);
}
.btn-random-color svg { width: 18px; height: 18px; }

/* Palette preview */
.palette-preview {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.palette-preview.visible {
  opacity: 1;
  transform: translateY(0);
}

.palette-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.palette-preview-header h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}
.palette-preview-header .palette-seed {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.palette-section {
  margin-bottom: 1.25rem;
}
.palette-section:last-child { margin-bottom: 0; }

.palette-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.palette-row {
  display: flex;
  gap: 4px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.palette-swatch {
  flex: 1;
  height: 48px;
  position: relative;
  cursor: pointer;
  transition: transform var(--transition-fast) var(--ease-out);
}
.palette-swatch:hover {
  transform: scaleY(1.15);
  z-index: 2;
}

.swatch-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-md);
  z-index: 10;
}
.palette-swatch:hover .swatch-tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Scale lock UI */
.palette-section.locked .palette-row{box-shadow:inset 0 0 0 2px #D9AE83;border-radius:6px;}
.scale-lock{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:rgba(255,255,255,.08);border:none;cursor:pointer;font-size:.7rem;margin-left:.5rem;opacity:.5;transition:all .2s;vertical-align:middle;}
.scale-lock:hover{opacity:1;background:rgba(255,255,255,.12);}
.scale-lock.locked{opacity:1;}

/* Primary color large swatch */
.palette-primary-swatch {
  height: 72px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  padding: 0.6rem 0.75rem;
  position: relative;
  cursor: pointer;
  transition: box-shadow var(--transition-fast);
  margin-bottom: 1rem;
}
.palette-primary-swatch:hover {
  box-shadow: 0 0 0 2px var(--brand-primary);
}
.palette-primary-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.palette-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
  text-align: center;
  padding: 2rem;
}
.palette-empty svg {
  width: 40px;
  height: 40px;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.color-copied-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--bg-base);
  border: 1px solid var(--color-success);
  color: var(--color-success);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease-spring);
}
.color-copied-flash.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Generate button */
.btn-generate {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}
.btn-generate .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

@media (max-width: 768px) {
  .step1-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ STEP 2: TYPOGRAPHY ============ */
.step2-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.step2-controls { display: flex; flex-direction: column; gap: 1.5rem; }

/* Searchable font select */
.font-select-wrap {
  position: relative;
}

.font-select-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.font-select-input:focus,
.font-select-input.open {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.font-select-arrow {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: transform var(--transition-fast);
}
.font-select-input.open ~ .font-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.font-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  padding: 4px;
}
.font-select-dropdown.open { display: block; }

.font-select-dropdown::-webkit-scrollbar { width: 6px; }
.font-select-dropdown::-webkit-scrollbar-track { background: transparent; }
.font-select-dropdown::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
}

.font-option {
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition-fast), color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.font-option:hover,
.font-option.highlighted {
  background: var(--brand-glow);
  color: var(--text-primary);
}
.font-option.selected {
  color: var(--brand-primary);
  font-weight: 600;
}
.font-option-category {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  opacity: 0.7;
}

.font-select-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Generate type scale button */
.btn-generate-type {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
}
.btn-generate-type .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

/* Type scale preview */
.type-preview-panel {
  position: relative;
}

.type-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
  text-align: center;
  padding: 2rem;
}
.type-preview-empty svg {
  width: 40px;
  height: 40px;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.type-preview {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.type-preview.visible {
  opacity: 1;
  transform: translateY(0);
}

.type-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.type-preview-header h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}
.type-preview-fonts-badge {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.type-preview-fonts-badge span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.type-preview-fonts-badge .sep {
  background: none;
  color: var(--text-muted);
  padding: 0;
  font-size: 0.6rem;
}

.type-scale-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.type-scale-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}
.type-scale-row:last-child { border-bottom: none; }
.type-scale-row:hover { background: rgba(167, 139, 250, 0.03); }

.type-scale-label {
  width: 52px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 0.15em;
}

.type-scale-sample {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.type-scale-meta {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: right;
  min-width: 70px;
  opacity: 0.7;
}

/* Palette tint strip under type preview */
.type-preview-colors {
  display: flex;
  gap: 3px;
  margin-top: 1.5rem;
  border-radius: 4px;
  overflow: hidden;
  height: 6px;
}
.type-preview-colors span {
  flex: 1;
}

@media (max-width: 768px) {
  .step2-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ STEP 3: ACCESSIBILITY ============ */
.step3-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Mode toggle */
.a11y-mode-toggle {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  margin-bottom: 1.5rem;
}
.a11y-mode-btn {
  padding: 0.6rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.a11y-mode-btn svg { width: 14px; height: 14px; }
.a11y-mode-btn.active {
  background: var(--brand-primary);
  color: var(--bg-base);
}
.a11y-mode-btn:not(.active):hover {
  color: var(--text-secondary);
}

/* Contrast checklist */
.contrast-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contrast-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.contrast-item:last-child { border-bottom: none; }

.contrast-swatch-pair {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-medium);
}
.contrast-swatch-fg,
.contrast-swatch-bg {
  width: 50%;
  height: 100%;
}

.contrast-info {
  flex: 1;
  min-width: 0;
}
.contrast-pair-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contrast-pair-hex {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.contrast-ratio-badge {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 52px;
  text-align: center;
}

.contrast-wcag {
  flex-shrink: 0;
  display: flex;
  gap: 0.3rem;
}
.wcag-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wcag-badge.pass {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(74, 222, 128, 0.25);
}
.wcag-badge.fail {
  background: rgba(248, 113, 113, 0.12);
  color: var(--color-error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.contrast-status-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contrast-status-icon.pass {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-success);
}
.contrast-status-icon.fail {
  background: rgba(248, 113, 113, 0.12);
  color: var(--color-error);
}
.contrast-status-icon svg { width: 12px; height: 12px; }

/* Suggested fix */
.contrast-fix {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: var(--color-warning);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.contrast-fix svg { width: 11px; height: 11px; flex-shrink: 0; }
.contrast-fix-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.1);
  margin: 0 2px;
  cursor: pointer;
}

/* Contrast fix controls */
.contrast-fix-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.contrast-fix-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 4px;
  background: rgba(74, 222, 128, 0.1);
  color: var(--color-success);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.contrast-fix-btn:hover {
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.5);
}
.contrast-picker-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  border: 1.5px solid var(--border-medium);
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}
.contrast-picker-wrap.passing { border-color: var(--color-success); }
.contrast-picker-wrap.failing { border-color: var(--color-error); }
.contrast-picker-wrap input[type="color"] {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  border: none;
  cursor: pointer;
  background: none;
}
.contrast-live-ratio {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  min-width: 36px;
  text-align: center;
}
.contrast-live-ratio.passing { color: var(--color-success); }
.contrast-live-ratio.failing { color: var(--color-error); }

/* WCAG target level toggle */
.a11y-target-toggle {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  margin-left: auto;
}
.a11y-target-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.65rem;
  font-weight: 700;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.a11y-target-btn.active {
  background: var(--brand-primary);
  color: var(--bg-base);
}
.a11y-target-btn:not(.active):hover {
  color: var(--text-secondary);
}

/* Summary bar */
.a11y-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.a11y-summary-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.a11y-summary-stat .count {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
}
.a11y-summary-stat.passing .count { color: var(--color-success); }
.a11y-summary-stat.failing .count { color: var(--color-error); }
.a11y-summary-stat.total .count { color: var(--text-secondary); }

/* Dark palette preview */
.dark-palette-panel {
  position: relative;
}

.dark-palette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.dark-palette-header h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.dark-palette-preview-area {
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: background 0.4s var(--ease-out);
}
.dark-palette-preview-area.light-mode {
  background: #f8f8f8;
}
.dark-palette-preview-area.dark-mode {
  background: #121212;
}

.dark-palette-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.dark-palette-swatch {
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  transition: transform var(--transition-fast);
  border: 1px solid rgba(255,255,255,0.06);
}
.dark-palette-swatch:hover { transform: scale(1.04); }

.dark-palette-swatch-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Side-by-side compare mini strip */
.palette-compare {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.palette-compare-col {
  flex: 1;
}
.palette-compare-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.palette-compare-strip {
  display: flex;
  gap: 2px;
  border-radius: 4px;
  overflow: hidden;
  height: 28px;
}
.palette-compare-strip span { flex: 1; }

.a11y-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
  text-align: center;
  padding: 2rem;
}
.a11y-empty svg {
  width: 40px;
  height: 40px;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.btn-run-a11y {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
}
.btn-run-a11y .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

@media (max-width: 768px) {
  .step3-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ STEP 4: LAYOUT ============ */
.layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.layout-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.layout-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.layout-section-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
}

/* Preset chooser (tight/default/relaxed) */
.preset-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.preset-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-base);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.preset-btn:hover { border-color: var(--border-medium); color: var(--text-primary); }
.preset-btn:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.preset-btn.active {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(167, 139, 250, 0.06);
}

/* Numeric sliders */
.layout-field {
  margin-bottom: 1rem;
}
.layout-field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.layout-field-label span {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}
.layout-field-value {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brand-primary);
  background: rgba(167, 139, 250, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}
.layout-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.layout-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.15);
}
.layout-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
}
.layout-range:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Generate button */
.btn-generate-layout {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}
.btn-generate-layout .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

/* Spacing preview */
.spacing-preview {
  margin-top: 1.25rem;
}
.spacing-token-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.spacing-token-row:last-child { border-bottom: none; }
.spacing-token-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 70px;
  flex-shrink: 0;
}
.spacing-token-bar {
  height: 20px;
  background: var(--brand-primary);
  opacity: 0.3;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.spacing-token-value {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  width: 50px;
  flex-shrink: 0;
  text-align: right;
}

/* Grid preview */
.grid-preview {
  margin-top: 1.25rem;
}
.grid-visual {
  display: flex;
  gap: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 80px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-base);
}
.grid-col {
  flex: 1;
  background: rgba(167, 139, 250, 0.08);
  border-right: 1px solid rgba(167, 139, 250, 0.12);
  position: relative;
}
.grid-col:last-child { border-right: none; }
.grid-col-number {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.5;
}
.grid-gutter-label {
  display: flex;
  justify-content: center;
  margin-top: 0.4rem;
}
.grid-gutter-label span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Grid spec info */
.grid-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.grid-spec-card {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}
.grid-spec-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.grid-spec-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Breakpoints table */
.breakpoints-table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
}
.breakpoints-table th,
.breakpoints-table td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  font-size: 0.72rem;
  border-bottom: 1px solid var(--border-subtle);
}
.breakpoints-table th {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.65rem;
}
.breakpoints-table td {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.breakpoints-table td:first-child {
  color: var(--brand-primary);
  font-weight: 500;
}

/* Live grid visualization */
.grid-live-viz {
  margin-top: 1.25rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.grid-live-viz-inner {
  display: grid;
  min-height: 120px;
  transition: padding 0.15s ease, gap 0.15s ease;
}
.grid-live-col {
  background: rgba(167, 139, 250, 0.12);
  border-radius: 3px;
  min-height: 80px;
  position: relative;
  transition: background 0.15s ease;
}
.grid-live-col:hover {
  background: rgba(167, 139, 250, 0.22);
}
.grid-live-col-num {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--brand-primary);
  opacity: 0.6;
  pointer-events: none;
}

/* Column content — spacing visualization */
.grid-live-col-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(167, 139, 250, 0.08);
  border-radius: 2px;
  transition: padding 0.15s ease, gap 0.15s ease;
  position: relative;
}
.grid-live-content-block {
  background: rgba(167, 139, 250, 0.25);
  border-radius: 2px;
  flex: 1;
  min-height: 8px;
}
.grid-live-spacing-label {
  position: absolute;
  top: 2px;
  right: 3px;
  font-family: var(--font-mono);
  font-size: 0.45rem;
  color: var(--brand-primary);
  opacity: 0.6;
  pointer-events: none;
  white-space: nowrap;
}
.grid-live-anno-dot.space-dot {
  background: rgba(110, 200, 180, 0.6);
}

/* Dimension annotations */
.grid-live-annotations {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(167, 139, 250, 0.03);
}
.grid-live-anno {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.grid-live-anno-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.grid-live-anno-dot.col-dot { background: rgba(167, 139, 250, 0.5); }
.grid-live-anno-dot.gap-dot { background: rgba(217, 174, 131, 0.6); }
.grid-live-anno-dot.margin-dot { background: rgba(255, 255, 255, 0.15); border: 1px solid var(--border-medium); }

/* Margin ruler markers on the sides */
.grid-live-viz-inner::before,
.grid-live-viz-inner::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed rgba(167, 139, 250, 0.15);
  pointer-events: none;
  z-index: 1;
}
.grid-live-viz-inner { position: relative; }
.grid-live-viz-inner::before { left: var(--margin-px, 48px); }
.grid-live-viz-inner::after { right: var(--margin-px, 48px); }

@media (max-width: 768px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
  .grid-live-viz-inner { min-height: 80px; }
  .grid-live-col { min-height: 56px; }
  .grid-live-spacing-label { display: none; }
  .grid-live-col-content { padding: 2px !important; gap: 1px !important; }
}

/* ============ STEP 5: PREVIEW ============ */
.preview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.preview-controls-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-build-preview {
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
}
.btn-build-preview .spinner { width: 18px; height: 18px; border-width: 2px; }

/* Preview theme toggle */
.preview-theme-toggle {
  display: flex;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.preview-theme-btn {
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.preview-theme-btn.active {
  background: var(--brand-primary);
  color: #08061A;
  font-weight: 600;
}

/* Preview frame */
.preview-frame {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #ffffff;
  transition: background 0.3s ease;
}
.preview-frame.dark-theme {
  background: #1a1a2e;
}

/* Inside the preview — scoped user brand styles */
.pv-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.dark-theme .pv-nav { border-bottom-color: rgba(255,255,255,0.08); }
.pv-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.pv-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}
.pv-brand-name {
  font-weight: 600;
  font-size: 1.1rem;
}
.pv-nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pv-nav-links li {
  font-size: 0.85rem;
  opacity: 0.7;
}
.pv-nav-cta {
  padding: 0.45rem 1rem;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  font-size: 0.8rem;
  color: #fff;
  cursor: default;
}

.pv-hero {
  padding: 4rem 2rem;
  text-align: center;
}
.pv-hero h1 {
  margin: 0 0 0.75rem;
  line-height: 1.15;
}
.pv-hero p {
  margin: 0 0 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.7;
  line-height: 1.6;
}
.pv-hero-btns {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.pv-btn {
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: default;
}
.pv-btn-primary { color: #fff; }
.pv-btn-secondary { background: transparent; }

.pv-cards-section {
  padding: 3rem 2rem;
}
.pv-cards-section-title {
  text-align: center;
  margin-bottom: 2rem;
}
.pv-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 800px;
  margin: 0 auto;
}
.pv-card {
  border-radius: 10px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pv-card:hover { transform: translateY(-2px); }
.pv-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}
.pv-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.pv-card p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.65;
  line-height: 1.5;
}

.pv-type-section {
  padding: 2.5rem 2rem;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.dark-theme .pv-type-section { border-top-color: rgba(255,255,255,0.06); }
.pv-type-section h2 { margin: 0 0 1.5rem; text-align: center; }
.pv-type-scale {
  max-width: 600px;
  margin: 0 auto;
}
.pv-type-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.3rem 0;
  border-bottom: 1px dashed rgba(128,128,128,0.15);
}
.pv-type-label {
  flex-shrink: 0;
  width: 45px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.4;
}
.pv-type-sample { line-height: 1.3; }

.pv-footer {
  padding: 1.5rem 2rem;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 0.75rem;
  opacity: 0.4;
}
.dark-theme .pv-footer { border-top-color: rgba(255,255,255,0.06); }

/* Export section */
.export-section { margin-top: 2rem; }
.export-section-title { font-family: 'Sora', sans-serif; font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--text-primary); }
.export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.export-card {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 0.85rem; border-radius: 8px;
  background: var(--bg-surface, #141220); border: 1px solid rgba(128,128,128,0.15);
  cursor: pointer; transition: all 0.15s; font-size: 0.8rem; color: var(--text-primary);
}
.export-card:hover { border-color: var(--copper); transform: translateY(-1px); }
.export-card-icon { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
.export-card-label { font-weight: 600; font-size: 0.78rem; }
.export-card-sub { font-size: 0.6rem; color: var(--text-muted); }
.export-card.asset { background: linear-gradient(135deg, rgba(167,139,250,0.08), rgba(217,174,131,0.08)); border-color: rgba(167,139,250,0.2); }
.export-card.asset:hover { border-color: rgba(167,139,250,0.5); }
.export-note { font-size: 0.75rem; color: var(--text-muted); text-align: center; }
@media (max-width: 600px) { .export-grid { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 768px) {
  .pv-cards-grid { grid-template-columns: 1fr; }
  .pv-hero { padding: 2.5rem 1.5rem; }
  .pv-nav { padding: 0.75rem 1rem; }
  .pv-nav-links { display: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .stepper-inner { display: none; }
  .stepper-mobile { display: flex; }

  .content-area { padding: 1.5rem 1.25rem 1.5rem; }

  .footer-inner { gap: 0.5rem; }
  .btn { padding: 0.65rem 1.15rem; font-size: 0.85rem; }

  .preview-controls { flex-direction: column; align-items: stretch; }
  .preview-controls-left { justify-content: center; }
  .btn-build-preview { width: 100%; }
  .preview-theme-toggle { justify-content: center; }

  .export-grid { grid-template-columns: repeat(2, 1fr); }

  .preset-row { flex-direction: column; gap: 0.4rem; }

  .step-header h1 { font-size: 1.5rem; }
  .step-header p { font-size: 0.85rem; }

  .pv-hero h1 { font-size: 1.75rem !important; }
  .pv-hero p { font-size: 0.85rem !important; }
  .pv-hero-btns { flex-direction: column; align-items: center; }

  .spacing-token-name { width: 50px; font-size: 0.65rem; }

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

@media (max-width: 480px) {
  .header-product { display: none; }
  .header-divider { display: none; }

  .content-area { padding: 1.25rem 1rem; }

  .pv-cards-section { padding: 2rem 1rem; }
  .pv-type-section { padding: 1.5rem 1rem; }
}

/* ---- Inline style replacements ---- */
.initially-hidden { display: none; }
.progress-initial { width: 20%; }
.mt-md { margin-top: 1.5rem; }

/* ---- CSP-safe helpers for JS template literals ---- */

/* Hidden swatch color picker — overlays swatch */
.swatch-picker-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* Contrast "no pairs" empty state */
.contrast-empty-msg {
  padding: 1rem;
  color: var(--text-muted);
  text-align: center;
}

/* Spacing "no tokens" empty state */
.spacing-empty-msg {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Spacing token bar container (flex row) */
.spacing-token-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
}

/* Dark palette "not available" empty state */
.mode-palette-empty {
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
}

/* Grid live viz col content — uses CSS custom props */
.grid-live-col-content {
  padding: var(--viz-pad);
  gap: var(--viz-gap);
}

/* Dark-mode badge in a11y summary */
.a11y-dark-badge {
  font-size: 0.65rem;
}

/* OG modal overlay */
.ov-og-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8,6,26,0.9);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* OG modal inner container */
.ov-og-modal-inner {
  background: linear-gradient(180deg,#0F0D24,#08061A);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
}

/* OG modal heading */
.ov-og-modal-title {
  font-family: 'Sora', serif;
  color: var(--body-text, #e8e8f0);
  margin-bottom: 1rem;
}

/* OG template grid */
.ov-og-template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* OG template card */
.ov-og-tpl-card {
  border: 2px solid #333;
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  text-align: center;
}

/* OG template card label */
.ov-og-tpl-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #e8e8f0;
}

/* OG template card description */
.ov-og-tpl-desc {
  font-size: 0.7rem;
  color: #8888a0;
}

/* OG tagline row */
.ov-og-tagline-row {
  margin-bottom: 1rem;
}

/* OG tagline input */
.ov-og-tagline-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e8e8f0;
  font-family: 'Instrument Sans', sans-serif;
}

/* OG preview canvas */
.ov-og-preview-canvas {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #333;
  margin-bottom: 1rem;
}

/* OG modal actions row */
.ov-og-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Preview frame: SVG logo variant */
.pv-logo--svg {
  background: transparent;
  padding: 0;
  overflow: hidden;
}
