/* ============================================================
   NameInTheBook — Character Builder Styles
   ============================================================ */

/* ── PAGE BASE ─────────────────────────────────────────────── */
.builder-page {
  background: var(--paper-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── BUILDER HEADER ────────────────────────────────────────── */
.builder-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper-50);
  border-bottom: 1px solid var(--line-200);
}
.builder-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--space-6);
  max-width: var(--max-width);
  margin: 0 auto;
  gap: var(--space-4);
}
.builder-header .wordmark {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink-900);
  text-decoration: none;
  flex-shrink: 0;
}
.builder-header-trust {
  display: none;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--ink-500);
}
@media (min-width: 600px) { .builder-header-trust { display: flex; } }
.builder-trust-item { display: flex; align-items: center; gap: var(--space-1); }
.builder-trust-sep { color: var(--line-200); }
.builder-exit {
  font-size: var(--text-sm);
  color: var(--ink-500);
  text-decoration: none;
  flex-shrink: 0;
  transition: color var(--transition);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.builder-exit:hover { color: var(--ink-900); }

/* ── PROGRESS BAR ──────────────────────────────────────────── */
.builder-progress {
  background: var(--paper-50);
  border-bottom: 1px solid var(--line-200);
  padding: var(--space-3) var(--space-6);
}
.builder-progress-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 480px;
  margin: 0 auto var(--space-2);
}
.progress-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
  flex-shrink: 0;
}
.progress-group-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--line-200);
  border: 2px solid var(--line-200);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-500);
}
.progress-group.active .progress-group-dot {
  background: var(--sea-teal);
  border-color: var(--sea-teal);
  color: white;
}
.progress-group.done .progress-group-dot {
  background: var(--sea-teal);
  border-color: var(--sea-teal);
  color: white;
}
.progress-group-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition);
  white-space: nowrap;
}
.progress-group.active .progress-group-label { color: var(--sea-teal); }
.progress-group.done .progress-group-label { color: var(--ink-700); }
.progress-connector {
  flex: 1;
  height: 2px;
  background: var(--line-200);
  margin-bottom: 16px;
  min-width: 24px;
  max-width: 80px;
  transition: background var(--transition);
}
.progress-connector.done { background: var(--sea-teal); }

/* Thin progress bar underneath */
.progress-bar-track {
  height: 2px;
  background: var(--line-200);
  border-radius: 2px;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--sea-teal);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── MAIN LAYOUT ───────────────────────────────────────────── */
.builder-main {
  flex: 1;
  padding: var(--space-8) var(--space-6) 120px; /* 120px = mobile CTA clearance */
}
@media (min-width: 768px) {
  .builder-main { padding: var(--space-10) var(--space-10) var(--space-16); }
}
.builder-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: start;
}
@media (min-width: 900px) {
  .builder-grid {
    grid-template-columns: 1fr 360px;
    gap: var(--space-12);
  }
}

/* ── WIZARD STEPS ──────────────────────────────────────────── */
.builder-step { display: none; }
.builder-step.active { display: block; }
.builder-step[hidden] { display: none !important; }

.step-header { margin-bottom: var(--space-8); }
.step-group-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--sea-teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}
.step-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.2;
  margin-bottom: var(--space-3);
}
.step-subtitle {
  font-size: var(--text-base);
  color: var(--ink-500);
  line-height: 1.6;
  margin: 0;
}

/* ── FIELDS ────────────────────────────────────────────────── */
.step-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}
.field-group { display: flex; flex-direction: column; gap: var(--space-3); }
.field-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-900);
}
.field-required { color: var(--sea-teal); margin-left: 2px; }
.field-optional { color: var(--ink-500); font-weight: 400; margin-left: 4px; }
.field-tooltip {
  font-size: var(--text-xs);
  color: var(--ink-500);
  cursor: help;
  margin-left: 4px;
}
.field-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink-900);
  background: white;
  border: 1.5px solid var(--line-200);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
}
.field-input:focus {
  outline: none;
  border-color: var(--sea-teal);
  box-shadow: 0 0 0 3px rgba(30,122,120,0.12);
}
.field-textarea { resize: vertical; min-height: 100px; }
.field-select { cursor: pointer; appearance: auto; }
.field-hint {
  font-size: var(--text-xs);
  color: var(--ink-500);
  margin: 0;
  line-height: 1.5;
}
.field-count { text-align: right; }

/* ── OPTION PILLS ──────────────────────────────────────────── */
.option-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.option-pill {
  display: inline-flex;
  position: relative;
  cursor: pointer;
}
.option-pill input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.option-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  min-height: 44px;
  background: white;
  border: 1.5px solid var(--line-200);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-700);
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
}
.option-pill input:checked + span {
  background: var(--sea-teal);
  border-color: var(--sea-teal);
  color: white;
}
.option-pill:hover span { border-color: var(--sea-teal); }
.option-pill input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(30,122,120,0.2);
}

/* ── SWATCH GRID ───────────────────────────────────────────── */
.swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
  position: relative;
}
.swatch-item input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  transition: all var(--transition);
  display: block;
}
.swatch-item input:checked + .swatch-circle {
  border-color: var(--sea-teal);
  box-shadow: 0 0 0 3px rgba(30,122,120,0.2);
  transform: scale(1.1);
}
.swatch-item:hover .swatch-circle { border-color: var(--sea-teal); }
.swatch-item input:focus-visible + .swatch-circle {
  box-shadow: 0 0 0 3px rgba(30,122,120,0.3);
}
.swatch-label {
  font-size: 10px;
  color: var(--ink-500);
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

/* ── STYLE GRID (hair style) ───────────────────────────────── */
.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
@media (max-width: 480px) { .style-grid { grid-template-columns: repeat(3, 1fr); } }
.style-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  position: relative;
}
.style-item input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.style-item > span:last-child {
  font-size: 10px;
  color: var(--ink-500);
  text-align: center;
  line-height: 1.3;
}
.style-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line-200);
  background: var(--paper-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all var(--transition);
}
.style-item input:checked ~ .style-icon,
.style-item input:checked + .style-icon {
  border-color: var(--sea-teal);
  background: rgba(30,122,120,0.08);
  box-shadow: 0 0 0 2px rgba(30,122,120,0.2);
}
/* Fix: style-icon is child before label text */
.style-item input:checked ~ * .style-icon { border-color: var(--sea-teal); }

/* ── TOGGLES ───────────────────────────────────────────────── */
.toggle-list { display: flex; flex-direction: column; gap: var(--space-3); }
.toggle-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  min-height: 44px;
  font-size: var(--text-base);
  color: var(--ink-700);
}
.toggle-item input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--line-200);
  flex-shrink: 0;
  position: relative;
  transition: background var(--transition);
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--transition);
}
.toggle-item input:checked ~ .toggle-track { background: var(--sea-teal); }
.toggle-item input:checked ~ .toggle-track::after { transform: translateX(18px); }

/* ── OPTION CARDS (family) ─────────────────────────────────── */
.option-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 400px) { .option-cards { grid-template-columns: 1fr; } }
.option-card { cursor: pointer; position: relative; }
.option-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.option-card-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  min-height: 44px;
  background: white;
  border: 1.5px solid var(--line-200);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.option-card input:checked ~ .option-card-inner {
  border-color: var(--sea-teal);
  background: rgba(30,122,120,0.04);
  box-shadow: 0 0 0 2px rgba(30,122,120,0.15);
}
.option-card:hover .option-card-inner { border-color: var(--sea-teal); }
.option-card-icon { font-size: 1.5rem; }
.option-card-title { font-size: var(--text-sm); font-weight: 600; color: var(--ink-900); }
.option-card-desc { font-size: var(--text-xs); color: var(--ink-500); }

/* ── PHOTO ASSIST ENTRY ────────────────────────────────────── */
.photo-assist-entry {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line-200);
}
.photo-assist-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--paper-100);
  border: 1px solid var(--line-200);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.photo-assist-icon { font-size: 1.25rem; flex-shrink: 0; }
.photo-assist-copy { flex: 1; min-width: 0; }
.photo-assist-title { font-size: var(--text-sm); font-weight: 600; color: var(--ink-900); margin: 0 0 2px; }
.photo-assist-desc { font-size: var(--text-xs); color: var(--ink-500); margin: 0; }

/* ── STEP FOOTER ───────────────────────────────────────────── */
.step-footer {
  display: none; /* hidden on mobile — pinned CTA bar is the single primary CTA */
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line-200);
}
@media (min-width: 900px) {
  .step-footer { display: flex; } /* show in-form CTA on desktop where pinned bar is hidden */
}
.step-footer--final { justify-content: flex-end; }

/* ── COMPLETE STATE ────────────────────────────────────────── */
.builder-step--complete .step-complete-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-6);
  padding: var(--space-12) var(--space-6);
}
.step-complete-icon { font-size: 4rem; }
.step-complete-summary {
  background: var(--paper-100);
  border: 1px solid var(--line-200);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-sm);
  color: var(--ink-700);
  line-height: 1.7;
  max-width: 400px;
  width: 100%;
  text-align: left;
}
.step-complete-actions { display: flex; flex-direction: column; gap: var(--space-3); align-items: center; }

/* ── PREVIEW PANEL (right column, desktop) ─────────────────── */
.builder-preview-panel {
  position: sticky;
  top: 120px;
  display: none;
}
@media (min-width: 900px) { .builder-preview-panel { display: block; } }
.preview-panel-inner {
  background: var(--paper-100);
  border: 1px solid var(--line-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.preview-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line-200);
  background: var(--paper-50);
}
.preview-panel-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-900);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.preview-avatar-stage {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  position: relative;
}
.avatar-base {
  width: 120px;
  height: 180px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.avatar-base--large { width: 160px; height: 240px; }
.avatar-body {
  width: 60px;
  height: 90px;
  border-radius: 12px 12px 0 0;
  background: var(--sea-teal);
  opacity: 0.7;
  margin-top: auto;
}
.avatar-head {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #FDDBB4;
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.avatar-skin-layer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #FDDBB4;
  transition: background 0.3s ease;
}
.avatar-hair-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  border-radius: 50% 50% 0 0;
  background: #7B4A1E;
  transition: background 0.3s ease;
}
.avatar-eyes-layer {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
}
.avatar-eye {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5B9BD5;
  transition: background 0.3s ease;
}
.avatar-extras-layer { position: absolute; inset: 0; pointer-events: none; }
.avatar-placeholder-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  text-align: center;
}
.avatar-placeholder-hint p {
  font-size: var(--text-sm);
  color: var(--ink-500);
  line-height: 1.5;
  margin: 0;
}
.preview-panel-details {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--line-200);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.preview-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  gap: var(--space-3);
}
.preview-detail-label { color: var(--ink-500); font-weight: 500; }
.preview-detail-value { color: var(--ink-900); font-weight: 600; text-align: right; }
.preview-panel-mobile-btn {
  display: block;
  width: calc(100% - var(--space-10));
  margin: var(--space-4) var(--space-5);
  text-align: center;
}
@media (min-width: 900px) { .preview-panel-mobile-btn { display: none; } }

/* ── MOBILE BOTTOM CTA ─────────────────────────────────────── */
.builder-mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--paper-50);
  border-top: 1px solid var(--line-200);
  padding: var(--space-3) var(--space-6);
  z-index: 90;
  box-shadow: 0 -4px 16px rgba(16,18,20,0.06);
}
@media (min-width: 900px) { .builder-mobile-cta { display: none; } }
.builder-mobile-cta-inner { max-width: 480px; margin: 0 auto; }
.builder-mobile-next { width: 100%; justify-content: center; }

/* ── CONSENT MODAL ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16,18,20,0.6);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: var(--space-6); }
}
.modal-overlay[hidden] { display: none !important; }
.modal-card {
  background: var(--paper-50);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: var(--space-8) var(--space-6);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
@media (min-width: 600px) {
  .modal-card { border-radius: var(--radius); }
}
.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  color: var(--ink-500);
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  border: none;
  background: none;
  cursor: pointer;
}
.modal-close:hover { color: var(--ink-900); }
.modal-icon { font-size: 2.5rem; text-align: center; }
.modal-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.2;
  text-align: center;
}
.modal-intro {
  font-size: var(--text-base);
  color: var(--ink-700);
  line-height: 1.65;
  margin: 0;
  text-align: center;
}
.modal-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--paper-100);
  border: 1px solid var(--line-200);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-6);
}
.modal-bullets li {
  font-size: var(--text-sm);
  color: var(--ink-700);
  line-height: 1.55;
  padding-left: var(--space-5);
  position: relative;
}
.modal-bullets li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--sea-teal);
  font-weight: 700;
}

.modal-guidance {
  border: 1px solid var(--line-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.modal-guidance-toggle {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-700);
  cursor: pointer;
  background: var(--paper-100);
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.modal-guidance-toggle::-webkit-details-marker { display: none; }
.modal-guidance-list {
  list-style: disc;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.modal-guidance-list li { font-size: var(--text-sm); color: var(--ink-500); line-height: 1.5; }

.modal-consent-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  background: rgba(30,122,120,0.05);
  border: 1px solid rgba(30,122,120,0.2);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.modal-consent-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--sea-teal);
  cursor: pointer;
  margin-top: 2px;
}
.modal-consent-check span {
  font-size: var(--text-sm);
  color: var(--ink-700);
  line-height: 1.55;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.modal-actions .btn { justify-content: center; width: 100%; }
#consent-continue:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── DELETION BANNER ───────────────────────────────────────── */
.deletion-banner {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  width: calc(100% - var(--space-12));
  max-width: 480px;
  background: #1a3d2e;
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}
.deletion-banner[hidden] { display: none; }
.deletion-banner-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
}
.deletion-icon {
  font-size: 1.25rem;
  color: #6ee7b7;
  flex-shrink: 0;
}
.deletion-banner strong { display: block; font-size: var(--text-base); margin-bottom: 2px; }
.deletion-banner p { font-size: var(--text-xs); color: rgba(255,255,255,0.75); margin: 0; line-height: 1.5; }
.deletion-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: var(--text-base);
  cursor: pointer;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deletion-dismiss:hover { color: white; }

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ── MOBILE PREVIEW SLIDE-OVER ─────────────────────────────── */
.preview-slideover {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: var(--paper-50);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.preview-slideover[hidden] { display: none !important; }
@media (min-width: 900px) { .preview-slideover { display: none !important; } }
.slideover-inner { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-6); }
.slideover-close {
  align-self: flex-end;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--sea-teal);
  background: none;
  border: none;
  cursor: pointer;
  min-height: 44px;
  padding: 0;
}
.slideover-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  background: var(--paper-100);
  border: 1px solid var(--line-200);
  border-radius: var(--radius);
}
.slideover-details {
  font-size: var(--text-sm);
  color: var(--ink-700);
  line-height: 1.7;
}

/* ============================================================
   NameInTheBook — v4 Personalization Flow Components
   ============================================================ */

/* ── BOOK SELECT (Step 0) ──────────────────────────────────── */
.book-select-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  max-width: 600px;
}
.book-select-card {
  background: white;
  border: 1.5px solid var(--line-200);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 12px rgba(16,18,20,0.06);
}
.book-select-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--gold, #D4AF37);
  color: #1a1009;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  z-index: 1;
}
.book-select-cover {
  background: var(--paper-100, #f3efe8);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  border-bottom: 1px solid var(--line-200);
  overflow: hidden;
}
/* Desktop: horizontal card layout */
@media (min-width: 768px) {
  .book-select-grid {
    max-width: 820px;
  }
  .book-select-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }
  .book-select-cover {
    flex: 0 0 280px;
    width: 280px;
    height: 340px;
    min-height: 340px;
    max-height: 340px;
    overflow: hidden;
    border-bottom: none;
    border-right: 1px solid var(--line-200);
  }
  .book-select-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
  }
  .book-select-info {
    flex: 1;
    padding: var(--space-7) var(--space-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
.book-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.book-cover-emoji { font-size: 3rem; }
.book-cover-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink-900);
}
.book-select-info {
  padding: var(--space-5) var(--space-6) var(--space-6);
}
.book-select-title {
  font-family: var(--font-display);
  font-size: var(--text-xl, 1.25rem);
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 var(--space-2);
}
.book-select-desc {
  font-size: var(--text-sm);
  color: var(--ink-600, var(--ink-700, #444));
  line-height: 1.6;
  margin: 0 0 var(--space-4);
}
.book-select-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.book-select-features li {
  font-size: var(--text-sm);
  color: var(--ink-600, #555);
  padding-left: 0;
}

/* ── CHILD COUNT TOGGLE ────────────────────────────────────── */
.child-count-toggle {
  display: flex;
  border: 1.5px solid var(--line-200);
  border-radius: var(--radius, 8px);
  overflow: hidden;
  width: fit-content;
}
.child-count-toggle .count-btn {
  flex: 1;
  min-width: 90px;
  padding: 0.625rem 1.25rem;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-600, #555);
  background: white;
  border: none;
  border-right: 1.5px solid var(--line-200);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.child-count-toggle .count-btn:last-child { border-right: none; }
.child-count-toggle .count-btn:hover { background: var(--paper-100, #f3efe8); color: var(--ink-900); }
.child-count-toggle .count-btn.active {
  background: var(--teal, var(--sea-teal, #1E7A78));
  color: white;
}

/* ── CHILD CARD ────────────────────────────────────────────── */
.child-card {
  background: white;
  border: 1.5px solid var(--line-200);
  border-radius: var(--radius, 8px);
  padding: var(--space-5);
}
.child-card .field-label { margin-bottom: var(--space-2); }
.long-name-warning {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: #FFF9E6;
  border: 1px solid #E8C97C;
  border-radius: 6px;
  color: #7A5800;
  font-size: var(--text-xs);
  line-height: 1.5;
}

/* ── FAMILY TYPE CARDS ─────────────────────────────────────── */
.family-type-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (min-width: 600px) {
  .family-type-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 360px) {
  .family-type-cards { grid-template-columns: 1fr; }
}

/* ── FAMILY CARD ───────────────────────────────────────────── */
.family-card {
  cursor: pointer;
  position: relative;
  display: block;
}
.family-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.family-card-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: var(--space-4);
  background: white;
  border: 1.5px solid var(--line-200);
  border-radius: var(--radius, 8px);
  transition: all var(--transition, 0.18s ease);
  min-height: 80px;
}
.family-card input:checked ~ .family-card-inner {
  border-color: var(--teal, var(--sea-teal, #1E7A78));
  background: rgba(30,122,120,0.04);
  box-shadow: 0 0 0 2px rgba(30,122,120,0.15);
}
.family-card:hover .family-card-inner {
  border-color: var(--teal, var(--sea-teal, #1E7A78));
}
.family-card input:focus-visible ~ .family-card-inner {
  box-shadow: 0 0 0 3px rgba(30,122,120,0.25);
}
.family-card-icon { font-size: 1.375rem; margin-bottom: 2px; }
.family-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.2;
}
.family-card-desc {
  font-size: var(--text-xs);
  color: var(--ink-500, #777);
  line-height: 1.3;
}

/* ── FAMILY SUB-CHOICE ─────────────────────────────────────── */
.family-sub-choice {
  background: #fffbf0;
  border: 2px solid #f0a500;
  border-radius: var(--radius, 8px);
  padding: var(--space-4) var(--space-5);
  animation: fadeSlideIn 0.2s ease;
  margin-top: var(--space-3);
}
.family-sub-choice[hidden] { display: none !important; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── APPEARANCE TABS ───────────────────────────────────────── */
.appearance-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  border-bottom: 2px solid var(--line-200);
  padding-bottom: 0;
}
.appearance-tab-btn {
  padding: var(--space-2) var(--space-4);
  min-height: 40px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-600, #555);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.appearance-tab-btn:hover { color: var(--ink-900); }
.appearance-tab-btn.active {
  color: var(--teal, var(--sea-teal, #1E7A78));
  border-bottom-color: var(--teal, var(--sea-teal, #1E7A78));
}
.appearance-child-title {
  font-family: var(--font-display);
  font-size: var(--text-lg, 1.125rem);
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 var(--space-5);
}

/* ── APPEARANCE SWATCHES ───────────────────────────────────── */
.appearance-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
}

/* ── SWATCH ────────────────────────────────────────────────── */
.swatch {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.swatch-item { cursor: pointer; }
.swatch-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}
.swatch-item input:checked + .swatch,
.swatch.selected {
  border-color: var(--teal, var(--sea-teal, #1E7A78));
  box-shadow: 0 0 0 2px rgba(30,122,120,0.3);
  transform: scale(1.1);
  outline: 2px solid var(--teal, var(--sea-teal, #1E7A78));
  outline-offset: 2px;
}
.swatch-item:hover .swatch {
  border-color: var(--teal, var(--sea-teal, #1E7A78));
}
.swatch-label {
  font-size: 10px;
  color: var(--ink-500, #777);
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  max-width: 48px;
  line-height: 1.2;
}

/* ── SUMMARY SIDEBAR ───────────────────────────────────────── */
.summary-sidebar {
  display: none; /* hidden on mobile */
}
@media (min-width: 900px) {
  .summary-sidebar {
    display: block;
    position: sticky;
    top: 120px;
  }
  .summary-sidebar[hidden] { display: none !important; }
}
.summary-sidebar-inner {
  background: var(--paper-100, #f3efe8);
  border: 1.5px solid var(--line-200);
  border-radius: 12px;
  overflow: hidden;
}
.summary-sidebar-header {
  padding: var(--space-4) var(--space-5);
  background: white;
  border-bottom: 1px solid var(--line-200);
}
.summary-sidebar-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink-900);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.summary-sidebar-body {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.summary-sidebar-manuscript {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--line-200);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.summary-sidebar-manuscript[hidden] { display: none !important; }
.summary-manuscript-code {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--teal, var(--sea-teal, #1E7A78));
  background: rgba(30,122,120,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

/* ── SUMMARY ROW ───────────────────────────────────────────── */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line-200);
}
.summary-row[hidden] { display: none !important; }
.summary-row:last-child { border-bottom: none; padding-bottom: 0; }
.summary-label {
  color: var(--ink-500, #777);
  font-weight: 500;
  flex-shrink: 0;
}
.summary-value {
  color: var(--ink-900);
  font-weight: 600;
  text-align: right;
}

/* ── V4 PROGRESS BAR ───────────────────────────────────────── */
.v4-progress {
  background: var(--paper-100, #f3efe8);
  border-bottom: 1px solid var(--line-200);
  padding: var(--space-3) var(--space-6);
}
.v4-progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 480px;
  margin: 0 auto var(--space-2);
}

/* ── CONFIRM SUMMARY (Step 6) ──────────────────────────────── */
.confirm-summary-block {
  background: var(--paper-100, #f3efe8);
  border: 1.5px solid var(--line-200);
  border-radius: 12px;
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line-200);
  font-size: var(--text-sm);
}
.confirm-row:last-child { border-bottom: none; padding-bottom: 0; }
.confirm-label { color: var(--ink-500, #777); font-weight: 500; flex-shrink: 0; }
.confirm-value { color: var(--ink-900); font-weight: 600; text-align: right; }

.confirm-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  padding: var(--space-4);
  background: rgba(30,122,120,0.04);
  border: 1.5px solid rgba(30,122,120,0.25);
  border-radius: 8px;
}
.confirm-checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--teal, var(--sea-teal, #1E7A78));
  cursor: pointer;
  margin-top: 2px;
}
.confirm-checkbox-row span {
  font-size: var(--text-sm);
  color: var(--ink-700, #333);
  line-height: 1.55;
}

/* ════════════════════════════════════════════════════════
   V5 ADDITIONS
   ════════════════════════════════════════════════════════ */

/* ── FIELD ROW (two columns) ───────────────────────────── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

/* ── CHILD BLOCKS ──────────────────────────────────────── */
.child-block {
  background: var(--paper-100, #f3efe8);
  border: 1.5px solid var(--line-200);
  border-radius: 12px;
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
}
.child-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.child-block-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink-700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.btn-remove-child {
  background: none;
  border: none;
  color: var(--ink-500);
  font-size: var(--text-xs);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--transition);
}
.btn-remove-child:hover { color: #c0392b; }
.add-child-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* ── BOOK OPTION CARD VARIANT ──────────────────────────── */
.option-card--book .option-card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: var(--sea-teal);
  color: white;
  border-radius: 20px;
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ── AVATAR STUDIO ─────────────────────────────────────── */
.avatar-studio-state { }

.avatar-studio-idle-inner,
.avatar-studio-generating-inner,
.avatar-studio-failed-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-10) var(--space-6);
  text-align: center;
}
.avatar-studio-idle-icon,
.avatar-failed-icon {
  font-size: 3rem;
  line-height: 1;
}
.avatar-studio-idle-copy,
.avatar-failed-copy {
  font-size: var(--text-base);
  color: var(--ink-700);
  max-width: 360px;
  line-height: 1.6;
}

/* Spinner */
.avatar-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--line-200);
  border-top-color: var(--sea-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar-generating-copy {
  font-size: var(--text-base);
  color: var(--ink-700);
  max-width: 340px;
  line-height: 1.6;
}

/* Attempt counter bar */
.avatar-attempt-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-3);
}
.avatar-attempt-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-500);
  background: var(--paper-100, #f3efe8);
  border: 1px solid var(--line-200);
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: 0.04em;
}

/* Portrait grid */
.avatar-portraits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.avatar-portrait-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  background: var(--paper-100, #f3efe8);
  border: 1.5px solid var(--line-200);
  border-radius: 14px;
  padding: var(--space-4);
  transition: box-shadow 0.2s;
}
.avatar-portrait-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.avatar-portrait-img {
  width: 120px;
  height: 135px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-200, #e8e2d8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-portrait-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-portrait-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-700);
}

/* Rerender controls */
.avatar-rerender-controls {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

/* Notes panel */
.avatar-notes-panel {
  background: var(--paper-100, #f3efe8);
  border: 1.5px solid var(--line-200);
  border-radius: 12px;
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Max attempts message */
.avatar-max-attempts-msg {
  background: #fff9e6;
  border: 1.5px solid #f0d060;
  border-radius: 10px;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  color: var(--ink-700);
  margin-bottom: var(--space-4);
}

/* Approval section */
.avatar-approval-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: rgba(30,122,120,0.04);
  border: 1.5px solid rgba(30,122,120,0.25);
  border-radius: 12px;
  margin-top: var(--space-5);
}
.avatar-approve-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--ink-700);
  line-height: 1.55;
}
.avatar-approve-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--sea-teal);
  cursor: pointer;
  margin-top: 2px;
}

/* Photo upload section */
.photo-upload-section {
  margin-top: var(--space-6);
  border: 1.5px solid var(--line-200);
  border-radius: 12px;
  overflow: hidden;
}
.photo-upload-toggle {
  display: block;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
  background: var(--paper-100, #f3efe8);
  list-style: none;
  user-select: none;
}
.photo-upload-toggle::-webkit-details-marker { display: none; }
.photo-upload-inner {
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.photo-gdpr-notice {
  background: #f0f7ff;
  border: 1.5px solid #c0d8f0;
  border-radius: 10px;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  color: var(--ink-700);
  line-height: 1.65;
}
.photo-gdpr-notice p { margin: 0 0 6px; }
.photo-gdpr-notice p:last-child { margin-bottom: 0; }
.photo-consent-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--ink-700);
  line-height: 1.55;
}
.photo-consent-label input[type="checkbox"] {
  width: 18px; height: 18px;
  flex-shrink: 0;
  accent-color: var(--sea-teal);
  cursor: pointer;
  margin-top: 2px;
}
.photo-file-input {
  font-size: var(--text-sm);
  color: var(--ink-700);
}

/* Avatar Studio footer (back only — no mobile CTA) */
.step-footer--avatar { justify-content: flex-start; }

/* ── PREVIEW STEP ───────────────────────────────────────── */
.preview-section {
  margin-bottom: var(--space-8);
}
.preview-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  margin-bottom: var(--space-4);
}
.preview-avatars {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.preview-avatar-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.preview-avatar-thumb img {
  width: 96px;
  height: 108px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--line-200);
}
.preview-avatar-thumb p {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-700);
  margin: 0;
}
.preview-spreads {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
@media (max-width: 540px) { .preview-spreads { grid-template-columns: 1fr 1fr; } }
.preview-spread-placeholder {
  aspect-ratio: 4/3;
  background: var(--paper-100, #f3efe8);
  border: 1.5px dashed var(--line-200);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--ink-500);
}
.preview-spread-icon { font-size: 1.5rem; }
.preview-book-cover .preview-spread-placeholder {
  aspect-ratio: 3/4;
  max-width: 200px;
}
.preview-summary-panel {
  background: var(--paper-100, #f3efe8);
  border: 1.5px solid var(--line-200);
  border-radius: 12px;
  padding: var(--space-5) var(--space-6);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line-200);
  gap: var(--space-4);
}
.summary-row[hidden] { display: none !important; }
.summary-row:last-child { border-bottom: none; }
.summary-row span { color: var(--ink-500); }
.summary-row strong { color: var(--ink-900); text-align: right; }

/* ── DELIVERY FORM ──────────────────────────────────────── */
.delivery-speed-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.delivery-speed-option {
  cursor: pointer;
  display: flex;
  align-items: stretch;
}
.delivery-speed-option input[type="radio"] { display: none; }
.delivery-speed-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: 1.5px solid var(--line-200);
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
  font-size: var(--text-sm);
}
.delivery-speed-option input[type="radio"]:checked + .delivery-speed-inner {
  border-color: var(--sea-teal);
  background: rgba(30,122,120,0.04);
}
.delivery-speed-name { font-weight: 700; color: var(--ink-900); min-width: 80px; }
.delivery-speed-time { color: var(--ink-500); flex: 1; }
.delivery-speed-price { font-weight: 700; color: var(--sea-teal); }

/* ── PAYMENT / TEST MODE ────────────────────────────────── */
.test-mode-banner {
  background: #fff9e6;
  border: 1.5px solid #f0d060;
  border-radius: 10px;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  color: var(--ink-700);
  margin-bottom: var(--space-6);
}
.test-mode-banner code {
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.9em;
}
.order-summary-panel {
  background: var(--paper-100, #f3efe8);
  border: 1.5px solid var(--line-200);
  border-radius: 12px;
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
}
.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-4);
  margin-top: var(--space-3);
  border-top: 2px solid var(--ink-900);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--ink-900);
}
#checkout-cta { margin-top: var(--space-2); }
.btn-checkout {
  width: 100%;
  justify-content: center;
}
.checkout-gate-msg {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-500);
  margin-top: var(--space-3);
}

/* ── CONFIRMATION ───────────────────────────────────────── */
.confirmation-block {
  background: var(--paper-100, #f3efe8);
  border: 1.5px solid var(--line-200);
  border-radius: 14px;
  padding: var(--space-6) var(--space-8);
  margin: var(--space-6) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.confirmation-order-number {
  font-size: var(--text-base);
  color: var(--ink-700);
  text-align: center;
}
.confirmation-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.timeline-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--ink-700);
}
.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-500);
  flex-shrink: 0;
}
.timeline-dot--done {
  background: var(--sea-teal);
  border-color: var(--sea-teal);
  color: white;
}
.confirmation-next h3 {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  margin: 0 0 var(--space-3);
}
.confirmation-next ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.confirmation-next ul li {
  font-size: var(--text-sm);
  color: var(--ink-700);
  padding-left: var(--space-5);
  position: relative;
  line-height: 1.55;
}
.confirmation-next ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--sea-teal);
  font-weight: 700;
}

/* ── INLINE LINK ────────────────────────────────────────── */
.link-inline {
  color: var(--sea-teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.link-inline:hover { opacity: 0.8; }

/* ── OPTION PILLS SMALL ─────────────────────────────────── */
.option-pills--sm .option-pill span {
  padding: 6px 10px;
  font-size: var(--text-xs);
}

/* ═══════════════════════════════════════════════════════════
   APPROVE + DELIVERY STEP (Step 9 merged)
═══════════════════════════════════════════════════════════ */

/* Section dividers */
.approve-section {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--sand-200);
}
.approve-section:last-child {
  border-bottom: none;
}
.approve-section-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 var(--space-2);
}
.approve-section-hint {
  font-size: var(--text-sm);
  color: var(--ink-500);
  margin: 0 0 var(--space-4);
}

/* Character cards in approve step */
.approve-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.approve-avatar-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  min-width: 220px;
  max-width: 340px;
  flex: 1;
}
.approve-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
}
.approve-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.approve-avatar-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.approve-avatar-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--ink-900);
}
.approve-avatar-details {
  font-size: var(--text-xs);
  color: var(--ink-500);
  line-height: 1.5;
}

/* Approve checkbox */
.approve-check-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--ink-700);
  cursor: pointer;
  padding: var(--space-3) var(--space-4);
  background: var(--sand-50);
  border: 1.5px solid var(--sand-200);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
}
.approve-check-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--sea-teal);
}
.approve-not-happy {
  font-size: var(--text-xs);
  color: var(--ink-400);
  margin: 0;
}
.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--sea-teal);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.btn-link:hover { opacity: 0.8; }

/* ── BOOK COVER MOCKUP ─────────────────────────────────────── */
.approve-cover-mockup {
  margin-top: var(--space-2);
}
.approve-cover-inner {
  display: inline-block;
  width: 260px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
}
.approve-cover-bg {
  background: linear-gradient(160deg, #1a3a2a 0%, #2d6a4a 40%, #1a4a32 100%);
  width: 260px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-5) var(--space-4) var(--space-4);
  gap: var(--space-3);
  position: relative;
}
.approve-cover-title-area {
  width: 100%;
  text-align: center;
}
.approve-cover-book-label {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #f5e6c8;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.approve-cover-avatar-slot {
  width: 160px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.15);
}
.approve-cover-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.approve-cover-avatar-placeholder {
  font-size: 3rem;
  opacity: 0.5;
}
.approve-cover-tagline {
  font-size: 0.72rem;
  color: rgba(245,230,200,0.8);
  text-align: center;
  font-style: italic;
  line-height: 1.4;
}
.approve-cover-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245,230,200,0.5);
  margin-top: auto;
}

/* Trust bar stars */
.builder-trust-item {
  white-space: nowrap;
}

/* ── SPREAD PREVIEW (Step 8.5) ─────────────────────────────── */
.spread-preview-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.spread-preview-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500, #6b5e4e);
}
.spread-preview-frame {
  background: linear-gradient(135deg, #e8f4e8 0%, #f0f8f0 50%, #e0eed8 100%);
  border: 2px solid var(--line-200, #e5ddd0);
  border-radius: 12px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.spread-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  text-align: center;
}
.spread-book-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #2a5c2a;
  font-family: Georgia, serif;
  letter-spacing: 0.02em;
}
.spread-cover-scene {
  font-size: 1.5rem;
  margin-top: 0.25rem;
}
.spread-avatar-badge {
  display: flex;
  align-items: center;
  justify-content: center;
}
.spread-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 160px;
  border-radius: 12px;
  overflow: hidden;
}
.spread-half {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  gap: 0.75rem;
}
.spread-half-left {
  background: linear-gradient(135deg, #dff0df 0%, #eef7ee 100%);
  border-right: 2px solid rgba(255,255,255,0.5);
}
.spread-half-right {
  background: linear-gradient(135deg, #f0f7f0 0%, #e8f0e0 100%);
}
.spread-scene-art {
  font-size: 1.25rem;
}
.spread-text-block {
  background: rgba(255,255,255,0.85);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  width: 100%;
}
.spread-story-text {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-800, #2a1f0f);
  margin: 0;
  font-family: Georgia, serif;
}
.spread-avatar-scene {
  margin-bottom: 0.25rem;
}

/* Clickable progress dots */
.progress-group[onclick] .progress-group-dot {
  box-shadow: 0 0 0 2px rgba(30,122,120,0.25);
  transition: box-shadow 0.15s, transform 0.15s;
}
.progress-group[onclick]:hover .progress-group-dot {
  box-shadow: 0 0 0 3px rgba(30,122,120,0.5);
  transform: scale(1.12);
}
.progress-group[onclick]:hover .progress-group-label {
  color: var(--sea-teal, #1E7A78);
}

/* ── AI Preview Step (step 86) ─────────────────────────────────── */
.preview-container { max-width: 480px; margin: 0 auto; text-align: center; }
.preview-idle { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding: 1rem 0; }
.preview-avatar-thumb img {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--sea-teal, #1E7A78);
  display: block;
}
.preview-book-page {
  width: 100%; max-width: 420px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  display: block; margin: 0 auto;
}
.preview-caption {
  font-size: 0.95rem; color: var(--ink-600, #5a4a2f);
  margin-top: 0.75rem; font-style: italic;
}
.preview-loading {
  display: flex; flex-direction: column;
  align-items: center; gap: 1rem; padding: 2.5rem 0;
}
.preview-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--line-200, #e0d9cd);
  border-top-color: var(--sea-teal, #1E7A78);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.preview-result { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.preview-error { color: var(--ink-500, #7a6a50); font-size: 0.9rem; padding: 1.5rem 0; }

/* Book card selected state */
.book-select-card--selected {
  border-color: var(--sea-teal, #1E7A78);
  box-shadow: 0 0 0 2px var(--sea-teal, #1E7A78), 0 2px 12px rgba(16,18,20,0.06);
}
