/* 퍼스널컬러 간이 진단 — 색 비교 화면이 주인공이라 바탕은 일부러 밝은 무채색(어두운 모드 없음) */
:root {
  --cobalt: #1b4fd6; --cobalt-deep: #12357f; --orange: #ff7a1a; --orange-ink: #c85500;
  --ink: #14203a; --gray: #5b6478; --rule: #e3e7f0; --paper: #f6f7f9; --white: #fff;
  --sans: "Noto Sans JP", "Noto Sans KR", "Noto Sans TC", "Noto Sans SC", system-ui, sans-serif;
  color-scheme: light;
}
:lang(ko) { --sans: "Noto Sans KR", "Noto Sans JP", system-ui, sans-serif; }
:lang(zh-hant) { --sans: "Noto Sans TC", "Noto Sans JP", system-ui, sans-serif; }
:lang(zh-hans) { --sans: "Noto Sans SC", "Noto Sans JP", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.65; font-size: 16px; -webkit-text-size-adjust: 100%; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: -0.01em; }
img { display: block; max-width: 100%; }

/* 상단 */
.top { background: var(--cobalt); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; max-width: 1080px; }
.logo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo svg { width: 26px; height: 26px; flex: none; }
.logo b { font-size: 17px; white-space: nowrap; }
.logo .sub { font-size: 13px; opacity: .85; white-space: nowrap; }
.badge { font-size: 11px; font-weight: 700; background: var(--orange); color: #fff; border-radius: 4px; padding: 1px 6px; letter-spacing: .06em; }
#lang { font: inherit; font-size: 14px; color: var(--ink); background: #fff; border: 0; border-radius: 8px; padding: 6px 8px; min-height: 36px; }
@media (max-width: 380px) { .logo .sub { display: none; } }

main.wrap { padding: 20px 16px 48px; }
section > * + * { margin-top: 16px; }
.kicker { color: var(--orange-ink); font-weight: 700; font-size: 14px; letter-spacing: .04em; margin: 0; }
.note { color: var(--gray); font-size: 14px; margin: 0; }
.note.small { font-size: 12.5px; }
.note.info { background: #eef3ff; border-left: 3px solid var(--cobalt); padding: 8px 12px; color: var(--ink); }
.note.lock::before { content: "🔒 "; }
.warn { background: #fff4e5; border-left: 3px solid var(--orange); padding: 8px 12px; font-size: 14px; margin: 8px 0 0; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: 16px; min-height: 50px; padding: 10px 20px; border-radius: 12px; border: 2px solid var(--cobalt); background: #fff; color: var(--cobalt); text-decoration: none; cursor: pointer; }
.btn.main { background: var(--cobalt); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--gray); font-weight: 400; }
.btn.line { background: #06c755; border-color: #06c755; color: #fff; }
.btn.line.kakao { background: #fee500; border-color: #fee500; color: #191919; }
.btn.wide { width: 100%; }
.btn:active { transform: translateY(1px); }
.stack { display: grid; gap: 10px; }
.stack.row { grid-template-columns: 1fr 1fr; }
.nav { display: flex; justify-content: space-between; }

/* 첫 화면 */
.hero h1 { font-size: 28px; }
.hero .lead { margin: 0; }
.hero-swatch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hero-swatch span { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; background: #fff; padding: 6px; border-radius: 10px; border: 1px solid var(--rule); }
.hero-swatch i { aspect-ratio: 1; border-radius: 50%; }
.hero-swatch b { grid-column: 1 / -1; text-align: center; font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps { margin: 0; padding-left: 1.4em; }
.steps li { margin: 2px 0; }
.hero .btn.main { width: 100%; font-size: 18px; min-height: 56px; }

/* 진행 */
.prog { display: grid; gap: 6px; font-size: 13px; color: var(--gray); }
.prog i { display: block; height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.prog b { display: block; height: 100%; background: var(--orange); transition: width .3s; }

/* 질문 */
h2 { font-size: 22px; }
.opts { display: grid; gap: 10px; }
.opt { font: inherit; font-size: 17px; text-align: left; min-height: 58px; padding: 12px 16px; border-radius: 12px; border: 2px solid var(--rule); background: #fff; color: var(--ink); cursor: pointer; }
.opt.on { border-color: var(--cobalt); background: #eef3ff; }
.tips { margin: 0; padding-left: 1.3em; }

/* 카메라·위치 맞추기 */
.cam, .adj { position: relative; width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; aspect-ratio: 3 / 4; background: #222; border-radius: 16px; overflow: hidden; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam .oval { position: absolute; inset: 0; width: 100%; height: 100%; }
.cam-hint { position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.adj canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.zoom { display: flex; align-items: center; gap: 10px; max-width: 420px; margin-left: auto; margin-right: auto; font-size: 14px; color: var(--gray); }
.zoom input { flex: 1; accent-color: var(--cobalt); }

/* 색 대어 보기 */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { margin: 0; position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--rule); background: #fff; cursor: pointer; }
.card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.card figcaption { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.92); color: var(--ink); font-weight: 700; border-radius: 8px; padding: 0 10px; font-size: 15px; }
.ab { display: none; }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) {
  .ab { display: grid; grid-template-columns: 1fr 1fr; background: #e6e9f0; border-radius: 12px; padding: 4px; }
  .ab button { font: inherit; font-weight: 700; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--gray); cursor: pointer; }
  .ab button.on { background: #fff; color: var(--cobalt); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
  .pair { grid-template-columns: 1fr; max-width: 360px; margin-left: auto; margin-right: auto; }
  .pair .card:not(.on) { display: none; }
}

/* 계산 중 */
.calc { text-align: center; padding: 60px 0; }
.spin { display: inline-grid; grid-template-columns: repeat(2, 28px); gap: 6px; animation: spin 1s linear infinite; }
.spin i { width: 28px; height: 28px; border-radius: 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* 결과 */
.result h3 { font-size: 17px; margin-top: 22px; }
.r-head { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--rule); border-radius: 18px; padding: 30px 20px 20px; }
.r-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: linear-gradient(90deg, var(--c1), var(--c2) 50%, var(--c3)); }
.r-head h1 { font-size: 28px; margin-top: 6px; word-break: keep-all; }
.r-head .tag { margin: 6px 0 0; font-weight: 700; color: var(--gray); }
.r-grid p { margin: 0 0 10px; }
.sw { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.sw i { aspect-ratio: 1; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--rule); }
.sw.small { grid-template-columns: repeat(8, 1fr); }
.bvw { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.bvw figure { margin: 0; }
.bvw img { border-radius: 12px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.bvw figcaption { text-align: center; font-size: 13px; color: var(--gray); margin-top: 4px; }
.tipl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: 15px; }
.tipl dt { font-weight: 700; color: var(--orange-ink); }
.tipl dd { margin: 0; }
.map { width: 100%; max-width: 300px; display: block; margin: 10px auto 0; }
.map .ax { stroke: #b9c0cf; stroke-width: 1.5; }
.map .al { font-size: 10.5px; fill: var(--gray); }
.map .mq { font-size: 13px; fill: var(--ink); font-weight: 700; opacity: .55; }
.map .mq.on { opacity: 1; fill: var(--cobalt); }
.box { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 16px; }
.box > * + * { margin-top: 10px; }
.box h3 { margin-top: 0; }
.box p { margin: 0; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.chk input { width: 20px; height: 20px; accent-color: var(--cobalt); }
.box .btn.main { width: 100%; }
#saveOut .preview { margin-top: 10px; border-radius: 10px; border: 1px solid var(--rule); max-width: 280px; }
#saveOut .btn { margin-top: 8px; }
.store { border-color: #cbd8fb; background: #f3f6ff; }

/* 태블릿 가로(매장) — 결과를 두 칸으로 */
@media (min-width: 900px) {
  main.wrap { max-width: 1040px; }
  main[data-screen="result"] .r-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; }
  main:not([data-screen="result"]) > section { max-width: 640px; margin: 0 auto; }
  .pair .card img { max-height: 52vh; }
  .pair { max-width: 760px; margin-left: auto; margin-right: auto; }
}
