/* 코디 데스크 — 왼쪽은 쇼핑몰 대화창(손님이 보는 것만), 오른쪽은 엔진이 손님 말을 처리한 순서.
   색이 어느 쪽인지 말해 준다: 손님 쪽 = 먹색 + 테이프 노랑(가격·담기), 엔진 쪽 = 청사진 파랑. */
:root {
  --bg: #eef0f3;
  --surface: #ffffff;
  --sunk: #f4f5f7;
  --ink: #1b1d20;
  --ink-2: #5d636b;
  --ink-3: #8b9199;
  --line: #e2e5e9;
  --line-2: #d0d5db;
  --tape: #f2c53d;
  --tape-ink: #2b2620;
  --blue: #2f5bd3;
  --blue-wash: #edf2fd;
  --blue-line: #c3d1f4;
  --warn: #b4532a;
  --warn-wash: #fbf1ec;
  --warn-line: #e6c0ad;
  --ok: #2e7d4f;
  --dot: rgba(27, 29, 32, 0.11);
  --serif: 'Hahmlet', 'Noto Serif KR', 'AppleMyungjo', serif;
  --sans: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --topbar: 44px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
/* hidden 은 언제나 숨긴다 — display 를 준 클래스(.chips·.step 등)가 hidden 을 이기지 못하게 */
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
button, select, textarea, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { color: var(--ink-2); font-size: 12.5px; }
.linkish { border: 0; background: none; padding: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; font-size: inherit; }
.linkish:hover { color: var(--ink); text-decoration-color: currentColor; }

button.primary { background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 0 16px; cursor: pointer; font-weight: 600; }
button.primary:disabled { opacity: 0.4; cursor: default; }
button.ghost { background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 12px; cursor: pointer; }
button.ghost:hover:not(:disabled) { border-color: var(--ink); }
button.ghost:disabled { opacity: 0.5; cursor: default; }
button.small { padding: 3px 10px; font-size: 12.5px; }
button.mini { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 6px; padding: 2px 9px; font-size: 12px; cursor: pointer; }
button.mini:hover { border-color: var(--ink); }
select { border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); padding: 3px 6px; }

/* ── 머리줄 */
.topbar { height: var(--topbar); display: flex; align-items: baseline; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar h1 { font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: var(--topbar); letter-spacing: -0.01em; white-space: nowrap; }
.topbar p { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 배치: 대화창 3 : 엔진 보기 2 */
.layout { display: grid; grid-template-columns: minmax(600px, 3fr) minmax(400px, 2fr); height: calc(100vh - var(--topbar)); }
/* min-width 0: 칸 옷 줄(가로 스크롤)이 최소 폭을 밀어 좁은 화면에서 페이지가 가로로 넘치지 않게 */
.chatcol { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); border-right: 1px solid var(--line); }
.enginecol { overflow: auto; padding: 18px 22px 32px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ── 대화창 머리: 손님 · 새 대화 */
.chathead { flex: none; height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.chathead h2 { font-size: 15px; margin-right: auto; }
.who-pick { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.who-pick select { color: var(--ink); font-size: 13px; max-width: 260px; }

/* ── 대화 */
.log { list-style: none; margin: 0; padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 12px; overflow: auto; flex: 1; min-height: 120px; container-type: inline-size; }
.msg { max-width: 82%; font-size: 14px; }
.msg > * + * { margin-top: 8px; }
.msg.me { align-self: flex-end; background: var(--ink); color: #fff; padding: 7px 13px; border-radius: 16px 16px 4px 16px; }
.msg.bot { align-self: flex-start; background: var(--sunk); padding: 9px 13px; border-radius: 16px 16px 16px 4px; }
.msg.bot.wide { max-width: 100%; width: 100%; background: none; padding: 0; border-radius: 0; }
.msg.bot.wide > p:first-child { display: inline-block; max-width: 82%; background: var(--sunk); padding: 9px 13px; border-radius: 16px 16px 16px 4px; }
.msg .sub { color: var(--ink-2); font-size: 12.5px; }
.msg .err { color: var(--warn); }
.msg .typing { color: var(--ink-2); }
/* 기다리는 문구: 돌아가며 바뀌는 한 줄 + 점 세 개 */
.msg .typing .wait-line { display: inline-block; }
.msg .typing .dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.msg .typing .dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.35; }
@media (prefers-reduced-motion: no-preference) {
  .msg .typing .wait-line.swap { animation: wait-in 0.35s ease-out; }
  .msg .typing .dots i { animation: wait-dot 1.2s infinite ease-in-out; }
  .msg .typing .dots i:nth-child(2) { animation-delay: 0.2s; }
  .msg .typing .dots i:nth-child(3) { animation-delay: 0.4s; }
  @keyframes wait-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  @keyframes wait-dot { 0%, 80%, 100% { opacity: 0.25; transform: none; } 40% { opacity: 1; transform: translateY(-2px); } }
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; cursor: pointer; text-align: left; }
.chips button:hover { border-color: var(--ink); }
.chips.follow { flex: none; padding: 0 16px 10px; overflow-x: auto; flex-wrap: nowrap; }
.chips.follow button { flex: none; }

/* 코디 4안 — 패턴지 한 장(옅은 점 모눈) 위에 옷 조각, 가격은 마스킹테이프 */
.ocards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@container (max-width: 680px) { .ocards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ocard {
  display: flex; flex-direction: column; gap: 8px; padding: 11px 9px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  background: var(--surface) radial-gradient(circle, var(--dot) 0.8px, transparent 1.3px) 7px 7px / 14px 14px;
}
.ocard header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ocard h3 { font-family: var(--serif); font-size: 18px; line-height: 1.2; }
.ocard .sum {
  font-size: 12px; font-variant-numeric: tabular-nums; background: rgba(242, 197, 61, 0.95); color: var(--tape-ink); padding: 2px 10px; font-weight: 600; white-space: nowrap;
  transform: rotate(-2.5deg); box-shadow: 0 1px 1px rgba(77, 63, 34, 0.16);
  clip-path: polygon(0 12%, 3% 0, 50% 6%, 97% 0, 100% 14%, 98% 50%, 100% 88%, 96% 100%, 50% 94%, 4% 100%, 0 86%, 2% 50%);
}
.othumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.othumb { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 2px; min-width: 0; }
.othumb .shot img { aspect-ratio: 1 / 1; }
.ocard .why { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ocard .why b { color: var(--ink); font-weight: 600; margin-right: 3px; }
.why-more { font-size: 12px; color: var(--ink-2); }
.why-more summary { cursor: pointer; width: max-content; }
.why-more ul { margin: 4px 0 0; padding-left: 15px; }
.why-more li.warning { color: var(--warn); }
.ocard footer { margin-top: auto; }
.ocard .pick { width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--ink); border-radius: 6px; padding: 5px 0; font-weight: 600; font-size: 13px; cursor: pointer; }
.ocard .pick:hover { background: var(--ink); color: #fff; }

/* 상품 사진(상품 컷 위에 모델 컷을 겹쳐 두고 올려 보면 보여 준다) */
.shot { position: relative; border-radius: 3px; overflow: hidden; background: #fff; }
.shot img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; display: block; background: #fff; }
.shot img.worn { position: absolute; inset: 0; height: 100%; object-fit: cover; object-position: top; opacity: 0; }
.shot.has-worn:hover img.worn, .shot.has-worn:focus img.worn { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .shot img.worn { transition: opacity 0.18s ease; } }

/* 상품 카드(단품·더할 옷·바꿀 후보) */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px 10px; }
.pcard { margin: 0; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pcard .shot { border: 1px solid var(--line); border-radius: 6px; }
.pcard .shot img { aspect-ratio: 1 / 1; }
.pcard figcaption { font-size: 12px; line-height: 1.4; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pcard .nm { font-weight: 600; font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .pr { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pcard .pr .linkish { font-size: 11.5px; color: var(--ink-3); margin-left: 4px; }
.pcard .why { color: var(--ink-2); font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .acts { margin-top: auto; padding-top: 3px; }
.srow { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: start; }
.srow + .srow { margin-top: 12px; }
.slabel { font-weight: 600; font-size: 13px; padding-top: 2px; }

/* 입어 본 결과 */
.msg.tryon { max-width: min(100%, 560px); }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 520px; }
.ba figure { margin: 0; }
.ba img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; background: #e9ebee; border-radius: 8px; display: block; }
.ba figcaption { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.ba figcaption .nw { white-space: nowrap; }
.zoombtn { border: 0; padding: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
.ba-items { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 12px; }
.ba-items img { width: 32px; height: 42px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.cart { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cart li { display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 8px; font-size: 13px; }
.cart img { width: 30px; height: 38px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 3px; }
.cart b { font-variant-numeric: tabular-nums; }
.cart .pr { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ── 입어 볼 옷 칸 */
.tray { flex: none; border-top: 1px solid var(--line); background: var(--sunk); padding: 9px 16px 10px; display: flex; flex-direction: column; gap: 8px; }
.tray-head { display: flex; align-items: center; gap: 6px 10px; min-width: 0; flex-wrap: wrap; }
.tray-head h2 { font-size: 13.5px; white-space: nowrap; }
.tray-from { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.tray-empty { font-size: 12.5px; color: var(--ink-3); }
.tray-sum { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.tray-sum b { color: var(--ink); }
.tray-sum .over { color: var(--warn); font-style: normal; font-weight: 600; }
.tray[data-empty='false'] .tray-empty { display: none; }
.tray[data-empty='true'] .tray-actions, .tray[data-empty='true'] .tray-items, .tray[data-empty='true'] .tray-foot { display: none; }
.tray-items { list-style: none; margin: 0; padding: 0 0 2px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(172px, 1fr); gap: 6px; overflow-x: auto; }
.titem { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 8px; align-items: start; background: var(--surface); border-radius: 8px; padding: 6px; max-width: 300px; }
.titem.left { outline: 1px dashed var(--line-2); opacity: 0.75; }
.titem .tshot { width: 38px; }
.tmeta { display: flex; flex-direction: column; min-width: 0; font-size: 12px; line-height: 1.35; gap: 1px; }
.tmeta .nm { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 16px; }
.tmeta .pr { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tmeta .size { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.tmeta .size .sk { font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.tmeta .size select { font-size: 12px; padding: 0 2px; max-width: 76px; }
.tmeta .size select.need { border-color: var(--warn-line); background: var(--warn-wash); }
.tmeta .tfoot { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.tmeta .snote { color: var(--ink-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tmeta .tfoot .linkish { margin-left: auto; font-size: 11.5px; flex: none; }
.tmeta .tnote { color: var(--warn); font-size: 11px; }
.titem .x { position: absolute; top: 4px; right: 4px; border: 0; background: none; width: 20px; height: 20px; border-radius: 50%; color: var(--ink-3); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.titem .x:hover { background: var(--sunk); color: var(--ink); }
.tray-foot { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.tray-foot > .linkish { margin-left: auto; font-size: 12px; }
.body-inputs { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.body-inputs .k { color: var(--ink); font-weight: 600; font-size: 12px; }
.body-inputs input { width: 54px; padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); font-variant-numeric: tabular-nums; }
.body-inputs select { font-size: 12.5px; padding: 2px 4px; }
.body-note { font-size: 11.5px; color: var(--ink-2); }
.tray-actions { display: flex; align-items: center; gap: 8px; }
.tray-actions .primary { padding: 6px 16px; }
.tray-actions .go { background: var(--tape); color: var(--tape-ink); border: 0; border-radius: 8px; padding: 6px 14px; font-weight: 600; cursor: pointer; }
.tray-actions .go:disabled { opacity: 0.5; cursor: default; }
.tray-hint { flex-basis: 100%; font-size: 11.5px; color: var(--ink-2); }
.tray-hint:empty { display: none; }

/* 입어 볼 사진 — 입어 보기 옆에서 펼쳐 고른다 */
.photo-pick { position: relative; }
.photo-pick > summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 3px 9px 3px 3px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font-size: 12.5px; white-space: nowrap; }
.photo-pick > summary::-webkit-details-marker { display: none; }
.photo-pick > summary:hover { border-color: var(--ink); }
.photo-now { display: inline-grid; place-items: center; width: 22px; height: 28px; border-radius: 4px; overflow: hidden; background: var(--sunk); font-size: 10px; color: var(--ink-2); }
.photo-now img, .photo-now svg { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.photo-pick .people { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 4; display: flex; flex-wrap: wrap; width: max-content; max-width: calc(100vw - 24px); gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 24, 30, 0.16); }
.person { width: 38px; height: 50px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; overflow: hidden; font-size: 11.5px; }
.person img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.person.auto { width: auto; padding: 0 9px; font-weight: 600; }
.person[aria-checked='true'] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* ── 입력 */
.ask { flex: none; display: flex; gap: 8px; padding: 10px 16px 8px; border-top: 1px solid var(--line); }
.ask textarea { flex: 1; resize: none; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); line-height: 1.45; }
.ask textarea::placeholder { color: var(--ink-3); }
.ask .primary { padding: 0 18px; border-radius: 10px; }

/* ── 엔진 보기 */
.eng-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.eng-head h2 { font-size: 16px; }
.row { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-basis: 100%; margin-top: 8px; }
.row select { padding: 4px 8px; border-radius: 8px; max-width: 280px; }
.profile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.profile b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.history { display: inline-flex; gap: 3px; }
.history img { width: 20px; height: 25px; border-radius: 3px; border: 1px solid var(--line); background: #fff; object-fit: contain; }

/* 처리 순서 — 위에서 아래로 한 줄 */
.pipeline { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { position: relative; padding: 0 0 20px 34px; counter-increment: step; min-width: 0; }
.step::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--bg); color: var(--ink-3); border: 1.5px solid var(--line-2);
}
.step::after { content: ''; position: absolute; left: 10.25px; top: 26px; bottom: 4px; width: 1.5px; background: var(--line-2); }
.step:last-child { padding-bottom: 0; }
.step:last-child::after { display: none; }
.step[data-state='done']::before { background: var(--blue); border-color: var(--blue); color: #fff; }
.step[data-state='done']::after { background: var(--blue-line); }
.step > h3 { font-size: 14px; line-height: 22px; margin-bottom: 6px; }
.step[data-state='idle'] > h3, .step[data-state='skip'] > h3 { color: var(--ink-3); margin-bottom: 2px; }
.step .idle { font-size: 12.5px; color: var(--ink-3); }
.step[data-state='skip'] .idle { color: var(--ink-2); }
.step[data-state='idle'] > :not(h3):not(.idle), .step[data-state='skip'] > :not(h3):not(.idle) { display: none; }
.step[data-state='done'] > .idle { display: none; }
.step > * + * { margin-top: 6px; }

.route-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.rchip { border: 1px solid var(--blue-line); background: var(--surface); border-radius: 999px; padding: 1px 9px; font-size: 12.5px; }
.rchip em { font-style: normal; color: var(--blue); font-variant-numeric: tabular-nums; margin-left: 2px; }
.rchip.turn { border-color: var(--blue); background: var(--blue-wash); font-weight: 600; }
.rchip.node { opacity: 0.55; }
.rchip.node.acc { opacity: 1; }
.rchip.llm.off { border-color: var(--ok); color: var(--ok); }
.rchip.llm.on { border-color: var(--warn); color: var(--warn); }
.route .steps { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 12px; }

.conds { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.conds li { border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 13px; background: var(--surface); }
.conds li .k { color: var(--ink-2); margin-right: 4px; }
.conds li .src { margin-left: 6px; font-size: 11px; color: var(--blue); }
.conds li.avoid { border-color: var(--warn-line); background: var(--warn-wash); }
.notes { font-size: 12.5px; color: var(--ink-2); }
.notes:empty { display: none; }
.expansion { display: flex; flex-direction: column; gap: 6px; }
.exp-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 13px; }
.exp-row .concept { font-weight: 600; min-width: 76px; }
.swatch { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 3px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); }
.swatch i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0, 0, 0, 0.12); background: #d8d3c8; }
.swatch i.sw-item { background: transparent; border: 1.5px solid #7d857f; }
.swatch i.sw-style { border-radius: 50%; background: var(--blue); border-color: var(--blue); width: 9px; height: 9px; margin: 0 2px; }
.swatch i.sw-material { background-color: #e4dccb; background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px), repeating-linear-gradient(-45deg, rgba(0,0,0,.1) 0 1px, transparent 1px 3px); }
.swatch i.sw-linen { background-color: #e8dfcc; } .swatch i.sw-denim { background-color: #5b7aa3; } .swatch i.sw-wool { background-color: #9a9a96; }
.swatch i.sw-straw { background-color: #d8c08a; } .swatch i.sw-cotton { background-color: #f1efe9; } .swatch i.sw-silk { background-color: #e9e1d6; }
.swatch i.sw-pattern { background: #fff; }
.swatch i.sw-stripe { background: repeating-linear-gradient(90deg, #4f6d93 0 2px, #fff 2px 5px); }
.swatch i.sw-check { background: repeating-linear-gradient(0deg, rgba(79,109,147,.5) 0 2px, transparent 2px 5px), repeating-linear-gradient(90deg, rgba(79,109,147,.5) 0 2px, #fff 2px 5px); }
.swatch i.sw-floral { background: radial-gradient(circle at 30% 30%, #e48aa8 0 2px, transparent 3px), radial-gradient(circle at 70% 70%, #e48aa8 0 2px, transparent 3px), #fff; }
.swatch i.sw-dot { background: radial-gradient(circle, #22304f 0 1.6px, transparent 2px) 0 0 / 5px 5px, #fff; }
.swatch i.sw-solid { background: #b9b3a8; }
.swatch.neg { background: var(--warn-wash); border-color: var(--warn-line); text-decoration: line-through; text-decoration-color: rgba(180, 83, 42, 0.6); }

.pick-body { font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.pick-body .counts { color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pick-body details { font-size: 12.5px; color: var(--ink-2); }
.pick-body summary { cursor: pointer; width: max-content; }
.pick-body details ul { margin: 4px 0; padding-left: 18px; }
.pick-body details p { margin-top: 4px; }
.verdict { font-weight: 600; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--warn); }

.sz-line { font-size: 12.5px; }
.sz-item { border-top: 1px solid var(--line-2); padding-top: 6px; margin-top: 6px; font-size: 13px; }
.sz-item .hint { font-size: 12px; }
.sz-item table { border-collapse: collapse; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.sz-item th, .sz-item td { padding: 1px 12px 1px 0; text-align: left; font-size: 12px; }
.sz-item th { color: var(--ink-2); font-weight: 500; }
.sz-item tr.pick td { font-weight: 600; color: var(--blue); }

.compare { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.compare h3 { font-size: 14px; }
.reading-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.cmp-table th, .cmp-table td { text-align: left; vertical-align: top; padding: 8px 6px; border-top: 1px solid var(--line); }
.cmp-table th { font-weight: 600; width: 160px; }
.cmp-table th small { display: block; color: var(--ink-2); font-weight: 400; }
.cmp-thumbs { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.cmp-thumbs img { width: 34px; height: 44px; border-radius: 3px; border: 1px solid var(--line); background: #fff; object-fit: contain; }
.cmp-thumbs span { font-size: 11.5px; color: var(--ink-2); margin-left: 4px; }
.cmp-table ul { margin: 4px 0 0; padding-left: 16px; color: var(--warn); }


/* 대화상자 */
dialog { border: 0; border-radius: 12px; padding: 0; max-width: min(92vw, 460px); }
dialog::backdrop { background: rgba(20, 24, 30, 0.5); }
.dialog { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.dialog.wide { width: min(92vw, 720px); }
dialog:has(.wide) { max-width: min(92vw, 760px); }
.dialog h2 { font-family: var(--serif); font-size: 19px; }
.dialog .primary { align-self: flex-end; padding: 6px 16px; }
.zoomed { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 8px; background: #e9ebee; }
.an-grid { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 14px; font-size: 13px; }
.an-grid img { width: 100%; border-radius: 6px; background: #fff; margin-bottom: 6px; }
.an-grid h3 { font-size: 14px; margin-bottom: 6px; }
.an-grid dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.an-grid dt { color: var(--ink-2); }
.an-grid dd { margin: 0; }
.bar { display: inline-block; height: 7px; background: var(--blue); border-radius: 2px; vertical-align: middle; margin-right: 6px; }

/* 알림은 대화창 머리 바로 아래 가운데 — 입력창·칸 버튼을 가리지 않게 */
.toast { position: fixed; left: 30%; top: calc(var(--topbar) + 58px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 5; }
.toast.show { opacity: 1; }

/* 코디 안이 놓이는 순간 한 번만 */
@media (prefers-reduced-motion: no-preference) {
  .ocard.fresh { animation: drop 0.32s ease-out both; }
  .ocard.fresh:nth-child(2) { animation-delay: 0.05s; }
  .ocard.fresh:nth-child(3) { animation-delay: 0.1s; }
  .ocard.fresh:nth-child(4) { animation-delay: 0.15s; }
  @keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .chatcol { height: calc(100vh - var(--topbar)); border-right: 0; }
  .enginecol { border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .topbar { padding: 0 14px; }
  .topbar p { display: none; }
  .chathead h2 { display: none; }
  .an-grid { grid-template-columns: 1fr; }
  .msg { max-width: 94%; }
}

/* 몰 안에서는 손님이 쓰는 대화만 보여 준다. 독립 데모의 배치는 유지한다. */
body.embed { background:#fff; font-family:Pretendard,'Apple SD Gothic Neo','Malgun Gothic',system-ui,sans-serif; font-size:13px; --tape:#222; --tape-ink:#fff; --blue:#444; --serif:var(--sans); }
.embed .topbar,.embed .enginecol,.embed .who-pick { display:none; }
.embed .layout { display:block; height:100dvh; }
.embed .chatcol { height:100%; border:0; }
.embed .chathead { height:42px; padding:0 12px; }
.embed .chathead h2 { font-size:13px; }
.embed .log { padding:12px; min-height:150px; }
.embed .msg { max-width:95%; font-size:13px; }
.embed .msg,.embed .msg.bot.wide>p:first-child { border-radius:0; }
.embed .ocards { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.embed .ocard { background:#fff; border-radius:0; }
.embed .ocard .sum { transform:none; clip-path:none; box-shadow:none; background:#f3f3f3; color:#222; padding:2px 5px; font-size:11px; }
.embed .ocard h3 { font-family:inherit; font-size:15px; }
.embed .ocard .why { font-size:11px; }
.embed .tray { max-height:43dvh; overflow:auto; flex-shrink:0; }
.embed .tray-head { flex-wrap:wrap; padding:10px 12px; gap:6px; }
.embed .tray-head h2 { font-size:13px; }
.embed .tray-actions { margin-left:0; width:100%; justify-content:flex-end; }
.embed .tray-items { padding:8px 12px; gap:8px; }
.embed .tray-items .titem { min-width:210px; }
.embed .tray-foot { padding:8px 12px; gap:6px; }
.embed .body-inputs { flex-wrap:wrap; gap:5px; }
.embed .body-inputs .k { font-size:11px; }
.embed .tray-empty { font-size:11px; }
.embed .ask { padding:10px 12px; gap:8px; }
.embed .ask textarea { min-height:52px; font-size:13px; }
.embed .ask button { padding:0 12px; }
.embed button,.embed select,.embed textarea,.embed .shot,.embed .othumb { border-radius:0; }
.embed .chips.follow { padding:0 12px 10px; }
.embed .nm[data-action],.embed .shot[data-action] { cursor:pointer; }
.embed .nm[data-action]:hover { text-decoration:underline; }
.embed .pcards { grid-template-columns:repeat(2,minmax(0,1fr)); }
.embed dialog { max-width:calc(100vw - 20px); width:calc(100vw - 20px); padding:14px; }

.embed .photo-pick .people { position:fixed; right:12px; bottom:160px; z-index:6; }

/* 몰 안의 상담 화면만 세올베인의 활자와 색을 따른다. */
body.embed{--sans:Pretendard,'Apple SD Gothic Neo','Malgun Gothic',system-ui,sans-serif;--serif:var(--sans);--tape:#80563f;--tape-ink:#fff;--blue:#80563f;--blue-wash:#f3f2ee;--blue-line:#dfdfd9;--bg:#fff;--ink:#20231f;--line:#dfdfd9;font-variant-numeric:tabular-nums}
.embed .chathead{background:#fff;border-color:#dfdfd9;padding:0 20px}
.embed .log{padding:18px 20px}
.embed .msg{font-size:12px;line-height:1.8}
.embed .msg.bot{background:#f3f2ee;border:0}
.embed .msg.me{background:#20231f;color:#fff;border:0}
.embed .chips button{font-size:11px;background:#fff;border-color:#dfdfd9;color:#6a6d63}
.embed .ask{border-top:1px solid #dfdfd9;padding:14px 18px;background:#fff}
.embed .ask textarea{background:#f7f7f3;border-color:#dfdfd9;font-size:12px}
.embed .ask button{background:#20231f;color:#fff;border-color:#20231f}
.embed .ocard{border:1px solid #dfdfd9;box-shadow:none}
.embed .tray{background:#f7f7f3;border-color:#dfdfd9}

/* 데모 배포(2026-11-05): 기록 안내 · 예산 넘는 후보 · 입어 보기 한도 안내 */
.ask-note { flex: none; margin: 0 16px 8px; color: var(--ink-2); font-size: 11.5px; }
.embed .ask-note { margin: 0 18px 8px; }
.overbudget { margin-top: 10px; }
.overbudget .over { display: block; margin-top: 2px; color: var(--warn); font-size: 11.5px; }
.msg .limit { color: var(--ink-2); }

/* 공개 데모 화면 다듬기(2026-11-06): 몰 안 상담 창의 칸 접기 · 알림이 창 밖으로 잘리지 않게 · 칸 옷 목록 세로 */
.tray-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tray[data-empty='true'] .tray-body { display: none; }
.tray-toggle { display: none; }
.toast { max-width: min(560px, calc(100vw - 24px)); box-sizing: border-box; }
.embed .toast { left: 50%; top: 52px; width: max-content; white-space: normal; text-align: center; font-size: 12.5px; line-height: 1.5; }
.embed .tray { max-height: none; overflow: visible; }
.embed .tray-toggle { display: inline-block; flex: none; white-space: nowrap; }
.embed .tray[data-open='true'] .tray-body { max-height: 52dvh; overflow: auto; }
.embed .tray[data-open='false'] .tray-body,
.embed .tray[data-open='false'] .photo-pick,
.embed .tray[data-open='false'] #cart-btn,
.embed .tray[data-open='false'] .tray-from { display: none; }
.embed .tray[data-open='false'] .tray-head { flex-wrap: nowrap; }
.embed .tray[data-open='false'] .tray-head h2 { flex: none; }
.embed .tray[data-open='false'] .tray-sum { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.embed .tray[data-open='false'] .tray-actions { width: auto; margin-left: 0; flex: none; }
.embed .tray-items { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); overflow-x: visible; }
.embed .tray-items .titem { min-width: 0; max-width: none; }
@keyframes tray-pulse { from { box-shadow: inset 0 0 0 2px var(--tape); } to { box-shadow: inset 0 0 0 2px transparent; } }
.tray.pulse { animation: tray-pulse 1.6s ease-out; }
.embed .tray[data-open='false'] { padding-top: 0; padding-bottom: 0; }
.embed .tray[data-open='false'] .tray-head { padding: 8px 12px; }
/* 펼친 칸: 사이즈 기준(키·몸무게)을 옷 목록 위로 — 목록이 길어도 스크롤 없이 보이게 */
.embed .tray-body .tray-foot { order: -1; }
