/* ClothMeasure — 패션 쇼핑몰 사이즈 가이드 톤: 흰 바탕, 검정 글씨, 얇은 선.
   GLANCE에서 가져온 것은 부드러운 모서리·옅은 그림자·파란 포인트 정도 */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f4;
  --surface: #ffffff;
  --ink: #111111;
  --ink-soft: #666666;
  --ink-faint: #9a9a9a;
  --line: #e6e6e3;
  --line-strong: #111111;
  --point: #5b8fd6;
  --point-soft: rgba(91, 143, 214, .1);
  --good: #3f8f6f;
  --good-soft: rgba(63, 143, 111, .1);
  --warn: #b5832e;
  --warn-soft: rgba(181, 131, 46, .12);
  --bad: #c4473d;
  --bad-soft: rgba(196, 71, 61, .1);
  /* 사진 위 측정선 색 */
  --auto: #d0342c;
  --manual: #e8890c;
  --ref: #3f7fd8;
  --stage: #1a1a1a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .04);
  --r: 10px;
  --r-sm: 6px;
  --ui: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Segoe UI", "Malgun Gothic", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --bg-soft: #1b1b1b;
    --surface: #181818;
    --ink: #f2f2f2;
    --ink-soft: #a8a8a8;
    --ink-faint: #707070;
    --line: #2c2c2c;
    --line-strong: #f2f2f2;
    --point: #7eaae3;
    --point-soft: rgba(126, 170, 227, .12);
    --ref: #7eaae3;
    --stage: #0a0a0a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 var(--ui); letter-spacing: -.01em;
  word-break: keep-all; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
small { color: var(--ink-faint); font-weight: 400; font-size: 12.5px; }
.muted { color: var(--ink-soft); margin: 0 0 8px; }
.small-text { font-size: 13px; }

/* ───────── 상단 바 ───────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { font-size: 17px; letter-spacing: .12em; font-weight: 400; }
.brand b { font-weight: 800; }
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 14px; color: var(--ink-soft); }
.topbar nav a:hover { color: var(--ink); }
.topbar .nav-cta { color: var(--ink); font-weight: 600; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; }
.topbar .nav-cta:hover { background: var(--ink); color: var(--bg); }
@media (max-width: 560px) { .topbar nav a:not(.nav-cta) { display: none; } }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }

/* ───────── 첫 화면 ───────── */
.hero { display: grid; gap: 40px; align-items: center; padding: 64px 0 56px; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr 1fr; padding: 88px 0 72px; } }
.label { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--point); }
.hero h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.22; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 18px; }
.lead { font-size: clamp(15px, 1.5vw, 17px); color: var(--ink-soft); max-width: 520px; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.note { margin: 16px 0 0; font-size: 13px; color: var(--ink-faint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 15px var(--ui); padding: 14px 26px; border-radius: var(--r-sm); cursor: pointer;
  transition: background .15s, color .15s, opacity .15s;
}
.btn-dark { background: var(--ink); color: var(--bg); border: 1px solid var(--ink); }
.btn-dark:hover { opacity: .85; }
.btn-line { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-line:hover { border-color: var(--ink); }

/* 예시 카드: 옷 도식 + 사이즈표 */
.size-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.size-figure { background: var(--bg-soft); padding: 26px 20px 14px; }
.size-figure svg { display: block; width: 100%; max-width: 360px; margin: 0 auto; }
.tee { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.mline { stroke: var(--point); stroke-width: 1.6; stroke-dasharray: 4 3; fill: none; }
.mdot { fill: var(--point); }
.mtxt { font: 600 10px var(--ui); fill: var(--point); text-anchor: middle; }
.mtxt.start { text-anchor: start; }
.mtxt.end { text-anchor: end; }
.mtxt.halo { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.mcap { font: 600 10px var(--ui); fill: var(--ink-soft); text-anchor: middle; }
.tee-line { stroke: var(--ink); stroke-width: 1.2; fill: none; }
.mguide { stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 2 2; fill: none; }
.cardref { fill: var(--point-soft); stroke: var(--point); stroke-width: 1; }
.size-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.size-table th { font-weight: 500; color: var(--ink-soft); padding: 12px 6px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.size-table td { padding: 12px 6px; }
.size-table th:first-child, .size-table td:first-child { color: var(--ink-faint); font-weight: 500; }
.size-table tr.hl td { font-weight: 700; }
.size-card figcaption { font-size: 12.5px; color: var(--ink-faint); padding: 0 16px 14px; text-align: center; }

/* ───────── 블록 ───────── */
.block { padding: 56px 0 0; }
.block-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 2px solid var(--line-strong); }
.block-head h2 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.block-head p { margin: 0; font-size: 14px; color: var(--ink-soft); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { padding: 26px 24px 28px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .steps li { padding-left: 24px; border-bottom: none; border-left: 1px solid var(--line); } .steps li:first-child { border-left: none; padding-left: 0; } }
.num { font-size: 13px; font-weight: 700; color: var(--point); letter-spacing: .06em; }
.steps h3 { font-size: 17px; font-weight: 700; margin: 8px 0 8px; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.steps p b { color: var(--ink); font-weight: 600; }

.item-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.item-table th { width: 96px; text-align: left; font-weight: 700; padding: 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.item-table td { padding: 12px 0; border-bottom: 1px solid var(--line); }
.item-table td span {
  display: inline-flex; align-items: center; gap: 4px; margin: 4px 6px 4px 0; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: 13.5px;
}

/* ───────── 올리기 ───────── */
.upload {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 52px 16px;
  border: 1.5px dashed #c9c9c5; border-radius: var(--r); background: var(--bg-soft); cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s;
}
.upload:hover, .upload.drag { border-color: var(--ink); background: var(--point-soft); }
.up-ico { width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.up-title { font-size: 18px; font-weight: 700; margin-top: 4px; }
.hint { color: var(--ink-faint); font-size: 13px; margin-bottom: 12px; }

/* ───────── 결과 화면 ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
#work { display: grid; gap: 16px; padding-top: 28px; }
@media (min-width: 900px) { #work { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
#work h2 { font-size: 16px; font-weight: 800; margin: 0 0 6px; padding-bottom: 10px; border-bottom: 2px solid var(--line-strong); }
#work h3 { font-size: 14px; font-weight: 700; margin: 20px 0 8px; }
.stage-wrap { padding: 12px; margin: 0; box-shadow: var(--shadow); }
.side .card { margin-bottom: 14px; }
.stage-tools { display: flex; gap: 6px; margin-bottom: 10px; align-items: center; }
.spacer { flex: 1; }
.scroller { background: var(--stage); border-radius: var(--r-sm); overflow: auto; max-height: 75vh; touch-action: pan-x pan-y; }
.stage { position: relative; width: 100%; margin: 0 auto; }
.stage img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage.picking svg { cursor: crosshair; }
.status { margin: 10px 2px 0; color: var(--ink-soft); font-size: 14px; min-height: 1.5em; }
.status.error { color: var(--bad); }
.banner { display: flex; align-items: center; gap: 8px; background: var(--ref); color: #fff; border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 10px; font-weight: 600; font-size: 14px; }
.banner.manual { background: var(--manual); }
.banner span { flex: 1; }

button {
  font: 500 13.5px var(--ui); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: border-color .15s, background .15s;
}
button:hover { border-color: var(--ink); }
button.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; width: 100%; padding: 12px; border-radius: var(--r-sm); font-size: 14.5px; }
button.primary:hover { opacity: .85; }
button.ghost { background: transparent; }
button.small { padding: 3px 10px; font-size: 12.5px; color: inherit; background: transparent; border-color: rgba(255, 255, 255, .6); }
button:disabled { opacity: .4; cursor: default; }
button.primary-chip { border-color: var(--manual); color: var(--manual); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.row { display: flex; gap: 6px; align-items: center; margin: 8px 0; }
input[type=text], select {
  font: 14px var(--ui); color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 9px 11px; outline: none;
}
input[type=text]:focus, select:focus { border-color: var(--ink); }
select { width: 100%; }
.row input { flex: 1; min-width: 0; }
#phoneBox select { flex: 1; }

/* 치수 목록 = 사이즈표 행 */
.values { list-style: none; padding: 0; margin: 0 0 14px; }
.values li { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.values li b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; font-weight: 500; color: var(--point); background: var(--point-soft); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
pre#summary { white-space: pre-wrap; background: var(--bg-soft); border-radius: var(--r-sm); padding: 12px; font: 13.5px/1.6 var(--ui); margin: 0 0 10px; }
.refs { list-style: none; padding: 0; margin: 8px 0; }
.refs li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }

.badge { display: inline-flex; border-radius: 4px; padding: 5px 10px; font-weight: 700; font-size: 13.5px; color: var(--ink-faint); background: var(--bg-soft); }
.badge.Good { background: var(--good-soft); color: var(--good); }
.badge.Warn { background: var(--warn-soft); color: var(--warn); }
.badge.Bad { background: var(--bad-soft); color: var(--bad); }
.factors { list-style: none; padding: 0; margin: 10px 0 0; }
.factors li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.factors li:last-child { border-bottom: none; }
.factors .head { display: flex; gap: 8px; align-items: center; }
.factors .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.factors .val { margin-left: auto; color: var(--ink-soft); }
.factors .advice { color: var(--bad); font-size: 12.5px; margin: 3px 0 0 15px; }
.dot.Good { background: var(--good); } .dot.Warn { background: var(--warn); } .dot.Bad { background: var(--bad); }

.busy {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; z-index: 60; font-weight: 600;
}
.busy[hidden] { display: none; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

svg .lbl { font-weight: 700; paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-linejoin: round; fill: #fff; font-family: var(--ui); }
svg .handle { cursor: grab; }
/* 변을 찍는 중에는 이미 찍은 점 위에서도 + 커서 (그 점을 같이 쓰는 새 변을 찍을 수 있음) */
.stage.picking svg .handle { cursor: crosshair; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ───────── 맨 아래 ───────── */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 24px; }
.foot-in { max-width: 1180px; margin: 0 auto; padding: 36px 20px 44px; font-size: 14px; color: var(--ink-soft); }
.foot-in p { margin: 0 0 8px; }
.foot-in b { color: var(--ink); font-weight: 600; }
.foot-brand { font-size: 14px; letter-spacing: .12em; color: var(--ink) !important; margin-bottom: 14px !important; }
.foot-brand b { font-weight: 800; }
.foot-sub { font-size: 12.5px; color: var(--ink-faint); }

/* 재는 항목: 표 옆에 예시 사진 */
.items-wrap { display: grid; gap: 28px; align-items: start; }
@media (min-width: 980px) { .items-wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.examples { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding-top: 16px; }
.examples figure { margin: 0; }
.ex-fig { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm); aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 6px; }
.ex-fig svg { display: block; width: 100%; height: 100%; }
.examples figcaption { font-size: 13px; font-weight: 600; margin-top: 8px; text-align: center; }
@media (max-width: 979px) and (min-width: 600px) { .examples { padding-top: 0; } }
@media (max-width: 599px) { .examples { grid-template-columns: 1fr; padding-top: 0; } .examples figure { max-width: 420px; } }
