/* ============================================================
   FITTA — 룩북(Lookbook) 디자인
   국내 패션 커머스의 표준 문법을 따른다: 흰 바탕, 헤어라인 구획,
   각진 모서리, 촘촘한 상품 그리드, 하나의 붉은 시그널 컬러.
   숫자는 Space Grotesk 의 tabular-nums 로 흔들리지 않게 고정한다.
   ============================================================ */

/* ── 토큰 ─────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --panel: #f4f4f4;
  --panel-2: #fafafa;
  --ink: #141414;
  --ink-soft: #6b6b6b;   /* 흰 바탕 위 5.33:1 — 본문 보조 텍스트 AA 통과 */
  --line: #e7e7e7;
  --line-strong: #141414;

  --signal: #e0332b;     /* 면·굵은 글씨 전용 (흰 바탕 4.49:1) */
  --signal-ink: #c42a23; /* 작은 글씨·버튼 바탕 전용 — 흰 글씨와 5.67:1 */
  --signal-deep: #a81f19;
  --signal-on: #ffffff;   /* 붉은 면 위 글자색 */
  --signal-tint: #fdeae9;

  --good: #1f6b3f;
  --warn: #8a5411;
  --bad: #c42a23;

  --shadow-sm: 0 1px 2px rgba(20, 20, 20, .05), 0 2px 6px rgba(20, 20, 20, .04);
  --shadow-md: 0 4px 12px rgba(20, 20, 20, .07), 0 18px 40px rgba(20, 20, 20, .07);

  --r: 2px;    /* 룩북은 각지다. 큰 곡률은 이 세계의 언어가 아니다. */
  --r-md: 6px;

  --disp: "Space Grotesk", "Noto Sans KR", system-ui, sans-serif;
  --sans: "Noto Sans KR", -apple-system, "Segoe UI", system-ui, sans-serif;
  --maxw: 1240px;
  --gutter: 44px;
}

:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --panel: #1a1a1a;
  --panel-2: #151515;
  --ink: #f2f2f2;
  --ink-soft: #a3a3a3;   /* 검정 바탕 위 7.65:1 */
  --line: #2a2a2a;
  --line-strong: #f2f2f2;

  --signal: #ff5a52;
  --signal-ink: #ff7a73;
  --signal-deep: #ff9a94;
  --signal-on: #0e0e0e;
  --signal-tint: #2a1412;

  --good: #6fd39a;
  --warn: #e0aa5e;
  --bad: #ff7a73;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .55), 0 18px 40px rgba(0, 0, 0, .5);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

/* ── 브라우저가 그리는 표면도 이 디자인에 속한다 ────────── */
::selection { background: var(--signal); color: var(--signal-on); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--signal); }
html { scrollbar-color: var(--ink) var(--bg); scrollbar-width: thin; }

input, textarea, select { caret-color: var(--signal); }

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: var(--r);
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: 10px 18px; font-weight: 700; text-decoration: none;
  transition: top .16s ease;
}
.skip-link:focus-visible { top: 12px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* 숫자는 자릿수가 바뀌어도 흔들리지 않게 한다. */
.disp, .pick-score, .pick-price, .reco-score, .product-price,
.score-bar b, .stat-row dd, .rule-metric b, .step-num, .block-num {
  font-family: var(--disp);
  font-variant-numeric: tabular-nums;
}

/* ── 상단바 ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand {
  font-family: var(--disp); font-weight: 700; font-size: 1.35rem;
  letter-spacing: -.01em; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px;
}
.brand:hover { color: var(--signal-ink); }

/* 진행 단계 — 룩북의 카테고리 내비 자리를 그대로 쓴다. */
.stepper { display: flex; gap: 4px; }
.step {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  background: none; border: 0; cursor: default;
  font-family: var(--sans); font-size: .88rem; font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  transition: color .16s ease, border-color .16s ease;
}
.step[data-clickable="1"] { cursor: pointer; }
.step[data-clickable="1"]:hover { color: var(--ink); }
.step-num { font-size: .78rem; font-weight: 700; opacity: .65; }
.step.is-done { color: var(--ink); }
.step.is-done .step-num { color: var(--signal-ink); opacity: 1; }
.step.is-active {
  color: var(--ink); font-weight: 700;
  border-bottom-color: var(--signal);
}
.step.is-active .step-num { color: var(--signal-ink); opacity: 1; }

.theme-toggle {
  position: relative;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; color: var(--ink);
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-icon {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
}

/* ── 레이아웃 ─────────────────────────────────────────── */
.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) 96px; }

.panel { display: none; }
.panel.is-active { display: block; animation: rise .3s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.block-head { padding: 56px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.block-head h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 900;
  line-height: 1.28; margin: 0; text-wrap: balance; word-break: keep-all; letter-spacing: -.02em;
}
.block-num { color: var(--signal-ink); margin-right: .5ch; font-weight: 700; }
.lede { color: var(--ink-soft); margin: 12px 0 0; max-width: 68ch; }

/* ── 1단계: 사진 ──────────────────────────────────────── */
.hero-split {
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: 0; border-bottom: 1px solid var(--line);
  min-height: 560px;
}
.hero-drop { border-right: 1px solid var(--line); display: flex; }
.hero-copy { padding: 56px 0 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.hero-copy h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-weight: 900;
  line-height: 1.26; margin: 0 0 16px; letter-spacing: -.02em;
  text-wrap: balance; word-break: keep-all;
}
.headline-line { display: block; }

.full-body-guide {
  display: grid; grid-template-columns: 96px 1fr; gap: 16px;
  align-items: center; margin: 24px 0 4px; padding: 12px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.full-body-guide img {
  width: 96px; height: 132px; object-fit: cover; object-position: center top;
  display: block; border: 1px solid var(--line-strong);
}
.full-body-guide h2 { font-size: .92rem; margin: 0 0 8px; }
.full-body-guide ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
/* 좁은 칸이라 음절 단위로 끊기기 쉽다. 여기도 낱말 단위로 묶는다. */
.full-body-guide li { color: var(--ink-soft); font-size: .78rem; line-height: 1.45; word-break: keep-all; }
.full-body-guide li::before { content: "•"; color: var(--signal); margin-right: 6px; }

.dropzone {
  flex: 1; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel);
  border: 0; cursor: pointer;
  padding: 40px 32px;
  transition: background .18s ease;
}
.dropzone:hover, .dropzone.is-drag { background: var(--signal-tint); }
.dropzone-empty { text-align: center; max-width: 34ch; }
.dz-badge {
  display: inline-block; background: var(--bg); color: var(--ink);
  font-family: var(--disp); font-size: .7rem; font-weight: 700;
  letter-spacing: .06em; padding: 5px 11px; margin-bottom: 22px;
}
.dz-icon { color: var(--ink-soft); margin: 0 auto 14px; width: 48px; height: 48px; }
.dz-icon svg { width: 100%; height: 100%; }
.dz-title { font-weight: 700; margin: 0 0 6px; }
.dz-sub { font-size: .85rem; color: var(--ink-soft); margin: 0 0 16px; }
.dz-privacy {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; line-height: 1.5;
  background: color-mix(in srgb, var(--good) 10%, transparent); color: var(--good);
  padding: 6px 13px; margin: 0;
}
.dz-privacy::before { content: "✓"; font-weight: 900; }

.dropzone-preview { position: relative; width: 100%; text-align: center; }
.dropzone-preview img {
  max-width: 100%; max-height: 460px; display: block; margin: 0 auto;
  box-shadow: var(--shadow-md);
}
.dropzone-sm { min-height: 132px; padding: 22px; border: 1px dashed var(--line-strong); background: var(--panel-2); }
.dropzone-sm .dropzone-preview img { max-height: 200px; }

.chip-btn {
  margin-top: 14px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 10px 16px; min-height: 44px;
  font-family: var(--sans); font-size: .82rem; font-weight: 500; cursor: pointer;
}
.chip-btn:hover { background: var(--ink); color: var(--bg); }

.tips { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tips li { font-size: .92rem; color: var(--ink-soft); display: flex; gap: 9px; line-height: 1.6; }
.tips li::before { content: "—"; color: var(--signal); flex-shrink: 0; font-weight: 700; }
.tips li strong { color: var(--ink); font-weight: 700; flex: none; white-space: nowrap; }
/* 한국어는 기본값(word-break: normal)에서 음절 사이 아무 데나 끊긴다.
   그래서 '코디'가 '코 / 디'로 갈라졌다. 낱말 단위로만 끊는다. */
.tips-note {
  font-size: .82rem; color: var(--ink-soft); margin: 18px 0 0; max-width: 46ch;
  word-break: keep-all;
}
.hero-primary-action { align-items: flex-start; }
.photo-gate-note {
  white-space: pre-line;
  flex: 1 0 100%; margin: 0 0 2px;
  font-size: .82rem; color: var(--ink-soft);
}
.photo-gate-note[data-tone="ok"] { color: var(--good); font-weight: 500; }
.photo-gate-note[data-tone="warn"] { color: var(--warn); font-weight: 600; }
.photo-gate-note[data-tone="bad"],
.photo-gate-note[data-tone="error"] { color: var(--bad); font-weight: 700; }

/* ── 폼 ───────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 0; }

.field-group { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 30px 0; }
.field-group:first-child { border-top: 0; padding-top: 0; }
.field-group legend {
  font-size: 1.05rem; font-weight: 900; padding: 0; margin-bottom: 20px;
  letter-spacing: -.01em;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.field { display: block; margin-bottom: 20px; }
.grid-2 .field, .grid-3 .field { margin-bottom: 0; }
.field-label {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: .86rem; font-weight: 700; margin-bottom: 8px;
}
.field-hint { display: block; font-size: .79rem; color: var(--ink-soft); margin-top: 7px; line-height: 1.55; }

.badge {
  font-style: normal; font-size: .69rem; font-weight: 700; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 999px; border: 1px solid;
}
.badge.required { color: var(--signal-ink); border-color: var(--signal-ink); background: var(--signal-tint); }
.badge.optional { color: var(--ink-soft); border-color: var(--line); background: transparent; }

input[type="text"], input[type="number"], select {
  width: 100%; min-height: 44px;
  padding: 10px 12px;
  font-family: var(--sans); font-size: .93rem; color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s ease;
}
input::placeholder { color: var(--ink-soft); opacity: 1; }
input:hover, select:hover { border-color: var(--ink-soft); }
input:focus, select:focus { border-color: var(--ink); }
select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* 예산 — 두 핸들로 최소·최대를 바로 정한다. */
.budget-slider { width: min(100%, 620px); }
.budget-values {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 12px;
}
.budget-values output {
  font-family: var(--disp); font-size: 1rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.budget-values span { color: var(--ink-soft); }
.budget-range { position: relative; height: 30px; }
.budget-track, .budget-selected {
  position: absolute; left: 0; right: 0; top: 13px;
  height: 5px; border-radius: 999px;
}
.budget-track { background: var(--line); }
.budget-selected { background: var(--signal); }
.budget-range input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 30px; margin: 0;
  appearance: none; -webkit-appearance: none;
  background: transparent; pointer-events: none;
}
.budget-range input[type="range"]::-webkit-slider-runnable-track { height: 5px; background: transparent; }
.budget-range input[type="range"]::-moz-range-track { height: 5px; background: transparent; }
.budget-range input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; margin-top: -8.5px;
  border: 3px solid var(--bg); border-radius: 50%; background: var(--signal-ink);
  box-shadow: 0 0 0 1px var(--signal-ink), var(--shadow-sm);
  cursor: grab; pointer-events: auto;
}
.budget-range input[type="range"]::-moz-range-thumb {
  width: 17px; height: 17px;
  border: 3px solid var(--bg); border-radius: 50%; background: var(--signal-ink);
  box-shadow: 0 0 0 1px var(--signal-ink), var(--shadow-sm);
  cursor: grab; pointer-events: auto;
}
.budget-range input[type="range"]:focus-visible { outline: none; }
.budget-range input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--signal); outline-offset: 3px;
}
.budget-range input[type="range"]:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--signal); outline-offset: 3px;
}
.budget-scale {
  display: flex; justify-content: space-between;
  margin-top: 1px; font-size: .73rem; color: var(--ink-soft);
}

/* 필수 블록 — 여기까지만 채우면 추천이 나온다는 걸 면으로 보여준다. */
.required-block {
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 26px 26px 30px; margin-bottom: 40px;
}
.required-title {
  font-size: 1.05rem; font-weight: 900; margin: 0 0 20px;
  display: flex; align-items: center; gap: 10px; letter-spacing: -.01em;
}
.required-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.required-block .grid-2 { margin-bottom: 20px; }

/* 선택 블록 — 열어본 사람만 더 정밀해진다. */
.optional-head { margin-bottom: 4px; }
.optional-head h2 { font-size: 1rem; font-weight: 900; margin: 0 0 4px; letter-spacing: -.01em; }
.optional-head p { font-size: .85rem; color: var(--ink-soft); margin: 0 0 8px; }
.optional-block > .disclosure:last-of-type { border-bottom: 1px solid var(--line); }
.section-hint { margin: 0 0 14px; }

/* 같은 행의 입력은 라벨·컨트롤·힌트 기준선을 공유한다. 문구 길이가 달라도
   계절/활동, 키/몸무게 입력칸에 단차가 생기지 않는다. */
.paired-fields { align-items: stretch; }
.paired-fields .field {
  display: grid;
  grid-template-rows: auto 44px minmax(0, 1fr);
  align-content: start;
}
.paired-fields .field-label { align-self: end; }
.paired-fields select, .paired-fields input { height: 44px; }
.body-info-grid .field { grid-template-rows: auto 44px; }
.selection-count { margin-left: auto; font-style: normal; font-weight: 500; color: var(--ink-soft); }

/* 무엇이 남았는지 미리 알려준다. 누른 뒤에 토스트로 알리면 이미 늦다. */
.gate-note {
  flex: 1 1 auto; margin: 0; align-self: center;
  font-size: .85rem; color: var(--ink-soft);
}
.gate-note[data-tone="ok"] { color: var(--good); font-weight: 500; }
.gate-note[data-tone="bad"] { color: var(--bad); font-weight: 700; }

/* 결과 칸이 분석을 기다리는 동안 */
.step.is-working { color: var(--ink); font-weight: 700; }
.step.is-working .step-num { color: var(--signal-ink); opacity: 1; }
.step.is-working::after {
  content: ""; width: 11px; height: 11px; margin-left: 2px;
  border: 2px solid var(--signal); border-right-color: transparent; border-radius: 50%;
  animation: spin .9s linear infinite;
}

/* ── 아코디언 ─────────────────────────────────────────── */
.disclosure { border-top: 1px solid var(--line); }
.disclosure summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 0;
  font-size: .93rem; font-weight: 700;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after {
  content: ""; margin-left: auto;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--ink-soft); border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
}
.disclosure[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.disclosure summary:hover { color: var(--signal-ink); }
.disclosure-body { padding: 4px 0 26px; }
.body-photo { margin-top: 22px; border-bottom: 1px solid var(--line); }

.swatches, .pills { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch, .pill {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 6px 14px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--sans); font-size: .84rem; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.swatch:hover, .pill:hover { border-color: var(--ink); }
.swatch.is-on, .pill.is-on {
  border-color: var(--ink); background: var(--ink); color: var(--bg); font-weight: 700;
}
.swatch i {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 1px solid rgba(128, 128, 128, .45);
}

.wardrobe-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.wardrobe-row {
  display: grid; grid-template-columns: minmax(110px, .35fr) minmax(220px, 1fr) auto;
  gap: 8px; align-items: stretch;
}
.wardrobe-row select { width: 100%; }
.wardrobe-upload {
  min-height: 44px; padding: 8px 12px;
  display: flex; align-items: center; gap: 10px; min-width: 0;
  border: 1px dashed var(--line-strong); cursor: pointer; background: var(--panel-2);
}
.wardrobe-upload:hover { background: var(--signal-tint); border-color: var(--signal-ink); }
.wardrobe-upload-copy {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .84rem; font-weight: 700;
}
.wardrobe-thumb { width: 34px; height: 34px; object-fit: cover; order: -1; flex: none; }
.wardrobe-row.has-image .wardrobe-upload { border-style: solid; }
.row-remove {
  min-width: 44px; min-height: 44px;
  background: none; border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink-soft); cursor: pointer; font-size: 1rem;
}
.row-remove:hover { border-color: var(--bad); color: var(--bad); }

/* ── 버튼 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 13px 26px;
  font-family: var(--sans); font-size: .95rem; font-weight: 700;
  border: 1px solid transparent; border-radius: var(--r);
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.btn-primary { background: var(--signal-ink); color: var(--signal-on); }
.btn-primary:hover:not(:disabled) { background: var(--signal-deep); }
.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.btn-sm { min-height: 44px; padding: 10px 16px; font-size: .85rem; }
.btn:disabled { opacity: .42; cursor: not-allowed; }

.panel-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 30px; flex-wrap: wrap; }
.hero-copy .panel-actions { justify-content: flex-start; margin-top: 30px; }

/* ── 3단계: 분석 ──────────────────────────────────────── */
.progress-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 32px; }
.stage-list { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.stage { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: .92rem; }
.stage-dot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--line-strong); flex-shrink: 0;
}
.stage.is-active { color: var(--ink); font-weight: 700; }
.stage.is-active .stage-dot {
  border-color: var(--signal); border-right-color: transparent;
  animation: spin .9s linear infinite;
}
.stage.is-done { color: var(--ink); }
.stage.is-done .stage-dot { background: var(--signal); border-color: var(--signal); }
@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar { height: 4px; background: var(--panel); overflow: hidden; }
.progress-fill {
  height: 100%; width: 100%; background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s cubic-bezier(.16, 1, .3, 1);
}
.progress-note { font-size: .87rem; color: var(--ink-soft); margin: 14px 0 0; }

.error-card {
  margin-top: 22px; padding: 26px;
  border: 1px solid var(--bad); border-radius: var(--r-md);
  background: var(--signal-tint);
}
.error-card h2 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 900; }
.error-card p { margin: 0 0 18px; color: var(--ink-soft); }

.budget-mismatch {
  padding: 26px; margin-bottom: 26px;
  border: 1px solid var(--bad); border-radius: var(--r-md); background: var(--signal-tint);
}
.budget-mismatch h2 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 900; }
.budget-mismatch p { margin: 0; color: var(--ink-soft); }

/* ── 4단계: 결과 ──────────────────────────────────────── */
.result-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.data-badge {
  display: inline-flex; align-items: center; min-height: 28px;
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-soft); background: var(--panel-2);
  font-size: .72rem; font-weight: 700;
}
.request-summary {
  margin: -4px 0 24px; padding: 14px 16px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.request-summary > strong {
  display: block; margin-bottom: 9px;
  font-size: .76rem; color: var(--ink-soft);
}
.request-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.request-chip {
  padding: 4px 9px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg); font-size: .75rem;
}
.request-chip b { margin-right: 3px; }
.view-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.view-tab {
  background: none; border: 0; cursor: pointer;
  padding: 0 2px 14px; min-height: 44px;
  font-family: var(--sans); font-size: .98rem; font-weight: 500; color: var(--ink-soft);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.view-tab:hover { color: var(--ink); }
.view-tab.is-active { color: var(--ink); font-weight: 900; border-bottom-color: var(--signal); }
.view-tab em {
  font-family: var(--disp); font-style: normal; font-weight: 700;
  font-size: .82rem; color: var(--signal-ink); margin-left: 5px;
}
.view { animation: rise .24s cubic-bezier(.16, 1, .3, 1) both; }

/* 코디 후보 — 룩북의 상품 카드 그리드 */
.tryon-batch-status {
  display: grid; gap: 13px; margin: 0 0 22px; padding: 17px 19px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2);
}
.tryon-batch-status[data-status="running"] { border-color: var(--signal); }
.tryon-batch-status[data-status="done"] { border-color: color-mix(in srgb, #2e7d4f 55%, var(--line)); }
.tryon-batch-copy { display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 18px; }
.tryon-batch-copy > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tryon-batch-copy strong { font-size: .92rem; }
.tryon-batch-copy span { color: var(--ink-soft); font-size: .78rem; white-space: nowrap; }
.tryon-batch-progress { height: 6px; overflow: hidden; background: var(--line); }
.tryon-batch-progress span {
  display: block; width: 100%; height: 100%; transform-origin: left;
  background: var(--signal); transition: transform .35s ease;
}
.tryon-batch-items { display: flex; flex-wrap: wrap; gap: 7px; }
.tryon-batch-items button {
  min-height: 34px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink-soft); font-family: var(--sans); font-size: .75rem;
}
.tryon-batch-items button.is-done { border-color: var(--ink); color: var(--ink); cursor: pointer; font-weight: 800; }
.tryon-batch-items button.is-running { border-color: var(--signal); color: var(--signal-ink); }
.tryon-batch-status > p { margin: 0; color: var(--warn); font-size: .78rem; }

/* 추천 개수가 3개든 4개든 아래 상세 블록과 같은 폭으로 꽉 차야 한다.
   고정 4열이면 3개일 때 마지막 칸이 비어 폭이 어긋난다. auto-fit 은
   빈 트랙을 접고 남은 카드가 그 자리를 나눠 갖는다. */
.reco-picker {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-bottom: 34px;
}
.pick {
  display: flex; flex-direction: column; gap: 9px;
  text-align: left; background: var(--bg); color: var(--ink); cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px; font-family: var(--sans);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.pick:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.pick.is-on { border-color: var(--ink); border-width: 2px; padding: 14px; box-shadow: var(--shadow-sm); }
.pick-top { display: flex; align-items: center; justify-content: space-between; }
.pick-rank { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--ink-soft); }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 21px; height: 21px; padding: 0 5px;
  background: var(--ink); color: var(--bg);
  font-family: var(--disp); font-size: .72rem; font-weight: 700;
}
.pick.is-on .rank-badge { background: var(--signal-ink); }
.pick-score { font-size: 1.05rem; font-weight: 700; }
.pick-swatches { display: flex; gap: 4px; }
.pick-swatches i {
  flex: 1; height: 44px; border-radius: var(--r);
  border: 1px solid rgba(128, 128, 128, .3);
}
.pick-names { font-size: .84rem; font-weight: 500; line-height: 1.5; }
.pick-price { font-size: .88rem; font-weight: 700; color: var(--ink-soft); margin-top: auto; }
.pick-render-state {
  align-self: flex-start; padding: 4px 8px; border-radius: 999px;
  background: var(--panel-2); color: var(--ink-soft); font-size: .68rem; font-weight: 800;
}
.pick-render-state.is-running { color: var(--signal-ink); }
.pick-render-state.is-done { background: color-mix(in srgb, #2e7d4f 13%, var(--bg)); color: #2e7d4f; }
.pick-render-state.is-failed { background: color-mix(in srgb, var(--warn) 12%, var(--bg)); color: var(--warn); }

/* 선택한 코디 상세 */
.reco-detail { display: grid; gap: 16px; }
.reco { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.reco.is-top { border-color: var(--signal); }
.reco.is-top .rank-badge { background: var(--signal-ink); }
.ranking-note {
  margin: 0 0 16px; padding: 10px 12px;
  border-left: 3px solid var(--signal); background: var(--panel-2);
  color: var(--ink-soft); font-size: .8rem;
}

.tryon-warning {
  margin: 10px 0 0;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 11%, var(--bg));
  color: var(--warn);
  font-size: 12px;
  line-height: 1.55;
}

/* 접어 둔 상태에서는 요약 한 줄만 보인다. 펼치면 목록이 나온다. */
.tryon-warning summary {
  cursor: pointer;
  font-weight: 700;
  list-style-position: outside;
}
.tryon-warning ul {
  margin: 6px 0 0;
  padding-left: 18px;
  word-break: keep-all;
}
.tryon-warning li + li { margin-top: 4px; }
.reco-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  padding: 20px 26px; border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.reco-rank { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.reco-score { font-family: var(--disp); font-size: 1.55rem; font-weight: 700; }
.reco-score small { font-family: var(--sans); font-size: .82rem; font-weight: 500; color: var(--ink-soft); margin-left: 5px; }
.reco-body { padding: 26px; display: flex; flex-direction: column; gap: 24px; }

.product-list { display: flex; flex-direction: column; }
.product {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.product:last-child { border-bottom: 0; }
.product-swatch {
  width: 42px; height: 56px; border-radius: var(--r);
  border: 1px solid rgba(128, 128, 128, .3);
}
.product-name { font-weight: 700; font-size: .95rem; }
.product-meta { font-size: .8rem; color: var(--ink-soft); margin-top: 3px; }
.product-price { font-weight: 700; font-size: .95rem; white-space: nowrap; }

/* 추천 키워드는 숨기고, 실시간 검색된 최종 상품만 보여준다. */
.shopping-section {
  margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--line);
}
.shopping-head {
  display: flex; align-items: end; justify-content: space-between; gap: 24px;
  margin-bottom: 18px;
}
.shopping-head h2 { margin: 3px 0 0; font-size: 1.35rem; }
.shopping-head p {
  max-width: 470px; margin: 0; color: var(--ink-soft); font-size: .82rem; line-height: 1.55;
}
.shopping-eyebrow {
  font-family: var(--disp); font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; color: var(--signal-ink);
}
.shopping-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.shopping-grid.has-outfit-combinations { display: block; }
.look-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: -1px; }
.look-tabs button {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 11px 20px; border: 1px solid var(--line); border-bottom-color: transparent;
  border-radius: var(--r-md) var(--r-md) 0 0; background: var(--bg);
  color: var(--ink-soft); font-family: var(--disp); font-size: .78rem;
  font-weight: 800; letter-spacing: .1em; cursor: pointer;
}
.look-tabs button:hover { color: var(--ink); background: var(--panel-2); }
.look-tabs button.is-on {
  background: var(--panel-2); color: var(--ink); border-color: var(--line);
  border-bottom-color: var(--panel-2);
}
.look-tabs button:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.look-tabs small {
  letter-spacing: 0; font-family: var(--body); font-size: .66rem; font-weight: 700;
  color: var(--ink-soft);
}
.look-tabs small[data-look-status="done"] { color: var(--signal-ink); }
.look-tabs small[data-look-status="failed"] { color: var(--warn); }
.look-panel {
  padding: 26px; border: 1px solid var(--line);
  border-radius: 0 var(--r-lg) var(--r-lg) var(--r-lg); background: var(--panel-2);
}
.look-panel:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.look-summary {
  margin: 0; max-width: 62ch; color: var(--ink);
  font-size: .95rem; line-height: 1.6; word-break: keep-all;
}
/* 근거는 문장이 두 개 이어 붙은 값이다. 문장마다 줄을 나눠야 읽힌다. */
.summary-sentence { display: block; }
.summary-sentence + .summary-sentence { margin-top: 4px; }
/* 부위별로 한 줄씩. 라벨 폭을 고정해 상품명 시작선을 맞춘다. */
.look-items { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.look-items li { display: flex; gap: 8px; align-items: baseline; }
.look-items b {
  flex: 0 0 2.4em; color: var(--ink); font-weight: 700;
  white-space: nowrap;
}
.look-items span { flex: 1 1 auto; min-width: 0; word-break: keep-all; }
.outfit-current-items { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0; }
.outfit-current-item {
  display: grid; gap: 3px; max-width: 100%; padding: 9px 12px;
  border: 1px dashed var(--line); border-radius: 12px; background: var(--bg);
}
.outfit-current-item span { color: var(--signal-ink); font-size: .67rem; font-weight: 900; }
.outfit-current-item strong {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-soft); font-size: .74rem;
}
/* 조합 근거. 라벨 폭을 고정해 설명의 시작선을 맞춘다. */
.look-reasons {
  display: grid; gap: 6px; max-width: 70ch; margin: 0; padding: 0; list-style: none;
  color: var(--ink); font-size: .92rem; line-height: 1.55;
}
.look-reasons li { display: flex; gap: 12px; align-items: baseline; }
.look-reasons b {
  flex: 0 0 4.6em; color: var(--signal-ink); font-size: .78rem; font-weight: 800;
  white-space: nowrap;
}
.look-reasons span { flex: 1 1 auto; min-width: 0; word-break: keep-all; }
.look-body {
  display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 3fr);
  align-items: start; gap: 16px; margin-top: 22px;
}
.look-render { min-width: 0; }
.outfit-tryon-result {
  margin: 0; overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--bg);
}
.outfit-tryon-result > img {
  display: block; width: 100%; max-height: 680px; object-fit: contain; background: #f4f4f4;
}
.outfit-tryon-result figcaption {
  display: grid; gap: 10px; padding: 14px 16px;
  color: var(--ink-soft); font-size: .73rem; line-height: 1.5;
}
.outfit-tryon-result figcaption a { color: var(--ink); font-weight: 800; }
.outfit-tryon-result.is-pending {
  display: grid; place-items: center; min-height: 420px; padding: 24px;
  border-style: dashed; text-align: center;
}
.outfit-tryon-result.is-pending p {
  margin: 0; max-width: 24ch; color: var(--ink-soft); font-size: .8rem; line-height: 1.6;
}
.outfit-tryon-result.is-pending[data-status="running"] {
  border-style: solid; border-color: var(--signal);
}
.look-products {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.change-categories { display: flex; flex-wrap: wrap; gap: 12px; }
.change-categories label {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer;
}
.change-categories label:has(input:checked) { border-color: var(--signal); background: var(--panel); }
.change-categories input { width: 18px; height: 18px; accent-color: var(--signal); }
.shopping-category-heading { grid-column: 1 / -1; margin: 14px 0 0; font-size: 1rem; }
.shopping-card {
  /* 근거 줄 수(1~3)와 상품명 길이가 카드마다 달라 가격·링크 줄이 제각각 높이에
     놓였다. 카드를 세로 플렉스로 잇고 가격줄을 바닥으로 밀어 한 줄에 세운다. */
  display: flex; flex-direction: column;
  min-width: 0; overflow: hidden; color: inherit;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.shopping-card.is-selected { border-color: var(--signal); box-shadow: 0 0 0 2px color-mix(in srgb, var(--signal) 28%, transparent); }
.shopping-card:hover {
  color: inherit; transform: translateY(-3px); border-color: var(--ink); box-shadow: var(--shadow-sm);
}
.shopping-link {
  display: flex; flex-direction: column; flex: 1 1 auto;
  color: inherit; text-decoration: none;
}
.shopping-link:focus-visible, .shopping-tryon-choice button:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.shopping-image-wrap { position: relative; aspect-ratio: 5 / 6; overflow: hidden; background: var(--panel-2); }
.shopping-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.shopping-category {
  position: absolute; top: 12px; left: 12px; padding: 5px 9px;
  background: rgba(17, 24, 39, .84); color: #fff; font-size: .72rem; font-weight: 800;
}
.shopping-copy { display: flex; flex-direction: column; flex: 1 1 auto; padding: 15px; }
.shopping-brand { color: var(--ink-soft); font-size: .75rem; font-weight: 700; }
.shopping-copy h3 {
  min-height: 2.8em; margin: 6px 0 8px; overflow: hidden;
  font-size: .92rem; line-height: 1.4; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.shopping-meta { min-height: 1.2em; color: var(--ink-soft); font-size: .75rem; }
.shopping-keywords { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.shopping-keyword {
  max-width: 100%; padding: 5px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink-soft); background: var(--bg); font-size: .7rem; font-weight: 700;
}
.shopping-reason {
  min-height: 4.8em; margin: 13px 0 0; padding: 11px 12px;
  border-left: 3px solid var(--signal); background: var(--bg);
  color: var(--ink-soft); font-size: .76rem; line-height: 1.55;
}
.shopping-reason > b { display: block; margin-bottom: 3px; color: var(--ink); font-size: .7rem; }
.shopping-reason ul { margin: 0; padding-left: 0; list-style: none; }
/* 라벨에 flex-shrink 를 막아 두지 않아 '핏'·'종류'·'색상'이 눌려 세로로 갈라졌다
   ('종 / 류'). 라벨은 고정 폭으로 잡고, 설명은 남은 폭을 쓴다. */
.shopping-reason li { display: flex; gap: 8px; margin-top: 3px; align-items: baseline; }
.shopping-reason li b {
  /* 가장 긴 라벨이 '스타일'(3자)이다. 2.8em 이면 '상품 사진'(4자) 같은 라벨이
     칸을 넘쳐 그 카드만 본문이 오른쪽으로 밀렸다. 라벨을 3자 이하로 줄이고
     칸도 3자가 들어가게 잡아 모든 카드의 본문 시작선을 맞춘다. */
  flex: 0 0 3.2em;
  color: var(--ink); font-weight: 700;
  word-break: keep-all; white-space: nowrap;
}
.shopping-reason li span { flex: 1 1 auto; min-width: 0; word-break: keep-all; }
.shopping-size-fit { padding: 12px 16px; border-top: 1px solid var(--line); font-size: .78rem; line-height: 1.6; }
/* 실측이 없는 카드도 같은 자리에 한 줄을 둔다. small 기본 크기로는 줄 높이가
   접힌 '사이즈별 실측 보기'와 달라져 가격줄이 어긋난다. 같은 크기를 쓴다. */
.shopping-size-fit.is-empty small {
  color: var(--ink-soft); font-size: inherit;
  margin-top: 8px;        /* details 와 같은 윗여백이라야 가격줄이 어긋나지 않는다 */
}
.shopping-size-fit > b { color: var(--ink); }
.shopping-size-fit p { margin: 5px 0; }
.shopping-size-fit small { display: block; color: var(--ink-soft); line-height: 1.6; }
.shopping-size-fit details { margin-top: 8px; }
.shopping-size-fit summary { cursor: pointer; }
.size-differences { font-weight: 600; }
.size-table-scroll { max-width: 100%; overflow-x: auto; margin: 8px 0; }
.size-table-scroll table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.size-table-scroll th, .size-table-scroll td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.size-reference { background: var(--panel); }
.size-closest { font-weight: 600; }
.shopping-bottom {
  display: flex; align-items: end; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 14px;   /* auto 로 카드 바닥에 붙인다 */
}
.shopping-bottom strong { font-family: var(--disp); font-size: 1rem; }
.shopping-bottom span { color: var(--signal-ink); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.shopping-tryon-choice { display: grid; gap: 6px; padding: 0 15px 15px; }
.shopping-tryon-choice button {
  min-height: 42px; padding: 9px 12px; border: 1px solid var(--ink); border-radius: var(--r);
  background: var(--ink); color: var(--bg); font-family: var(--sans); font-weight: 800; cursor: pointer;
}
.shopping-card.is-selected .shopping-tryon-choice button { background: var(--signal); border-color: var(--signal); color: #111; }
.shopping-tryon-choice button:disabled { border-color: var(--line); background: var(--panel-2); color: var(--ink-soft); cursor: not-allowed; }
.shopping-tryon-choice small { min-height: 2.6em; color: var(--ink-soft); font-size: .69rem; line-height: 1.35; }
.shopping-tryon-panel {
  margin-top: 20px; overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--panel-2);
}
.shopping-tryon-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px;
}
.shopping-tryon-toolbar strong { display: block; font-size: 1rem; }
.shopping-tryon-toolbar p { margin: 8px 0 0; color: var(--ink-soft); font-size: .76rem; line-height: 1.5; }
.shopping-selection { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.shopping-selection span {
  padding: 6px 9px; border-radius: 999px; background: var(--bg);
  color: var(--ink-soft); font-size: .73rem;
}
.shopping-selection b { color: var(--ink); }
.length-check {
  display: grid; gap: 8px; padding: 14px 20px 16px;
  border-top: 1px solid var(--line); background: var(--panel);
}
.length-check strong { font-size: .84rem; }
.length-check p { margin: 0; color: var(--ink-soft); font-size: .76rem; line-height: 1.5; }
.length-check[data-status="needs_input"] { background: color-mix(in srgb, var(--warn) 8%, var(--panel)); }
.shopping-batch {
  display: grid; gap: 10px; padding: 14px 20px 18px;
  border-top: 1px solid var(--line); background: var(--panel);
}
.shopping-batch-copy { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.shopping-batch-copy strong { font-size: .84rem; }
.shopping-batch-copy span { color: var(--ink-soft); font-size: .76rem; white-space: nowrap; }
.shopping-batch-progress { height: 6px; overflow: hidden; background: var(--line); }
.shopping-batch-progress span {
  display: block; width: 100%; height: 100%; background: var(--signal);
  transform-origin: left; transition: transform .25s ease;
}
.shopping-batch-items { display: flex; flex-wrap: wrap; gap: 6px; }
.shopping-batch-items span {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-soft); background: var(--bg); font-size: .68rem;
}
.shopping-batch-items .is-running { border-color: var(--signal); color: var(--signal-ink); }
.shopping-batch-items .is-done { border-color: #2e7d4f; color: #2e7d4f; }
.shopping-batch-items .is-failed { border-color: var(--warn); color: var(--warn); }
.shopping-batch > p { margin: 0; color: var(--warn); font-size: .75rem; }
.shopping-tryon-result { border-top: 1px solid var(--line); background: var(--bg); }
.shopping-tryon-result > img { width: 100%; max-height: 760px; display: block; object-fit: contain; background: #111; }
.shopping-tryon-history { display: flex; flex-wrap: wrap; gap: 7px; padding: 13px 18px; }
.shopping-tryon-history button {
  min-height: 34px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink-soft); font-family: var(--sans); cursor: pointer;
}
.shopping-tryon-history button.is-on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.shopping-tryon-result-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px;
}
.shopping-tryon-result-actions .look-items { flex: 1 1 auto; }
.shopping-tryon-result-actions span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: .78rem; }
.shopping-tryon-result-actions a {
  flex: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); font-size: .76rem; font-weight: 800; text-decoration: none;
}
.product-name a { color: inherit; text-underline-offset: 3px; }

.reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.reasons li {
  font-size: .9rem; color: var(--ink-soft); line-height: 1.6;
  padding-left: 15px; position: relative;
}
.reasons li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 5px; height: 5px; background: var(--signal);
}

.tips-block h3 { font-size: .88rem; font-weight: 900; margin: 0 0 9px; }
.tips-block ul { margin: 0; padding-left: 17px; color: var(--ink-soft); font-size: .88rem; }
.tips-block li { margin-bottom: 5px; }

.score-bars { display: flex; flex-direction: column; gap: 9px; }
.score-bar {
  display: grid; grid-template-columns: 132px 1fr 34px;
  align-items: center; gap: 12px; font-size: .82rem; color: var(--ink-soft);
}
.score-track { height: 5px; background: var(--panel); display: block; overflow: hidden; }
.score-value {
  display: block; height: 100%; width: 100%; background: var(--ink);
  transform-origin: left;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1);
}
.score-bar b { text-align: right; color: var(--ink); font-weight: 700; }

.rule-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-chip {
  font-family: var(--disp); font-size: .72rem; font-weight: 500;
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-soft); cursor: help;
}
.rule-chip:hover { border-color: var(--ink); color: var(--ink); }

.reco-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--line);
}
.feedback-group { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-btn {
  min-height: 44px; padding: 10px 16px;
  background: var(--bg); color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--sans); font-size: .84rem; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.fb-btn:hover { border-color: var(--ink); color: var(--ink); }
.fb-btn.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.coverage-note { font-size: .78rem; color: var(--ink-soft); }

/* 가상 피팅 */
.tryon { border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; }
.tryon.is-done { padding: 0; overflow: hidden; }
.tryon.is-working { border-color: var(--signal); }
.tryon.is-done img { width: 100%; display: block; }
.tryon-note { font-size: .78rem; color: var(--ink-soft); margin: 0; padding: 13px 20px; }
.tryon-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 20px 15px;
}
.tryon-switcher { display: inline-flex; align-items: center; gap: 8px; }
.tryon-switcher button, .tryon-download {
  min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: .76rem;
  text-decoration: none; cursor: pointer;
}
.tryon-switcher button:hover, .tryon-download:hover { border-color: var(--ink); }
.tryon-switcher span { min-width: 42px; text-align: center; color: var(--ink-soft); font-size: .75rem; }
.tryon-download { display: inline-flex; align-items: center; font-weight: 800; }
.tryon-slot { display: flex; align-items: center; gap: 16px; }
.tryon-icon { width: 38px; height: 38px; color: var(--ink-soft); flex-shrink: 0; }
.tryon-icon svg { width: 100%; height: 100%; }
.tryon-copy { flex: 1; font-size: .88rem; color: var(--ink-soft); }
.tryon-copy strong { display: block; color: var(--ink); font-weight: 700; margin-bottom: 3px; }
.tryon-btn {
  min-height: 44px; padding: 11px 20px;
  background: var(--ink); color: var(--bg);
  border: 0; border-radius: var(--r);
  font-family: var(--sans); font-size: .88rem; font-weight: 700; cursor: pointer;
}
.tryon-btn:hover { background: var(--signal-ink); }
.tryon-btn:disabled { opacity: .42; cursor: not-allowed; }
.tryon-auto-badge {
  flex: none; padding: 7px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--signal) 14%, var(--bg));
  color: var(--signal-ink); font-size: .74rem; font-weight: 800;
}

/* ── 착장 분석 ────────────────────────────────────────── */
.current-score-panel {
  margin-bottom: 28px; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel);
}
.current-score-head {
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.current-score-head h2 { margin: 4px 0 3px; font-size: 1.35rem; }
.current-score-head p { margin: 0; color: var(--ink-soft); font-size: .84rem; }
.current-score-total { display: flex; align-items: baseline; gap: 5px; flex: none; }
.current-score-total strong {
  font-family: var(--disp); font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1; letter-spacing: -.05em;
}
.current-score-total span { color: var(--ink-soft); font-size: .82rem; }
.current-score-content {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .85fr); gap: 26px;
  padding-top: 20px; align-items: start;
}
.score-matrix-wrap { min-width: 0; overflow-x: auto; }
.score-matrix { width: 100%; min-width: 520px; border-collapse: collapse; }
.score-matrix th, .score-matrix td {
  padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: center;
}
.score-matrix thead th { color: var(--ink-soft); font-size: .72rem; font-weight: 700; }
.score-matrix tbody th { text-align: left; font-size: .82rem; }
.matrix-score {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 7px;
  min-width: 88px; padding: 7px 9px; border-radius: 10px; background: var(--bg);
}
.matrix-score b { font-family: var(--disp); font-size: .92rem; }
.matrix-score small { font-size: .65rem; font-weight: 800; }
.matrix-score.is-pass { color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--bg)); }
.matrix-score.is-fail { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--bg)); }
.score-threshold { margin: 9px 0 0; color: var(--ink-soft); font-size: .7rem; }
.outfit-summary-block h3 { margin: 0 0 11px; font-size: .9rem; }
.outfit-summary-block ul { margin: 0; padding-left: 18px; color: var(--ink-soft); }
.outfit-summary-block li { margin-bottom: 8px; font-size: .8rem; line-height: 1.55; }
.analysis-visual { position: sticky; top: 84px; }
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; }
.figure-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.figure-tab {
  min-height: 44px; padding: 10px 15px;
  background: var(--bg); color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--sans); font-size: .83rem; cursor: pointer;
}
.figure-tab:hover { border-color: var(--ink); color: var(--ink); }
.figure-tab.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.figure { margin: 0; }
.figure img { width: 100%; display: block; background: var(--panel); border-radius: var(--r-md); }
.figure figcaption { font-size: .8rem; color: var(--ink-soft); margin-top: 10px; }

.analysis-info { display: flex; flex-direction: column; gap: 20px; }
.current-outfit { display: grid; gap: 12px; }
.body-stats { display: grid; gap: 9px; margin-bottom: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.card-tight { padding: 18px 22px; }
.card h2 { font-size: .98rem; font-weight: 900; margin: 0 0 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-note { font-size: .8rem; color: var(--ink-soft); margin: 12px 0 0; }

.outfit-row { display: flex; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.outfit-row:last-child { border-bottom: 0; padding-bottom: 0; }
.outfit-tag {
  flex-shrink: 0; align-self: flex-start;
  font-size: .72rem; font-weight: 700; padding: 3px 9px;
  background: var(--panel); border-radius: 999px; color: var(--ink-soft);
}
.outfit-desc { font-size: .91rem; font-weight: 500; }
.outfit-meta { font-size: .79rem; color: var(--ink-soft); margin-top: 2px; }

.detail-table { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.detail-row, .stat-row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 10px; align-items: baseline;
  padding: 7px 0; margin: 0; font-size: .85rem;
}
.stat-row { grid-template-columns: 1fr auto; }
.detail-row dt, .stat-row dt { color: var(--ink-soft); }
.detail-row dd, .stat-row dd { margin: 0; font-weight: 700; }
.src-tag { font-size: .7rem; color: var(--ink-soft); padding: 2px 7px; background: var(--panel); border-radius: 999px; }

.confidence-pill {
  font-family: var(--disp); font-size: .72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--panel); color: var(--ink-soft);
}
.confidence-pill.high { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.confidence-pill.mid  { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.confidence-pill.low  { background: var(--signal-tint); color: var(--bad); }

.rule-summary { display: flex; flex-direction: column; gap: 8px; }
.rule-metric {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; font-size: .85rem; color: var(--ink-soft);
}
.rule-metric b { color: var(--ink); font-weight: 700; }

.mini-disclosure { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.mini-disclosure summary {
  cursor: pointer; font-size: .82rem; color: var(--ink-soft);
  min-height: 44px; display: flex; align-items: center;
}
.mini-disclosure summary:hover { color: var(--ink); }
.unsupported-list { margin: 8px 0 0; padding-left: 17px; font-size: .8rem; color: var(--ink-soft); }
.unsupported-list li { margin-bottom: 5px; line-height: 1.55; }

/* ── 개인정보 바 · 토스트 ─────────────────────────────── */
.privacy-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap;
  margin-top: 34px; padding: 18px 22px;
  background: var(--panel); border-radius: var(--r-md);
}
.privacy-bar strong { display: block; font-size: .88rem; font-weight: 700; }
.privacy-bar span { font-size: .8rem; color: var(--ink-soft); }
.privacy-bar.is-deleted { background: color-mix(in srgb, var(--good) 12%, transparent); }

.disclaimer { font-size: .78rem; color: var(--ink-soft); margin-top: 26px; max-width: 72ch; line-height: 1.65; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  z-index: 60; max-width: min(90vw, 480px);
  background: var(--ink); color: var(--bg);
  padding: 14px 22px; border-radius: var(--r-md);
  font-size: .89rem; font-weight: 500; box-shadow: var(--shadow-md);
  animation: toast-in .26s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

.backend-down {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px var(--gutter);
  background: var(--signal-deep); color: var(--signal-on);
  font-size: .88rem; line-height: 1.55;
}
.backend-down strong { font-weight: 700; }
.backend-down code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem; opacity: .88;
}

/* ── 반응형 ───────────────────────────────────────────── */
@media (max-width: 1080px) {
  .analysis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --gutter: 20px; }
  .required-block { padding: 20px 18px 24px; }
  .gate-note { flex: 1 1 100%; order: -1; margin-bottom: 4px; }
  .topbar-inner { flex-wrap: wrap; min-height: 0; padding-top: 10px; padding-bottom: 0; }
  .stepper { order: 3; width: 100%; overflow-x: auto; border-top: 1px solid var(--line); }
  .step { flex: 1 0 auto; justify-content: center; }
  .analysis-visual { position: static; }
  .hero-split { grid-template-columns: 1fr; min-height: 0; }
  .hero-drop { border-right: 0; border-bottom: 1px solid var(--line); }
  .dropzone { min-height: 320px; }
  .hero-copy { padding: 34px 0; }
  .hero-copy h1 { font-size: clamp(1.75rem, 8vw, 2.1rem); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .shopping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .look-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .look-body { grid-template-columns: minmax(220px, .8fr) minmax(0, 2fr); }
  .shopping-head { align-items: stretch; flex-direction: column; gap: 8px; }
  .current-score-content { grid-template-columns: 1fr; }
  .score-bar { grid-template-columns: 96px 1fr 30px; }
  .panel-actions .btn { flex: 1 1 auto; }
  .wardrobe-row { grid-template-columns: 1fr auto; }
  .wardrobe-upload { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 520px) {
  .full-body-guide { grid-template-columns: 76px 1fr; gap: 12px; padding: 10px; }
  .full-body-guide img { width: 76px; height: 108px; }
  .full-body-guide li { font-size: .74rem; }

  .step { gap: 5px; padding: 0 9px; font-size: .8rem; }
  .step-num { font-size: .76rem; }
  .reco-picker {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 82vw);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    padding: 2px 20px 12px 0;
    margin-right: calc(var(--gutter) * -1);
  }
  .pick { scroll-snap-align: start; }
  .tryon-batch-copy { grid-template-columns: 1fr; gap: 10px; }
  .tryon-batch-copy > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
  .tryon-actions { align-items: stretch; flex-direction: column; }
  .tryon-switcher { justify-content: space-between; }
  .tryon-download { justify-content: center; }
  .budget-values output { font-size: .92rem; }
  .product { grid-template-columns: auto 1fr; }
  .product-price { grid-column: 2; text-align: right; }
  .shopping-grid { grid-template-columns: 1fr; }
  .look-panel { padding: 18px 14px; border-radius: var(--r-lg); }
  .look-tabs button { flex: 1 1 auto; justify-content: center; padding: 10px 12px; }
  .look-body { grid-template-columns: 1fr; }
  .look-products { grid-template-columns: 1fr; }
  .outfit-tryon-result.is-pending { min-height: 260px; }
  .current-score-panel { padding: 18px 14px; }
  .current-score-head { align-items: flex-start; }
  .current-score-total strong { font-size: 2.2rem; }
  .shopping-tryon-toolbar, .shopping-tryon-result-actions { align-items: stretch; flex-direction: column; }
  .shopping-batch-copy { align-items: flex-start; flex-direction: column; gap: 4px; }
  .shopping-tryon-toolbar .btn, .shopping-tryon-result-actions a { width: 100%; justify-content: center; text-align: center; }
  .shopping-tryon-result-actions span { white-space: normal; }
}

/* ── 모션 축소 ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  /* 상태 변화 자체는 남기고, 이동만 없앤다. */
  .panel.is-active, .view, .toast { animation: none; }
  .step.is-working::after { animation: none; border-right-color: var(--signal); }
  .stage.is-active .stage-dot { animation: none; border-right-color: var(--signal); }
  .pick:hover { transform: none; }
  * { transition-duration: .01ms !important; }
}
