/* ============================================================
   MODENAQ — Refined Luxury Design System v4
   Inspired by Tiffany & Cartier — Minimal, Elegant, Timeless
   ============================================================ */

/* ── Design Tokens ──────────────────────────────────────── */
:root {
  /* Brand Colors — Refined Gold */
  --gold:            #b8943f;
  --gold-light:      #c9a84e;
  --gold-dark:       #96772f;
  --gold-gradient:   linear-gradient(135deg, #c9a84e 0%, #96772f 100%);
  --gold-shimmer:    linear-gradient(135deg, #b8943f 0%, #dbb960 50%, #96772f 100%);
  --gold-subtle:     rgba(184,148,63,0.06);

  /* Neutrals — Cool-toned */
  --white:           #ffffff;
  --off-white:       #fcfbf9;
  --black:           #1a1a1a;
  --cream:           #f9f8f6;
  --warm-gray:       #f4f3f1;
  --border:          #e9e7e3;
  --border-light:    #f0eeea;
  --border-dark:     #d8d5cf;

  /* Typography */
  --text:            #1a1a1a;
  --text-secondary:  #6b6560;
  --text-muted:      #a09a93;
  --font-body:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display:    'Playfair Display', 'Georgia', 'Times New Roman', serif;

  /* Spacing (4px grid) — More generous */
  --s1:  4px;   --s2:  8px;   --s3:  12px;  --s4:  16px;
  --s5:  20px;  --s6:  24px;  --s8:  32px;  --s10: 40px; --s12: 48px;

  /* Radius — More refined */
  --r-sm: 6px;   --r-md: 10px;   --r-lg: 16px;   --r-xl: 24px;   --r-pill: 999px;

  /* Shadows — Ultra subtle, diffused */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.04), 0 0.5px 1px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.03);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.03);
  --shadow-gold: 0 2px 16px rgba(184,148,63,0.12);

  /* Transition — Smoother, less springy */
  --ease-out: 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184,148,63,0.25); }
  50%      { box-shadow: 0 0 0 10px rgba(184,148,63,0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-12px) scale(0.95); }
}
@keyframes borderPulse {
  0%, 100% { border-color: var(--border-dark); }
  50%      { border-color: var(--gold-light); }
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--text);
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.modenaq-flow-app .step-progress-shell {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-light);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-top: var(--s6);
  color: var(--text);
}

.panel-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  margin: var(--s2) auto var(--s6);
  max-width: 420px;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}

.style-card {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--s3);
  box-shadow: var(--shadow-xs);
  text-align: left;
  cursor: pointer;
  transition: all var(--ease-out);
}

.style-card:disabled {
  cursor: wait;
}

.style-card:hover,
.style-card.selected {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.style-card-media {
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  background: #fff;
  overflow: hidden;
}

.style-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 8px;
  display: block;
}

.style-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(180deg, #fff 0%, #faf8f4 100%);
  color: var(--text-secondary);
  text-align: center;
}

.style-card-placeholder-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(184,148,63,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dark);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(184,148,63,0.08);
}

.style-card-placeholder-text {
  font-size: 12px;
  line-height: 1.6;
}

.style-step-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
  margin-top: var(--s5);
}

.style-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s3);
  padding-top: var(--s3);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.style-card-check {
  font-size: 11px;
  color: var(--gold-dark);
}

.loading-card {
  min-height: 220px;
  background: linear-gradient(90deg, var(--warm-gray) 0%, #fbfaf8 50%, var(--warm-gray) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.style-note {
  margin-top: var(--s5);
}

.refine-preview-card {
  width: min(100%, 380px);
  margin: 0 auto;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.refine-preview-card img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  padding: 12px;
}

.refine-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin: var(--s4) 0;
}

.refine-counter,
.refine-selected-style {
  border-radius: var(--r-pill);
  background: var(--cream);
  border: 1px solid var(--border-light);
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.refine-chip-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.refine-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  border-radius: var(--r-pill);
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-out);
}

.refine-chip:hover {
  border-color: var(--gold-light);
  color: var(--gold-dark);
}

.refine-textarea {
  min-height: 96px;
}

.refine-actions {
  display: flex;
  gap: var(--s3);
}

.refine-actions .btn {
  flex: 1;
}

.progress-checklist {
  width: min(100%, 360px);
  margin: 0 auto var(--s6);
  display: grid;
  gap: var(--s3);
}

.progress-item {
  border-radius: var(--r-pill);
  background: var(--cream);
  border: 1px solid var(--border-light);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.progress-item.done {
  color: var(--gold-dark);
  border-color: rgba(184,148,63,0.28);
  background: rgba(184,148,63,0.08);
}

.compact-compare {
  margin-top: var(--s5);
}

.compact-compare .comparison-media {
  min-height: 180px;
}

#lockedDesignPreview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 10px;
}

.material-item {
  width: 100%;
  text-align: left;
}

@media (max-width: 640px) {
  .style-grid,
  .refine-chip-list,
  .style-step-actions {
    grid-template-columns: 1fr;
  }

  .refine-meta-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── App Shell ──────────────────────────────────────────── */
.app {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background: transparent;
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ── Top Bar ─────────────────────────────────────────────── */
.top-bar {
  padding: 12px var(--s5);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--off-white);
  border-bottom: 1px solid var(--border-light);
}
.top-bar-group { display: flex; align-items: center; gap: var(--s2); }
.top-bar-icon { width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; opacity: 0.6; }
.top-bar-title { font-size: 10px; font-weight: 700; color: var(--text); line-height: 1.3; display: block; letter-spacing: 0.03em; }
.top-bar-sub { font-size: 9px; font-weight: 500; color: var(--text-muted); line-height: 1.3; display: block; }

/* ── Page Content ───────────────────────────────────────── */
.page-content {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* ── Nav Header (Steps 2-5) ─────────────────────────────── */
.nav-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 55;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 var(--s4);
  height: 52px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.nav-header.show { display: flex; }
.nav-header-back {
  position: absolute; left: var(--s4); top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--ease-out);
  padding: 0;
}
.nav-header-back:hover { background: var(--black); border-color: var(--black); }
.nav-header-back:hover svg { stroke: #fff; }
.nav-header-back:active { transform: translateY(-50%) scale(0.92); }
.nav-header-back svg {
  width: 14px; height: 14px;
  stroke: var(--text); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; fill: none;
  transition: stroke var(--ease-out);
}
.nav-header-title {
  font-size: 14px; font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ── Step Panels ────────────────────────────────────────── */
.step-panel {
  display: none;
  padding: 0 var(--s5) 130px;
  animation: fadeInUp 0.4s var(--ease-out);
}
.step-panel.active { display: block; }

/* ── Step Progress Indicator ────────────────────────────── */
.step-indicator {
  display: flex; justify-content: center; align-items: flex-start;
  padding: var(--s6) var(--s4) 0;
}
.step-ind-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; flex: 1; position: relative;
}
.step-ind-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: var(--white);
  transition: all var(--ease-out);
  z-index: 2; position: relative;
}
.step-ind-item.done .step-ind-circle {
  background: var(--text); color: #fff; border-color: var(--text);
}
.step-ind-item.active .step-ind-circle {
  background: var(--gold); color: #fff; border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}
.step-ind-label {
  font-size: 9px; font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: color var(--ease-out);
}
.step-ind-item.done .step-ind-label { color: var(--text-secondary); }
.step-ind-item.active .step-ind-label { color: var(--gold-dark); font-weight: 700; }
.step-ind-item::before {
  content: '';
  position: absolute; top: 16px; left: calc(-50% + 16px);
  width: calc(100% - 32px); height: 1.5px;
  background: var(--border-light);
  z-index: 1;
  transition: background var(--ease-out);
}
.step-ind-item:first-child::before { display: none; }
.step-ind-item.done::before { background: var(--gold-light); }

/* ── Section Typography ─────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 600;
  text-align: center;
  margin-top: var(--s8);
  margin-bottom: var(--s2);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}
.section-subtitle {
  font-size: 13px; color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--s8);
  line-height: 1.6;
  font-weight: 400;
}

/* ── How It Works ───────────────────────────────────────── */
.how-it-works { margin-top: var(--s4); }
.how-title {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--s5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.how-steps {
  display: flex; gap: var(--s4);
  justify-content: center;
}
.how-step { flex: 1; max-width: 80px; text-align: center; }
.how-step-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--white);
  margin: 0 auto var(--s3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: all var(--ease-out);
}
.how-step:hover .how-step-icon {
  border-color: var(--gold-light);
  box-shadow: var(--shadow-gold);
}
.how-step-label {
  font-size: 10px; font-weight: 500;
  color: var(--text-muted);
}

/* ── Upload Area ────────────────────────────────────────── */
.upload-area {
  border: 1.5px dashed var(--border-dark);
  border-radius: var(--r-lg);
  padding: var(--s10) var(--s5);
  text-align: center;
  cursor: pointer;
  transition: all var(--ease-out);
  background: var(--cream);
  margin: var(--s5) 0;
  position: relative;
  overflow: hidden;
}
.upload-area::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--gold-subtle), transparent 50%, var(--gold-subtle) 100%);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--gold);
  border-style: solid;
  background: linear-gradient(135deg, var(--gold-subtle), var(--off-white), var(--gold-subtle));
}
.upload-cloud {
  width: 44px; height: 44px;
  margin: 0 auto var(--s3);
  color: var(--text-muted);
  transition: var(--ease-out);
}
.upload-area:hover .upload-cloud {
  color: var(--gold);
  transform: translateY(-2px);
}
.upload-label {
  font-size: 14px; font-weight: 600;
  margin-bottom: var(--s1);
  color: var(--text);
  transition: color var(--ease-out);
  letter-spacing: 0.02em;
}
.upload-area:hover .upload-label { color: var(--gold-dark); }
.upload-hint { font-size: 11px; color: var(--text-muted); }
.upload-preview-img {
  max-width: 120px; max-height: 120px;
  border-radius: var(--r-sm);
  object-fit: cover;
  display: none; margin: 0 auto var(--s3);
  box-shadow: var(--shadow-md);
}
.upload-preview-img.show { display: block; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--ease-out);
  letter-spacing: 0.04em;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-black {
  background: var(--text); color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-black:hover { background: var(--black); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-black:active { transform: scale(0.97) translateY(0); }
.btn-black:disabled {
  background: var(--border-dark); color: var(--text-muted);
  box-shadow: none; cursor: not-allowed; transform: none;
}
.btn-gold {
  background: var(--gold-gradient); color: #fff;
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { box-shadow: 0 4px 24px rgba(184,148,63,0.2); transform: translateY(-1px); }
.btn-outline {
  background: var(--white); color: var(--text-secondary);
  border: 1px solid var(--border-dark);
}
.btn-outline:hover { border-color: var(--text); color: var(--text); background: var(--cream); }
.btn-block { width: 100%; }
.btn-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all var(--ease-out);
  color: var(--text-secondary);
}
.btn-icon:hover { border-color: var(--text); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-icon:active { transform: scale(0.92); }
.btn-icon.active { background: var(--gold-gradient); color: #fff; border-color: var(--gold); box-shadow: var(--shadow-gold); }
.btn-row { display: flex; gap: 8px; justify-content: center; margin-top: var(--s5); }
.step1-primary-row { display: none; }

/* ── Mode Tabs ──────────────────────────────────────────── */
.mode-tabs {
  display: flex; gap: var(--s2); margin: var(--s2) 0 var(--s3);
  background: var(--cream);
  padding: 4px; border-radius: var(--r-pill);
}
.mode-tab {
  flex: 1; text-align: center;
  padding: 10px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all var(--ease-out);
}
.mode-tab:hover { color: var(--text); }
.mode-tab.active {
  background: var(--white); color: var(--text);
  box-shadow: var(--shadow-sm);
}
.text-input-area {
  width: 100%; min-height: 100px;
  padding: var(--s4); border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--off-white);
  font-family: var(--font-body); font-size: 13px;
  color: var(--text); resize: vertical; outline: none;
  transition: all var(--ease-out);
  line-height: 1.6;
}
.text-input-area:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}
.text-input-area::placeholder { color: var(--text-muted); }
.text-examples {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2);
}
.text-example {
  font-size: 11px; padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--white); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  white-space: nowrap;
  transition: all var(--ease-out);
}
.text-example:hover {
  border-color: var(--gold);
  background: var(--gold-subtle);
  color: var(--gold-dark);
}

/* ── Step 2 — Generate ──────────────────────────────────── */
.generate-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  text-align: center; margin-top: var(--s8);
  letter-spacing: -0.01em;
}
.generate-wait {
  font-size: 13px; color: var(--text-secondary);
  text-align: center; margin: var(--s2) 0 var(--s10);
  line-height: 1.6;
}
.progress-ring-wrap {
  position: relative; width: 140px; height: 140px;
  margin: 0 auto var(--s10);
  display: flex; align-items: center; justify-content: center;
}
.progress-ring-svg {
  position: absolute; inset: 0;
  transform: rotate(-90deg);
  filter: drop-shadow(0 1px 6px rgba(184,148,63,0.15));
}
.progress-ring-bg {
  fill: none; stroke: var(--border-light); stroke-width: 2.5;
}
.progress-ring-fill {
  fill: none; stroke: var(--gold); stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease-out);
}
.progress-percent {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 600;
  color: var(--gold-dark);
  letter-spacing: -0.02em;
}

/* ── Comparison Cards ───────────────────────────────────── */
.compare-wrap {
  position: relative; display: flex; gap: var(--s4);
}
.comparison-card { flex: 1; text-align: center; }
.comparison-label {
  font-size: 9px; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--s3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.comparison-media {
  width: 100%; aspect-ratio: 1;
  border-radius: var(--r-md);
  background: var(--cream);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-xs);
}
.comparison-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 10px;
}
.comparison-media canvas { width: 100% !important; height: 100% !important; }
.comparison-arrow {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; z-index: 2;
  box-shadow: var(--shadow-md);
  color: var(--gold);
}

/* ── Security Note ──────────────────────────────────────── */
.security-note {
  display: flex; align-items: center;
  gap: 12px; margin-top: var(--s6);
  font-size: 12px; color: var(--text-secondary);
  background: var(--cream);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 14px var(--s5);
  line-height: 1.6;
}
.security-note svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--gold); }

/* ── Step 3 — Preview ───────────────────────────────────── */
.preview-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin: var(--s3) 0 var(--s2);
}
.preview-tool-text {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: none; border: none; cursor: pointer;
  padding: 6px 0;
  transition: color var(--ease-out);
}
.preview-tool-text:hover { color: var(--gold); }
.preview-tool-text:active { transform: scale(0.96); }
.preview-tool-text svg {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 2; fill: none;
}
.preview-tool-group { display: flex; gap: var(--s2); }
.preview-canvas-wrap {
  width: 100%; aspect-ratio: 1;
  background: var(--cream);
  border-radius: var(--r-lg);
  overflow: hidden; position: relative;
  margin: var(--s4) 0 var(--s4);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.preview-canvas-wrap canvas { width: 100% !important; height: 100% !important; }

/* ── Angle Thumbnails ───────────────────────────────────── */
.angle-thumbs {
  display: flex; gap: var(--s2); justify-content: center;
  margin-bottom: var(--s4);
}
.angle-thumb {
  width: 52px; height: 52px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  transition: all var(--ease-out);
  box-shadow: var(--shadow-xs);
  letter-spacing: 0.04em;
}
.angle-thumb:hover { border-color: var(--gold-light); color: var(--text-secondary); }
.angle-thumb.active {
  border-color: var(--gold); color: var(--gold-dark);
  background: var(--gold-subtle);
  box-shadow: var(--shadow-gold);
}

/* ── Preview Disclaimer ─────────────────────────────────── */
.preview-disclaimer {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; color: var(--text-secondary);
  background: var(--cream);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 14px var(--s5);
  margin: var(--s4) 0 var(--s6);
  line-height: 1.6;
}
.preview-disclaimer::before {
  content: '\2139'; font-size: 16px; flex-shrink: 0; color: var(--gold);
}

/* ── Step 4 — Material Selection ────────────────────────── */
.material-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  margin-top: var(--s6);
  margin-bottom: var(--s2);
  letter-spacing: -0.01em;
}
.material-list {
  margin-top: var(--s5);
  display: flex; flex-direction: column; gap: var(--s3);
}
.material-item {
  display: flex; align-items: center; gap: var(--s5);
  padding: 14px var(--s5);
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  cursor: pointer; transition: all var(--ease-out);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}
.material-item:hover {
  border-color: var(--gold-light);
  box-shadow: var(--shadow-sm);
}
.material-item.selected {
  border-color: var(--gold);
  background: var(--gold-subtle);
  box-shadow: var(--shadow-gold);
}
.material-thumb-placeholder {
  width: 48px; height: 48px; border-radius: var(--r-sm);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: var(--cream);
}
.material-info { flex: 1; }
.material-name { font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }
.material-price { font-size: 13px; color: var(--text-secondary); margin-top: 2px; font-weight: 400; }
.material-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: transparent; font-weight: 700;
  transition: all var(--ease-out);
}
.material-item.selected .material-check {
  border-color: var(--gold); background: var(--gold); color: #fff;
}

/* ── Size Selector ──────────────────────────────────────── */
.size-section { margin-top: var(--s8); }
.size-label {
  font-size: 13px; font-weight: 600;
  margin-bottom: 6px;
}
.size-recommend {
  font-size: 11px; color: var(--text-muted);
  margin-bottom: var(--s4);
}
.size-options { display: flex; gap: var(--s3); }
.size-option {
  flex: 1; padding: var(--s4) var(--s3); text-align: center;
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  cursor: pointer; transition: all var(--ease-out);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}
.size-option:hover { border-color: var(--gold-light); }
.size-option.selected {
  border-color: var(--gold);
  background: var(--gold-subtle);
  box-shadow: var(--shadow-gold);
}
.size-option .size-value { font-size: 20px; font-weight: 600; font-family: var(--font-display); }
.size-option .size-unit { font-size: 11px; color: var(--text-muted); }
.size-option.selected .size-value { color: var(--gold-dark); }

/* ── Payment Icons ──────────────────────────────────────── */
.payment-icons-row {
  display: flex; gap: 10px; justify-content: center;
  margin-top: var(--s4); flex-wrap: wrap;
}
.payment-icon {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  padding: 6px 12px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; height: 28px;
  box-shadow: var(--shadow-sm);
}
.payment-visa { background: #1a1f71; color: #fff; font-style: italic; }
.payment-mc   { background: linear-gradient(135deg, #eb001b 50%, #f79e1b 50%); color: #fff; }
.payment-amex { background: linear-gradient(135deg, #016fd0, #016fd0); color: #fff; }
.payment-paypal { background: linear-gradient(135deg, #003087, #009cde); color: #fff; border-radius: 20px; }
.payment-gpay { background: #000; color: #fff; }

/* ── Step 5 — Order Summary ─────────────────────────────── */
.order-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  text-align: center; margin-top: var(--s8);
  letter-spacing: -0.01em;
}
.order-charm-card {
  display: flex; align-items: center; gap: var(--s5);
  padding: var(--s5); border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  background: var(--cream); margin: var(--s6) 0;
  box-shadow: var(--shadow-xs);
}
.order-charm-preview {
  width: 64px; height: 64px;
  border-radius: var(--r-sm);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--border-light);
}
.order-charm-preview canvas { width: 100% !important; height: 100% !important; }
.order-charm-info { flex: 1; }
.order-charm-name { font-size: 14px; font-weight: 600; }
.order-charm-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.order-charm-price { font-size: 15px; font-weight: 600; color: var(--gold-dark); }
.order-summary {
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.order-row {
  display: flex; justify-content: space-between;
  padding: 14px var(--s5); font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  background: var(--white);
}
.order-row:last-child { border-bottom: none; }
.order-row .label { color: var(--text-secondary); }
.order-row.total {
  font-weight: 600; font-size: 15px;
  background: var(--gold-subtle);
}

/* ── Success ────────────────────────────────────────────── */
.success-icon {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  margin: var(--s10) auto var(--s5);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.5s var(--ease-spring);
}
.success-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; text-align: center; }
.success-subtitle { font-size: 13px; color: var(--text-secondary); text-align: center; margin: var(--s3) 0 var(--s8); line-height: 1.6; }

/* ── Bottom Action Bar ──────────────────────────────────── */
.action-bar {
  position: fixed; bottom: 0; left: 0;
  width: 100%;
  padding: var(--s4) var(--s5) 24px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  z-index: 9999;
  display: flex; flex-direction: column; gap: var(--s3);
  pointer-events: none;
}
.action-bar > * { pointer-events: auto; }
.action-bar-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4);
}
.action-bar-price { display: flex; flex-direction: column; }
.action-bar-price-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.08em;
}
.action-bar-price-value {
  font-size: 22px; font-weight: 600; color: var(--text);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

@media (min-width: 601px) {
  /* no rounded corners or shadow — blends with page */
}
/* ── Toast ──────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: var(--s4); left: 50%;
  transform: translateX(-50%); z-index: 99999;
  width: calc(100% - 40px); max-width: 390px;
}
.toast {
  background: var(--text); color: #fff;
  border-radius: var(--r-pill);
  padding: 12px 24px; font-size: 13px;
  text-align: center; font-weight: 500;
  animation: toastIn 0.4s var(--ease-spring), toastOut 0.3s 2.5s var(--ease-out) forwards;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  letter-spacing: 0.01em;
}
.toast.error { background: linear-gradient(135deg, #d4555a, #c0392b); }
.toast.success { background: linear-gradient(135deg, #3a8a4e, #2d6a3a); }

/* ── Utility ────────────────────────────────────────────── */
#fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
::-webkit-scrollbar { width: 0; }

/* Minestone white theme alignment */
:root {
  --gold: #111111;
  --gold-light: #333333;
  --gold-dark: #000000;
  --gold-gradient: linear-gradient(135deg, #111111 0%, #000000 100%);
  --gold-shimmer: linear-gradient(135deg, #111111 0%, #333333 50%, #000000 100%);
  --gold-subtle: #f5f5f5;
  --white: #ffffff;
  --off-white: #ffffff;
  --black: #000000;
  --cream: #f7f7f7;
  --warm-gray: #f5f5f5;
  --border: #eeeeee;
  --border-light: #f1f1f1;
  --border-dark: #dddddd;
  --text: #111111;
  --text-secondary: #666666;
  --text-muted: #999999;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: var(--font-body);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 5px 16px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 26px rgba(0,0,0,0.05);
  --shadow-lg: 0 16px 38px rgba(0,0,0,0.07);
  --shadow-gold: 0 10px 26px rgba(0,0,0,0.06);
}

body {
  background: #ffffff;
  font-family: var(--font-body);
}

.modenaq-flow-app {
  background: #ffffff;
  color: var(--text);
}

.modenaq-flow-app .top-bar,
.modenaq-flow-app .nav-header,
.modenaq-flow-app .step-progress-shell,
.modenaq-flow-app .action-bar {
  background: rgba(255,255,255,0.96);
  border-color: var(--border);
  box-shadow: none;
}

.top-bar-title,
.nav-header-title,
.panel-title,
.section-title {
  letter-spacing: 0;
  color: var(--text);
}

.top-bar-sub,
.panel-subtitle,
.section-subtitle {
  color: var(--text-secondary);
}

.step-indicator {
  padding-bottom: 8px;
}

.step-ind-circle {
  border-color: var(--border-dark);
  background: #ffffff;
}

.step-ind-item.active .step-ind-circle,
.step-ind-item.done .step-ind-circle {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
  box-shadow: none;
}

.step-ind-item.active .step-ind-label,
.step-ind-item.done .step-ind-label {
  color: var(--text);
}

.step-ind-item.done::before {
  background: #111111;
}

.btn,
.mode-tab,
.style-card,
.refine-chip,
.size-option,
.angle-thumb,
.security-note,
.preview-disclaimer,
.comparison-media,
.preview-canvas-wrap,
.order-summary,
.order-charm-card {
  border-radius: 14px;
}

.btn-black {
  background: #111111;
  color: #ffffff;
  box-shadow: none;
}

.btn-black:hover {
  background: #000000;
  box-shadow: var(--shadow-sm);
}

.btn-outline,
.btn-icon,
.nav-header-back,
.mode-tab.active,
.text-example {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

.btn-icon.active {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
  box-shadow: none;
}

.mode-tabs,
.upload-area,
.how-step-icon,
.security-note,
.preview-disclaimer,
.progress-item,
.refine-counter,
.refine-selected-style,
.order-charm-card,
.order-row.total {
  background: #f7f7f7;
}

.upload-area {
  border-color: var(--border-dark);
}

.upload-area::before {
  display: none;
}

.upload-area:hover,
.upload-area.drag-over {
  background: #ffffff;
  border-color: #111111;
}

.style-grid {
  gap: 18px;
}

.style-card {
  border-color: var(--border);
  background: #ffffff;
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.style-card:hover,
.style-card.selected {
  border-color: #111111;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.style-card-media {
  border-radius: 12px;
  background: #f7f7f7;
  border: 1px solid var(--border);
}

.style-card-media img {
  padding: 0;
  object-fit: cover;
  background: #f7f7f7;
}

.style-card-preview {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f7f7f7;
}

.style-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.style-card-preview-state {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.style-card-placeholder {
  background: #f7f7f7;
  color: var(--text);
  align-items: flex-start;
  text-align: left;
  justify-content: flex-end;
}

.style-card-placeholder-icon {
  display: none;
}

.style-card-placeholder-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.style-card-placeholder-text {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.style-card-footer {
  font-size: 13px;
}

.style-card-check {
  color: var(--text-secondary);
}

.style-card.selected .style-card-check {
  color: var(--text);
}

.loading-card {
  background: linear-gradient(90deg, #f2f2f2 0%, #ffffff 50%, #f2f2f2 100%);
}

.text-input-area {
  background: #ffffff;
  border-color: var(--border);
}

.text-input-area:focus {
  border-color: #111111;
  box-shadow: 0 0 0 3px #f2f2f2;
}

.progress-ring-svg {
  filter: none;
}

.progress-ring-fill {
  stroke: #111111;
}

.progress-percent,
.order-charm-price,
.size-option.selected .size-value {
  color: #111111;
}

.progress-item.done,
.size-option.selected,
.angle-thumb.active {
  border-color: #111111;
  background: #f5f5f5;
  color: #111111;
  box-shadow: none;
}
