/* ============================================================
   Design tokens — calm, premium, neutral base + one accent
   ============================================================ */
:root {
  /* FİTRİNE "Runway Grid": sharp editorial fashion-tech. Zero radius, no
     shadows, hairline rules, one blue accent — tokens mirror fitrine.css so
     the app speaks the same language as the marketing site. Success states
     keep their own green (see --ok) per the design handoff. */
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-soft: #f1f0ec;
  --border: #e5e3dd; /* brand hairline — #ddd was a notch too sharp at panel density */
  --text: #111;
  --text-soft: #555;
  --text-faint: #999;
  --accent: #2340c8;
  --accent-hover: #111111;
  --accent-soft: #eef0fb;
  --danger: #b3503e;
  --radius-lg: 0;
  --radius-md: 0;
  --radius-sm: 0;
  --font-display: "Space Grotesk", sans-serif; /* brand voice, same as marketing */
  --font-mono: "IBM Plex Mono", monospace;
  --shadow-sm: none;
  --shadow-md: none;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The hidden attribute must always win over display rules like flex/grid. */
[hidden] { display: none !important; }

/* Quiet, hairline scrollbars: long control panels and strips shouldn't shout. */
* { scrollbar-width: thin; scrollbar-color: #c9c6bd transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #c9c6bd; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: #a9a69d; }

/* ============================================================
   Studio — Botika-style stepped layout (top tabs + wide body)
   ============================================================ */
body.studio-page { height: auto; background: var(--bg); color: var(--text); overflow-y: auto; }

.studio-app {
  /* Full-bleed workspace (Botika-style): the stage earns the whole screen.
     A generous cap keeps ultra-wide monitors from stretching lines of copy. */
  max-width: 1840px;
  margin: 0 auto;
  padding: 20px clamp(24px, 2.6vw, 48px) 44px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border); /* hairline anchors the app chrome */
}
.studio-topbar .brand { text-decoration: none; color: var(--text); }
.studio-topbar .brand h1 { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.brand-app-tag { color: var(--accent); font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; margin-left: 6px; }
.studio-topbar .credit-pill { margin-left: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.btn-logout { padding: 8px 14px; font-size: 13px; }

/* Horizontal stepper */
.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: var(--shadow-sm);
}

.stepper-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 12px 8px;
  border-radius: var(--radius-md);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  min-width: 0;
}

.stepper-no {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

.stepper-label { overflow: hidden; text-overflow: ellipsis; }

.stepper-pick {
  font-weight: 500;
  font-size: 12px;
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}
.stepper-pick:empty { display: none; }

.stepper-tab:hover:not(:disabled):not(.active) { background: var(--surface-soft); color: var(--text); }

.stepper-tab.active { background: var(--text); color: #fff; }
.stepper-tab.active .stepper-no { background: rgba(255, 255, 255, 0.22); border-color: transparent; color: #fff; }

.stepper-tab.done { color: var(--text); }
.stepper-tab.done .stepper-no { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

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

/* Two-column body: step controls (left) + preview (right) */
.studio-body {
  display: grid;
  /* Controls breathe a little on wide screens; the stage takes the rest. */
  grid-template-columns: minmax(360px, 420px) 1fr;
  gap: 20px;
  align-items: start;
}

/* Upload guidance rail: a third column, only on the garment step and only
   when there is room. Narrow screens keep the inline collapsible guide. */
.guide-rail { display: none; }
@media (min-width: 1200px) {
  .studio-body[data-step="step-garment"] { grid-template-columns: minmax(360px, 420px) 1fr 290px; }
  .studio-body[data-step="step-garment"] .guide-rail {
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    position: sticky;
    top: 20px;
  }
  .studio-body[data-step="step-garment"] .upload-guide-inline { display: none; }
}
.guide-rail-head { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }
.guide-rail-head.good { color: var(--ok, #0f7a5c); }
.guide-rail-head.bad { color: var(--danger); }
.guide-rail-sub { font-size: 12px; color: var(--text-soft); line-height: 1.5; margin-top: 4px; }
.guide-rail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.guide-rail-grid figure { position: relative; margin: 0; }
.guide-rail-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--border); display: block; }
.guide-rail-grid .mark {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.guide-rail-grid .mark.ok { background: var(--ok, #0f7a5c); }
.guide-rail-grid .mark.no { background: var(--danger); }
.guide-rail-note { font-size: 12px; color: var(--text-soft); line-height: 1.6; border-top: 1px solid var(--border); padding-top: 14px; }

.studio-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px 24px; /* calmer rhythm: fields breathe, the eye rests */
}

.studio-controls .step-body { display: flex; flex-direction: column; gap: 18px; }
.studio-controls .step.collapsed { display: none; }

.step-next { margin-top: 4px; }

/* Preview column */
.studio-body .preview { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.studio-body .stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  min-height: 72vh;
}

/* Inline upload guide inside step 1 */
.upload-guide-inline {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 0 12px;
}
.upload-guide-inline summary {
  list-style: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-soft);
  padding: 11px 0;
}
.upload-guide-inline summary::-webkit-details-marker { display: none; }
.upload-guide-inline summary:hover { color: var(--accent); }
.upload-guide-inline .guide-cols { padding-bottom: 12px; }

/* Premium welcome state in the studio stage */
.stage-welcome {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: grid;
  place-items: end center;
  overflow: hidden;
}
.stage-welcome-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.stage-welcome::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(23, 32, 28, 0.72) 0%, rgba(23, 32, 28, 0.1) 45%, rgba(23, 32, 28, 0) 70%);
}
.stage-welcome-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  padding: 0 32px 40px;
  max-width: 460px;
}
.stage-welcome-copy h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.stage-welcome-copy p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 8px;
}

@media (max-width: 900px) {
  .studio-body { grid-template-columns: 1fr; }
  .studio-body .stage { min-height: 420px; }
  .stepper-label { display: none; }
  .stepper-tab { padding: 12px 4px; }
}

/* ============================================================
   Admin dashboard
   ============================================================ */
.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Size segmented control: compact so XS/S/M/L/XL fit on one row */
.segmented-size label span { min-width: 0; padding: 8px 10px; }

/* Solid-colour backdrop tile: fills like a scene thumbnail, with a rainbow
   "pick any colour" badge and the chosen colour shown live. */
.scene-solid-fill { display: block; width: 100%; aspect-ratio: 1 / 1; }
.scene-solid-badge {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); pointer-events: none;
  background: conic-gradient(from 0deg, #ff004c, #ffa800, #f6ff00, #00e676, #00b0ff, #7c4dff, #ff004c);
}
.scene-solid-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  padding: 0; border: 0; background: transparent; opacity: 0; cursor: pointer;
  appearance: none; -webkit-appearance: none; }
.scene-solid-input::-webkit-color-swatch-wrapper { padding: 0; }
.scene-solid-input::-webkit-color-swatch { border: 0; }

/* Summary total row (photos · credits) */
.sr-total { margin-top: 6px; padding-top: 10px; border-top: 1.5px solid var(--hairline); }
.sr-total strong { color: var(--accent); }

/* Editorial refine panel (result view) */
.refine-panel { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.refine-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.refine-chip { padding: 8px 14px; border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text-2); cursor: pointer; border-radius: var(--radius-md, 8px); transition: background 0.15s, border-color 0.15s; }
.refine-chip:hover { background: var(--surface-soft); border-color: var(--accent); }
.refine-text { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md, 8px);
  font-family: var(--font-body, inherit); font-size: 15px; line-height: 1.6; color: var(--text); background: var(--surface); resize: vertical; }
.refine-text:focus-visible { outline: none; border-color: var(--accent); }

/* Signup consent checkbox (login pages) */
.consent { display: flex; gap: 9px; align-items: flex-start; margin-top: 16px; text-align: left;
  font-size: 12px; line-height: 1.5; color: var(--text-soft); }
.consent input { margin-top: 2px; flex: none; accent-color: var(--accent); cursor: pointer; }
.consent a { color: var(--accent); font-weight: 600; }

/* Provider-balance alert banner (admin panel only) */
.admin-banner {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
}
.admin-banner.is-low {
  background: #fdf1e3;
  color: #92500f;
  border-color: #f0c99a;
}
.admin-banner.is-critical {
  background: #fdeaea;
  color: #a01b1b;
  border-color: #eeb0b0;
}

.admin-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.06em;
}

.admin-card-value {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.1;
  color: var(--text);
}

.admin-card-sub { font-size: 12.5px; color: var(--text-soft); }

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}

.admin-panel h2 { font-size: 14.5px; font-weight: 600; margin-bottom: 14px; }

.admin-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

/* 14-day production bars */
.admin-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  align-items: end;
  height: 140px;
}

.admin-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  position: relative;
}

.admin-bar i {
  width: 100%;
  max-width: 34px;
  background: var(--accent);
  border-radius: 5px 5px 0 0;
  min-height: 2px;
  opacity: 0.85;
}

.admin-bar span { font-size: 10px; color: var(--text-faint); white-space: nowrap; }
.admin-bar b { position: absolute; top: -2px; font-size: 10.5px; color: var(--text-soft); }

/* Ranked lists with proportion bars */
.admin-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.admin-list li { display: grid; grid-template-columns: 1fr 90px 74px; align-items: center; gap: 10px; }
.al-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-bar { height: 7px; background: var(--surface-soft); border-radius: 4px; overflow: hidden; }
.al-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.al-count { font-size: 12px; color: var(--text-soft); text-align: right; }

/* Contact inbox: stacked message cards override the ranked-list grid */
.admin-messages li.admin-message { display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 14px 16px; border: 1px solid var(--border); }
.admin-message.is-done { opacity: 0.45; }
.am-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.am-head strong { font-size: 14px; }
.am-meta { font-size: 12px; color: var(--text-soft); }
.am-body { font-size: 13px; line-height: 1.6; color: var(--text-2, inherit); white-space: pre-wrap; max-width: 72ch; }

/* Respect reduced-motion: keep color/opacity feedback, drop movement */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover:not(:disabled),
  .dropzone.dragover,
  .model-item:hover,
  .scene-item:hover,
  .l-step:hover,
  .l-price-card:hover { transform: none !important; }
}

html, body { height: 100%; }

body {
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Layout
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 340px 1fr 190px;
  gap: 24px;
  height: 100vh;
  padding: 24px;
  max-width: 1560px;
  margin: 0 auto;
}


/* ============================================================
   Left panel — controls
   ============================================================ */
.controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--text);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.brand h1 { font-size: 17px; font-weight: 600; }
.brand p { font-size: 12.5px; color: var(--text-soft); margin-top: 1px; }

/* Remaining FASHN credit balance */
.credit-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

.divider { height: 1px; background: var(--border); }

.step { display: flex; flex-direction: column; gap: 16px; }

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: inherit;
}

.step-no {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.step-header h2 { font-size: 14.5px; font-weight: 600; }

/* Wizard: chosen value echoed next to the title; body collapses per step */
.step-summary {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45%;
}

.step-chevron {
  flex-shrink: 0;
  color: var(--text-soft);
  transition: transform var(--transition);
}

.step.collapsed .step-chevron { transform: rotate(-90deg); }

.step-body { display: flex; flex-direction: column; gap: 16px; }

.step.collapsed .step-body { display: none; }

/* Step 2: visual scene picker (sidebar) */
.scene-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.scene-pick {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: var(--surface-soft);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.scene-pick:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.scene-pick.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.scene-pick img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.scene-pick span {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(23, 32, 28, 0.72);
  border-radius: 5px;
  padding: 3px 5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "Keep the mannequin's scene" tile: icon + label, no thumb */
.scene-pick-keep {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-soft);
}

.scene-pick-keep span {
  position: static;
  background: none;
  color: inherit;
  padding: 0 6px;
  white-space: normal;
  line-height: 1.3;
}

.scene-pick-keep.active { color: var(--accent); }

/* Pose picker: 3:4 tiles so the stance is readable (scenes stay square) */
.pose-grid .scene-pick img { aspect-ratio: 3 / 4; }
.pose-grid .scene-pick-keep { aspect-ratio: 3 / 4; }

/* Pose not generated yet: own base photo, dimmed, auto-fills when ready */
.pose-pending img { opacity: 0.35; filter: grayscale(0.4); }

.pose-sample-chip {
  position: absolute;
  top: 5px;
  right: 5px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
}

.pose-prep { width: 100%; margin-bottom: 10px; }

/* Sticky warning when the node process is older than the code on disk */
.stale-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #7a2e1d;
  color: #fff;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
  padding: 10px 20px;
}

.stale-banner strong { font-weight: 700; }

/* Intake-driven scene recommendation chip on suggested tiles */
.scene-pick-suggested {
  position: absolute;
  top: 5px;
  left: 5px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--accent);
  border-radius: 5px;
  padding: 2px 6px;
}

/* Format export dropdown on the result bar */
.export-menu { position: relative; display: inline-flex; }

.export-options {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 170px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 20;
}

.export-options button {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  padding: 9px 12px;
  cursor: pointer;
}

.export-options button:hover { background: var(--accent-soft); color: var(--accent-hover); }

/* Matrix comparison: mannequin name captioned on each result cell */
.matrix-caption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(23, 32, 28, 0.72);
  border-radius: 6px;
  padding: 4px 9px;
  pointer-events: none;
}

/* Before/after slider: product photo overlays the result; a draggable
   divider reveals either side. Both images object-fit:contain in the same
   frame so the divider sweep reads cleanly even with different aspects. */
.compare-slider {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--surface-soft);
  overflow: hidden;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  outline: none;
}
.compare-slider .cs-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.compare-slider .cs-top { background: var(--surface-soft); }
.compare-slider .cs-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--accent);
  pointer-events: none;
}
.compare-slider .cs-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 6px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.compare-slider .cs-tag {
  position: absolute;
  bottom: 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(23, 32, 28, 0.72);
  padding: 4px 8px;
  pointer-events: none;
}
.compare-slider .cs-tag-l { left: 10px; }
.compare-slider .cs-tag-r { right: 10px; }
.credit-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.fidelity-badge .fidelity-mark {
  font-style: normal;
  font-weight: 800;
  margin-right: 2px;
}

/* Before/after: uploaded product photo next to the finished result */
.compare-grid {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.compare-grid figure {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
}

.compare-grid img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  background: var(--surface-soft);
}

.compare-grid figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(23, 32, 28, 0.72);
  border-radius: 6px;
  padding: 4px 9px;
}

.field { display: flex; flex-direction: column; gap: 7px; }

.field > label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.06em;
}

.field:focus-within > label { color: var(--accent); }

/* First-run setup card */
.setup-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 18px;
}

.setup-card h2 { font-size: 15px; font-weight: 600; }

.setup-card p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
}

.setup-card input {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  transition: border-color var(--transition);
}

.setup-card input:focus-visible { border-color: var(--accent); outline: none; }

/* Locked company badge */
.company-badge {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 2px 0;
}

.company-badge-label {
  /* Caps written at the source (no text-transform: Turkish İ problem). */
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.07em;
}

.company-badge-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.workflow {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.section-hint {
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.5;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* Pool attribute filters */
.pool-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pool-filters select {
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 6px;
  cursor: pointer;
  min-width: 0;
  transition: border-color var(--transition);
}

.pool-filters select:hover,
.pool-filters select:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.pool-empty {
  font-size: 12.5px;
  color: var(--text-faint);
  padding: 6px 2px;
}

/* Mannequin pool grid */
.model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.model-item {
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform var(--transition);
}

.model-item:hover { transform: translateY(-2px); }

.model-frame {
  aspect-ratio: 3 / 4;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-soft);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.model-item.active .model-frame {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.model-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Pool mannequins: dedicated square face crop + name */
.model-face .model-frame { aspect-ratio: 1 / 1; }

.model-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-item.active .model-name { color: var(--accent); }

/* Collapsible mannequin generator */
.generator {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.generator summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  padding: 11px 14px;
  border-radius: var(--radius-md);
  transition: color var(--transition), background var(--transition);
  user-select: none;
}

.generator summary::-webkit-details-marker { display: none; }

.generator summary:hover { color: var(--accent); }

.generator[open] summary { color: var(--text); border-bottom: 1px solid var(--border); }

.generator-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}

.field .optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-faint);
}

.text-input {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  transition: border-color var(--transition);
}

.text-input::placeholder { color: var(--text-faint); }
.text-input:focus-visible { border-color: var(--accent); outline: none; }

/* Step 4 summary recap */
.summary-review {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  margin-bottom: 4px;
}

.summary-review .sr-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-soft);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.summary-review .sr-row:last-child { border-bottom: none; }
.summary-review .sr-row strong { color: var(--text); font-weight: 600; }

/* Live pre-generation cost estimate */
.cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.cost-row strong { color: var(--accent); font-weight: 600; }

/* Segmented control */
.segmented {
  display: flex;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented span {
  display: block;
  text-align: center;
  padding: 7px 4px;
  font-size: 13px;
  color: var(--text-soft);
  border-radius: calc(var(--radius-sm) - 3px);
  cursor: pointer;
  /* Spring easing on selection (Disney: follow-through / overshoot) */
  transition: background 220ms cubic-bezier(0.34, 1.56, 0.64, 1),
              color 150ms ease-out, box-shadow 150ms ease-out;
  white-space: nowrap;
}

.segmented span:hover { color: var(--text); }

.segmented input:checked + span {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Buttons */
.btn {
  position: relative;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation; /* no double-tap zoom delay on mobile */
  transition: background var(--transition), transform 120ms ease-out,
              box-shadow 120ms ease-out, opacity var(--transition);
}

/* Anticipation: buttons lift on hover, then compress on press (follow-through) */
.btn-primary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-secondary:hover:not(:disabled) { box-shadow: var(--shadow-md); }

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  box-shadow: var(--shadow-sm);
  transition-duration: 60ms;
}

/* Accessibility: visible keyboard focus for buttons and studio controls */
.btn:focus-visible,
.history-tab:focus-visible,
.tip-chip:focus-visible,
.model-item:focus-visible,
.scene-item:focus-visible,
.variant-item:focus-visible,
.guide-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Flat brand blue (DESIGN.md button-primary) — the old green-blue gradient
   was a pre-rebrand leftover and the noisiest element in the panel. */
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-soft); }

/* Button loading spinner */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: absolute;
  right: 16px;
  top: 50%;
  margin-top: -8px;
}

.btn.loading .btn-spinner { display: block; }
.btn.loading { pointer-events: none; opacity: 0.85; }

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

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  min-height: 150px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 140ms ease-out;
  overflow: hidden;
}

.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); outline: none; }

/* Staging: dropzone reacts to a drag with a subtle lift + accent wash */
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.015);
}

.dropzone-empty {
  text-align: center;
  color: var(--text-soft);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-empty svg { color: var(--text-faint); }
.dropzone-empty p { font-size: 13px; line-height: 1.5; }
.dropzone-empty strong { color: var(--text); font-weight: 500; }
.dropzone-empty .hint { font-size: 11.5px; color: var(--text-faint); }

/* Multi-garment thumbnails inside the dropzone */
.garment-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  padding: 12px;
}

.garment-item {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
}

.garment-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.garment-item .btn-clear {
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  font-size: 13px;
}

/* Product-intake badge overlaid at the bottom of each garment thumbnail */
.garment-intake {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(3px);
}

.garment-intake.analysing { color: #fff; background: rgba(23, 32, 28, 0.6); font-weight: 500; }
.garment-intake.ok { color: #fff; background: rgba(15, 122, 92, 0.85); }
.garment-intake.warn { color: #fff; background: rgba(179, 80, 62, 0.92); }

/* Type chips beneath the thumbnail: auto-picked from the intake, one tap to
   correct. The choice decides the engine — try-on for garments,
   product-to-model for jewellery/bags — so a visible, correctable control
   kills misroutes without ever covering the product. */
.garment-cell { display: flex; flex-direction: column; gap: 5px; }
.garment-type { display: flex; gap: 4px; }
.garment-type button {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 0;
  cursor: pointer;
  color: var(--text-soft);
  background: var(--surface);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.garment-type button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.garment-type button:not(.active):hover { background: var(--surface-soft); color: var(--text); }

/* Optional AI-transparency label toggle, sits beside the download button */
.ai-label-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.ai-label-toggle input { accent-color: var(--accent); cursor: pointer; }

/* Smart mannequin recommendation nudge */
.mannequin-suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px solid #cfe6db;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.4;
  animation: fade-in 220ms ease both;
}

.mannequin-suggestion .ms-icon { flex: 0 0 auto; }
.mannequin-suggestion .ms-text { flex: 1; min-width: 0; }
.mannequin-suggestion strong { color: var(--accent-hover); font-weight: 600; }
.mannequin-suggestion .btn-compact { flex: 0 0 auto; padding: 6px 12px; font-size: 12px; }

.btn-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(29, 27, 24, 0.65);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-clear:hover { background: rgba(29, 27, 24, 0.85); }

.tryon-requirement {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  transition: opacity var(--transition);
}

.tryon-requirement.hidden-soft { opacity: 0; }

/* ============================================================
   Right panel — preview stage
   ============================================================ */
.preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.stage {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.stage-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 40px;
  animation: fade-in 300ms ease both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Empty state */
.stage-empty .stage-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-faint);
}

.stage-empty h3 { font-size: 16px; font-weight: 600; }
.stage-empty p { font-size: 13.5px; color: var(--text-soft); max-width: 320px; line-height: 1.55; }

/* Loading state */
.stage-loading .loader {
  width: 46px;
  height: 46px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.stage-loading h3 { font-size: 15px; font-weight: 600; }
.stage-loading p { font-size: 13px; color: var(--text-soft); min-height: 1.2em; }

/* Error state */
.stage-error .stage-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #f9ece9;
  color: var(--danger);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 600;
}

.stage-error h3 { font-size: 15.5px; font-weight: 600; }
.stage-error p {
  font-size: 13px;
  color: var(--text-soft);
  max-width: 420px;
  line-height: 1.55;
  word-break: break-word;
}

/* Result state */
.stage-result {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: fade-in 300ms ease both;
}

.stage-result .result-image {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px 24px 12px;
}

.stage-result img,
.stage-result video {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Mannequin cutout placed INSIDE the picked scene — no credits spent */
/* Model + picked scene: clean, honest preview — mannequin shown as-is with a
   scene label chip. No fake compositing (that never matches lighting). */
.scene-preview {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
}

.scene-preview img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.scene-preview-chip {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(23, 32, 28, 0.72);
  border-radius: 999px;
  padding: 5px 11px;
  backdrop-filter: blur(4px);
}

.scene-note {
  font-size: 12px;
  color: var(--text-soft);
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px 20px;
}

.result-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 12px;
  margin-right: auto;
}

.result-bar .btn { padding: 9px 16px; font-size: 13px; }

/* Batch try-on queue */
.batch-header {
  text-align: center;
  padding: 22px 24px 4px;
}

.batch-header h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.batch-header p { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; }

.batch-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 24px;
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
}

.batch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: border-color var(--transition), background var(--transition);
}

.batch-row img {
  width: 42px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 auto;
  background: #fff;
}

.batch-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.batch-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-status {
  font-size: 12px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-done { cursor: pointer; }
.batch-done:hover { border-color: var(--accent); background: var(--accent-soft); }
.batch-error .batch-status { color: var(--danger); }

.batch-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  flex: 0 0 auto;
}

.batch-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.batch-ok {
  color: var(--accent);
  font-weight: 700;
  flex: 0 0 auto;
}

.batch-err {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f9ece9;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.batch-summary { font-size: 13px; color: var(--text-soft); }

/* Scene picker (grouped, scrollable) */
.scene-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 24px 24px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.scene-group-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.06em;
  margin: 16px 0 10px;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.scene-item {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: var(--surface-soft);
  position: relative;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.scene-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.scene-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.scene-item span {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(23, 32, 28, 0.72);
  border-radius: 6px;
  padding: 5px 8px;
  text-align: center;
}

/* Right utility rail: stacked compact cards, page background breathes
   between them — the rail never stretches into an empty white void. */
.guide-side {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-content: start;
}

.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
}

.side-card h3 {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.06em;
}

/* Style-instruction tip chips (click to fill the prompt input) */
.tip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tip-chip {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.tip-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* Mini credit cost list */
.cost-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.cost-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-soft);
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.cost-list li:last-child { border-bottom: none; }

.cost-list strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.guide-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.guide-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-col-head {
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  border-radius: 6px;
  padding: 4px 0;
}

.guide-col-head.good { color: var(--accent); background: var(--accent-soft); }
.guide-col-head.bad { color: var(--danger); background: #f9ece9; }

.guide-col figure {
  margin: 0;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
}

.guide-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.guide-caption {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.5;
}

.guide-badge {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 1.5px solid #fff;
}

.guide-badge.good { background: var(--accent); }
.guide-badge.bad { background: var(--danger); }

/* Multi-variant pick-best grid */
.variant-header {
  text-align: center;
  padding: 22px 24px 4px;
}

.variant-header h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.variant-header p { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; }

.variant-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  padding: 18px 24px 24px;
  align-items: center;
  overflow-y: auto;
}

.variant-item {
  position: relative; /* anchors the matrix mannequin caption */
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: var(--surface-soft);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.variant-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.variant-item img {
  width: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* ============================================================
   History strip
   ============================================================ */
.history {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px 16px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.06em;
}

.history-tabs {
  display: flex;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.history-tab {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.history-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.history-empty {
  font-size: 12.5px;
  color: var(--text-faint);
  padding: 12px 0;
}

.history-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.history-item {
  position: relative;
  flex: 0 0 auto;
  width: 68px;
  height: 90px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: var(--surface-soft);
  transition: border-color var(--transition), transform var(--transition);
}

.history-item:hover { transform: translateY(-2px); }
.history-item.active { border-color: var(--accent); }

.history-item img,
.history-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(23, 32, 28, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.history-item .tag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 9.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(29, 27, 24, 0.72);
  border-radius: 5px;
  padding: 2px 6px;
  pointer-events: none;
}

/* ============================================================
   Pricing page
   ============================================================ */
.pricing-page { overflow-y: auto; }

.pricing-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.pricing-header { text-align: center; margin-bottom: 36px; position: relative; }

.back-link {
  position: absolute;
  left: 0;
  top: 4px;
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--transition);
}

.back-link:hover { color: var(--accent); }

.pricing-header h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }

.pricing-tagline {
  font-size: 14.5px;
  color: var(--text-soft);
  max-width: 560px;
  margin: 10px auto 0;
  line-height: 1.6;
}

.pricing-tagline strong { color: var(--text); font-weight: 600; }

.billing-toggle {
  display: inline-flex;
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.toggle-opt {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-soft);
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background var(--transition), color var(--transition);
}

.toggle-opt.active { background: var(--text); color: #fff; }

.save-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
}

.toggle-opt.active .save-badge { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* Plan cards */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.plan:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.plan-popular {
  border: 2px solid var(--text);
  position: relative;
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plan-head h2 { font-size: 19px; font-weight: 700; }

.popular-badge {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.plan-sub { font-size: 12px; color: var(--text-soft); line-height: 1.5; min-height: 2.6em; }

.plan-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

.plan-price .amount { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; }
.plan-price .amount-custom { font-size: 30px; }
.plan-price .per { font-size: 12px; color: var(--text-soft); }

.credit-select {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  cursor: pointer;
  transition: border-color var(--transition);
}

.credit-select:hover, .credit-select:focus-visible { border-color: var(--accent); outline: none; }

.plan-cta { text-align: center; text-decoration: none; }

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}

.plan-features li {
  font-size: 13px;
  color: var(--text);
  padding-left: 24px;
  position: relative;
  line-height: 1.45;
}

.plan-features li::before {
  content: '✓';
  position: absolute;
  left: 2px;
  color: var(--accent);
  font-weight: 700;
}

.plan-features li.inherit { color: var(--text-faint); }
.plan-features li.inherit::before { content: ''; }

.pricing-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 28px;
  line-height: 1.6;
}

/* Link from the studio back to pricing */
.pricing-link {
  font-size: 12.5px;
  color: var(--text-soft);
  text-decoration: none;
  text-align: center;
  padding-top: 4px;
  transition: color var(--transition);
}

.pricing-link:hover { color: var(--accent); }

/* ============================================================
   Responsive fallback (narrow windows)
   ============================================================ */
@media (max-width: 1150px) {
  .app { grid-template-columns: 340px 1fr; }
  .guide-side { display: none; }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    height: auto;
  }
  .stage { min-height: 480px; }
}

/* ============================================================
   Garment-fidelity verification — badges, difference panel,
   best-variant marker, "korunacak detaylar" chips
   ============================================================ */
:root {
  --ok: #0f7a5c;      /* green — birebir */
  --warn: #b7791f;    /* amber — küçük fark */
  --warn-soft: #fbf3e2;
  --danger-soft: #f7e6e2;
}

.fidelity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}
.fidelity-badge .fidelity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.fidelity-ok { color: var(--ok); background: var(--accent-soft); }
.fidelity-minor { color: var(--warn); background: var(--warn-soft); }
.fidelity-major { color: var(--danger); background: var(--danger-soft); }

/* Difference panel under the result image */
.fidelity-detail {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 12px 4px 0;
  font-size: 13px;
}
.fidelity-detail.fidelity-minor { border-color: #e7cd93; background: var(--warn-soft); }
.fidelity-detail.fidelity-major { border-color: #e2b3a9; background: var(--danger-soft); }
.fidelity-detail summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.fidelity-detail summary::-webkit-details-marker { display: none; }
.fidelity-detail.fidelity-minor summary { color: var(--warn); }
.fidelity-detail.fidelity-major summary { color: var(--danger); }
.fidelity-detail ul { margin: 8px 0 0; padding-left: 18px; color: var(--text); }
.fidelity-detail li { margin: 3px 0; line-height: 1.45; }
.fidelity-hint { margin-top: 8px; font-size: 12px; color: var(--text-soft); line-height: 1.5; }

/* Per-dimension check rows: ✓ preserved / △ slight / ✕ drifted */
.fq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 14px;
  margin-top: 8px;
}
.fq-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); }
.fq-row em { font-style: normal; font-weight: 700; width: 14px; text-align: center; }
.fq-row.fq-ok em { color: var(--accent); }
.fq-row.fq-minor em { color: var(--warn); }
.fq-row.fq-major em { color: var(--danger); }
.fq-row.fq-major { font-weight: 600; }

/* Per-variant badge overlay + best marker */
.variant-item { position: relative; }
.variant-item .fidelity-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  padding: 4px 8px;
  box-shadow: var(--shadow-sm);
}
.variant-item.is-best { outline: 2px solid var(--accent); outline-offset: 2px; }
.variant-best-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

/* "Korunacak detaylar" chips in the summary review */
.sr-details { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.sr-details-head {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 7px;
}
.sr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sr-chip {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px;
}

/* Live ETA under the loading spinner (median of real past run durations) */
.loading-eta { width: min(320px, 80%); margin-top: 14px; }
.loading-eta-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.loading-eta-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 1s linear;
}
.loading-eta p { font-size: 12px; color: var(--text-soft); margin-top: 7px; text-align: center; }

/* Lifestyle scene poses section heading in the pose step */
.pose-lifestyle-head {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.campaign-btn { width: 100%; margin-top: 10px; }

/* Kombin Modu: mode switch + suggestion cards (zero-credit rule table) */
.combo-seg { display: flex; gap: 6px; margin-bottom: 10px; }
.combo-seg-btn {
  flex: 1; padding: 8px 10px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.combo-seg-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.combo-card {
  border: 1px solid var(--border); background: var(--surface-soft);
  padding: 12px 14px; margin-bottom: 8px;
}
.combo-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.combo-card strong { font-size: 13.5px; }
.combo-why { margin: 6px 0 8px; font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }
.combo-note { font-size: 12px; color: var(--text-soft); margin: 8px 0 0; }
.advanced-style summary { cursor: pointer; font-weight: 600; font-size: 13px; margin-bottom: 8px; }

/* Modest-wear suggestion box on the garment card */
.modest-suggest { border: 1px solid var(--border); background: var(--accent-soft); padding: 10px 12px; margin-top: 8px; }
.modest-suggest p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; }
.modest-suggest .btn { margin-right: 6px; font-size: 12px; }
.modest-suggest .modest-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Modesty compliance block inside the fidelity panel */
.fq-modesty { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.fq-modesty strong { font-size: 13px; }
